auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void doTileProcessing() { final ThreadPoolExecutor completedWorkExecutor = new ThreadPoolExecutorWithExceptions(1); final CompletedWorkChecker workChecker = new CompletedWorkChecker(); completedWorkExecutor.submit(workChecker); completedWorkExecutor.shutdown(); final ThreadPoolExecutorWithExceptions tileProcessingExecutor = new ThreadPoolExecutorWithExceptions(numThreads); for (final Integer tile : tiles) { tileProcessingExecutor.submit(new TileProcessor(tile, barcodesFiles.get(tile))); } tileProcessingExecutor.shutdown(); awaitThreadPoolTermination("Reading executor", tileProcessingExecutor); if(tileProcessingExecutor.exception != null) { completedWorkExecutor.purge(); barcodeWriterThreads.values().forEach(ThreadPoolExecutor::purge); List<Runnable> tasksStillRunning = new ArrayList<>(completedWorkExecutor.shutdownNow()); barcodeWriterThreads.values().forEach(executor -> tasksStillRunning.addAll(executor.shutdownNow())); <START> throw new PicardException("Reading executor had exceptions " + tasksStillRunning.size() <END> + " tasks were still running or queued and have been cancelled.", tileProcessingExecutor.exception); } else { awaitThreadPoolTermination("Tile completion executor", completedWorkExecutor); barcodeWriterThreads.values().forEach(ThreadPoolExecutor::shutdown); barcodeWriterThreads.forEach((barcode, executor) -> awaitThreadPoolTermination(barcode + " writer", executor)); } }</code><technical_language>missing a . exceptions? clearer ... exceptions. " + size() +" tasks running queued ..</technical_language>

Target:
public void doTileProcessing() { final ThreadPoolExecutor completedWorkExecutor = new ThreadPoolExecutorWithExceptions(1); final CompletedWorkChecker workChecker = new CompletedWorkChecker(); completedWorkExecutor.submit(workChecker); completedWorkExecutor.shutdown(); final ThreadPoolExecutorWithExceptions tileProcessingExecutor = new ThreadPoolExecutorWithExceptions(numThreads); for (final Integer tile : tiles) { tileProcessingExecutor.submit(new TileProcessor(tile, barcodesFiles.get(tile))); } tileProcessingExecutor.shutdown(); awaitThreadPoolTermination("Reading executor", tileProcessingExecutor); if (tileProcessingExecutor.exception != null) { int tasksStillRunning = completedWorkExecutor.shutdownNow().size(); tasksStillRunning += barcodeWriterThreads.values().stream().mapToLong(executor -> executor.shutdownNow().size()).sum(); throw new PicardException("Reading executor had exceptions. There were " + tasksStillRunning + " tasks were still running or queued and have been cancelled.", tileProcessingExecutor.exception); } else { awaitThreadPoolTermination("Tile completion executor", completedWorkExecutor); barcodeWriterThreads.values().forEach(ThreadPoolExecutor::shutdown); barcodeWriterThreads.forEach((barcode, executor) -> awaitThreadPoolTermination(barcode + " writer", executor)); } }
Source:
<code>private boolean addMessage(Message<?> message) { Object sequence = message.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER); <START> if (sequence instanceof Integer) { <END> this.sequences.add((Integer) sequence); } return this.messages.add(message); }</code><technical_language>M-m-m. I fine request Integer type for header, is done right messageHeaderAccessor.getSequenceNumber(). I do this if: Integer sequence = message.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, Integer.class); this.sequences.add(sequence != null ? sequence : 0);</technical_language>

Target:
private boolean addMessage(Message<?> message) { Integer sequence = message.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, Integer.class); this.sequences.add(sequence != null ? sequence : 0); return this.messages.add(message); }
Source:
<code>public void pickBestPath() { BubbleMergeWithSearchVertexValueWritable vertex = getVertexValue(); int k = 1; VKmerList pathList = vertex.getArrayOfPathList().get(k); EdgeTypeList edgeTypes = vertex.getArrayOfEdgeTypes().get(k); <START> for (EDGETYPE et : EDGETYPE.OUTGOING) { <END> for (VKmer dest : vertex.getEdgeMap(et).keySet()) { if (edgeTypes.get(0) == et && pathList.getPosition(1).equals(dest)) continue; vertex.getEdgeMap(et).remove(dest); } } VKmerList kmerList = new VKmerList(); for (int i = 1; i < pathList.size(); i++) { VKmer dest = new VKmer(pathList.getPosition(i)); outgoingMsg.reset(); outgoingMsg.setFlag(BubbleMergeWithSearchState.KILL_MESSAGE_FROM_SOURCE); kmerList.reset(); kmerList.append(pathList.getPosition(i - 1)); if (i + 1 < pathList.size()) { kmerList.append(pathList.getPosition(i + 1)); } outgoingMsg.setPathList(kmerList); outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i - 1).mirror()); if (i < edgeTypes.size()) outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i)); sendMsg(dest, outgoingMsg); } }</code><technical_language>OUTGOING. FORWARD.edgeTypes(), right</technical_language>

