auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void logVmStatusTransition(VM vmToUpdate, VmDynamic runningVm) { log.infoFormat("VM moved from {0} --> {1}", vmToUpdate.getstatus().name(), runningVm.getstatus().name()); }

Target:
private void logVmStatusTransition(VM vmToUpdate, VmDynamic runningVm) { if (vmToUpdate.getstatus() != runningVm.getstatus()) { log.infoFormat("VM {0} {1} moved from {2} --> {3}", vmToUpdate.getvm_name(), vmToUpdate.getId(), vmToUpdate.getstatus().name(), runningVm.getstatus().name()); } }
Source:
private boolean canPaymentWorksNewVendorRequestProcessingContinueForVendor(PaymentWorksVendor stgNewVendorRequestDetailToProcess, PaymentWorksNewVendorRequestsBatchReportData reportData) { List<String> errorMessages = new ArrayList<String>(); if (pmwDtosCouldConvertCustomAttributesToPmwJavaClassAttributes(stgNewVendorRequestDetailToProcess) && pmwNewVendorAttributesConformToKfsLengthsOrFormats(stgNewVendorRequestDetailToProcess, errorMessages) && validateVendorType(stgNewVendorRequestDetailToProcess, errorMessages) && allPmwNewVendorIsoCountriesMapToSingleFipsCountry(stgNewVendorRequestDetailToProcess, errorMessages) && pmwNewVendorIdentifierDoesNotExistInKfsStagingTable(stgNewVendorRequestDetailToProcess, errorMessages)){ return true; } else { if (!errorMessages.isEmpty()){ reportData.getPendingPaymentWorksVendorsThatCouldNotBeProcessed().incrementRecordCount(); reportData.addPmwVendorsThatCouldNotBeProcessed(new PaymentWorksBatchReportRawDataItem( stgNewVendorRequestDetailToProcess.toString(), errorMessages)); } return false; } }

Target:
private boolean canPaymentWorksNewVendorRequestProcessingContinueForVendor(PaymentWorksVendor stgNewVendorRequestDetailToProcess, PaymentWorksNewVendorRequestsBatchReportData reportData) { List<String> errorMessages = new ArrayList<String>(); if (pmwDtosCouldConvertCustomAttributesToPmwJavaClassAttributes(stgNewVendorRequestDetailToProcess) && pmwNewVendorAttributesConformToKfsLengthsOrFormats(stgNewVendorRequestDetailToProcess, errorMessages) && allPmwNewVendorIsoCountriesMapToSingleFipsCountry(stgNewVendorRequestDetailToProcess, errorMessages) && pmwNewVendorIdentifierDoesNotExistInKfsStagingTable(stgNewVendorRequestDetailToProcess, errorMessages)){ return true; } else { if (!errorMessages.isEmpty()){ reportData.getPendingPaymentWorksVendorsThatCouldNotBeProcessed().incrementRecordCount(); reportData.addPmwVendorsThatCouldNotBeProcessed(new PaymentWorksBatchReportRawDataItem(stgNewVendorRequestDetailToProcess.toString(), errorMessages)); } return false; } }
Source:
public boolean deleteStoreClientConfig(List<String> storeNames, String coordinatorUrl) { try { RestRequestBuilder requestBuilder = new RestRequestBuilder(new URI(coordinatorUrl + URL_SEPARATOR + STORE_CLIENT_CONFIG_OPS + URL_SEPARATOR + Joiner.on(",") .join(storeNames))); String timeoutStr = Long.toString(this.config.getTimeoutConfig() .getOperationTimeout(VoldemortOpCode.GET_OP_CODE)); requestBuilder.setMethod(DELETE); requestBuilder.setHeader(RestMessageHeaders.X_VOLD_REQUEST_TIMEOUT_MS, timeoutStr); requestBuilder.setHeader(RestMessageHeaders.X_VOLD_REQUEST_ORIGIN_TIME_MS, String.valueOf(System.currentTimeMillis())); if(this.routingTypeCode != null) { requestBuilder.setHeader(RestMessageHeaders.X_VOLD_ROUTING_TYPE_CODE, this.routingTypeCode); } if(this.zoneId != INVALID_ZONE_ID) { requestBuilder.setHeader(RestMessageHeaders.X_VOLD_ZONE_ID, String.valueOf(this.zoneId)); } RestRequest request = requestBuilder.build(); Future<RestResponse> future = client.restRequest(request); RestResponse response = future.get(); final ByteString entity = response.getEntity(); if(entity == null) { if(logger.isDebugEnabled()) { logger.debug("Empty response !"); } return false; } System.out.println(entity.asString("UTF-8")); return true; } catch(ExecutionException e) { if(e.getCause() instanceof RestException) { RestException exception = (RestException) e.getCause(); if(logger.isDebugEnabled()) { logger.debug("REST EXCEPTION STATUS : " + exception.getResponse().getStatus()); } } else { throw new VoldemortException("Unknown HTTP request execution exception: " + e.getMessage(), e); } } catch(InterruptedException e) { if(logger.isDebugEnabled()) { logger.debug("Operation interrupted : " + e.getMessage(), e); } throw new VoldemortException("Operation interrupted exception: " + e.getMessage(), e); } catch(URISyntaxException e) { throw new VoldemortException("Illegal HTTP URL" + e.getMessage(), e); } return false; }

Target:
public boolean deleteStoreClientConfig(List<String> storeNames, String coordinatorUrl) { try { StringBuilder URIStringBuilder = new StringBuilder().append(coordinatorUrl) .append(URL_SEPARATOR) .append(STORE_CLIENT_CONFIG_OPS) .append(URL_SEPARATOR) .append(Joiner.on(",") .join(storeNames)); RestRequestBuilder requestBuilder = new RestRequestBuilder(new URI(URIStringBuilder.toString())); String timeoutStr = Long.toString(this.config.getTimeoutConfig() .getOperationTimeout(VoldemortOpCode.GET_OP_CODE)); requestBuilder.setMethod(requestType.DELETE.toString()); requestBuilder.setHeader(RestMessageHeaders.X_VOLD_REQUEST_TIMEOUT_MS, timeoutStr); requestBuilder = setCommonRequestHeader(requestBuilder); RestRequest request = requestBuilder.build(); Future<RestResponse> future = client.restRequest(request); RestResponse response = future.get(); final ByteString entity = response.getEntity(); if(entity == null) { if(logger.isDebugEnabled()) { logger.debug("Empty response !"); } return false; } System.out.println(entity.asString("UTF-8")); return true; } catch(Exception e) { handleRequestAndResponseException(e); } return false; }
Source:
public StateDescription getStateDescription(String itemName, Locale locale) { Set<ChannelUID> boundChannels = itemChannelLinkRegistry.getBoundChannels(itemName); if (!boundChannels.isEmpty()) { ChannelUID channelUID = boundChannels.iterator().next(); Channel channel = thingRegistry.getChannel(channelUID); if (channel != null) { ChannelType channelType = thingTypeRegistry.getChannelType(channel, locale); if (channelType != null) { StateDescription stateDescription = thingTypeRegistry.getStateDescription(channel, locale); if (stateDescription == null) { stateDescription = channelType.getState(); } if ((channelType.getItemType() != null) && ((stateDescription == null) || (stateDescription.getPattern() == null))) { String pattern = null; if (channelType.getItemType().equalsIgnoreCase(CoreItemFactory.STRING)) { pattern = "%s"; } else if (channelType.getItemType().equalsIgnoreCase(CoreItemFactory.NUMBER)) { pattern = "%.0f"; } if (pattern != null) { logger.trace("Provide a default pattern for item {}", pattern, itemName); if (stateDescription == null) { stateDescription = new StateDescription(null, null, null, pattern, false, null); } else { stateDescription = new StateDescription(stateDescription.getMinimum(), stateDescription.getMaximum(), stateDescription.getStep(), pattern, stateDescription.isReadOnly(), stateDescription.getOptions()); } } } return stateDescription; } else { return null; } } } return null; }

