auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void run(final int addEvalNum, final int addThreadNum) { final String[] args = { "-split", "1", "-local", "true", "-input", ClassLoader.getSystemResource("data").getPath() + "/sample", "-output", ClassLoader.getSystemResource("data").getPath() + "/result", "-maxNumEvalLocal", Integer.toString(addEvalNum + 2), "-timeout", "120000" }; LauncherStatus status; try { status = DolphinLauncher.run( Configurations.merge( DolphinConfiguration.getConfiguration(args), Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(JobIdentifier.class, "EM Add Integration Test") .bindImplementation(UserJobInfo.class, SimpleJobInfo.class) .build()), Tang.Factory.getTang().newConfigurationBuilder() .bindSetEntry(DriverStartHandler.class, AddTestHandlers.AddTestStartHandler.class) .bindSetEntry(EvaluatorAllocatedHandlers.class, AddTestHandlers.AddTestEvaluatorAllocatedHandler.class) .bindSetEntry(Clock.StopHandler.class, AddTestHandlers.AddTestDriverStopHandler.class) .bindNamedParameter(AddEvalNumber.class, Integer.toString(addEvalNum)) .bindNamedParameter(AddThreadNumber.class, Integer.toString(addThreadNum)) .build()); } catch (IOException e) { status = LauncherStatus.failed(e); } assertEquals(LauncherStatus.COMPLETED, status); }

Target:
private void run(final int addEvalNum, final int addThreadNum) { final String[] args = { "-split", "1", "-local", "true", "-input", ClassLoader.getSystemResource("data").getPath() + "/sample", "-output", ClassLoader.getSystemResource("data").getPath() + "/result", "-maxNumEvalLocal", Integer.toString(addEvalNum + 2), "-timeout", "120000" }; LauncherStatus status; try { status = DolphinLauncher.run( Configurations.merge( DolphinConfiguration.getConfiguration(args), Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(JobIdentifier.class, "EM Add Integration Test") .bindImplementation(UserJobInfo.class, SimpleJobInfo.class) .build()), Tang.Factory.getTang().newConfigurationBuilder() .bindSetEntry(DriverStartHandler.class, AddTestHandlers.AddTestStartHandler.class) .bindSetEntry(EvaluatorAllocatedHandlers.class, AddTestHandlers.AddTestEvaluatorAllocatedHandler.class) .bindSetEntry(Clock.StopHandler.class, AddTestHandlers.AddTestStopHandler.class) .bindNamedParameter(AddEvalNumber.class, Integer.toString(addEvalNum)) .bindNamedParameter(AddThreadNumber.class, Integer.toString(addThreadNum)) .build()); } catch (final IOException e) { status = LauncherStatus.failed(e); } assertEquals(LauncherStatus.COMPLETED, status); }
Source:
public boolean updateClientCustomField(String clientId, String customFieldId, String fieldValue) throws MambuApiException { ParamsMap params = ServiceHelper.makeParamsForUpdateCustomField(clientId, customFieldId, fieldValue); return serviceExecutor.execute(updateClientCustomField, clientId, customFieldId, params); }

Target:
public boolean updateClientCustomField(String clientId, String customFieldId, String fieldValue) throws MambuApiException { ParamsMap params = ServiceHelper.makeParamsForUpdateCustomField(customFieldId, fieldValue); return serviceExecutor.execute(updateClientCustomField, clientId, customFieldId, params); }
Source:
public TmfXmlPatternSegmentField(Element element) { fName = element.getAttribute(TmfXmlStrings.NAME); fType = element.getAttribute(TmfXmlStrings.TYPE); String constantValue = element.getAttribute(TmfXmlStrings.VALUE); if (constantValue.isEmpty() && !fType.equals(TmfXmlStrings.TYPE_NULL)) { fStateValue = null; Element elementFieldStateValue = (Element) element.getElementsByTagName(TmfXmlStrings.STATE_VALUE).item(0); if (elementFieldStateValue == null) { throw new IllegalArgumentException(); } fXmlStateValue = fModelFactory.createStateValue(elementFieldStateValue, fContainer, new ArrayList<>()); } else { switch (fType) { case TmfXmlStrings.TYPE_INT: fStateValue = TmfStateValue.newValueInt(Integer.parseInt(constantValue)); break; case TmfXmlStrings.TYPE_LONG: fStateValue = TmfStateValue.newValueLong(Long.parseLong(constantValue)); break; case TmfXmlStrings.TYPE_STRING: fStateValue = TmfStateValue.newValueString(constantValue); break; case TmfXmlStrings.TYPE_NULL: fStateValue = TmfStateValue.nullValue(); break; default: throw new IllegalArgumentException("pattern segment field : invalid type of field"); } fXmlStateValue = null; } }

Target:
public TmfXmlPatternSegmentField(Element element) { fName = element.getAttribute(TmfXmlStrings.NAME); fType = element.getAttribute(TmfXmlStrings.TYPE); String constantValue = element.getAttribute(TmfXmlStrings.VALUE); if (constantValue.isEmpty() && !fType.equals(TmfXmlStrings.TYPE_NULL)) { fStateValue = null; Element elementFieldStateValue = (Element) element.getElementsByTagName(TmfXmlStrings.STATE_VALUE).item(0); if (elementFieldStateValue == null) { throw new IllegalArgumentException("The value of the field " + fName + " is missing"); } fXmlStateValue = fModelFactory.createStateValue(elementFieldStateValue, fContainer, new ArrayList<>()); } else { fStateValue = getStateValueFromConstant(constantValue, fType); fXmlStateValue = null; } }
Source:
public URL getURL(DocumentReference reference) throws XWikiRestException { try { Locale locale = reference.getLocale(); if (locale != null && !locale.toString().isEmpty()) { return Utils.createURI(getBaseURI(), PageTranslationResource.class, reference.getWikiReference().getName(), getSpaceList(reference.getLastSpaceReference()), reference.getName(), reference.getLocale()).toURL(); } return Utils.createURI(getBaseURI(), PageResource.class, reference.getWikiReference().getName(), getSpaceList(reference.getLastSpaceReference()), reference.getName()).toURL(); } catch (MalformedURLException e) { throw new XWikiRestException( String.format("Failed to generate a REST URL for the document [%s].", reference), e); } }