Target:
public void pickBestPath() { BubbleMergeWithSearchVertexValueWritable vertex = getVertexValue(); int k = 1; VKmerList pathList = vertex.getArrayOfPathList().get(k); EdgeTypeList edgeTypes = vertex.getArrayOfEdgeTypes().get(k); for (EDGETYPE et : SEARCH_DIRECTION.edgeTypes()) { for (VKmer dest : vertex.getEdgeMap(et).keySet()) { if (edgeTypes.get(0) == et && pathList.getPosition(1).equals(dest)) continue; vertex.getEdgeMap(et).remove(dest); } } VKmerList kmerList = new VKmerList(); for (int i = 1; i < pathList.size(); i++) { VKmer dest = new VKmer(pathList.getPosition(i)); outgoingMsg.reset(); if (i == pathList.size() - 1) outgoingMsg.setFlag(BubbleMergeWithSearchState.SAVE_ONLY_PATH_NODES_LAST_NODE); else outgoingMsg.setFlag(BubbleMergeWithSearchState.SAVE_ONLY_PATH_NODES); kmerList.reset(); kmerList.append(pathList.getPosition(i - 1)); if (i + 1 < pathList.size()) { kmerList.append(pathList.getPosition(i + 1)); } outgoingMsg.setPathList(kmerList); outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i - 1).mirror()); if (i < edgeTypes.size()) outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i)); sendMsg(dest, outgoingMsg); } }
Source:
<code>private boolean map(KeyCacheObject key, boolean forceKeys) { try { int keyPart = cctx.affinity().partition(key); GridDhtLocalPartition part = topVer.topologyVersion() > 0 ? cache().topology().localPartition(keyPart, topVer, true) : cache().topology().localPartition(keyPart); if (part == null) return false; assert this.part == -1; if (!forceKeys && part.state() == LOST && !recovery) { Throwable error = LostPolicyValidator.validate(cctx, key, READ, singleton(part.id())); if (error != null) { onDone(null, error); return false; } } if (part.reserve()) { boolean mvccNoOwners = false; if (cctx.mvccEnabled()) mvccNoOwners = cctx.topology().owners(cctx.affinity().partition(key), topVer).isEmpty(); <START> if (forceKeys || (part.state() == OWNING || part.state() == LOST) || mvccNoOwners) { <END> this.part = part.id(); return true; } else { part.release(); return false; } } else return false; } catch (GridDhtInvalidPartitionException ex) { return false; } }</code><technical_language>Is additionl flag needed here? If partition owner is safe for READ operation, in LOST state, is</technical_language>

Target:
private boolean map(KeyCacheObject key, boolean forceKeys) { try { int keyPart = cctx.affinity().partition(key); if (cctx.mvccEnabled()) { boolean noOwners = cctx.topology().owners(keyPart, topVer).isEmpty(); if (noOwners) forceKeys = true; } GridDhtLocalPartition part = topVer.topologyVersion() > 0 ? cache().topology().localPartition(keyPart, topVer, true) : cache().topology().localPartition(keyPart); if (part == null) return false; assert this.part == -1; if (!forceKeys && part.state() == LOST && !recovery) { Throwable error = LostPolicyValidator.validate(cctx, key, READ, singleton(part.id())); if (error != null) { onDone(null, error); return false; } } if (part.reserve()) { if (forceKeys || (part.state() == OWNING || part.state() == LOST)) { this.part = part.id(); return true; } else { part.release(); return false; } } else return false; } catch (GridDhtInvalidPartitionException ex) { return false; } }
Source:
<code>private FileMetadata putSingleBody(Exchange exchange, String dropboxPath, DropboxUploadMode mode) throws Exception { byte[] data = exchange.getIn().getMandatoryBody(byte[].class); InputStream is = new ByteArrayInputStream(data); try { FileMetadata uploadedFile; WriteMode uploadMode; if (mode == DropboxUploadMode.force) { uploadMode = WriteMode.OVERWRITE; } else { uploadMode = WriteMode.ADD; } <START> uploadedFile = client.files().upload(dropboxPath).uploadAndFinish(is, data.length); <END> return uploadedFile; } finally { IOHelper.close(is); } }</code><technical_language>uploadBuilder allows uploadMode</technical_language>

Target:
private FileMetadata putSingleBody(Exchange exchange, String dropboxPath, DropboxUploadMode mode) throws Exception { byte[] data = exchange.getIn().getMandatoryBody(byte[].class); InputStream is = new ByteArrayInputStream(data); try { FileMetadata uploadedFile; WriteMode uploadMode; if (mode == DropboxUploadMode.force) { uploadMode = WriteMode.OVERWRITE; } else { uploadMode = WriteMode.ADD; } uploadedFile = client.files().uploadBuilder(dropboxPath).withMode(uploadMode).uploadAndFinish(is, data.length); return uploadedFile; } finally { IOHelper.close(is); } }
Source:
<code>private void generatePathLocator() { javaBuffer.addImport(BASE_PACKAGE + ".Service"); <START> javaBuffer.addDocComment("Resource locator method, returns individual resource on which the URI is dispatched."); <END> javaBuffer.addLine("Service service(String path);"); }</code><technical_language>Try avoid "resource" word here, stick "service" instead</technical_language>

Target:
private void generatePathLocator() { javaBuffer.addImport(BASE_PACKAGE + ".Service"); javaBuffer.addDocComment("Service locator method, returns individual service on which the URI is dispatched."); javaBuffer.addLine("Service service(String path);"); }
Source:
<code>public DependencyState( final Properties userProps ) { overrideTransitive = Boolean.valueOf( userProps.getProperty( "overrideTransitive", "true" ) ); overrideDependencies = Boolean.valueOf( userProps.getProperty( "overrideDependencies", "true" ) ); strict = Boolean.valueOf( userProps.getProperty( STRICT_DEPENDENCIES, "false" ) ); ignoreSuffix = Boolean.valueOf( userProps.getProperty( STRICT_ALIGNMENT_IGNORE_SUFFIX, "false" ) ); failOnStrictViolation = Boolean.valueOf( userProps.getProperty( STRICT_VIOLATION_FAILS, "false" ) ); remoteBOMdepMgmt = IdUtils.parseGAVs( userProps.getProperty( DEPENDENCY_MANAGEMENT_POM_PROPERTY ) ); dependencyExclusions = PropertiesUtils.getPropertiesByPrefix( userProps, DEPENDENCY_EXCLUSION_PREFIX ); if ( dependencyExclusions.isEmpty()) { <START> dependencyExclusions = PropertiesUtils.getPropertiesByPrefix( userProps, DEPENDENCY_OVERRIDE_PREFIX ); <END> } }</code><technical_language>this additive instead of other? if user dependencyExclusions dependencyOverrides</technical_language>