Target:
public StateDescription getStateDescription(String itemName, Locale locale) { Set<ChannelUID> boundChannels = itemChannelLinkRegistry.getBoundChannels(itemName); if (!boundChannels.isEmpty()) { ChannelUID channelUID = boundChannels.iterator().next(); Channel channel = thingRegistry.getChannel(channelUID); if (channel != null) { StateDescription stateDescription = null; ChannelType channelType = thingTypeRegistry.getChannelType(channel, locale); if (channelType != null) { stateDescription = channelType.getState(); if ((channelType.getItemType() != null) && ((stateDescription == null) || (stateDescription.getPattern() == null))) { String pattern = null; if (channelType.getItemType().equalsIgnoreCase(CoreItemFactory.STRING)) { pattern = "%s"; } else if (channelType.getItemType().equalsIgnoreCase(CoreItemFactory.NUMBER)) { pattern = "%.0f"; } if (pattern != null) { logger.trace("Provide a default pattern for item {}", pattern, itemName); if (stateDescription == null) { stateDescription = new StateDescription(null, null, null, pattern, false, null); } else { stateDescription = new StateDescription(stateDescription.getMinimum(), stateDescription.getMaximum(), stateDescription.getStep(), pattern, stateDescription.isReadOnly(), stateDescription.getOptions()); } } } } StateDescription dynamicStateDescription = getDynamicStateDescription(channel, stateDescription, locale); if (dynamicStateDescription != null) { return dynamicStateDescription; } return stateDescription; } } return null; }
Source:
public void takeSnapshot(){ try { lastSnapshotZxid = zkDb.getDataTreeLastProcessedZxid(); isGeneratingSnapshot.incrementAndGet(); txnLogFactory.save(zkDb.getDataTree(), zkDb.getSessionWithTimeOuts()); } catch (IOException e) { LOG.error("Severe unrecoverable error, exiting", e); System.exit(10); } finally { isGeneratingSnapshot.decrementAndGet(); } }

Target:
public void takeSnapshot(){ generatingSnapshot.lock(); try { lastSnapshotZxid = zkDb.getDataTreeLastProcessedZxid(); txnLogFactory.save(zkDb.getDataTree(), zkDb.getSessionWithTimeOuts()); } catch (IOException e) { LOG.error("Severe unrecoverable error, exiting", e); System.exit(10); } finally { generatingSnapshot.unlock(); } }
Source:
public Optional<FieldProjectionExpectations<Double>> getFieldProjectionExpectations() { return Optional.of( new FieldProjectionExpectations<>( 1.001, 3.0, 5.1 ) ); }

Target:
public Optional<FieldProjectionExpectations<Double>> getFieldProjectionExpectations() { return Optional.of( new FieldProjectionExpectations<>( -1.001, 3.0, 5.1 ) ); }
Source:
public void run() { int httpPort = -1; m_rvdb.m_jsonEnabled = false; boolean httpsEnabled = false; if ((m_deployment.getHttpd() != null) && (m_deployment.getHttpd().isEnabled())) { if (m_deployment.getHttpd().getSsl()!=null && m_deployment.getHttpd().getSsl().isEnabled()) { httpsEnabled = true; } httpPort = (m_deployment.getHttpd().getPort()==null) ? (httpsEnabled ? VoltDB.DEFAULT_HTTPS_PORT : VoltDB.DEFAULT_HTTP_PORT) : m_deployment.getHttpd().getPort(); if (m_deployment.getHttpd().getJsonapi() != null) { m_rvdb.m_jsonEnabled = m_deployment.getHttpd().getJsonapi().isEnabled(); } } if (m_config.m_httpPort != Constants.HTTP_PORT_DISABLED) { setupHttpServer(m_config.m_httpPortInterface, m_config.m_publicInterface, m_config.m_httpPort, false, true); } else if (httpPort == Constants.HTTP_PORT_AUTO) { httpPort = httpsEnabled ? VoltDB.DEFAULT_HTTPS_PORT : VoltDB.DEFAULT_HTTP_PORT; setupHttpServer("", "", httpPort, true, false); } else if (httpPort != Constants.HTTP_PORT_DISABLED) { if (!m_deployment.getHttpd().isEnabled()) { return; } setupHttpServer(m_config.m_httpPortInterface, m_config.m_publicInterface, httpPort, false, true); } }

Target:
public void run() { int httpPort = -1; m_rvdb.m_jsonEnabled = false; boolean sslEnabled = false; if ((m_deployment.getHttpd() != null) && (m_deployment.getHttpd().isEnabled())) { if (m_config.m_sslContextFactory != null) { sslEnabled = true; } httpPort = (m_deployment.getHttpd().getPort()==null) ? (sslEnabled ? VoltDB.DEFAULT_HTTPS_PORT : VoltDB.DEFAULT_HTTP_PORT) : m_deployment.getHttpd().getPort(); if (m_deployment.getHttpd().getJsonapi() != null) { m_rvdb.m_jsonEnabled = m_deployment.getHttpd().getJsonapi().isEnabled(); } } if (m_config.m_httpPort != Constants.HTTP_PORT_DISABLED) { setupHttpServer(m_config.m_httpPortInterface, m_config.m_publicInterface, m_config.m_httpPort, false, true); } else if (httpPort == Constants.HTTP_PORT_AUTO) { httpPort = sslEnabled ? VoltDB.DEFAULT_HTTPS_PORT : VoltDB.DEFAULT_HTTP_PORT; setupHttpServer("", "", httpPort, true, false); } else if (httpPort != Constants.HTTP_PORT_DISABLED) { if (!m_deployment.getHttpd().isEnabled()) { return; } setupHttpServer(m_config.m_httpPortInterface, m_config.m_publicInterface, httpPort, false, true); } }
Source:
public <B> IO<List<B>> traverseIO(F<A, IO<B>> f) { F2<A, IO<List<B>>, IO<List<B>>> f2 = (a, acc) -> IOFunctions.bind(acc, (bs) -> IOFunctions.map(f.f(a), b -> bs.cons(b))); return this.foldRight(f2, IOFunctions.unit(List.<B>nil())); }