Target:
public URL getURL(DocumentReference reference) throws XWikiRestException { try { Locale locale = reference.getLocale(); URL url; if (locale != null && !locale.toString().isEmpty()) { url = Utils.createURI(getBaseURI(), PageTranslationResource.class, reference.getWikiReference().getName(), getSpaceList(reference.getLastSpaceReference()), reference.getName(), reference.getLocale()).toURL(); } else { url = Utils.createURI(getBaseURI(), PageResource.class, reference.getWikiReference().getName(), getSpaceList(reference.getLastSpaceReference()), reference.getName()).toURL(); } return url; } catch (MalformedURLException e) { throw new XWikiRestException( String.format("Failed to generate a REST URL for the document [%s].", reference), e); } }
Source:
private int createInternal(String path, long mode, FuseFileInfo fi) { final AlluxioURI uri = mPathResolverCache.getUnchecked(path); if (uri.getName().length() > MAX_NAME_LENGTH) { LOG.error("Failed to create {}: file name longer than characters", path, MAX_NAME_LENGTH); return -ErrorCodes.ENAMETOOLONG(); } try { FileOutStream os = mFileSystem.createFile(uri, CreateFilePOptions.newBuilder() .setMode(new Mode((short) mode).toProto()) .build()); long fid = mNextOpenFileId.getAndIncrement(); mCreateFileEntries.put(fid, os); fi.fh.set(fid); setUserGroupIfNeeded(uri); } catch (Throwable e) { LOG.error("Failed to getattr {}: ", path, e); return -ErrorCodes.EIO(); } return 0; }

Target:
private int createInternal(String path, long mode, FuseFileInfo fi) { final AlluxioURI uri = mPathResolverCache.getUnchecked(path); if (uri.getName().length() > MAX_NAME_LENGTH) { LOG.error("Failed to create {}: file name longer than characters", path, MAX_NAME_LENGTH); return -ErrorCodes.ENAMETOOLONG(); } try { FileOutStream os = mFileSystem.createFile(uri, CreateFilePOptions.newBuilder() .setMode(new Mode((short) mode).toProto()) .build()); long fid = mNextOpenFileId.getAndIncrement(); mCreateFileEntries.put(fid, os); fi.fh.set(fid); setUserGroupIfNeeded(uri); } catch (Throwable e) { LOG.error("Failed to create {}: ", path, e); return -ErrorCodes.EIO(); } return 0; }
Source:
private void _setLastLoginAddress(String address) { lastLoginAddress = address; if (ess.getSettings().storeIPAddressPlainText()) { config.setProperty("ipAddress", address); } else { config.setProperty("ipAddress", "hidden"); } }

Target:
private void _setLastLoginAddress(String address) { lastLoginAddress = address; if (ess.getSettings().storeUserIPAddress()) { config.setProperty("ipAddress", address); } else { config.setProperty("ipAddress", "hidden"); } }
Source:
private ArrayList<Map<String, Object>> resultSetToArrayList(ResultSet rs) throws SQLException { ResultSetMetaData md = rs.getMetaData(); int columns = md.getColumnCount(); ArrayList<Map<String, Object>> arraylist = new ArrayList<>(); while (rs.next()) { Map<String, Object> row = new LinkedHashMap<>(columns); for (int i = 1; i <= columns; ++i) { if (rs.getObject(i) == null) { row.put(md.getColumnName(i), ""); } else { if (md.getColumnTypeName(i).compareToIgnoreCase("blob") == 0) { row.put(md.getColumnName(i), "BLOB Data not shown..."); } else { row.put(md.getColumnName(i), rs.getObject(i)); } } } arraylist.add(row); } return arraylist; }

Target:
private ArrayList<Map<String, Object>> resultSetToArrayList(ResultSet rs) throws SQLException { ResultSetMetaData metaData = rs.getMetaData(); int columns = metaData.getColumnCount(); ArrayList<Map<String, Object>> rowlist = new ArrayList<>(); while (rs.next()) { Map<String, Object> row = new LinkedHashMap<>(columns); for (int i = 1; i <= columns; ++i) { if (rs.getObject(i) == null) { row.put(metaData.getColumnName(i), ""); } else { if (metaData.getColumnTypeName(i).compareToIgnoreCase("blob") == 0) { row.put(metaData.getColumnName(i), Bundle.SQLiteViewer_BlobNotShown_message()); } else { row.put(metaData.getColumnName(i), rs.getObject(i)); } } } rowlist.add(row); } return rowlist; }
Source:
public void testExecuteQueryWithNotExistingIscsiBond() { IscsiBond iscsiBond = new IscsiBond(); iscsiBond.setId(Guid.newGuid()); when(getQueryParameters().getId()).thenReturn(iscsiBondId); getQuery().executeQueryCommand(); IscsiBond result = getQuery().getQueryReturnValue().getReturnValue(); assertNull(result); }

Target:
public void testExecuteQueryWithNotExistingIscsiBond() { when(getQueryParameters().getId()).thenReturn(iscsiBondId); getQuery().executeQueryCommand(); IscsiBond result = getQuery().getQueryReturnValue().getReturnValue(); assertNull(result); }
Source:
public List<Migration> getMigrations() { var descriptors = getDescriptors(XP_CONFIG); return descriptors.stream().map(d -> getMigration(d.getId())).collect(Collectors.toList()); }

Target:
public List<Migration> getMigrations() { return getDescriptors(XP_CONFIG).stream().map(Descriptor::getId).map(this::getMigration).collect(toList()); }
Source:
private void writeGroup(ArrayList<SAMRecord> groupOfReads, HashMap<Integer, SAMFileWriter> writers) { int destination = TARGET_INDEX; boolean unaligned = true; for (SAMRecord rec: groupOfReads) { if (!(rec.getReadUnmappedFlag())) { if (( INVERT_TARGET) ^ (!(SUBSET.contains(rec.getReferenceName())))) { destination = EXCLUDED_INDEX; break; } else { unaligned = false; } } else { if ((EXCLUDE_UNALIGNED) && (SUBSET.contains(rec.getReferenceName()))) { destination = EXCLUDED_INDEX; } } } if (unaligned && EXCLUDE_UNALIGNED && destination==TARGET_INDEX) { destination = EXCLUDED_INDEX; } for (SAMRecord rec: groupOfReads) { writers.get(destination).addAlignment(rec); } }