Target:
public DependencyState( final Properties userProps ) throws ManipulationException { overrideTransitive = Boolean.valueOf( userProps.getProperty( "overrideTransitive", "true" ) ); overrideDependencies = Boolean.valueOf( userProps.getProperty( "overrideDependencies", "true" ) ); strict = Boolean.valueOf( userProps.getProperty( STRICT_DEPENDENCIES, "false" ) ); ignoreSuffix = Boolean.valueOf( userProps.getProperty( STRICT_ALIGNMENT_IGNORE_SUFFIX, "false" ) ); failOnStrictViolation = Boolean.valueOf( userProps.getProperty( STRICT_VIOLATION_FAILS, "false" ) ); remoteBOMdepMgmt = IdUtils.parseGAVs( userProps.getProperty( DEPENDENCY_MANAGEMENT_POM_PROPERTY ) ); dependencyExclusions = getPropertiesByPrefix( userProps, DEPENDENCY_EXCLUSION_PREFIX ); Map<String, String> oP = PropertiesUtils.getPropertiesByPrefix( userProps, DEPENDENCY_OVERRIDE_PREFIX ); for ( String s : oP.keySet() ) { if ( dependencyExclusions.put( s, oP.get( s ) ) != null ) { throw new ManipulationException( "Property clash between dependencyOverride and dependencyExclusion for " + s ); } } }
Source:
<code><START> static RestTemplate createRestTemplate(GoodDataEndpoint endpoint, HttpClient httpClient) { <END> final UriPrefixingClientHttpRequestFactory factory = new UriPrefixingClientHttpRequestFactory( new HttpComponentsClientHttpRequestFactory(httpClient), endpoint.getHostname(), endpoint.getPort(), endpoint.getProtocol() ); final RestTemplate restTemplate = new RestTemplate(factory); restTemplate.setInterceptors(Arrays.<ClientHttpRequestInterceptor>asList( new HeaderSettingRequestInterceptor(singletonMap("Accept", getAcceptHeaderValue())))); restTemplate.setErrorHandler(new ResponseErrorHandler(restTemplate.getMessageConverters())); return restTemplate; }</code><technical_language>extract content of GoodData.createRestTemplate() a package private static method (just content, instance method stay) reuse here. repeat: "just content, instance method stay"</technical_language>

Target:
static RestTemplate createRestTemplate(GoodDataEndpoint endpoint, HttpClient httpClient) { notNull(endpoint, "endpoint"); notNull(httpClient, "httpClient"); final UriPrefixingClientHttpRequestFactory factory = new UriPrefixingClientHttpRequestFactory( new HttpComponentsClientHttpRequestFactory(httpClient), endpoint.getHostname(), endpoint.getPort(), endpoint.getProtocol() ); final RestTemplate restTemplate = new RestTemplate(factory); restTemplate.setInterceptors(Arrays.<ClientHttpRequestInterceptor>asList( new HeaderSettingRequestInterceptor(singletonMap("Accept", getAcceptHeaderValue())))); restTemplate.setErrorHandler(new ResponseErrorHandler(restTemplate.getMessageConverters())); return restTemplate; }
Source:
<code><START> private static <D, T, S> double[] calculateLogBackwardProbabilities(final HiddenMarkovModel<D, T, S> model, <END> final List<D> dataList, final List<T> positionList) { final List<S> states = model.hiddenStates(); final int width = states.size(); final int length = dataList.size(); final double[] result = new double[width * length]; if (length == 0) { return result; } final double[] logSumBuffer = new double[states.size()]; for (int t = length - 2; t >= 0; --t) { final int u = t + 1; final int tOffset = width * t; final int uOffset = tOffset + width; final T positionT = positionList.get(t); final T positionU = positionList.get(u); for (int sT = 0; sT < width; sT++) { final S stateT = states.get(sT); for (int sU = 0; sU < width; sU++) { logSumBuffer[sU] = result[sU + uOffset] + model.logTransitionProbability(stateT, positionT, states.get(sU), positionU) + model.logEmissionProbability(dataList.get(u), states.get(sU), positionU); } result[sT + tOffset] = MathUtils.approximateLogSumLog(logSumBuffer); } } return result; }</code><technical_language>double[][]</technical_language>