Target:
public <B> IO<List<B>> traverseIO(F<A, IO<B>> f) { return this.foldRight( (a, acc) -> IOFunctions.bind(acc, (bs) -> IOFunctions.map(f.f(a), b -> bs.cons(b))), IOFunctions.unit(List.<B>nil()) ); }
Source:
public void countLostEvent(TmfTimeRange timeRange, int nbLostEvents, boolean fullRange) { if (timeRange.getStartTime().getValue() < 0 || timeRange.getEndTime().getValue() < 0) { return; } int indexStart = (int) ((timeRange.getStartTime().getValue() - fFirstBucketTime) / fBucketDuration); int indexEnd = (int) ((timeRange.getEndTime().getValue() - fFirstBucketTime) / fBucketDuration); if (!fullRange) { if (timeRange.getEndTime().getValue() > fTimeLimit) { indexEnd = (int) ((fTimeLimit - fFirstBucketTime) / fBucketDuration); } } int nbBucketRange = (indexEnd - indexStart) + 1; int lostEventPerBucket = (int) Math.ceil((double) nbLostEvents / nbBucketRange); int lastLostCol = nbLostEvents - lostEventPerBucket * (nbBucketRange -1); if (fullRange && timeRange.getEndTime().getValue() >= fTimeLimit) { while (timeRange.getEndTime().getValue() >= fTimeLimit) { mergeBuckets(); } } indexEnd = Math.min(indexEnd, DEFAULT_NUMBER_OF_BUCKETS); for (int index = indexStart; index <= indexEnd; index++) { if (index == (indexStart + nbBucketRange)) { fLostEventsBuckets[index] += lastLostCol; } else { fLostEventsBuckets[index] += lostEventPerBucket; } } fNbEvents++; fireModelUpdateNotification(nbLostEvents); }

Target:
public void countLostEvent(TmfTimeRange timeRange, int nbLostEvents, boolean fullRange) { if (timeRange.getStartTime().getValue() < 0 || timeRange.getEndTime().getValue() < 0) { return; } int indexStart = (int) ((timeRange.getStartTime().getValue() - fFirstBucketTime) / fBucketDuration); int indexEnd = (int) ((timeRange.getEndTime().getValue() - fFirstBucketTime) / fBucketDuration); if (!fullRange) { if (timeRange.getEndTime().getValue() > fTimeLimit) { indexEnd = (int) ((fTimeLimit - fFirstBucketTime) / fBucketDuration); } } int nbBucketRange = (indexEnd - indexStart) + 1; int lostEventPerBucket = (int) Math.ceil((double) nbLostEvents / nbBucketRange); int lastLostCol = nbLostEvents - lostEventPerBucket * (nbBucketRange - 1); if (fullRange && timeRange.getEndTime().getValue() >= fTimeLimit) { while (timeRange.getEndTime().getValue() >= fTimeLimit) { mergeBuckets(); } } indexEnd = Math.min(indexEnd, fLastBucket); for (int index = indexStart; index <= indexEnd; index++) { if (index == (indexStart + nbBucketRange)) { fLostEventsBuckets[index] += lastLostCol; } else { fLostEventsBuckets[index] += lostEventPerBucket; } } fNbEvents++; fireModelUpdateNotification(nbLostEvents); }
Source:
private static boolean isSAM(ClassTree classBody) { if (hasOnlyOneMethod(classBody.members()) && classBody.symbol().isTypeSymbol()) { MethodJavaSymbol methodSymbol = ((MethodJavaSymbol) ((MethodTree) classBody.symbol().memberSymbols().stream().findFirst().get().declaration()) .symbol()); JavaSymbol.TypeJavaSymbol symbol = (JavaSymbol.TypeJavaSymbol) classBody.symbol(); boolean checkAnonymousClassFP = defaultMehodsSameSign(methodSymbol); return symbol.getInterfaces().size() == 1 && symbol.getSuperclass().is("java.lang.Object") && checkAnonymousClassFP; } return false; }

Target:
private static boolean isSAM(ClassTree classBody) { if (hasOnlyOneMethod(classBody.members())) { JavaSymbol.TypeJavaSymbol symbol = (JavaSymbol.TypeJavaSymbol) classBody.symbol(); return symbol.getInterfaces().size() == 1 && symbol.getSuperclass().is(JAVA_LANG_OBJECT) && hasSingleAbstractMethodInHierarchy(symbol.superTypes()); } return false; }
Source:
protected void documentModelToAvro(Schema schema, DocumentModel doc, GenericRecord record) { record.put(Constants.UUID, doc.getId()); record.put(Constants.NAME, doc.getName()); record.put(Constants.TITLE, doc.getTitle()); record.put(Constants.PATH, doc.getPathAsString()); record.put(Constants.REPOSITORY, doc.getRepositoryName()); record.put(Constants.PRIMARY_TYPE, doc.getType()); DocumentRef parentRef = doc.getParentRef(); if (parentRef != null) { record.put(Constants.PARENT_ID, parentRef.toString()); } record.put(Constants.CURRENT_LIFE_CYCLE_STATE, doc.getCurrentLifeCycleState()); if (doc.isVersion()) { record.put(Constants.VERSION_LABEL, doc.getVersionLabel()); record.put(Constants.VERSION_VERSIONABLE_ID, doc.getVersionSeriesId()); } record.put(Constants.IS_PROXY, doc.isProxy()); record.put(Constants.IS_TRASHED, doc.isTrashed()); record.put(Constants.IS_VERSION, doc.isVersion()); record.put(Constants.IS_CHECKIN, !doc.isCheckedOut()); record.put(Constants.IS_LATEST_VERSION, doc.isLatestVersion()); record.put(Constants.IS_LATEST_MAJOR_VERSION, doc.isLatestMajorVersion()); record.put(Constants.CHANGE_TOKEN, doc.getChangeToken()); if (doc.getPos() != null) { record.put(Constants.IS_PROXY, doc.getPos()); } record.put(Constants.MIXIN_TYPES, doc.getFacets()); record.put(Constants.DOCUMENT_TYPE, service.toAvro(schema.getField(Constants.DOCUMENT_TYPE).schema(), doc)); }