Target:
private void writeGroup(ArrayList<SAMRecord> groupOfReads, HashMap<Integer, SAMFileWriter> writers) { int destination = TARGET_INDEX; boolean unaligned = true; for (SAMRecord rec: groupOfReads) { if (!(rec.getReadUnmappedFlag())) { if (( INVERT_TARGET) ^ (!(SUBSET.contains(rec.getReferenceName())))) { destination = EXCLUDED_INDEX; break; } else { unaligned = false; } } } if (unaligned && EXCLUDE_UNALIGNED && destination==TARGET_INDEX) { destination = EXCLUDED_INDEX; } for (SAMRecord rec: groupOfReads) { writers.get(destination).addAlignment(rec); } }
Source:
protected boolean validateImages() { List<DiskImage> imagesToValidate = getDiskImagesToValidate(); List<DiskImage> allDiskImagesInSrcAndDstToValidate = getAllDiskImagesInSrcAndDstToValidate(); DiskImagesValidator diskImagesValidator = new DiskImagesValidator(imagesToValidate); DiskImagesValidator allDiskImagesInChainValidator = new DiskImagesValidator(allDiskImagesInSrcAndDstToValidate); return validateImagesNotLocked(diskImagesValidator) && (getVm().isQualifiedForLiveSnapshotMerge() || validate(allDiskImagesInChainValidator.diskImagesNotIllegal())) && (!getVm().isQualifiedForLiveSnapshotMerge() || validateSnapshotDisksArePlugged()); }

Target:
protected boolean validateImages() { List<DiskImage> imagesToValidate = getDiskImagesToValidate(); DiskImagesValidator diskImagesValidator = new DiskImagesValidator(imagesToValidate); List<DiskImage> allDiskImagesInSrcAndDstToValidate = getAllDiskImagesInSrcAndDstToValidate(); DiskImagesValidator allDiskImagesInChainValidator = new DiskImagesValidator(allDiskImagesInSrcAndDstToValidate); return validateImagesNotLocked(diskImagesValidator) && (getVm().isQualifiedForLiveSnapshotMerge() || validate(allDiskImagesInChainValidator.diskImagesNotIllegal())) && (!getVm().isQualifiedForLiveSnapshotMerge() || validateSnapshotDisksArePlugged()); }
Source:
public long lastModified() { try { return p4.getHead(base + "/..."); } catch (Exception e) { logger.warning("Unable to check changes: " + e.getMessage()); } return 0; }

Target:
public long lastModified() { long last = 0L; try { last = p4.getHead(base + "/..."); } catch (Exception e) { logger.warning("Unable to check changes: " + e.getMessage()); } return last; }
Source:
public synchronized void onComplete(Result result) { Throwable throwable = result.getFailure(); if (throwable != null) { future.failed(throwable); } else { currentBuffer = null; currentBufferPosition = 0; future.completed(result.getResponse(), new GatheringByteArrayInputStream(buffers, size)); } }

Target:
public synchronized void onComplete(Result result) { Throwable throwable = result.getFailure(); if (throwable != null) { future.failed(throwable); } else { currentBuffer = new byte[0]; currentBufferPosition = 0; future.completed(result.getResponse(), new GatheringByteArrayInputStream(buffers, size)); buffers = new ArrayList<>(); size = 0; } }
Source:
public void customize(RestTemplate restTemplate) { restTemplate.setRequestFactory(new DefaultZipkinConnectionFactory(this.zipkinProperties)); if (this.zipkinProperties.isBasicAuthenticated()) { restTemplate.getInterceptors().add( new BasicAuthorizationInterceptor(this.zipkinProperties.getUsername(), this.zipkinProperties.getPassword())); } }

Target:
public void customize(RestTemplate restTemplate) { if (this.zipkinProperties.getCompression().isEnabled()) { restTemplate.getInterceptors().add(0, new GZipInterceptor()); } }
Source:
public Map<String, Gauge> getTaskGauges(int taskId) { Map<String, Gauge> taskGaugeMap = new HashMap<>(); Collection<Gauge> gauges = registry.getGauges().values(); Map<String, Metric> taskMetrics = taskIdMetrics.getOrDefault(taskId, Collections.emptyMap()); for (Map.Entry<String, Metric> entry : taskMetrics.entrySet()) { if (gauges.contains(entry.getValue())) { taskGaugeMap.put(entry.getKey(), (Gauge) entry.getValue()); } } return taskGaugeMap; }

Target:
public Map<String, Gauge> getTaskGauges(int taskId) { return getMetricNameMap(taskId, taskIdGauges); }
Source:
public OfLong getListOfEntriesOfLedger(long ledgerId) throws IOException { Iterator<LedgerCache.PageEntries> pageEntriesIteratorNonFinal = null; try { pageEntriesIteratorNonFinal = ledgerCache.listEntries(ledgerId).iterator(); } catch (Bookie.NoLedgerException noLedgerException) { pageEntriesIteratorNonFinal = Collections.emptyIterator(); } final Iterator<LedgerCache.PageEntries> pageEntriesIterator = pageEntriesIteratorNonFinal; return new OfLong() { long[] entriesInCurrentLedgerPage = new long[entriesPerLedgerEntryPage]; final MutableInt indOfArrayOfCurrentLedgerPage = new MutableInt(0); { Arrays.fill(entriesInCurrentLedgerPage, INVALID_ENTRYID); } @Override public boolean hasNext() { try { if ((indOfArrayOfCurrentLedgerPage.intValue() == entriesPerLedgerEntryPage) || entriesInCurrentLedgerPage[indOfArrayOfCurrentLedgerPage .intValue()] == INVALID_ENTRYID) { if (pageEntriesIterator.hasNext()) { Arrays.fill(entriesInCurrentLedgerPage, INVALID_ENTRYID); MutableInt tempIndOfArray = new MutableInt(0); PageEntries pageEntry = pageEntriesIterator.next(); LedgerEntryPage lep = pageEntry.getLEP(); lep.getEntries((entryId, position) -> { entriesInCurrentLedgerPage[tempIndOfArray.getAndIncrement()] = entryId; return true; }); indOfArrayOfCurrentLedgerPage.setValue(0); } } return ((!(indOfArrayOfCurrentLedgerPage.intValue() == entriesPerLedgerEntryPage)) && (entriesInCurrentLedgerPage[indOfArrayOfCurrentLedgerPage .intValue()] != INVALID_ENTRYID)); } catch (Exception exc) { throw new RuntimeException( "Received exception in InterleavedLedgerStorage getEntriesOfLedger hasNext call", exc); } } @Override public long nextLong() { if (!hasNext()) { throw new NoSuchElementException(); } return entriesInCurrentLedgerPage[indOfArrayOfCurrentLedgerPage.getAndIncrement()]; } }; }