Target:
private static <D, T, S> double[][] calculateLogBackwardProbabilities(final HiddenMarkovModel<D, T, S> model, final List<D> dataList, final List<T> positionList) { final List<S> states = model.hiddenStates(); final int numStates = states.size(); final int length = dataList.size(); final double[][] result = new double[length][numStates]; if (length == 0) { return result; } final double[] logSumBuffer = new double[states.size()]; for (int thisPositionIndex = length - 2; thisPositionIndex >= 0; --thisPositionIndex) { final int nextPositionIndex = thisPositionIndex + 1; final T thisPosition = positionList.get(thisPositionIndex); final T nextPosition = positionList.get(nextPositionIndex); for (int thisStateIndex = 0; thisStateIndex < numStates; thisStateIndex++) { final S thisState = states.get(thisStateIndex); for (int nextStateIndex = 0; nextStateIndex < numStates; nextStateIndex++) { logSumBuffer[nextStateIndex] = result[nextPositionIndex][nextStateIndex] + model.logTransitionProbability(thisState, thisPosition, states.get(nextStateIndex), nextPosition) + model.logEmissionProbability(dataList.get(nextPositionIndex), states.get(nextStateIndex), nextPosition); } result[thisPositionIndex][thisStateIndex] = MathUtils.approximateLogSumLog(logSumBuffer); } } return result; }
Source:
<code>public void testSortByPriority() { ProviderFactory pf = ServerProviderFactory.getInstance(); List<Object> providers = new ArrayList<>(); BookReaderWriter bookHandler = new BookReaderWriter(); providers.add(bookHandler); HighPriorityBookReaderWriter highPriorityBookHandler = new HighPriorityBookReaderWriter(); providers.add(highPriorityBookHandler); pf.setUserProviders(providers); assertSame(highPriorityBookHandler, pf.createMessageBodyReader(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); assertSame(highPriorityBookHandler, pf.createMessageBodyWriter(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); pf = ServerProviderFactory.getInstance(); <START> providers = new ArrayList<>(); <END> highPriorityBookHandler = new HighPriorityBookReaderWriter(); providers.add(highPriorityBookHandler); bookHandler = new BookReaderWriter(); providers.add(bookHandler); pf.setUserProviders(providers); assertSame(highPriorityBookHandler, pf.createMessageBodyReader(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); assertSame(highPriorityBookHandler, pf.createMessageBodyWriter(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); }</code><technical_language>mind please extract part of test case separate method, for example public void testSortByPriorityReversed()? Thanks</technical_language>

Target:
public void testSortByPriority() { ProviderFactory pf = ServerProviderFactory.getInstance(); List<Object> providers = new ArrayList<>(); BookReaderWriter bookHandler = new BookReaderWriter(); providers.add(bookHandler); HighPriorityBookReaderWriter highPriorityBookHandler = new HighPriorityBookReaderWriter(); providers.add(highPriorityBookHandler); pf.setUserProviders(providers); assertSame(highPriorityBookHandler, pf.createMessageBodyReader(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); assertSame(highPriorityBookHandler, pf.createMessageBodyWriter(Book.class, Book.class, new Annotation[]{}, MediaType.APPLICATION_XML_TYPE, new MessageImpl())); }
Source:
<code>public void testGetWithSource() throws Exception { config(null); File jar = repo.get("org.osgi.dto", new Version("1.0.0.201505202023"), null); <START> assertThat(jar.isFile()).isTrue(); <END> File sources = repo.get("org.osgi.dto.source", new Version("1.0.0.201505202023"), null); assertThat(sources.isFile()).isTrue(); }</code><technical_language>This written assertThat(jar).isFile();</technical_language>

Target:
public void testGetWithSource() throws Exception { config(null); File jar = repo.get("org.osgi.dto", new Version("1.0.0.201505202023"), null); assertThat(jar).isFile(); File sources = repo.get("org.osgi.dto.source", new Version("1.0.0.201505202023"), null); assertThat(sources).isFile(); }
Source:
<code>private StudyDetails convertToStudyDetails(final UserSelection userSelection) { final StudyDetails studyDetails = new StudyDetails(); studyDetails.setStudyName(userSelection.getStudyName()); studyDetails.setEndDate(ETLServiceImpl.formatDate(userSelection.getStudyEndDate())); studyDetails.setObjective(userSelection.getStudyObjective()); studyDetails.setDescription(userSelection.getStudyDescription()); if (!StringUtils.isEmpty(userSelection.getStudyType())) { studyDetails.setStudyType(StudyType.valueOf(userSelection.getStudyType())); } else { studyDetails.setStudyType(StudyType.N); } <START> studyDetails.setDescription(userSelection.getStudyDescription()); <END> studyDetails.setStartDate(ETLServiceImpl.formatDate(userSelection.getStudyStartDate())); if (userSelection.getStudyId() != null) { studyDetails.setId(userSelection.getStudyId()); } return studyDetails; }</code><technical_language>Remove studyDetails.setDescription(userSelection.getStudyDescription()); a couple of lines</technical_language>

Target:
private StudyDetails convertToStudyDetails(final UserSelection userSelection) { final StudyDetails studyDetails = new StudyDetails(); studyDetails.setStudyName(userSelection.getStudyName()); studyDetails.setEndDate(ETLServiceImpl.formatDate(userSelection.getStudyEndDate())); studyDetails.setObjective(userSelection.getStudyObjective()); if (!StringUtils.isEmpty(userSelection.getStudyType())) { studyDetails.setStudyType(StudyType.valueOf(userSelection.getStudyType())); } else { studyDetails.setStudyType(StudyType.N); } studyDetails.setDescription(userSelection.getStudyDescription()); studyDetails.setStartDate(ETLServiceImpl.formatDate(userSelection.getStudyStartDate())); if (userSelection.getStudyId() != null) { studyDetails.setId(userSelection.getStudyId()); } return studyDetails; }
Source:
<code><START> public void setAlphabeticallySortActive(boolean sort) { <END> this.alphabeticallySort = sort; }</code><technical_language>need public</technical_language>

Target:
private void setAlphabeticallySortActive(boolean sort) { this.alphabeticallySort = sort; }
Source:
<code>public static boolean shouldUseBitmapIndex( Filter filter, BitmapIndexSelector indexSelector, @Nullable FilterTuning filterTuning ) { final FilterTuning tuning = filterTuning != null ? filterTuning : FilterTuning.createDefault(filter, indexSelector); if (filter.supportsBitmapIndex(indexSelector) && tuning.getUseBitmapIndex()) { return filter.getRequiredColumns().stream().allMatch(column -> { final BitmapIndex index = indexSelector.getBitmapIndex(column); <START> Preconditions.checkNotNull(index, "WTF?! column doesn't have a bitmap index"); <END> final int cardinality = index.getCardinality(); return cardinality >= tuning.getMinCardinalityToUseBitmapIndex() && cardinality <= tuning.getMaxCardinalityToUseBitmapIndex(); }); } return false; }</code><technical_language>I suggest "WTF" in project. #8269</technical_language>

Target:
public static boolean shouldUseBitmapIndex( Filter filter, BitmapIndexSelector indexSelector, @Nullable FilterTuning filterTuning ) { final FilterTuning tuning = filterTuning != null ? filterTuning : FilterTuning.createDefault(filter, indexSelector); if (filter.supportsBitmapIndex(indexSelector) && tuning.getUseBitmapIndex()) { return filter.getRequiredColumns().stream().allMatch(column -> { final BitmapIndex index = indexSelector.getBitmapIndex(column); Preconditions.checkNotNull(index, "Column does not have a bitmap index"); final int cardinality = index.getCardinality(); return cardinality >= tuning.getMinCardinalityToUseBitmapIndex() && cardinality <= tuning.getMaxCardinalityToUseBitmapIndex(); }); } return false; }
Source:
<code>private void addVote() { <START> List<Vote> votes = new Vector<>(); <END> Collections.addAll(votes, evaluator.getPredictionVotes()); Vote[] finalVotes = votes.toArray(new Vote[votes.size()]); learningCurve.setVote(finalVotes); logger.debug("evaluator id = {}", this.id); if (immediatePredictionStream != null) { if (firstVoteDump) { immediatePredictionStream.println(learningCurve.voteHeaderToString()); firstVoteDump = false; } immediatePredictionStream.println(learningCurve.voteEntryToString()); immediatePredictionStream.flush(); } }</code><technical_language>If need synchronization, please ArrayList</technical_language>

Target:
private void addVote() { Vote[] finalVotes = evaluator.getPredictionVotes(); learningCurve.setVote(finalVotes); logger.debug("evaluator id = {}", this.id); if (immediatePredictionStream != null) { if (firstVoteDump) { immediatePredictionStream.println(learningCurve.voteHeaderToString()); firstVoteDump = false; } immediatePredictionStream.println(learningCurve.voteEntryToString()); immediatePredictionStream.flush(); } }
Source:
<code>protected void initialize(AFCliRequest cliRequest) throws ExitException { if (cliRequest.getWorkingDirectory() == null) { cliRequest.setWorkingDirectory(System.getProperty("user.dir")); } if (cliRequest.getMultiModuleProjectDirectory() == null) { String basedirProperty = System.getProperty(MULTIMODULE_PROJECT_DIRECTORY); if (basedirProperty == null) { System.err.format("-D%s system propery is not set." + " Check $M2_HOME environment variable and mvn script match.", MULTIMODULE_PROJECT_DIRECTORY); throw new ExitException(1); } <START> Path basedir = Paths.get(basedirProperty); <END> cliRequest.setMultiModuleProjectDirectory(basedir.toAbsolutePath().toString()); } }</code><technical_language>@domhanak careful modifying classes in external339 package - copy-pasted sources maven. Please check this @desmax74 . Max, news merge of upstream changes maven (the reason duplicating maven code in place)</technical_language>

Target:
protected void initialize(AFCliRequest cliRequest) throws ExitException { if (cliRequest.getWorkingDirectory() == null) { cliRequest.setWorkingDirectory(System.getProperty("user.dir")); } if (cliRequest.getMultiModuleProjectDirectory() == null) { String basedirProperty = System.getProperty(MULTIMODULE_PROJECT_DIRECTORY); if (basedirProperty == null) { System.err.format("-D%s system propery is not set." + " Check $M2_HOME environment variable and mvn script match.", MULTIMODULE_PROJECT_DIRECTORY); throw new ExitException(1); } Path basedir = basedirProperty != null ? Paths.get(basedirProperty) : Paths.get(""); cliRequest.setMultiModuleProjectDirectory(basedir.toAbsolutePath().toString()); } }
Source:
<code>private String heidelTimeNormalize(Constituent temporal_phrase) throws Exception { if (this.dct == null) { this.dct = new Date(); } String xml_res = this.heidelTime.process(temporal_phrase.toString(), this.dct); <START> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); <END> DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml_res))); Element rootElement = document.getDocumentElement(); String res = recurseNormalizedTimeML(rootElement); return res; }</code><technical_language>this a field, a local variable? get instantiated time process a temporal phrase</technical_language>

Target:
private String heidelTimeNormalize(Constituent temporal_phrase) throws Exception { if (this.dct == null) { this.dct = new Date(); timexNormalizer.setTime(this.dct); } String xml_res = this.heidelTime.process(temporal_phrase.toString(), this.dct); int startIndex = xml_res.indexOf("<TimeML>"); xml_res = xml_res.substring(startIndex); Interval interval_res = timexNormalizer.normalize(xml_res); String string_res = interval_res==null?"":interval_res.toString(); return string_res; }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); <START> sb.append("filter="); <END> sb.append(filter); sb.append(",startIndex="); sb.append(startIndex); sb.append(",pageSize="); sb.append(pageSize); sb.append(",requestsTotalResultsCount="); sb.append(requestsTotalResultsCount); sb.append(",timeoutMillis="); sb.append(timeoutMillis); sb.append(",sortBy="); sb.append(sortBy); sb.append(",properties="); sb.append(properties); return sb.toString(); }</code><technical_language>suggestion sb.append("QueryImpl{"); sb.append("filter=");</technical_language>