Target:
protected void documentModelToAvro(Schema schema, DocumentModel doc, GenericRecord record) { record.put(AvroConstants.UUID, doc.getId()); record.put(AvroConstants.NAME, doc.getName()); record.put(AvroConstants.TITLE, doc.getTitle()); record.put(AvroConstants.PATH, doc.getPathAsString()); record.put(AvroConstants.REPOSITORY_NAME, doc.getRepositoryName()); record.put(AvroConstants.PRIMARY_TYPE, doc.getType()); DocumentRef parentRef = doc.getParentRef(); if (parentRef != null) { record.put(AvroConstants.PARENT_ID, parentRef.toString()); } record.put(AvroConstants.CURRENT_LIFE_CYCLE_STATE, doc.getCurrentLifeCycleState()); if (doc.isVersion()) { record.put(AvroConstants.VERSION_LABEL, doc.getVersionLabel()); record.put(AvroConstants.VERSION_VERSIONABLE_ID, doc.getVersionSeriesId()); } record.put(AvroConstants.IS_PROXY, doc.isProxy()); record.put(AvroConstants.IS_TRASHED, doc.isTrashed()); record.put(AvroConstants.IS_VERSION, doc.isVersion()); record.put(AvroConstants.IS_CHECKEDIN, !doc.isCheckedOut()); record.put(AvroConstants.IS_LATEST_VERSION, doc.isLatestVersion()); record.put(AvroConstants.IS_LATEST_MAJOR_VERSION, doc.isLatestMajorVersion()); record.put(AvroConstants.CHANGE_TOKEN, doc.getChangeToken()); if (doc.getPos() != null) { record.put(AvroConstants.POS, doc.getPos()); } record.put(AvroConstants.MIXIN_TYPES, doc.getFacets()); record.put(AvroConstants.DOCUMENT_TYPE, service.toAvro(schema.getField(AvroConstants.DOCUMENT_TYPE).schema(), doc)); }
Source:
public boolean releaseAllWriters() { boolean released = writerPool.releaseAll(); if (null != backupWriterPool) { return backupWriterPool.releaseAll() || released; } return released; }

Target:
public boolean releaseAllWriters () { return writerPool.releaseAll(); }
Source:
private void setBondAggregatorIdsValidStatuses( List<VdsNetworkInterface> interfaces) { for (VdsNetworkInterface bond : interfaces) { if (!bond.isBond()) { continue; } bond.setBondAggregatorIdsValid(isSlaveAggregatorIdsValid(bond, interfaces)); } }

Target:
private void setBondAggregatorIdsValidStatuses( List<VdsNetworkInterface> interfaces) { interfaces.stream().filter(b -> b.isBond()).forEach(b -> b.setBondAggregationAlert(getBondAggregationAlert(b, interfaces))); }
Source:
private void createExistingTagsSection(Composite parent) { Composite right = new Composite(parent, SWT.BORDER); right.setLayout(GridLayoutFactory.swtDefaults().create()); new Label(right, SWT.WRAP).setText(UIText.CreateTagDialog_existingTags); Table table = new Table(right, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.FILL); table.setLayoutData(new GridData(GridData.FILL_BOTH)); TableLayout layout = new TableLayout(); layout.addColumnData(new ColumnWeightData(100, 20)); table.setLayout(layout); new TableColumn(table, SWT.BORDER | SWT.V_SCROLL); tagViewer = new TableViewer(table); tagViewer.setLabelProvider(new TagLabelProvider()); tagViewer.setContentProvider(new WorkbenchContentProvider()); tagViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { fillTagDialog(); } }); tagViewer.setInput(new TagInputList(existingTags)); tagViewer.addFilter(new ViewerFilter() { @Override public boolean select(Viewer viewer, Object parentElement, Object element) { Tag tag = (Tag) element; if (null != tagNamePattern) return tagNamePattern.matcher(tag.getTag()).find(); else return true; } }); applyDialogFont(parent); }

Target:
private void createExistingTagsSection(Composite parent) { Composite right = new Composite(parent, SWT.BORDER); right.setLayout(GridLayoutFactory.swtDefaults().create()); new Label(right, SWT.WRAP).setText(UIText.CreateTagDialog_existingTags); Table table = new Table(right, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.FILL); table.setLayoutData(new GridData(GridData.FILL_BOTH)); TableLayout layout = new TableLayout(); layout.addColumnData(new ColumnWeightData(100, 20)); table.setLayout(layout); tagViewer = new TableViewer(table); tagViewer.setLabelProvider(new TagLabelProvider()); tagViewer.setContentProvider(new WorkbenchContentProvider()); tagViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { fillTagDialog(); } }); tagViewer.setInput(new TagInputList(existingTags)); tagViewer.addFilter(new ViewerFilter() { @Override public boolean select(Viewer viewer, Object parentElement, Object element) { Tag tag = (Tag) element; if (tagNamePattern != null) return tagNamePattern.matcher(tag.getTag()).find(); else return true; } }); applyDialogFont(parent); }
Source:
protected boolean isInVisibleLines() { if (!super.isInVisibleLines()) { return false; } try { ISourceViewer viewer= super.getViewer(); int startLineOffset= viewer.getDocument().getLineInformationOfOffset(getPosition().getOffset()).getOffset(); int previousEndLineOffset= startLineOffset - 1; return super.isInVisibleLines(previousEndLineOffset); } catch (Exception e) { return true; } }

Target:
protected boolean isInVisibleLines() { if (!super.isInVisibleLines()) { return false; } ISourceViewer viewer= super.getViewer(); IDocument document= viewer.getDocument(); if (document == null) { return false; } try { int startLineOffset= document.getLineInformationOfOffset(getPosition().getOffset()).getOffset(); int previousEndLineOffset= startLineOffset - 1; return super.isInVisibleLines(previousEndLineOffset); } catch (BadLocationException e) { return false; } }
Source:
public void validateRedirectURIs(FacesContext context, UIComponent component, Object value) { if (!(value instanceof String)) { handleValidationError(context, "label.oauth2.missing.redirectURI"); } List<String> redirectURIs = Arrays.asList(((String) value).split(",")); if (redirectURIs.isEmpty()) { handleValidationError(context, "label.oauth2.missing.redirectURI"); } redirectURIs.stream().map(redirectURI -> redirectURI.trim()).forEach(redirectURI -> { if (redirectURI.isEmpty()) { handleValidationError(context, "label.oauth2.empty.redirectURI"); } if (!OAuth2Client.isRedirectURIValid(redirectURI)) { handleValidationError(context, "label.oauth2.invalid.redirectURIs"); } }); }