Target:
public OfLong getListOfEntriesOfLedger(long ledgerId) throws IOException { return ledgerCache.getEntriesIterator(ledgerId); }
Source:
public CompletableFuture<Optional<Endpoint>> getRestEndpoint(String clusterId) { final int restPort = this.flinkConfig.getInteger(RestOptions.PORT); final KubernetesConfigOptions.ServiceExposedType serviceExposedType = flinkConfig.get(KubernetesConfigOptions.REST_SERVICE_EXPOSED_TYPE); if (serviceExposedType == KubernetesConfigOptions.ServiceExposedType.ClusterIP) { return CompletableFuture.completedFuture( Optional.of(new Endpoint(KubernetesUtils.getInternalServiceName(clusterId) + "." + nameSpace, restPort))); } return getRestService(clusterId).thenApply(restService -> { if (!restService.isPresent()) { return Optional.empty(); } Service service = restService.get().getInternalResource(); String address = null; int endpointPort = restPort; if (service.getStatus() != null && (service.getStatus().getLoadBalancer() != null || service.getStatus().getLoadBalancer().getIngress() != null)) { if (service.getStatus().getLoadBalancer().getIngress().size() > 0) { address = service.getStatus().getLoadBalancer().getIngress().get(0).getIp(); if (address == null || address.isEmpty()) { address = service.getStatus().getLoadBalancer().getIngress().get(0).getHostname(); } } else { address = this.internalClient.getMasterUrl().getHost(); endpointPort = getServiceNodePort(service, RestOptions.PORT); } } else if (service.getSpec().getExternalIPs() != null && service.getSpec().getExternalIPs().size() > 0) { address = service.getSpec().getExternalIPs().get(0); } if (address == null || address.isEmpty()) { return Optional.empty(); } return Optional.of(new Endpoint(address, endpointPort)); }); }