Target:
public String toString() { return "QueryImpl{" + "filter=" + filter + ", startIndex=" + startIndex + ", pageSize=" + pageSize + ", requestsTotalResultsCount=" + requestsTotalResultsCount + ", timeoutMillis=" + timeoutMillis + ", sortBy=" + sortBy + ", properties=" + properties + '}'; }
Source:
<code>public void move(@Nullable Collection<Path> pathsToDelete, <START> @Nullable Collection<PathMetadata> pathsToCreate, @Nullable final BulkOperationState operationState) throws IOException { <END> if (pathsToDelete == null && pathsToCreate == null) { return; } LOG.debug("Moving paths of table in region {}: paths to delete and {}" + " paths to create", tableName, region, pathsToDelete == null ? 0 : pathsToDelete.size(), pathsToCreate == null ? 0 : pathsToCreate.size()); LOG.trace("move: pathsToDelete = {}, pathsToCreate = {}", pathsToDelete, pathsToCreate); AncestorState ancestorState = extractOrCreate(operationState, BulkOperationState.OperationType.Rename); List<DDBPathMetadata> newItems = new ArrayList<>(); if (pathsToCreate != null) { synchronized (ancestorState) { newItems.addAll( completeAncestry( pathMetaToDDBPathMeta(pathsToCreate), ancestorState, extractTimeProvider(ttlTimeProvider))); } } newItems.sort(PathOrderComparators.TOPMOST_PM_FIRST); if (pathsToDelete != null) { List<DDBPathMetadata> tombstones = new ArrayList<>(pathsToDelete.size()); for (Path meta : pathsToDelete) { Preconditions.checkArgument(ttlTimeProvider != null, "ttlTimeProvider" + " must not be null"); final PathMetadata pmTombstone = PathMetadata.tombstone(meta); pmTombstone.setLastUpdated(ttlTimeProvider.getNow()); tombstones.add(new DDBPathMetadata(pmTombstone)); } tombstones.sort(PathOrderComparators.TOPMOST_PM_LAST); newItems.addAll(tombstones); } processBatchWriteRequest(null, pathMetadataToItem(newItems)); }</code><technical_language>again, chopped & 80 chars wide</technical_language>

Target:
public void move(@Nullable Collection<Path> pathsToDelete, @Nullable Collection<PathMetadata> pathsToCreate, @Nullable final BulkOperationState operationState) throws IOException { if (pathsToDelete == null && pathsToCreate == null) { return; } LOG.debug("Moving paths of table in region {}: paths to delete and {}" + " paths to create", tableName, region, pathsToDelete == null ? 0 : pathsToDelete.size(), pathsToCreate == null ? 0 : pathsToCreate.size()); LOG.trace("move: pathsToDelete = {}, pathsToCreate = {}", pathsToDelete, pathsToCreate); AncestorState ancestorState = extractOrCreate(operationState, BulkOperationState.OperationType.Rename); List<DDBPathMetadata> newItems = new ArrayList<>(); if (pathsToCreate != null) { synchronized (ancestorState) { newItems.addAll( completeAncestry( pathMetaToDDBPathMeta(pathsToCreate), ancestorState)); } } newItems.sort(PathOrderComparators.TOPMOST_PM_FIRST); if (pathsToDelete != null) { List<DDBPathMetadata> tombstones = new ArrayList<>(pathsToDelete.size()); for (Path meta : pathsToDelete) { Preconditions.checkArgument(ttlTimeProvider != null, "ttlTimeProvider" + " must not be null"); final PathMetadata pmTombstone = PathMetadata.tombstone(meta); pmTombstone.setLastUpdated(ttlTimeProvider.getNow()); tombstones.add(new DDBPathMetadata(pmTombstone)); } tombstones.sort(PathOrderComparators.TOPMOST_PM_LAST); newItems.addAll(tombstones); } processBatchWriteRequest(ancestorState, null, pathMetadataToItem(newItems)); }
Source:
<code>protected ConcurrentClassLoader(final ConcurrentClassLoader parent, final String name) { super(parent == null ? ConcurrentClassLoader.class.getClassLoader() : parent, name); <START> if (getClassLoadingLock("$TEST$") == this) { <END> throw new Error("Cannot instantiate non-parallel subclass"); } }</code><technical_language>This check be: ! JDKSpecific.isParallelCapable(this)</technical_language>