Target:
public void validateRedirectURIs(FacesContext context, UIComponent component, Object value) { if (!(value instanceof String)) { handleValidationError(context, "label.oauth2.missing.redirectURI"); } List<String> redirectURIs = Arrays.asList(((String) value).split(",")); if (redirectURIs.isEmpty()) { handleValidationError(context, "label.oauth2.missing.redirectURI"); } redirectURIs.stream().map(String::trim).forEach(redirectURI -> { if (redirectURI.isEmpty()) { handleValidationError(context, "label.oauth2.empty.redirectURI"); } if (!OAuth2Client.isRedirectURIValid(redirectURI)) { handleValidationError(context, "label.oauth2.invalid.redirectURIs"); } }); }
Source:
public void execute(TaskListener listener) { int numFiles = 0; File root = new File(getRootDir(), FINGERPRINTS_DIR_NAME); File[] files1 = root.listFiles(f -> f.isDirectory() && f.getName().length()==2); if(files1!=null) { for (File file1 : files1) { File[] files2 = file1.listFiles(f -> f.isDirectory() && f.getName().length()==2); for(File file2 : files2) { File[] files3 = file2.listFiles(f -> f.isFile() && Pattern.compile("[0-9a-f]{28}\\.xml").matcher(f.getName()).matches()); for(File file3 : files3) { if(check(file3, listener)) numFiles++; } deleteIfEmpty(file2); } deleteIfEmpty(file1); } } listener.getLogger().println("Cleaned up "+numFiles+" records"); }

Target:
public void execute(TaskListener listener) { int numFiles = 0; File root = new File(getRootDir(), FINGERPRINTS_DIR_NAME); File[] files1 = root.listFiles(f -> f.isDirectory() && f.getName().length()==2); if(files1!=null) { for (File file1 : files1) { File[] files2 = file1.listFiles(f -> f.isDirectory() && f.getName().length()==2); for(File file2 : files2) { File[] files3 = file2.listFiles(f -> f.isFile() && FINGERPRINT_FILE_PATTERN.matcher(f.getName()).matches()); for(File file3 : files3) { if(check(file3, listener)) numFiles++; } deleteIfEmpty(file2); } deleteIfEmpty(file1); } } listener.getLogger().println("Cleaned up "+numFiles+" records"); }
Source:
public void testExceptionWhenUsePositionalParameters() throws Exception { thrown.expect( PersistenceException.class ); thrown.expectMessage( "org.hibernate.HibernateException: OGM000094" ); StoredProcedureQuery storedProcedureQuery = em.createStoredProcedureQuery( Car.SIMPLE_VALUE_PROC, Car.class ); storedProcedureQuery.registerStoredProcedureParameter( 0, Integer.class, ParameterMode.IN ); storedProcedureQuery.setParameter( 0, 1 ); storedProcedureQuery.getSingleResult(); }

Target:
public void testExceptionWhenUsePositionalParameters() throws Exception { thrown.expect( PersistenceException.class ); thrown.expectMessage( "org.hibernate.HibernateException: OGM000094" ); inTransaction( em -> { StoredProcedureQuery storedProcedureQuery = em.createStoredProcedureQuery( Car.SIMPLE_VALUE_PROC, Car.class ); storedProcedureQuery.registerStoredProcedureParameter( 0, Integer.class, ParameterMode.IN ); storedProcedureQuery.setParameter( 0, 1 ); storedProcedureQuery.getSingleResult(); } ); }
Source:
public int read(byte[] b, int off, int len) throws IOException { try { return super.read(b, off, len); } catch (ZipException e) { throw buildBadDataException(format, e); } catch (EOFException e) { throw buildPrematureEofException(format, e); } }

Target:
public int read(byte[] b, int off, int len) throws IOException { try { return delegate.read(b, off, len); } catch (IOException e) { throw handleException(format, e); } }
Source:
public void downloadLinkReceived(String url) { if (url != null) incomingRef = url; uiState = UiState.READY_TO_INSTALL; uiStateScreenTransition(); Toast.makeText(this, Localization.get("menu.sms.ready"), Toast.LENGTH_LONG).show(); }

Target:
public void downloadLinkReceived(String url) { if (url != null) { incomingRef = url; uiState = UiState.READY_TO_INSTALL; uiStateScreenTransition(); Toast.makeText(this, Localization.get("menu.sms.ready"), Toast.LENGTH_LONG).show(); } }
Source:
public AdGroupConditionFieldAutoCompleter() { super(); mVerbs.put("NAME", "NAME"); buildCompletions(); getTypeDictionary().put("NAME", String.class); mColumnNameDict.put("NAME", "$CN"); ValueValidationFunction charValidation = validCahracters; for (String key : mVerbs.keySet()) { java.util.ArrayList<ValueValidationFunction> curList = new java.util.ArrayList<ValueValidationFunction>(); curList.add(charValidation); mValidationDict.put(key, curList); } }

Target:
public AdGroupConditionFieldAutoCompleter() { super(); mVerbs.put("NAME", "NAME"); buildCompletions(); getTypeDictionary().put("NAME", String.class); mColumnNameDict.put("NAME", "$CN"); ValueValidationFunction charValidation = validCahracters; for (String key : mVerbs.keySet()) { List<ValueValidationFunction> curList = new ArrayList<ValueValidationFunction>(1); curList.add(charValidation); mValidationDict.put(key, curList); } }
Source:
public LiveData<List<Provider>> getProviders(RestApi restApi) { final MutableLiveData<List<Provider>> providerLiveData = new MutableLiveData<>(); if (NetworkUtils.isOnline()) { restApi.getProviderList().enqueue(new Callback<Results<Provider>>() { @Override public void onResponse(@NotNull Call<Results<Provider>> call, @NotNull Response<Results<Provider>> response) { if (response.isSuccessful()) { if (!response.body().getResults().isEmpty()) { providerLiveData.setValue(response.body().getResults()); } else { providerLiveData.setValue(null); } } else { Log.d(TAG, "Response Unsuccessful!" + response.errorBody()); ToastUtil.error(openMRS.getString(R.string.unable_to_fetch_providers)); providerLiveData.setValue(null); } } @Override public void onFailure(@NotNull Call<Results<Provider>> call, @NotNull Throwable t) { Log.d(TAG, "Call Failed! Error: " + t.getMessage()); ToastUtil.error(openMRS.getString(R.string.unable_to_fetch_providers)); providerLiveData.setValue(null); } }); } else { ToastUtil.error(openMRS.getString(R.string.device_offline_msg)); } return providerLiveData; }