Target:
public Optional<Endpoint> getRestEndpoint(String clusterId) { Optional<KubernetesService> restService = getRestService(clusterId); if (!restService.isPresent()) { return Optional.empty(); } final Service service = restService.get().getInternalResource(); final int restPort = getRestPortFromExternalService(service); final KubernetesConfigOptions.ServiceExposedType serviceExposedType = KubernetesConfigOptions.ServiceExposedType.valueOf(service.getSpec().getType()); if (serviceExposedType == KubernetesConfigOptions.ServiceExposedType.ClusterIP) { return Optional.of( new Endpoint(KubernetesUtils.getInternalServiceName(clusterId) + "." + nameSpace, restPort)); } return getRestEndPointFromService(service, restPort); }
Source:
public IRetryAnalyzer getRetryAnalyzer() { if (this.m_retryAnalyzerClass != null && IRetryAnalyzer.class.isAssignableFrom(this.m_retryAnalyzerClass)) { try { return (IRetryAnalyzer) this.m_retryAnalyzerClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { } } return null; }

Target:
public IRetryAnalyzer getRetryAnalyzer() { return m_retryAnalyzer; }
Source:
public Response validate(ConcurEventNotificationDTO concurEventNotificationDTO) { ConcurEventNotification concurEventNotification = null; try { concurEventNotification = getConcurEventNotificationConversionService().convertConcurEventNotification(concurEventNotificationDTO); } catch (ParseException e) { LOG.error(e.getMessage()); throw new BadRequestException(); } getConcurEventNotificationService().saveConcurEventNotification(concurEventNotification); return Response.ok().build(); }

Target:
public Response validate(ConcurEventNotificationDTO concurEventNotificationDTO) { ConcurEventNotification concurEventNotification = null; try { concurEventNotification = getConcurEventNotificationConversionService().convertConcurEventNotification(concurEventNotificationDTO); } catch (ParseException e) { LOG.error("validate():" + e.getMessage(), e); throw new BadRequestException(); } getConcurEventNotificationService().saveConcurEventNotification(concurEventNotification); return Response.ok().build(); }
Source:
private void determineResult() { if (m_forEverySite || m_responses.isEmpty()) { return; } ResponseResult leaderResponse = m_responses.remove(m_leaderHSID); assert (leaderResponse != null); m_responseHashes = leaderResponse.hashes; m_lastResponse = leaderResponse.message; int pos = -1; for (Iterator<Map.Entry<Long, ResponseResult>> it = m_responses.entrySet().iterator(); it.hasNext();) { Map.Entry<Long, ResponseResult> entry = it.next(); if (!m_replicas.contains(entry.getKey())) { it.remove(); continue; } ResponseResult res = entry.getValue(); if (leaderResponse.success != entry.getValue().success) { tmLog.error(String.format(FAIL_MSG, getStoredProcedureName())); logRelevantMismatchInformation("HASH MISMATCH", res.hashes, res.message, pos); m_allMatched = false; m_misMatchedReplicas.add(entry.getKey()); } else if ((pos = DeterminismHash.compareHashes(leaderResponse.hashes, res.hashes)) >= 0) { tmLog.error(String.format(MISMATCH_MSG, getStoredProcedureName())); logRelevantMismatchInformation("HASH MISMATCH", res.hashes, res.message, pos); m_allMatched = false; m_misMatchedReplicas.add(entry.getKey()); } } }

Target:
private void determineResult() { if (m_forMPEverySiteSysProc || m_responses.isEmpty()) { return; } ResponseResult leaderResponse = m_responses.remove(m_leaderHSID); assert (leaderResponse != null); m_responseHashes = leaderResponse.hashes; m_lastResponse = leaderResponse.message; int pos = -1; for (Iterator<Map.Entry<Long, ResponseResult>> it = m_responses.entrySet().iterator(); it.hasNext();) { Map.Entry<Long, ResponseResult> entry = it.next(); if (!m_replicas.contains(entry.getKey())) { it.remove(); continue; } ResponseResult res = entry.getValue(); if (leaderResponse.success != entry.getValue().success) { if (!m_allMatched) { tmLog.error(String.format(FAIL_MSG, getStoredProcedureName())); logRelevantMismatchInformation("HASH MISMATCH", res.hashes, res.message, pos); m_allMatched = false; } m_misMatchedReplicas.add(entry.getKey()); } else if ((pos = DeterminismHash.compareHashes(leaderResponse.hashes, res.hashes)) >= 0) { if (!m_allMatched) { tmLog.error(String.format(MISMATCH_MSG, getStoredProcedureName())); logRelevantMismatchInformation("HASH MISMATCH", res.hashes, res.message, pos); } m_allMatched = false; m_misMatchedReplicas.add(entry.getKey()); } } }
Source:
public Document toDocument(AggregationOperationContext context) { Document projections = new Document(); ReflectionUtils.doWithFields(type, it -> projections.append(it.getName(), 1)); return context.getMappedObject(projections, type); }

Target:
public Document toDocument(AggregationOperationContext context) { Document projections = new Document(); Fields fields = context.getFields(type); fields.asList().forEach(it -> projections.append(it.getName(), 1)); return context.getMappedObject(projections, type); }
Source:
public void execute() throws MojoExecutionException, MojoFailureException { if ( expression == null && !settings.isInteractiveMode() ) { getLog().error("Maven is configured to NOT interact with the user for input. " + "This Mojo requires that 'interactiveMode' in your settings file is flag to 'true'."); return; } validateParameters(); if ( StringUtils.isNotEmpty( artifact ) ) { Artifact artifactObj = getArtifact( artifact ); try { project = getMavenProject( artifactObj ); } catch ( ProjectBuildingException e ) { throw new MojoExecutionException( "Unable to get the POM for the artifact '" + artifact + "'. Verify the artifact parameter." ); } } if ( expression == null ) { while ( true ) { System.out.println( "Enter the Maven expression i.e. ${project.groupId} or 0 to exit?:" ); try { String userExpression = inputHandler.readLine(); if ( userExpression == null || userExpression.toLowerCase( Locale.ENGLISH ).equals( "0" ) ) { break; } handleResponse( userExpression ); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to read from standard input.", e ); } } } else { handleResponse( "${" + expression + "}" ); } }

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if ( expression == null && !settings.isInteractiveMode() ) { getLog().error( "Maven is configured to NOT interact with the user for input. " + "This Mojo requires that 'interactiveMode' in your settings file is flag to 'true'." ); return; } validateParameters(); if ( StringUtils.isNotEmpty( artifact ) ) { Artifact artifactObj = getArtifact( artifact ); try { project = getMavenProject( artifactObj ); } catch ( ProjectBuildingException e ) { throw new MojoExecutionException( "Unable to get the POM for the artifact '" + artifact + "'. Verify the artifact parameter." ); } } if ( expression == null ) { while ( true ) { System.out.print( "Enter the Maven expression i.e. ${project.groupId} or 0 to exit?: " ); try { String userExpression = inputHandler.readLine(); if ( userExpression == null || userExpression.toLowerCase( Locale.ENGLISH ).equals( "0" ) ) { break; } handleResponse( userExpression ); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to read from standard input.", e ); } } } else { handleResponse( "${" + expression + "}" ); } }
Source:
private void preloadDataSet(){ preloadedDataSet = load(iter.next()); totalOutcomes = preloadedDataSet.getLabels().size(1); inputColumns = preloadedDataSet.getFeatureMatrix().size(1); batch = preloadedDataSet.numExamples(); }

Target:
private void preloadDataSet(){ preloadedDataSet = load(iter.next()); totalOutcomes = preloadedDataSet.getLabels().size(1); inputColumns = preloadedDataSet.getFeatureMatrix().size(1); }
Source:
private static boolean hasServerError(final HttpResponse response) { return Response.Status.fromStatusCode(response.getStatusCode()) == Response.Status.INTERNAL_SERVER_ERROR; }

Target:
private static boolean hasServerError(final HttpResponse response) { return response.getStatusCode() >= 500; }
Source:
private void verifyGetters(IndexValue value, String logSegmentName, long size, long offset, boolean isDeleted, long expiresAtMs, long originalMessageOffset, long operationTimeInMs, short serviceId, short containerId) { assertEquals("Size is not as expected", size, value.getSize()); assertEquals("Offset is not as expected", new Offset(logSegmentName, offset), value.getOffset()); assertEquals("Delete status not as expected", isDeleted, value.isFlagSet(IndexValue.Flags.Delete_Index)); if (version == 0) { assertEquals("ExpiresAtMs not as expected", expiresAtMs, value.getExpiresAtMs()); assertEquals("Operation time mismatch", Utils.Infinite_Time, value.getOperationTimeInMs()); assertEquals("ServiceId mismatch ", IndexValue.SERVICE_CONTAINER_ID_DEFAULT_VALUE, value.getServiceId()); assertEquals("ContainerId mismatch ", IndexValue.SERVICE_CONTAINER_ID_DEFAULT_VALUE, value.getContainerId()); } else { assertEquals("ExpiresAtMs not as expected", expiresAtMs != Utils.Infinite_Time ? (expiresAtMs / Time.MsPerSec) * Time.MsPerSec : Utils.Infinite_Time, value.getExpiresAtMs()); assertEquals("Operation time mismatch", operationTimeInMs != Utils.Infinite_Time ? (operationTimeInMs / Time.MsPerSec) * Time.MsPerSec : Utils.Infinite_Time, value.getOperationTimeInMs()); assertEquals("ServiceId mismatch ", serviceId, value.getServiceId()); assertEquals("ContainerId mismatch ", containerId, value.getContainerId()); } assertEquals("Original message offset not as expected", originalMessageOffset, value.getOriginalMessageOffset()); }

Target:
private void verifyGetters(IndexValue value, String logSegmentName, long size, long offset, boolean isDeleted, long expiresAtMs, long originalMessageOffset, long operationTimeInMs, short serviceId, short containerId) { assertEquals("Size is not as expected", size, value.getSize()); assertEquals("Offset is not as expected", new Offset(logSegmentName, offset), value.getOffset()); assertEquals("Delete status not as expected", isDeleted, value.isFlagSet(IndexValue.Flags.Delete_Index)); assertEquals("ExpiresAtMs not as expected", expiresAtMs, value.getExpiresAtMs()); assertEquals("Operation time mismatch", operationTimeInMs, value.getOperationTimeInMs()); assertEquals("ServiceId mismatch ", serviceId, value.getServiceId()); assertEquals("ContainerId mismatch ", containerId, value.getContainerId()); assertEquals("Original message offset not as expected", originalMessageOffset, value.getOriginalMessageOffset()); }
Source:
public int getLoaderQueueSize() { return verifyPositive(LOADER_QUEUE_SIZE_PROP, getInt(LOADER_QUEUE_SIZE_PROP, LOADER_QUEUE_SIZE_DEFAULT)); }

Target:
public int getLoaderQueueSize() { return getPositiveInt(LOADER_QUEUE_SIZE_PROP, LOADER_QUEUE_SIZE_DEFAULT); }
Source:
public void tick(WorkloadExecutionStatus status, WorkloadAdjuster adjuster) { log.debug("Going to perform tick with status {}", status); tickCount ++; totalSamples = status.getTotalSamples(); int avgSamplesPerTick = totalSamples / tickCount; int samplesLeft = samplesCount - samplesSubmitted; if (samplesLeft <= 0) { return; } if (status.getTotalSamples() < samplesSubmitted / 2) { return; } Set<NodeId> nodes = status.getNodes(); int threads = threadCount / nodes.size(); int residue = threadCount % nodes.size(); int samplesToAdd = (samplesLeft <= SAMPLES_COUNT_SPLITTING_FACTOR || samplesLeft < avgSamplesPerTick * 1.5) ? samplesLeft : samplesLeft / SAMPLES_COUNT_SPLITTING_FACTOR; int s = 0; for (NodeId node : nodes) { int submittedSamplesCount = submittedConfigurations.get(node) != null ? submittedConfigurations.get(node).getSamples() : 0; int curThreads = threads + residue; residue = 0; int samples = submittedSamplesCount; if (samplesToAdd < nodes.size()) { samples += samplesToAdd; samplesToAdd = 0; } else { samples += Math.round(samplesToAdd * (curThreads)/ threadCount); } WorkloadConfiguration workloadConfiguration = WorkloadConfiguration.with(curThreads, delay, samples); adjuster.adjustConfiguration(node, workloadConfiguration); s += samples; submittedConfigurations.put(node, workloadConfiguration); } samplesSubmitted = s; }

Target:
public void tick(WorkloadExecutionStatus status, WorkloadAdjuster adjuster) { log.debug("Going to perform tick with status {}", status); tickCount ++; totalSamples = status.getTotalSamples(); int avgSamplesPerTick = totalSamples / tickCount; int samplesLeft = samplesCount - samplesSubmitted; if (samplesLeft <= 0) { return; } if (status.getTotalSamples() < samplesSubmitted / 2) { return; } Set<NodeId> nodes = status.getNodes(); int threads = threadCount / nodes.size(); int residue = threadCount % nodes.size(); int samplesToAdd = (samplesLeft <= SAMPLES_COUNT_SPLITTING_FACTOR || samplesLeft < avgSamplesPerTick * 1.5) ? samplesLeft : samplesLeft / SAMPLES_COUNT_SPLITTING_FACTOR; int s = 0; for (NodeId node : nodes) { int submittedSamplesCount = submittedConfigurations.get(node) != null ? submittedConfigurations.get(node).getSamples() : 0; int curThreads = threads; if (residue > 0) { threads += residue--; } int samples = submittedSamplesCount; if (samplesToAdd < nodes.size()) { samples += samplesToAdd; samplesToAdd = 0; } else { samples += Math.round((double) samplesToAdd * curThreads / threadCount); } WorkloadConfiguration workloadConfiguration = WorkloadConfiguration.with(curThreads, delay, samples); adjuster.adjustConfiguration(node, workloadConfiguration); s += samples; submittedConfigurations.put(node, workloadConfiguration); } samplesSubmitted = s; }
Source:
protected void ExecuteIrsBrokerCommand() { uuidReturn = getIrsProxy().moveImage(getParameters().getStoragePoolId().toString(), getParameters().getStorageDomainId().toString(), getParameters().getDstDomainId().toString(), getParameters().getImageGroupId().toString(), getParameters().getVmId().toString(), getParameters().getOp().getValue(), (Boolean.valueOf(getParameters().getPostZero())).toString().toLowerCase(), (Boolean.valueOf(getParameters().getForce())).toString().toLowerCase()); ProceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.mUuid); getVDSReturnValue().setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.moveImage, getParameters().getStoragePoolId())); }

Target:
protected void ExecuteIrsBrokerCommand() { uuidReturn = getIrsProxy().moveImage(getParameters().getStoragePoolId().toString(), getParameters().getStorageDomainId().toString(), getParameters().getDstDomainId().toString(), getParameters().getImageGroupId().toString(), getParameters().getVmId().toString(), getParameters().getOp().getValue(), String.valueOf(getParameters().getPostZero()).toLowerCase(), String.valueOf(getParameters().getForce()).toLowerCase()); ProceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.mUuid); getVDSReturnValue().setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.moveImage, getParameters().getStoragePoolId())); }
Source:
private Map<String, RerankerContext> buildRerankerContextMap() throws IOException { Map<String, RerankerContext> queryContextMap = new HashMap<>(); IndexSearcher searcher = new IndexSearcher(reader); for (String qid : qrels.getQids()) { LOG.debug(String.format("Constructing context for QID: %s", qid)); String queryText = topics.get(qid).get("title"); Query q = null; q = parseQuery(queryText); List<String> queryTokens = AnalyzerUtils.tokenize(queryAnalyzer, queryText); RerankerContext<String> context = new RerankerContext<>(searcher, q, qid, queryText, queryTokens, getTermVectorField(), null, null); queryContextMap.put(qid, context); } LOG.debug("Completed constructing context for all qrels"); return queryContextMap; }

Target:
private Map<String, RerankerContext<K>> buildRerankerContextMap() throws IOException { Map<String, RerankerContext<K>> queryContextMap = new HashMap<>(); IndexSearcher searcher = new IndexSearcher(reader); for (String qid : qrels.getQids()) { LOG.debug(String.format("Constructing context for QID: %s", qid)); String queryText = topics.get((K)qid).get("title"); Query q = null; q = parseQuery(queryText); List<String> queryTokens = AnalyzerUtils.tokenize(queryAnalyzer, queryText); RerankerContext<K> context = new RerankerContext<>(searcher, (K)qid, q, queryText, queryTokens, null, null); queryContextMap.put(qid, context); } LOG.debug("Completed constructing context for all qrels"); return queryContextMap; }
Source:
private void releaseGlobalLock() { if (threadCount.decrementAndGet() <= 0 || System.nanoTime() >= nextFinish) { globalSync.release(); onGlobalLock = false; } }

Target:
private void releaseGlobalLock() throws IgniteCheckedException { assert lock.isHeldByCurrentThread(); if (threadCnt.decrementAndGet() <= 0 || System.nanoTime() >= nextFinish) { globalSync.release(); isGloballyLocked = false; } }
Source:
private boolean isExistingUsername0(ByteBuffer username) { if(disabledUsers.contains(username)) return false; return credentials.containsValue(ByteBuffers.encodeAsHex(username)); }

Target:
private boolean isExistingUsername0(ByteBuffer username) { return credentials.containsValue(ByteBuffers.encodeAsHex(username)); }
Source:
public ValidationResult networkNotUsedByRunningVms() { final List<String> runningVmNames = new ArrayList<>(); final List<VDS> hostsForNetwork = vdsDao.getAllForNetwork(network.getId()); for (VDS host : hostsForNetwork) { final Version maxSupportedVersion = Collections.max(host.getSupportedClusterVersionsSet()); if (!FeatureSupported.changeNetworkUnderBridgeInUseSupported(maxSupportedVersion)) { final List<String> activeVmsUsingNetworkOnHost = vmInterfaceManager.findActiveVmsUsingNetworks( host.getId(), Collections.singleton(network.getName())); runningVmNames.addAll(activeVmsUsingNetworkOnHost); } } return networkNotUsed(runningVmNames, EngineMessage.VAR__ENTITIES__VMS, EngineMessage.VAR__ENTITIES__VM); }

Target:
public ValidationResult networkNotUsedByRunningVms() { List<VM> runningVms = new ArrayList<>(); List<VmNetworkInterface> vnics = vmNetworkInterfaceDao.getAllForNetwork(network.getId()); Map<Guid, List<VmNetworkInterface>> vnicsByVmId = Entities.vmInterfacesByVmId(vnics); for (VM vm : getVms()) { if (vm.isRunningOrPaused()) { for (VmNetworkInterface nic : vnicsByVmId.get(vm.getId())) { if (VmNetworkCanBeUpdatedPredicate.getInstance().eval(nic)) { runningVms.add(vm); break; } } } } final List<VM> runningVmNotSupportNetworkChange = LinqUtils.filter(runningVms, new Predicate<VM>() { final Map<Guid, Version> clusterVersions = new HashMap<>(); @Override public boolean eval(VM vm) { final Guid clusterId = vm.getVdsGroupId(); Version clusterVersion = clusterVersions.get(clusterId); if (clusterVersion == null) { final VDSGroup cluster = vdsGroupDao.get(clusterId); clusterVersion = cluster.getCompatibilityVersion(); clusterVersions.put(clusterId, clusterVersion); } return !FeatureSupported.changeNetworkUsedByVmSupported(clusterVersion); } }); return networkNotUsed(runningVmNotSupportNetworkChange, EngineMessage.VAR__ENTITIES__VMS, EngineMessage.VAR__ENTITIES__VM); }
Source:
private void initToolbar(final Toolbar toolbar) { if (DEBUG) { Log.d(TAG, "initToolbar() called with: toolbar = [" + toolbar + "]"); } boolean isLight = ThemeHelper.isLightThemeSelected(getActivity()); toolbar.setTitle(R.string.download_dialog_title); toolbar.setNavigationIcon( ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_arrow_back)); toolbar.inflateMenu(R.menu.dialog_url); toolbar.setNavigationOnClickListener(v -> getDialog().dismiss()); toolbar.setNavigationContentDescription(R.string.cancel); okButton = toolbar.findViewById(R.id.okay); okButton.setEnabled(false); toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.okay) { prepareSelectedDownload(); if (getActivity() instanceof RouterActivity) { getActivity().finish(); } return true; } return false; }); }