Target:
protected ConcurrentClassLoader(final ConcurrentClassLoader parent, final String name) { super(parent == null ? ConcurrentClassLoader.class.getClassLoader() : parent, name); if (! JDKSpecific.isParallelCapable(this)) { throw new Error("Cannot instantiate non-parallel subclass"); } }
Source:
<code>public void run(SourceContext<T> ctx) throws Exception { double taskRowsPerSecond = (double) rowsPerSecond / getRuntimeContext().getNumberOfParallelSubtasks(); long nextReadTime = System.currentTimeMillis(); while (isRunning) { for (int i = 0; i < taskRowsPerSecond; i++) { if (isRunning && generator.hasNext() && (numberOfRows == null || outputSoFar < toOutput)) { synchronized (ctx.getCheckpointLock()) { if (numberOfRows != null) { <START> outputSoFar++; <END> } ctx.collect(this.generator.next()); } } else { return; } } nextReadTime += 1000; long toWaitMs = nextReadTime - System.currentTimeMillis(); while (toWaitMs > 0) { Thread.sleep(toWaitMs); toWaitMs = nextReadTime - System.currentTimeMillis(); } } }</code><technical_language>I idea: print outputSoFar in close. is good for debugging</technical_language>

Target:
public void run(SourceContext<T> ctx) throws Exception { double taskRowsPerSecond = (double) rowsPerSecond / getRuntimeContext().getNumberOfParallelSubtasks(); long nextReadTime = System.currentTimeMillis(); while (isRunning) { for (int i = 0; i < taskRowsPerSecond; i++) { if (isRunning && generator.hasNext() && (numberOfRows == null || outputSoFar < toOutput)) { synchronized (ctx.getCheckpointLock()) { outputSoFar++; ctx.collect(this.generator.next()); } } else { return; } } nextReadTime += 1000; long toWaitMs = nextReadTime - System.currentTimeMillis(); while (toWaitMs > 0) { Thread.sleep(toWaitMs); toWaitMs = nextReadTime - System.currentTimeMillis(); } } }
Source:
<code>JSONObject getDebugState() { JSONObject debugState = new JSONObject(); <START> debugState.put("octoReceiver", octoReceiver.getDebugState()); <END> debugState.put("mediaStreamTracks", mediaStreamTracks.getNodeStats().toJson()); return debugState; }</code><technical_language>add octoSender.getNodeStats()</technical_language>

Target:
JSONObject getDebugState() { JSONObject debugState = new JSONObject(); debugState.put("octoReceiver", octoReceiver.getDebugState()); debugState.put("octoSender", octoSender.getDebugState()); debugState.put("mediaStreamTracks", mediaStreamTracks.getNodeStats().toJson()); return debugState; }
Source:
<code>public List<Integer> queryYearlyMetrics(String targetType, String targetId, String name, LocalDate from, LocalDate to) { List<Integer> result = new ArrayList<>(); LocalDate date = from; <START> while (!date.isAfter(to)) { <END> result.add(queryMetric(getYearlyMetricType(), targetType, targetId, name, date.getYear(), null, null)); date = date.plusYears(1); } return result; }</code><technical_language>add a saveguard for extremely broad ranges</technical_language>

Target:
public List<Integer> queryYearlyMetrics(String targetType, String targetId, String name, LocalDate from, LocalDate to) { List<Integer> result = new ArrayList<>(); LocalDate date = from; AtomicInteger limit = new AtomicInteger(MAX_YEARLY_METRICS); while (!date.isAfter(to) && limit.decrementAndGet() > 0) { result.add(queryMetric(getYearlyMetricType(), targetType, targetId, name, date.getYear(), null, null)); date = date.plusYears(1); } return result; }
Source:
<code>private static String getNodeOpeningTag(Node currentNode) { StringBuilder openingTag = new StringBuilder(); openingTag.append("<" + currentNode.getNodeName().toLowerCase()); NamedNodeMap attributes = currentNode.getAttributes(); <START> if (attributes != null) { END> for (int i = 0; i < attributes.getLength(); i++) { Node attribute = attributes.item(i); openingTag.append(" " + attribute.getNodeName().toLowerCase() + "=" + "\"" + attribute.getNodeValue().replace("\"", "&quot;") + "\""); } } openingTag.append(getEndOfOpeningTag(currentNode) + "\n"); return openingTag.toString(); }</code><technical_language>I this check necessary, for reason check for null in <code>isToolTip</code> neccessary</technical_language>

Target:
private static String getNodeOpeningTag(Node currentNode) { StringBuilder openingTag = new StringBuilder(); openingTag.append("<" + currentNode.getNodeName().toLowerCase()); NamedNodeMap attributes = currentNode.getAttributes(); for (int i = 0; i < attributes.getLength(); i++) { Node attribute = attributes.item(i); openingTag.append(" " + attribute.getNodeName().toLowerCase() + "=" + "\"" + attribute.getNodeValue().replace("\"", "&quot;") + "\""); } openingTag.append(getEndOfOpeningTag(currentNode) + "\n"); return openingTag.toString(); }
Source:
<code>public void handle_missing_node() throws Exception { EslintBridgeServerImpl eslintBridgeServer = new EslintBridgeServerImpl(NodeCommand.builder(), tempFolder); eslintBridgeServer = spy(eslintBridgeServer); <START> doThrow(new NodeCommandException("Exception Message", new IOException())).when(eslintBridgeServer).deploy(); <END> AnalysisWarningsWrapper analysisWarnings = mock(AnalysisWarningsWrapper.class); EslintBasedRulesSensor eslintBasedRulesSensor = new EslintBasedRulesSensor(checkFactory(ESLINT_BASED_RULE), eslintBridgeServer, analysisWarnings); eslintBasedRulesSensor.execute(context); assertThat(logTester.logs(LoggerLevel.ERROR)).contains("Exception Message"); verify(analysisWarnings).addUnique("Some JavaScript rules were not executed. Exception Message"); }</code><technical_language>change throw method startServerLazily for deploy</technical_language>