Target:
public LiveData<List<Provider>> getProviders(RestApi restApi) { final MutableLiveData<List<Provider>> providerLiveData = new MutableLiveData<>(); if (NetworkUtils.isOnline()) { restApi.getProviderList().enqueue(new Callback<Results<Provider>>() { @Override public void onResponse(@NotNull Call<Results<Provider>> call, @NotNull Response<Results<Provider>> response) { if (response.isSuccessful()) { if (!response.body().getResults().isEmpty()) { providerLiveData.setValue(response.body().getResults()); } else { providerLiveData.setValue(null); } } else { OpenMRS.getInstance().getOpenMRSLogger().e("Reading providers failed. Response: " + response.errorBody()); ToastUtil.error(OpenMRS.getInstance().getString(R.string.unable_to_fetch_providers)); providerLiveData.setValue(null); } } @Override public void onFailure(@NotNull Call<Results<Provider>> call, @NotNull Throwable t) { OpenMRS.getInstance().getOpenMRSLogger().e("Reading providers failed.", t); ToastUtil.error(OpenMRS.getInstance().getString(R.string.unable_to_fetch_providers)); providerLiveData.setValue(null); } }); } else { ToastUtil.error(OpenMRS.getInstance().getString(R.string.device_offline_msg)); OpenMRS.getInstance().getOpenMRSLogger().e("Failed to read providers. Device Offline"); } return providerLiveData; }
Source:
public void onMapReady(@NonNull final MapboxMap map) { map.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { style.addSource(new VectorSource(VECTOR_SOURCE_NAME, "mapbox://mapbox.us_census_states_2015")); try { statesArray = new JSONArray(loadJson()); } catch (Exception exception) { Log.e("JSONVectorMix", "Exception Loading GeoJSON: ", exception); } Expression.Stop[] stops = new Expression.Stop[statesArray.length()]; for (int x = 0; x < statesArray.length(); x++) { try { JSONObject singleState = statesArray.getJSONObject(x); double green = singleState.getDouble(DATA_STYLE_UNEMPLOYMENT_PROP) / 14 * 255; stops[x] = stop( Double.parseDouble(singleState.getString(DATA_MATCH_PROP)), rgba(0, green, 0, 1) ); } catch (JSONException exception) { throw new RuntimeException(exception); } } FillLayer statesJoinLayer = new FillLayer("states-join", VECTOR_SOURCE_NAME); statesJoinLayer.setSourceLayer(VECTOR_SOURCE_NAME); statesJoinLayer.withProperties( fillColor(match(toNumber(get(DATA_MATCH_PROP)), rgba(0, 0, 0, 1), stops)) ); style.addLayerAbove(statesJoinLayer, "waterway-label"); } }); }

Target:
public void onMapReady(@NonNull final MapboxMap map) { this.mapboxMap = map; map.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { style.addSource(new VectorSource(VECTOR_SOURCE_NAME, "mapbox://mapbox.us_census_states_2015")); new LoadJson(ChoroplethJsonVectorMixActivity.this).execute(); } }); }
Source:
public ModeshapeNodeData readModeshapeNodeData(ModelId modelId) { String path = '/' + modelId.getNamespace().replace('.', '/') + '/' + modelId.getName() + '/' + modelId.getVersion(); return readModeshapeNodeData(path); }

Target:
public ModeshapeNodeData readModeshapeNodeData(ModelId modelId) { String path = String.format("/%s/%s/%s", modelId.getNamespace().replace('.', '/'), modelId.getName(), modelId.getVersion()); return readModeshapeNodeData(path); }
Source:
public List<Thread> getThreads() { try { getResult(); } catch (SQLException e) { new IllegalStateException("SQL Error: " + e); } return threads; }

Target:
public List<Thread> getThreads() { try { getResult(); } catch (SQLException e) { throw new IllegalStateException("SQL Error: " + e); } return threads; }
Source:
private VariantContext createVC(final VCFHeader header) { return createVCGeneral(header, "1", 1); }

Target:
private VariantContext createVC(final VCFHeader header) { final List<Allele> alleles = new ArrayList<>(); final Map<String, Object> attributes = new HashMap<>(); final GenotypesContext genotypes = GenotypesContext.create(header.getGenotypeSamples().size()); alleles.add(Allele.create("A", true)); alleles.add(Allele.create("ACC", false)); attributes.put("DP", "50"); for (final String name : header.getGenotypeSamples()) { final Genotype gt = new GenotypeBuilder(name, alleles.subList(1, 2)).GQ(0).attribute("BB", "1").phased(true) .make(); genotypes.add(gt); } return new VariantContextBuilder("RANDOM", "1", 1, 1, alleles) .genotypes(genotypes).attributes(attributes).make(); }
Source:
private long processFile(FileStatus file, String currentFile, String checkPointValue, FileSystem fs, Map<FileStatus, String> results, Map<String, FileStatus> collectorPaths, String stream) throws IOException { long fileTimeStamp = -1; String fileName = file.getPath().getName(); if (fileName != null && (!fileName.equalsIgnoreCase(currentFile) || processLastFile)) { String destDir = getCategoryJobOutTmpPath(stream) .toString(); if (aboveCheckpoint(checkPointValue, fileName)) { results.put(file, destDir); fileTimeStamp = CalendarHelper.getDateFromCollectorFileName(fileName); numberOfFilesProcessed++; } collectorPaths.put(fileName, file); } return fileTimeStamp; }

Target:
private long processFile(FileStatus file, String currentFile, String checkPointValue, FileSystem fs, Map<FileStatus, String> results, Map<String, FileStatus> collectorPaths, String stream) throws IOException { long fileTimeStamp = -1; String fileName = file.getPath().getName(); if (fileName != null && (!fileName.equalsIgnoreCase(currentFile) || processLastFile)) { String destDir = getCategoryJobOutTmpPath(stream) .toString(); if (aboveCheckpoint(checkPointValue, fileName)) { results.put(file, destDir); fileTimeStamp = CalendarHelper.getDateFromCollectorFileName(fileName); if (file.getLen() != 0) { numberOfFilesProcessed++; } } collectorPaths.put(fileName, file); } return fileTimeStamp; }
Source:
private boolean finalizeParentTemplate(DatadiskTO dataDiskTemplate, VMTemplateVO templateVO, TemplateInfo parentTemplate, DataStore imageStore, int diskCount) { TemplateInfo templateInfo = imageFactory.getTemplate(templateVO.getId(), imageStore); AsyncCallFuture<TemplateApiResult> templateFuture = createDatadiskTemplateAsync(parentTemplate, templateInfo, dataDiskTemplate.getPath(), dataDiskTemplate.getDiskId(), dataDiskTemplate.getFileSize(), dataDiskTemplate.isBootable()); TemplateApiResult result = null; try { result = templateFuture.get(); if (!result.isSuccess()) { s_logger.debug("Since creation of parent template: " + templateInfo.getId() + " failed, delete Datadisk templates that were created as part of parent" + " template download"); cleanupDatadiskTemplates(templateInfo); } return result.isSuccess(); } catch (Exception e) { s_logger.error("Creation of template: " + templateVO.getId() + " failed: " + result.getResult(), e); return false; } }