Target:
private void initToolbar(final Toolbar toolbar) { if (DEBUG) { Log.d(TAG, "initToolbar() called with: toolbar = [" + toolbar + "]"); } toolbar.setTitle(R.string.download_dialog_title); toolbar.setNavigationIcon( ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_arrow_back)); toolbar.inflateMenu(R.menu.dialog_url); toolbar.setNavigationOnClickListener(v -> requireDialog().dismiss()); toolbar.setNavigationContentDescription(R.string.cancel); okButton = toolbar.findViewById(R.id.okay); okButton.setEnabled(false); toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.okay) { prepareSelectedDownload(); if (getActivity() instanceof RouterActivity) { getActivity().finish(); } return true; } return false; }); }
Source:
public ScriptDebugFrame(final Script script, final int lineNumber, final int type) { fScript = new Script(script.getTitle(), script.getCommand()); fLineNumber = lineNumber; fType = type; }

Target:
public ScriptDebugFrame(final Script script, final int lineNumber, final int type) { fScript = script.clone(); fLineNumber = lineNumber; fType = type; }
Source:
public List<TopicNameWithMetrics> queryTopicsMetrics(Query<TopicNameWithMetrics> query) { List<Topic> filteredNames = query.filterNames(getAllTopics()) .collect(Collectors.toList()); return query.filter(getTopicsMetrics(filteredNames)) .collect(toList()); }