Target:
public void handle_missing_node() throws Exception { doThrow(new NodeCommandException("Exception Message", new IOException())).when(eslintBridgeServerMock).startServerLazily(any()); AnalysisWarningsWrapper analysisWarnings = mock(AnalysisWarningsWrapper.class); EslintBasedRulesSensor eslintBasedRulesSensor = new EslintBasedRulesSensor(checkFactory(ESLINT_BASED_RULE), eslintBridgeServerMock, analysisWarnings); eslintBasedRulesSensor.execute(context); assertThat(logTester.logs(LoggerLevel.ERROR)).contains("Exception Message"); verify(analysisWarnings).addUnique("Some JavaScript rules were not executed. Exception Message"); }
Source:
<code>public Collection<Path> branchChangedFiles(String targetBranchName, Path rootBaseDir) { RepositoryBuilder builder = new RepositoryBuilder().findGitDir(rootBaseDir.toFile()); if (builder.getGitDir() == null) { <START> LOG.warn("Not inside a Git work tree: {}", rootBaseDir); <END> return null; } try { Repository repo = builder.build(); Ref targetRef = repo.exactRef("refs/heads/" + targetBranchName); if (targetRef == null) { LOG.warn("Could not find ref: {}", targetBranchName); return null; } Git git = new Git(repo); return git.diff().setShowNameAndStatusOnly(true).setOldTree(prepareTreeParser(repo, targetRef)).call().stream() .map(diffEntry -> repo.getWorkTree().toPath().resolve(diffEntry.getNewPath())) .collect(Collectors.toList()); } catch (IOException | GitAPIException e) { LOG.warn(e.getMessage(), e); } return null; }</code><technical_language>existing blame is throwing exception if this happens, throw too. .setMustExist(true); create a repo. better, create a factory classes</technical_language>

Target:
public Set<Path> branchChangedFiles(String targetBranchName, Path rootBaseDir) { try (Repository repo = getVerifiedRepositoryBuilder(rootBaseDir).build()) { Ref targetRef = repo.exactRef("refs/heads/" + targetBranchName); if (targetRef == null) { LOG.warn("Could not find ref: {}", targetBranchName); return null; } try (Git git = new Git(repo)) { return git.diff().setShowNameAndStatusOnly(true).setOldTree(prepareTreeParser(repo, targetRef)).call().stream() .filter(diffEntry -> diffEntry.getChangeType() == DiffEntry.ChangeType.ADD || diffEntry.getChangeType() == DiffEntry.ChangeType.MODIFY) .map(diffEntry -> repo.getWorkTree().toPath().resolve(diffEntry.getNewPath())) .collect(Collectors.toSet()); } } catch (IOException | GitAPIException e) { LOG.warn(e.getMessage(), e); } return null; }
Source:
<code><START> public SamLocusAndReferenceIterator(final ReferenceSequenceFileWalker referenceFile, final SamLocusIterator locusIterator) { <END> this.referenceSequenceFileWalker = referenceFile; this.locusIterator = locusIterator; }</code><technical_language>sort of check reference is consistent sam file</technical_language>

Target:
public SamLocusAndReferenceIterator(final ReferenceSequenceFileWalker referenceFile, final SamLocusIterator locusIterator) throws IllegalArgumentException { if(!SequenceUtil.areSequenceDictionariesEqual( locusIterator.getHeader().getSequenceDictionary(), referenceFile.getSequenceDictionary())) { throw new IllegalArgumentException("reference and locus iterator have difference dictionaries." + locusIterator.getHeader().getSequenceDictionary().toString() + referenceFile.getSequenceDictionary().toString()); } this.referenceSequenceFileWalker = referenceFile; this.locusIterator = locusIterator; }
Source:
<code>public boolean getRewriteBatchedStatements() { final String isRewrite = super.connectionProperties.getProperty(REWRITE_BATCHED_STATEMENTS); <START> return isRewrite == null ? null : Boolean.valueOf(isRewrite); <END> }</code><technical_language>return null ? I meant 'false', you</technical_language>

Target:
public boolean getRewriteBatchedStatements() { final String isRewrite = super.connectionProperties.getProperty(REWRITE_BATCHED_STATEMENTS); return isRewrite == null ? false : Boolean.valueOf(isRewrite); }
Source:
<code>public static AlertDialog buildAboutCommCareDialog(Activity activity) { final String commcareVersion = CommCareApplication._().getCurrentVersionString(); LayoutInflater li = LayoutInflater.from(activity); View view = li.inflate(R.layout.about_commcare_dialog, null); TextView titleView = (TextView) view.findViewById(R.id.dialog_title).findViewById(R.id.dialog_title_text); <START> titleView.setText("About CommCare"); <END> TextView aboutText = (TextView)view.findViewById(R.id.about_commcare_text); String msg = activity.getString(R.string.aboutdialog, commcareVersion); Spannable markdownText = MarkupUtil.returnMarkdown(activity, msg); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { aboutText.setText(markdownText); } else { aboutText.setText(markdownText.toString()); } AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setView(view); return builder.create(); }</code><technical_language>this text for localization</technical_language>