Target:
private boolean finalizeParentTemplate(DatadiskTO dataDiskTemplate, VMTemplateVO templateVO, TemplateInfo parentTemplate, DataStore imageStore, int diskCount) throws ExecutionException, InterruptedException, CloudRuntimeException { TemplateInfo templateInfo = imageFactory.getTemplate(templateVO.getId(), imageStore); AsyncCallFuture<TemplateApiResult> templateFuture = createDatadiskTemplateAsync(parentTemplate, templateInfo, dataDiskTemplate.getPath(), dataDiskTemplate.getDiskId(), dataDiskTemplate.getFileSize(), dataDiskTemplate.isBootable()); TemplateApiResult result = null; result = templateFuture.get(); if (!result.isSuccess()) { s_logger.debug("Since creation of parent template: " + templateInfo.getId() + " failed, delete Datadisk templates that were created as part of parent" + " template download"); cleanupDatadiskTemplates(templateInfo); } return result.isSuccess(); }
Source:
public void saveTestMeasures(SensorContext context) { InputFile unitTestFile = getUnitTestInputFile(context.fileSystem()); if (unitTestFile != null) { context.<Integer>newMeasure().on(unitTestFile).withValue(skipped).forMetric(CoreMetrics.SKIPPED_TESTS).save(); context.<Long>newMeasure().on(unitTestFile).withValue((long) testDurationSeconds()).forMetric(CoreMetrics.TEST_EXECUTION_TIME).save(); context.<Integer>newMeasure().on(unitTestFile).withValue((int) liveTests()).forMetric(CoreMetrics.TESTS).save(); context.<Integer>newMeasure().on(unitTestFile).withValue(errors).forMetric(CoreMetrics.TEST_ERRORS).save(); context.<Integer>newMeasure().on(unitTestFile).withValue(failures).forMetric(CoreMetrics.TEST_FAILURES).save(); if (liveTests() > 0) { context.<Double>newMeasure().on(unitTestFile).withValue(ParsingUtils.scaleValue(successPercentage())).forMetric(CoreMetrics.TEST_SUCCESS_DENSITY).save(); } } else { LOGGER.debug("Following file is not located in the test folder specified in the Sonar configuration: " + file + ". The test results won't be reported in Sonar."); } }

Target:
public void saveTestMeasures(SensorContext context) { InputFile unitTestFile = getUnitTestInputFile(context.fileSystem()); if (unitTestFile != null) { context.<Integer>newMeasure().on(unitTestFile).withValue(skipped).forMetric(CoreMetrics.SKIPPED_TESTS).save(); context.<Long>newMeasure().on(unitTestFile).withValue((long) testDurationMilliseconds()).forMetric(CoreMetrics.TEST_EXECUTION_TIME).save(); context.<Integer>newMeasure().on(unitTestFile).withValue((int) liveTests()).forMetric(CoreMetrics.TESTS).save(); context.<Integer>newMeasure().on(unitTestFile).withValue(errors).forMetric(CoreMetrics.TEST_ERRORS).save(); context.<Integer>newMeasure().on(unitTestFile).withValue(failures).forMetric(CoreMetrics.TEST_FAILURES).save(); if (liveTests() > 0) { context.<Double>newMeasure().on(unitTestFile).withValue(ParsingUtils.scaleValue(successPercentage())).forMetric(CoreMetrics.TEST_SUCCESS_DENSITY).save(); } } else { LOGGER.debug("Following file is not located in the test folder specified in the Sonar configuration: " + file + ". The test results won't be reported in Sonar."); } }
Source:
public boolean verifySig(byte[] data, byte[] sig) throws EncryptionException { try { Signature signer = Signature.getInstance("SHA1withDSA"); signer.initVerify(this.publicKeyPart); signer.update(data); return (signer.verify(sig)); } catch (Exception e) { throw new EncryptionException("DSA verification failed unexpectedly", e); } }

Target:
public boolean verifySig(byte[] data, byte[] sig) throws EncryptionException { try { Signature signer = Signature.getInstance("SHA1withDSA"); signer.initVerify(this.publicKeyPart); signer.update(data); return (signer.verify(sig)); } catch (InvalidKeyException|SignatureException|NoSuchAlgorithmException e) { throw new EncryptionException("DSA verification failed unexpectedly", e); } }
Source:
public void afterVideoExtensionConfigured(@Observes VideoExtensionConfigured event, ArquillianDescriptor descriptor) { VideoConfiguration configuration = new WebcamVideoConfiguration(reporterConfiguration.get()); for (ExtensionDef extension : descriptor.getExtensions()) { if (extension.getExtensionName().equals(EXTENSION_NAME)) { configuration.setConfiguration(extension.getExtensionProperties()); configuration.validate(); break; } } this.configuration.set(configuration); if (logger.isLoggable(Level.INFO)) { System.out.println("Configuration of Arquillian Desktop Video Recorder:"); System.out.println(this.configuration.get().toString()); } List<VideoStrategy> strategies = new ArrayList<VideoStrategy>(serviceLoader.get().all(VideoStrategy.class)); strategy.set(resolveVideoStrategy(strategies)); strategy.get().setConfiguration(this.configuration.get()); setup(); }

Target:
public void afterVideoExtensionConfigured(@Observes VideoExtensionConfigured event, ArquillianDescriptor descriptor) { VideoConfiguration configuration = new WebcamVideoConfiguration(reporterConfiguration.get()); for (ExtensionDef extension : descriptor.getExtensions()) { if (extension.getExtensionName().equals(EXTENSION_NAME)) { configuration.setConfiguration(extension.getExtensionProperties()); configuration.validate(); break; } } this.configuration.set(configuration); if (logger.isLoggable(Level.INFO)) { System.out.println("Configuration of Arquillian Webcam Video Recorder:"); System.out.println(this.configuration.get().toString()); } List<VideoStrategy> strategies = new ArrayList<VideoStrategy>(serviceLoader.get().all(VideoStrategy.class)); strategy.set(resolveVideoStrategy(strategies)); strategy.get().setConfiguration(this.configuration.get()); setup(); }
Source:
public InitCommand setSeparateGitDir(File gitDir) throws IllegalStateException { this.gitDir = gitDir; validateDirs(); return this; }

Target:
public InitCommand setSeparateGitDir(File gitDir) throws IllegalStateException { validateDirs(directory, gitDir, bare); this.gitDir = gitDir; return this; }
Source:
protected void addReadBuffer(final ByteBuffer bb) { addReadStats(bb.remaining()); synchronized(readerLock) { readBuffers.add(bb); callReader(); } }

Target:
protected void addReadBuffer(final ByteBuffer bb) { addReadStats(bb.remaining()); synchronized(readerLock) { readBuffers.add(bb); } callReader(); }
Source:
public void onBindHeaderViewHolder(HeaderViewHolder holder, int position) { String sortTitle = Utils.checkStringEmpty(getItem(position).getTitle()); String sortName = Utils.checkStringEmpty(getItem(position).getTrack().getName()); if (SortOrder.sortTypeSchedule().equals(Session.Companion.getTITLE()) && (!Utils.isEmpty(sortTitle))) { holder.header.setText(String.valueOf(sortTitle.toUpperCase().charAt(0))); } else if (SortOrder.sortTypeSchedule().equals(Session.Companion.getTRACK())){ holder.header.setText(String.valueOf(sortName)); } else if (SortOrder.sortTypeSchedule().equals(Session.Companion.getSTART_TIME())) { holder.header.setText(DateConverter.formatDateWithDefault(DateConverter.FORMAT_24H, getItem(position).getStartsAt())); } }