Target:
public List<TopicNameWithMetrics> queryTopicsMetrics(Query<TopicNameWithMetrics> query) { List<Topic> filteredNames = query.filterNames(getAllTopics()) .collect(toList()); return query.filter(getTopicsMetrics(filteredNames)) .collect(toList()); }
Source:
public List<SdxClusterResponse> list(String envName) { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); List<SdxCluster> sdxClusters = sdxService.listSdx(userCrn, envName); return sdxClusters.stream() .map(sdxCluster -> { SdxClusterResponse sdxClusterResponse = sdxClusterConverter.sdxClusterToResponse(sdxCluster); sdxService.setAdditionalClusterResponseFields(sdxClusterResponse, sdxCluster); return sdxClusterResponse; }).collect(Collectors.toList()); }

Target:
public List<SdxClusterResponse> list(String envName) { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); List<SdxCluster> sdxClusters = sdxService.listSdx(userCrn, envName); return sdxClusters.stream() .map(sdx -> sdxClusterConverter.sdxClusterToResponse(sdx)) .collect(Collectors.toList()); }
Source:
public String getWebSocketKey() { if(secWebsocketKeyField.getText() == null || secWebsocketKeyField.getText().equals("")) { return null; }else{ return secWebsocketKeyField.getText(); } }

Target:
public String getWebSocketKey() { if(webSocketKeyField.getText().isEmpty()) { return null; }else{ return webSocketKeyField.getText(); } }
Source:
public List<Link> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { List<Link> result = new ArrayList<Link>(); String relation; Link link; while (!JsonToken.END_OBJECT.equals(jp.nextToken())) { if (!JsonToken.FIELD_NAME.equals(jp.getCurrentToken())) { throw new JsonParseException("Expected relation name", jp.getCurrentLocation()); } relation = jp.getText(); if (JsonToken.START_ARRAY.equals(jp.nextToken())) { while (!JsonToken.END_ARRAY.equals(jp.nextToken())) { link = jp.readValueAs(Link.class); result.add(link); } } else { link = jp.readValueAs(Link.class); result.add(link); } } return result; }