Target:
public static AlertDialog buildAboutCommCareDialog(Activity activity) { final String commcareVersion = CommCareApplication._().getCurrentVersionString(); LayoutInflater li = LayoutInflater.from(activity); View view = li.inflate(R.layout.about_commcare_dialog, null); TextView titleView = (TextView) view.findViewById(R.id.dialog_title).findViewById(R.id.dialog_title_text); titleView.setText(activity.getString(R.string.about_cc)); TextView aboutText = (TextView)view.findViewById(R.id.about_commcare_text); String msg = activity.getString(R.string.aboutdialog, commcareVersion); Spannable markdownText = MarkupUtil.returnMarkdown(activity, msg); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { aboutText.setText(markdownText); } else { aboutText.setText(markdownText.toString()); } AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setView(view); return builder.create(); }
Source:
<code>public int getSerializedSizeInBytes() { return NAME.length() + SIZE_OF_INT + SIZE_OF_INT + SIZE_OF_BYTE + <START> nullsBufferIndex + END> (remainingNullsCount > 0 ? SIZE_OF_BYTE : 0) + valuesBufferIndex; }</code><technical_language>Remove</technical_language>

Target:
public long getSerializedSizeInBytes() { return NAME.length() + SIZE_OF_INT + SIZE_OF_INT + getNullsBufferSerializedSizeInBytes() + valuesBufferIndex; }
Source:
<code>private void handlePackError(IOException e, PackFile p) { String warnTmpl = null; String errTmpl = JGitText.get().exceptionWhileReadingPack; if ((e instanceof CorruptObjectException) || (e instanceof PackInvalidException)) { warnTmpl = JGitText.get().corruptPack; removePack(p); } else if (e instanceof FileNotFoundException) { if (p.getPackFile().exists()) { <START> errTmpl = JGitText.get().packInaccessible; <END> } else { warnTmpl = JGitText.get().packWasDeleted; removePack(p); } } else if (FileUtils.isStaleFileHandleInCausalChain(e)) { warnTmpl = JGitText.get().packHandleIsStale; removePack(p); } if (warnTmpl != null) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath()), e); } else { LOG.warn(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath())); } } else { LOG.error(MessageFormat.format( errTmpl, p.getPackFile().getAbsolutePath()), e); } }</code><technical_language>Is a "track" number of consecutive failed attempts open pack file</technical_language>

Target:
private void handlePackError(IOException e, PackFile p) { String warnTmpl = null; int retryTransientCount = 0; String errTmpl = JGitText.get().exceptionWhileReadingPack; if ((e instanceof CorruptObjectException) || (e instanceof PackInvalidException)) { warnTmpl = JGitText.get().corruptPack; removePack(p); } else if (e instanceof FileNotFoundException) { if (p.getPackFile().exists()) { errTmpl = JGitText.get().packInaccessible; retryTransientCount = p.incrementTransientErrorCount(); } else { warnTmpl = JGitText.get().packWasDeleted; removePack(p); } } else if (FileUtils.isStaleFileHandleInCausalChain(e)) { warnTmpl = JGitText.get().packHandleIsStale; removePack(p); } else { retryTransientCount = p.incrementTransientErrorCount(); } if (warnTmpl != null) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath()), e); } else { LOG.warn(MessageFormat.format(warnTmpl, p.getPackFile().getAbsolutePath())); } } else { if (doLogExponentialBackoff(retryTransientCount)) { LOG.error(MessageFormat.format(errTmpl, p.getPackFile().getAbsolutePath()), Integer.valueOf(retryTransientCount), e); } } }
Source:
<code>public TexasProvider(final String apiBase, final String authorization) { super(NetworkId.TX, apiBase, authorization); <START> setTimeZone("America/Chicago"); <END> }</code><technical_language>Timezone Chicago, really? a major city in Texas</technical_language>

Target:
public TexasProvider(final String apiBase, final String authorization) { super(NetworkId.TEXAS, apiBase, authorization); setTimeZone("America/Chicago"); }
Source:
<code>public synchronized HttpResponse doStop() throws IOException, ServletException { Executor e = Executor.of(this); if (e == null) { for (Computer c : Jenkins.getActiveInstance().getComputers()) { <START> for (Executor e1 : c.getOneOffExecutors()) { <END> if (e1.getCurrentExecutable() == this) e = e1; } } } if (e != null) { return e.doStop(); } else { return HttpResponses.forwardToPreviousPage(); } }</code><technical_language>Unnecessary, of handles this</technical_language>

Target:
public synchronized HttpResponse doStop() throws IOException, ServletException { Executor e = Executor.of(this); if (e != null) { return e.doStop(); } else { return HttpResponses.forwardToPreviousPage(); } }
Source:
<code><START> @Override protected void prepareConnectionForEditing(StorageServerConnections connection) <END></code><technical_language>convention - move annotation a separate line</technical_language>

Target:
protected void prepareConnectionForEditing(StorageServerConnections connection)
Source:
<code>public void testBundlePreservesFullUrl() { Bundle bundle = new Bundle(); bundle.setType(BundleType.DOCUMENT); Composition composition = new Composition(); composition.setTitle("Visit Summary"); bundle.addEntry().setFullUrl("http://foo").setResource(composition); <START> IIdType id = myClient.create().resource(bundle).execute().getId(); <END> Bundle retBundle = myClient.read().resource(Bundle.class).withId(id).execute(); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(retBundle)); assertEquals("http://foo", bundle.getEntry().get(0).getFullUrl()); }</code><technical_language>parameter myClient renamed ourClient match renamed parameter in BaseResourceProviderR4Test.java (3 occurrences in this file)</technical_language>

Target:
public void testBundlePreservesFullUrl() { Bundle bundle = new Bundle(); bundle.setType(BundleType.DOCUMENT); Composition composition = new Composition(); composition.setTitle("Visit Summary"); bundle.addEntry().setFullUrl("http://foo").setResource(composition); IIdType id = ourClient.create().resource(bundle).execute().getId(); Bundle retBundle = ourClient.read().resource(Bundle.class).withId(id).execute(); ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(retBundle)); assertEquals("http://foo", bundle.getEntry().get(0).getFullUrl()); }
Source:
<code>public Query createNativeQuery(String sqlString, Class resultClass) { <START> SQLQuery q = ( (Session) getDelegate() ).createSQLQuery( sqlString ); <END> q.addEntity( "alias1", resultClass.getName(), LockMode.READ ); return new QueryImpl( q, (AbstractEntityManagerImpl) hibernateEm ); }</code><technical_language>Invoke validate()</technical_language>

Target:
public Query createNativeQuery(String sqlString, Class resultClass) { SQLQuery q = ( (Session) getDelegate() ).createSQLQuery( sqlString ); q.addEntity( "alias1", resultClass.getName(), LockMode.READ ); return new OgmNativeQuery( q, hibernateEm ); }