Target:
public void onBindHeaderViewHolder(HeaderViewHolder holder, int position) { String sortTitle = Utils.checkStringEmpty(getItem(position).getTitle()); String sortName = Utils.checkStringEmpty(getItem(position).getTrack().getName()); if (SortOrder.sortTypeSchedule().equals(Session.TITLE) && (!Utils.isEmpty(sortTitle))) { holder.header.setText(String.valueOf(sortTitle.toUpperCase().charAt(0))); } else if (SortOrder.sortTypeSchedule().equals(Session.TRACK)){ holder.header.setText(String.valueOf(sortName)); } else if (SortOrder.sortTypeSchedule().equals(Session.START_TIME)) { holder.header.setText(DateConverter.formatDateWithDefault(DateConverter.FORMAT_24H, getItem(position).getStartsAt())); } }
Source:
public Object[] getSyncConfigurationOptions(RealmConfiguration config) { return new Object[14]; }

Target:
public Object[] getSyncConfigurationOptions(RealmConfiguration config) { return new Object[SYNC_CONFIG_OPTIONS]; }
Source:
private void validateRngRequiredSource() { Version cluVersion = getVersion().getSelectedItem(); boolean rngSupportedForCluster = isRngSupportedForClusterVersion(cluVersion); getRngRandomSourceRequired().setIsValid(rngSupportedForCluster || !getRngRandomSourceRequired().getEntity()); getRngHwrngSourceRequired().setIsValid(rngSupportedForCluster || !getRngHwrngSourceRequired().getEntity()); }

Target:
private void validateRngRequiredSource() { Version clusterVersion = getVersion().getSelectedItem(); boolean rngSupportedForCluster = isRngSupportedForClusterVersion(clusterVersion); getRngRandomSourceRequired().setIsValid(rngSupportedForCluster || !getRngRandomSourceRequired().getEntity()); getRngHwrngSourceRequired().setIsValid(rngSupportedForCluster || !getRngHwrngSourceRequired().getEntity()); }
Source:
public void getStats(Path segment, final SegmentReaderStats stats) throws Exception { long cnt = 0L; Text key = new Text(); Text val = new Text(); FileSystem fs = segment.getFileSystem(getConf()); if (ge) { MapFile.Reader[] readers = MapFileOutputFormat.getReaders( new Path(segment, CrawlDatum.GENERATE_DIR_NAME), getConf()); for (int i = 0; i < readers.length; i++) { while (readers[i].next(key, val)) cnt++; readers[i].close(); } stats.generated = cnt; } if (fe) { Path fetchDir = new Path(segment, CrawlDatum.FETCH_DIR_NAME); if (fs.exists(fetchDir) && fs.getFileStatus(fetchDir).isDirectory()) { cnt = 0L; long start = Long.MAX_VALUE; long end = Long.MIN_VALUE; CrawlDatum value = new CrawlDatum(); MapFile.Reader[] mreaders = MapFileOutputFormat.getReaders(fetchDir, getConf()); for (int i = 0; i < mreaders.length; i++) { while (mreaders[i].next(key, value)) { cnt++; if (value.getFetchTime() < start) start = value.getFetchTime(); if (value.getFetchTime() > end) end = value.getFetchTime(); } mreaders[i].close(); } stats.start = start; stats.end = end; stats.fetched = cnt; } } if (pd) { Path parseDir = new Path(segment, ParseData.DIR_NAME); if (fs.exists(parseDir) && fs.getFileStatus(parseDir).isDirectory()) { cnt = 0L; long errors = 0L; ParseData value = new ParseData(); MapFile.Reader[] mreaders = MapFileOutputFormat.getReaders(parseDir, getConf()); for (int i = 0; i < mreaders.length; i++) { while (mreaders[i].next(key, value)) { cnt++; if (!value.getStatus().isSuccess()) errors++; } mreaders[i].close(); } stats.parsed = cnt; stats.parseErrors = errors; } } }

Target:
public void getStats(Path segment, final SegmentReaderStats stats) throws Exception { long cnt = 0L; Text key = new Text(); Text val = new Text(); FileSystem fs = segment.getFileSystem(getConf()); if (ge) { SequenceFile.Reader[] readers = SegmentReaderUtil.getReaders( new Path(segment, CrawlDatum.GENERATE_DIR_NAME), getConf()); for (int i = 0; i < readers.length; i++) { while (readers[i].next(key, val)) cnt++; readers[i].close(); } stats.generated = cnt; } if (fe) { Path fetchDir = new Path(segment, CrawlDatum.FETCH_DIR_NAME); if (fs.exists(fetchDir) && fs.getFileStatus(fetchDir).isDirectory()) { cnt = 0L; long start = Long.MAX_VALUE; long end = Long.MIN_VALUE; CrawlDatum value = new CrawlDatum(); MapFile.Reader[] mreaders = MapFileOutputFormat.getReaders(fetchDir, getConf()); for (int i = 0; i < mreaders.length; i++) { while (mreaders[i].next(key, value)) { cnt++; if (value.getFetchTime() < start) start = value.getFetchTime(); if (value.getFetchTime() > end) end = value.getFetchTime(); } mreaders[i].close(); } stats.start = start; stats.end = end; stats.fetched = cnt; } } if (pd) { Path parseDir = new Path(segment, ParseData.DIR_NAME); if (fs.exists(parseDir) && fs.getFileStatus(parseDir).isDirectory()) { cnt = 0L; long errors = 0L; ParseData value = new ParseData(); MapFile.Reader[] mreaders = MapFileOutputFormat.getReaders(parseDir, getConf()); for (int i = 0; i < mreaders.length; i++) { while (mreaders[i].next(key, value)) { cnt++; if (!value.getStatus().isSuccess()) errors++; } mreaders[i].close(); } stats.parsed = cnt; stats.parseErrors = errors; } } }
Source:
public ArticlePageObject openMercuryArticleByName(String wikiURL, String articleName) { getUrl(wikiURL + URLsContent.WIKI_DIR + articleName + "?cb=" + new Timestamp(System.currentTimeMillis()).getTime()); PageObjectLogging .log("openMercuryArticleByName", "Article" + articleName + " was opened", true); return new ArticlePageObject(driver); }

Target:
public ArticlePageObject openMercuryArticleByName(String wikiURL, String articleName) { getUrl(wikiURL + URLsContent.WIKI_DIR + articleName + "?cb=" + DateTime.now().getMillis()); PageObjectLogging .log("openMercuryArticleByName", "Article" + articleName + " was opened", true); return new ArticlePageObject(driver); }
Source:
public CcLinkingHelper setLinkedDLLNameSuffix(String suffix) { if(this.cppConfiguration.isRenameDLL(featureConfiguration)) { this.linkedDLLNameSuffix = Preconditions.checkNotNull(suffix); } return this; }

Target:
public CcLinkingHelper setLinkedDLLNameSuffix(String suffix) { this.linkedDLLNameSuffix = Preconditions.checkNotNull(suffix); return this; }