Target:
public List<Link> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { List<Link> result = new ArrayList<Link>(); String relation; Link link; while (!JsonToken.END_OBJECT.equals(jp.nextToken())) { if (!JsonToken.FIELD_NAME.equals(jp.getCurrentToken())) { throw new JsonParseException("Expected relation name", jp.getCurrentLocation()); } relation = jp.getText(); if (JsonToken.START_ARRAY.equals(jp.nextToken())) { while (!JsonToken.END_ARRAY.equals(jp.nextToken())) { link = jp.readValueAs(Link.class); link = new Link(link.getHref(), relation); result.add(link); } } else { link = jp.readValueAs(Link.class); link = new Link(link.getHref(), relation); result.add(link); } } return result; }
Source:
private boolean createFyberInterstitialListener() { if (mInterstitialSpot == null || false == (mInterstitialSpot.getSelectedUnitController() instanceof InneractiveFullscreenUnitController)) { return false; } InneractiveFullscreenUnitController controller = (InneractiveFullscreenUnitController)mInterstitialSpot.getSelectedUnitController(); InneractiveFullscreenAdEventsListener interstitalListener = new InneractiveFullscreenAdEventsListenerAdapter() { @Override public void onAdImpression(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdOpened(FyberMediationAdapter.this); } @Override public void onAdClicked(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdClicked(FyberMediationAdapter.this); } @Override public void onAdDismissed(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdClosed(FyberMediationAdapter.this); } @Override public void onAdWillOpenExternalApp(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdLeftApplication(FyberMediationAdapter.this); } }; controller.setEventsListener(interstitalListener); return true; }

Target:
private InneractiveFullscreenAdEventsListener createFyberInterstitialListener() { if (mInterstitialSpot == null || !(mInterstitialSpot.getSelectedUnitController() instanceof InneractiveFullscreenUnitController)) { return null; } InneractiveFullscreenUnitController controller = (InneractiveFullscreenUnitController)mInterstitialSpot.getSelectedUnitController(); InneractiveFullscreenAdEventsListener interstitialListener = new InneractiveFullscreenAdEventsListenerAdapter() { @Override public void onAdImpression(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdOpened(FyberMediationAdapter.this); } @Override public void onAdClicked(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdClicked(FyberMediationAdapter.this); } @Override public void onAdDismissed(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdClosed(FyberMediationAdapter.this); } @Override public void onAdWillOpenExternalApp(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdLeftApplication(FyberMediationAdapter.this); } }; controller.setEventsListener(interstitialListener); return interstitialListener; }
Source:
public void awaitCompletion() { setPhase(WorkPhase.RUNNING); logger.trace("exec running endpoint={} work={}", getEndpointPath(), getCallContext().getWorkUnit()); if(threadCount == 1) processOutput(getCallContext()); else { for (int i = 0; i < threadCount; i++) { BulkCallableImpl bulkCallableImpl = new BulkCallableImpl(this); try { bulkCallableImpl.submit(bulkCallableImpl); getCallerThreadPoolExecutor().awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS); } catch(Throwable throwable) { throw new RuntimeException("Error occurred while awaiting termination ", throwable); } } } }

Target:
public void awaitCompletion() { setPhase(WorkPhase.RUNNING); logger.trace("exec running endpoint={} work={}", getEndpointPath(), getCallContext().getWorkUnit()); if(getCallContext() != null) processOutput(); else if(getCallContextQueue() != null && !getCallContextQueue().isEmpty()){ try { for (int i = 0; i < getThreadCount(); i++) { BulkCallableImpl bulkCallableImpl = new BulkCallableImpl(this); submitTask(bulkCallableImpl); } getCallerThreadPoolExecutor().awaitTermination(); } catch(Throwable throwable) { throw new RuntimeException("Error occurred while awaiting termination ", throwable); } } else { throw new IllegalArgumentException("Cannot process output without Callcontext."); } }
Source:
private MessageBuffer getNextBuffer() throws IOException { MessageBuffer next = in.next(); if (next == null) { throw new MessageInsufficientBufferException(); } totalReadBytes += buffer.size(); return next; }

Target:
private MessageBuffer getNextBuffer() throws IOException { MessageBuffer next = in.next(); if (next == null) { throw new MessageInsufficientBufferException(); } assert (buffer != null); totalReadBytes += buffer.size(); return next; }
Source:
public final CacheEntry wrapEntryForReading(InvocationContext ctx, Object key, boolean isOwner) { if (!isOwner && !isL1Enabled) { return null; } CacheEntry cacheEntry = getFromContext(ctx, key); if (cacheEntry == null) { cacheEntry = getFromContainer(key, isOwner, false); if (cacheEntry != null) { if (useRepeatableRead) { cacheEntry = createWrappedEntry(key, cacheEntry, ctx, false); } ctx.putLookedUpEntry(key, cacheEntry); } } if (trace) { log.tracef("Wrap %s for read. Entry=%s", toStr(key), cacheEntry); } return cacheEntry; }

Target:
public final void wrapEntryForReading(InvocationContext ctx, Object key, boolean isOwner) { if (!isOwner && !isL1Enabled) { return; } CacheEntry cacheEntry = getFromContext(ctx, key); if (cacheEntry == null) { cacheEntry = getFromContainer(key, isOwner, false); if (cacheEntry != null) { if (useRepeatableRead) { cacheEntry = createWrappedEntry(key, cacheEntry); } ctx.putLookedUpEntry(key, cacheEntry); } } if (trace) { log.tracef("Wrap %s for read. Entry=%s", toStr(key), cacheEntry); } }