auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void processKeyPressed(BluetoothDevice device) { final HeadsetPhoneState phoneState = mSystemInterface.getHeadsetPhoneState(); if (phoneState.getCallState() == HeadsetHalConstants.CALL_STATE_INCOMING) { mSystemInterface.answerCall(device); } else if (phoneState.getNumActiveCall() > 0) { if (getAudioState() != BluetoothHeadset.STATE_AUDIO_DISCONNECTED) { mHeadsetService.setActiveDevice(mDevice); mNativeInterface.connectAudio(mDevice); } else { mSystemInterface.hangupCall(device, false); } } else { String dialNumber = mPhonebook.getLastDialledNumber(); if (dialNumber == null) { log("processKeyPressed, last dial number null"); return; } mHeadsetService.setActiveDevice(mDevice); Intent intent = <START> new Intent(Intent.ACTION_CALL_PRIVILEGED, Uri.fromParts(SCHEME_TEL, dialNumber, null)); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); updateCallIntent(intent, dialNumber); mHeadsetService.startActivity(intent); <END> } }</code><technical_language>prefer defining a method private Intent getDialCallIntent(String dialNumber) return intent do intent related setup there. Also, longer repeat this code in places if define method</technical_language>

Target:
private void processKeyPressed(BluetoothDevice device) { final HeadsetPhoneState phoneState = mSystemInterface.getHeadsetPhoneState(); if (phoneState.getCallState() == HeadsetHalConstants.CALL_STATE_INCOMING) { mSystemInterface.answerCall(device); } else if (phoneState.getNumActiveCall() > 0) { if (getAudioState() != BluetoothHeadset.STATE_AUDIO_DISCONNECTED) { mHeadsetService.setActiveDevice(mDevice); mNativeInterface.connectAudio(mDevice); } else { mSystemInterface.hangupCall(device, false); } } else { String dialNumber = mPhonebook.getLastDialledNumber(); if (dialNumber == null) { log("processKeyPressed, last dial number null"); return; } mHeadsetService.setActiveDevice(mDevice); Intent intent = getDialCallIntent(dialNumber); mHeadsetService.startActivity(intent); } }
Source:
<code>public void onComplete() { int currentNumOfAttempts = numOfAttempts.get(); if (currentNumOfAttempts > 0 && currentNumOfAttempts < maxAttempts) { succeededAfterRetryCounter.increment(); Throwable throwable = Option.of(lastException.get()) .getOrElse(lastRuntimeException.get()); publishRetryEvent( () -> new RetryOnSuccessEvent(getName(), currentNumOfAttempts, throwable)); } else { if (currentNumOfAttempts >= maxAttempts) { failedAfterRetryCounter.increment(); Throwable throwable = Option.of(lastException.get()) .getOrElse(lastRuntimeException.get()); <START> RuntimeException maxRetriesExceeded = new MaxRetriesExceeded( <END> "Max retries reached for retry=" + name ); publishRetryEvent(() -> new RetryOnErrorEvent(name, currentNumOfAttempts, throwable != null && !failAfterMaxAttempts ? throwable : maxRetriesExceeded)); if (failAfterMaxAttempts) { throw maxRetriesExceeded; } } else { succeededWithoutRetryCounter.increment(); } } }</code><technical_language>I create a new exception MaxRetriesExceededException similar CallNotPermittedException BulkheadFullException, if throw part of Public API now. store causing retry name a field similar CallNotPermittedException provide a getter method. I guess need a writableStackTrace config property users disable stacktrace is filling log files much</technical_language>

Target:
public void onComplete() { int currentNumOfAttempts = numOfAttempts.get(); if (currentNumOfAttempts > 0 && currentNumOfAttempts < maxAttempts) { succeededAfterRetryCounter.increment(); Throwable throwable = Option.of(lastException.get()) .getOrElse(lastRuntimeException.get()); publishRetryEvent( () -> new RetryOnSuccessEvent(getName(), currentNumOfAttempts, throwable)); } else { if (currentNumOfAttempts >= maxAttempts) { failedAfterRetryCounter.increment(); Throwable throwable = Option.of(lastException.get()) .orElse(Option.of(lastRuntimeException.get())) .filter(p -> !failAfterMaxAttempts) .getOrElse(new MaxRetriesExceeded( "max retries is reached out for the result predicate check" )); publishRetryEvent(() -> new RetryOnErrorEvent(name, currentNumOfAttempts, throwable)); if (failAfterMaxAttempts) { throw MaxRetriesExceededException.createMaxRetriesExceededException(RetryImpl.this); } } else { succeededWithoutRetryCounter.increment(); } } }
Source:
<code><START> public S3DDFManager(S3DataSourceDescriptor s3dsd, EngineType engineType) throws DDFException { <END> mCredential = (S3DataSourceCredentials)s3dsd.getDataSourceCredentials(); AWSCredentials credentials = new BasicAWSCredentials(mCredential.getAwsKeyID(), mCredential.getAwsScretKey()); mConn = new AmazonS3Client(credentials); }</code><technical_language>call this(s3dsd.getDataSourceCredentials(), engineType)</technical_language>

Target:
public S3DDFManager(S3DataSourceDescriptor s3dsd, EngineType engineType) throws DDFException { this((S3DataSourceCredentials)s3dsd.getDataSourceCredentials(), engineType); }
Source:
<code>private static void handleZoneWithPreviousType( String mgrsPart, MgrsPartType previousType, StringBuilder mgrsBuilder, List<String> mgrsStrings) { LOGGER.trace("Found a ZONE which occurs after a {}", mgrsPart, previousType); switch (previousType) { case ZONE: case HUNDRED_KM: LOGGER.trace("Storing final result coordinate, clearing the builder, and saving this part"); mgrsStrings.add(mgrsBuilder.toString()); mgrsBuilder.delete(0, mgrsBuilder.length()); mgrsBuilder.append(mgrsPart); break; case NUMERIC: LOGGER.trace("Clearing the builder and saving this part"); mgrsBuilder.delete(0, mgrsBuilder.length()); mgrsBuilder.append(mgrsPart); break; case NONE: LOGGER.trace("Saving this part"); mgrsBuilder.append(mgrsPart); <START> break; <END> } }</code><technical_language>pencil2: need for a breake here</technical_language>

Target:
private static void handleZoneWithPreviousType( String mgrsPart, MgrsPartType previousType, StringBuilder mgrsBuilder, List<String> mgrsStrings) { LOGGER.trace("Found a ZONE which occurs after a {}", mgrsPart, previousType); switch (previousType) { case ZONE: case HUNDRED_KM: LOGGER.trace( "Storing final result coordinate, clearing the builder, and saving this part [{}]", mgrsPart); mgrsStrings.add(mgrsBuilder.toString()); mgrsBuilder.delete(0, mgrsBuilder.length()); mgrsBuilder.append(mgrsPart); break; case NUMERIC: LOGGER.trace("Clearing the builder and saving this part [{}]", mgrsPart); mgrsBuilder.delete(0, mgrsBuilder.length()); mgrsBuilder.append(mgrsPart); break; case NONE: LOGGER.trace("Saving this part [{}]", mgrsPart); mgrsBuilder.append(mgrsPart); } }
Source:
<code>public void handleReplaceKeysResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleReplaceKeysResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Replace Keys Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } <START> this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() <END> .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }</code><technical_language>Extract building of ResponseMessage variable (in eclipse, select text, right-click > refactor > extract local variable / select code + shift+alt+L). This code a bit more readable, especially passing in other besides ResponseMessage</technical_language>

Target:
public void handleReplaceKeysResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleReplaceKeysResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Replace Keys Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
<code>public static void sortRevisionInfoByNumber(JsArray<RevisionInfo> list) { final int parent_edit_number = findEditParent(list); Collections.sort(Natives.asList(list), new Comparator<RevisionInfo>() { @Override public int compare(RevisionInfo a, RevisionInfo b) { int a_number = a._number(); int b_number = b._number(); if (a_number == 0) { a_number = parent_edit_number + 1; } if (b_number == 0) { b_number = parent_edit_number + 1; } <START> return a_number - b_number; <END> } }); }</code><technical_language>edit PS2. This sort 0 2 3. this line means 0 compares equal 3. Collections.sort is stable, this means if 0 appears in input list 3, stay 3 sorted</technical_language>

Target:
public static void sortRevisionInfoByNumber(JsArray<RevisionInfo> list) { final int parent_number = findEditParent(list); Collections.sort(Natives.asList(list), new Comparator<RevisionInfo>() { @Override public int compare(RevisionInfo a, RevisionInfo b) { int a_number = a._number(); int b_number = b._number(); if (a_number == 0) { if (b_number == parent_number + 1) { a_number = parent_number; } else { a_number = parent_number + 1; } } if (b_number == 0) { if (a_number == parent_number + 1) { b_number = parent_number; } else { b_number = parent_number + 1; } } return a_number - b_number; } }); }
Source:
<code>public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; <START> } <END> final TocTreeNodeStyle other = (TocTreeNodeStyle) obj; if (this.style != other.style && (this.style == null || !this.style.equals(other.style))) { return false; } return true; }</code><technical_language>above. instanceof</technical_language>

Target:
public boolean equals(Object obj) { if (obj instanceof TocTreeNodeStyle) { final TocTreeNodeStyle other = (TocTreeNodeStyle) obj; return this.style != null && this.style.equals(other.style); } else { return false; } }
Source:
<code>protected ElasticsearchIndexFieldType<BigDecimal> toIndexFieldType(PropertyMapping mapping) { int resolvedDecimalScale = resolveDecimalScale(); <START> mapping.setScalingFactor( BigInteger.TEN.pow( resolvedDecimalScale ).intValue() ); <END> ToDocumentFieldValueConverter<?, ? extends BigDecimal> dslToIndexConverter = createDslToIndexConverter(); FromDocumentFieldValueConverter<? super BigDecimal, ?> indexToProjectionConverter = createIndexToProjectionConverter(); ElasticsearchBigDecimalFieldCodec codec = new ElasticsearchBigDecimalFieldCodec( resolvedDecimalScale ); return new ElasticsearchIndexFieldType<>( codec, new ElasticsearchStandardFieldPredicateBuilderFactory<>( dslToIndexConverter , createToDocumentRawConverter(), codec ), new ElasticsearchStandardFieldSortBuilderFactory<>( resolvedSortable, dslToIndexConverter, createToDocumentRawConverter(), codec ), new ElasticsearchStandardFieldProjectionBuilderFactory<>( resolvedProjectable, indexToProjectionConverter, createFromDocumentRawConverter(), codec ), mapping ); }</code><technical_language>doubleValue(). First, simply decimal scale negative, store large numbers, in case scaling factor 0 1. Second, scaling factor large, large fit integer</technical_language>

Target:
protected ElasticsearchIndexFieldType<BigDecimal> toIndexFieldType(PropertyMapping mapping) { BigDecimal scalingFactor = BigDecimal.TEN.pow( resolveDecimalScale(), new MathContext( 10, RoundingMode.HALF_UP ) ); mapping.setScalingFactor( scalingFactor.doubleValue() ); ToDocumentFieldValueConverter<?, ? extends BigDecimal> dslToIndexConverter = createDslToIndexConverter(); FromDocumentFieldValueConverter<? super BigDecimal, ?> indexToProjectionConverter = createIndexToProjectionConverter(); ElasticsearchBigDecimalFieldCodec codec = new ElasticsearchBigDecimalFieldCodec( scalingFactor ); return new ElasticsearchIndexFieldType<>( codec, new ElasticsearchStandardFieldPredicateBuilderFactory<>( dslToIndexConverter , createToDocumentRawConverter(), codec ), new ElasticsearchStandardFieldSortBuilderFactory<>( resolvedSortable, dslToIndexConverter, createToDocumentRawConverter(), codec ), new ElasticsearchStandardFieldProjectionBuilderFactory<>( resolvedProjectable, indexToProjectionConverter, createFromDocumentRawConverter(), codec ), mapping ); }
Source:
<code>public String apply(HttpResponse from) { String id = from.getFirstHeaderOrNull(GlacierHeaders.JOB_ID); if (id == null) <START> throw new HttpException("Did not receive JobId"); <END> return id; }</code><technical_language>[minor] Write if (id == null) { throw new HttpException("Did receive JobId"); } ? Thanks</technical_language>

Target:
public String apply(HttpResponse from) { String id = from.getFirstHeaderOrNull(GlacierHeaders.JOB_ID); if (id == null) { throw new HttpException("Did not receive JobId"); } return id; }
Source:
<code>public AVideo(String name, InputStream isdata) throws IOException { if (isdata == null) <START> throw new IllegalArgumentException("null stream"); <END> _name = name; _isdata = isdata; _data = null; _url = null; _file = null; }</code><technical_language>"stream null"? a completed sentence</technical_language>

Target:
public AVideo(String name, InputStream isdata) throws IOException { if (isdata == null) throw new IllegalArgumentException("stream cannot be null"); _name = name; _isdata = isdata; _data = null; _url = null; _file = null; }
Source:
<code>public void testModuleWizard() throws Throwable { ComponentWizard connectionWizard = getComponentService() .getComponentWizard(SalesforceConnectionWizardDefinition.COMPONENT_WIZARD_NAME, "nodeSalesforce"); List<Form> forms = connectionWizard.getForms(); Form connectionWizardForm = forms.get(0); SalesforceConnectionProperties connProps = (SalesforceConnectionProperties) connectionWizardForm.getProperties(); ComponentWizard[] subWizards = getComponentService().getComponentWizardsForProperties(connProps, "location") .toArray(new ComponentWizard[2]); Arrays.sort(subWizards, new WizardNameComparator()); assertEquals(2, subWizards.length); assertFalse(subWizards[1].getDefinition().isTopLevel()); <START> assertEquals("Salesforce Modules", subWizards[1].getDefinition().getMenuItemName()); <END> assertTrue(subWizards[0].getDefinition().isTopLevel()); assertEquals("Salesforce Connection", subWizards[0].getDefinition().getMenuItemName()); }</code><technical_language>I reorder **subWizards[0]** **subWizards[1]** asserts</technical_language>

Target:
public void testModuleWizard() throws Throwable { ComponentWizard connectionWizard = getComponentService() .getComponentWizard(SalesforceConnectionWizardDefinition.COMPONENT_WIZARD_NAME, "nodeSalesforce"); List<Form> forms = connectionWizard.getForms(); Form connectionWizardForm = forms.get(0); SalesforceConnectionProperties connProps = (SalesforceConnectionProperties) connectionWizardForm.getProperties(); ComponentWizard[] subWizards = getComponentService().getComponentWizardsForProperties(connProps, "location") .toArray(new ComponentWizard[2]); Arrays.sort(subWizards, new WizardNameComparator()); assertEquals(2, subWizards.length); assertTrue(subWizards[0].getDefinition().isTopLevel()); assertEquals("Salesforce Connection", subWizards[0].getDefinition().getMenuItemName()); assertFalse(subWizards[1].getDefinition().isTopLevel()); assertEquals("Salesforce Modules", subWizards[1].getDefinition().getMenuItemName()); }
Source:
<code>public boolean remove(ChannelInterceptor interceptor) { this.size--; <START> return this.interceptors.remove(interceptor); <END> }</code><technical_language>This is a bug! requested interceptor in list, decrement if true remove()</technical_language>

Target:
public boolean remove(ChannelInterceptor interceptor) { if (this.interceptors.remove(interceptor)) { this.size--; return true; } else { return false; } }
Source:
<code>public void onRotateEntryLog() { <START> if (null != checkpointer) { <END> Checkpoint checkpoint = checkpointSource.newCheckpoint(); checkpointer.startCheckpoint(checkpoint); } }</code><technical_language>in case null? is ok null</technical_language>

Target:
public void onRotateEntryLog() { Checkpoint checkpoint = checkpointSource.newCheckpoint(); checkpointer.startCheckpoint(checkpoint); }
Source:
<code>private List<JoinNode.EquiJoinClause> flippedCriteria(JoinNode node) { return node.getCriteria().stream() <START> .map(criteria -> new JoinNode.EquiJoinClause(criteria.getRight(), criteria.getLeft())) <END> .collect(toImmutableList()); }</code><technical_language>criteria.flip() also, singular is criterion</technical_language>

Target:
private List<JoinNode.EquiJoinClause> flippedCriteria(JoinNode node) { return node.getCriteria().stream() .map(EquiJoinClause::flip) .collect(toImmutableList()); }
Source:
<code>public void setReloadingConfigs(boolean reloadingConfigs) { if (reloadingConfigs && !this.reloadingConfigs) { this.reloadingConfigs = true; synchronized (files) { for (String fileName : <START> files.keySet()) { <END> if (null == files.get(fileName)) { try { monitorFile(new URL(fileName)); } catch (MalformedURLException e) { LOG.warn("Error creating URL from [{}]!", fileName, e); } } } } } this.reloadingConfigs = reloadingConfigs; }</code><technical_language>Strange formatting, put this in a line</technical_language>

Target:
public void setReloadingConfigs(boolean reloadingConfigs) { if (reloadingConfigs && !this.reloadingConfigs) { this.reloadingConfigs = true; synchronized (lazyMonitoredFilesCache) { for (URL fileUrl : lazyMonitoredFilesCache) { monitorFile(fileUrl); } lazyMonitoredFilesCache.clear(); } } this.reloadingConfigs = reloadingConfigs; }
Source:
<code>public final static Map<String,String> asNodeSettingsMap(DeploymentType depl) { PathsType paths = depl.getPaths(); return ImmutableMap.<String,String>builder() .put(NodeSettings.VOLTDBROOT_PATH_KEY, paths.getVoltdbroot().getPath()) .put(NodeSettings.CL_PATH_KEY, paths.getCommandlog().getPath()) .put(NodeSettings.CL_SNAPSHOT_PATH_KEY, paths.getCommandlogsnapshot().getPath()) .put(NodeSettings.SNAPTHOT_PATH_KEY, paths.getSnapshots().getPath()) .put(NodeSettings.EXPORT_OVERFLOW_PATH_KEY, paths.getExportoverflow().getPath()) <START> .put(NodeSettings.DR_OVERFLOW_PATH_KEY, paths.getDroverflow().getPath()) <END> .build(); }</code><technical_language>supposed read sites host too</technical_language>

Target:
public final static Map<String,String> asNodeSettingsMap(DeploymentType depl) { PathsType paths = depl.getPaths(); return ImmutableMap.<String,String>builder() .put(NodeSettings.VOLTDBROOT_PATH_KEY, paths.getVoltdbroot().getPath()) .put(NodeSettings.CL_PATH_KEY, paths.getCommandlog().getPath()) .put(NodeSettings.CL_SNAPSHOT_PATH_KEY, paths.getCommandlogsnapshot().getPath()) .put(NodeSettings.SNAPTHOT_PATH_KEY, paths.getSnapshots().getPath()) .put(NodeSettings.EXPORT_OVERFLOW_PATH_KEY, paths.getExportoverflow().getPath()) .put(NodeSettings.DR_OVERFLOW_PATH_KEY, paths.getDroverflow().getPath()) .put(NodeSettings.LOCAL_SITES_COUNT_KEY, Integer.toString(depl.getCluster().getSitesperhost())) .build(); }
Source:
<code>public void testErrorForwarding() throws Exception { new Context() {{ runTest(() -> { final Exception testException = new Exception("test leader Exeption"); <START> testingLeaderElectionDriver.getFatalErrorHandler().onFatalError(testException); <END> testingContender.waitForError(timeout); assertThat(testingContender.getError(), is(notNullValue())); assertThat(testingContender.getError().getMessage(), containsString(testException.getMessage())); }); }}; }</code><technical_language>I guess testingLeaderElectionDriver is a testing implementation. Hence, expose onFatalError there. exposing internal structure of this class violates law of demeter</technical_language>

Target:
public void testErrorForwarding() throws Exception { new Context() {{ runTest(() -> { final Exception testException = new Exception("test leader exception"); testingLeaderElectionDriver.onFatalError(testException); testingContender.waitForError(timeout); assertThat(testingContender.getError(), is(notNullValue())); assertThat(testingContender.getError(), FlinkMatchers.containsCause(testException)); }); }}; }
Source:
<code>protected boolean irrelevant(EStructuralFeature feat) { <START> boolean irrelevantFeature = feat.isDerived() || feat.isTransient(); <END> if (!irrelevantFeature && feat instanceof EReference) { EReference ref = (EReference)feat; irrelevantFeature = ref.isContainment() || ref.isContainer(); } return irrelevantFeature; }</code><technical_language>This method is hard read. I this method clearer this: if (feat instanceof EAttribute) { return feat.isDerived() || feat.isTransient(); } else { EReference ref = (EReference)feat; return ref.isDerived() || ref.isTransient() || ref.isContainment() || ref.isContainer(); } is clearer</technical_language>

Target:
protected boolean irrelevant(EStructuralFeature feat) { if (feat instanceof EAttribute) { return feat.isDerived() || feat.isTransient(); } else { EReference ref = (EReference)feat; return ref.isDerived() || ref.isTransient() || ref.isContainment() || ref.isContainer(); } }
Source:
<code>protected InputStream onSuccessfulProxyRepositoryResponse(InputStream is, String storageId, String repositoryId, String path) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { <START> final Path tempPath = Files.createTempFile("strongbox", ".tmp"); <END> try (final OutputStream tempPathOs = Files.newOutputStream(tempPath)) { final Storage storage = getConfiguration().getStorage(storageId); final Repository repository = storage.getRepository(repositoryId); final LayoutProvider layoutProvider = layoutProviderRegistry.getProvider(repository.getLayout()); final RepositoryPath artifactPath = layoutProvider.resolve(repository).resolve(path); artifactByteStreamsCopyStrategyDeterminator.determine(repository).copy(is, tempPathOs, artifactPath); } IOUtils.closeQuietly(is); return Files.newInputStream(tempPath); }</code><technical_language>I noticed this. incorrect. get path for this way: ConfigurationResourceResolver.getHomeDirectory(). check ConfigurationResourceResolver.getConfigurationResource(...)</technical_language>

Target:
protected InputStream onSuccessfulProxyRepositoryResponse(InputStream is, String storageId, String repositoryId, String path) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { final Path tempDir = Paths.get(ConfigurationResourceResolver.getTempDirectory()); final Path tempPath = Files.createTempFile(tempDir, "strongbox", ".tmp"); try (final OutputStream tempPathOs = Files.newOutputStream(tempPath)) { final Storage storage = getConfiguration().getStorage(storageId); final Repository repository = storage.getRepository(repositoryId); final LayoutProvider layoutProvider = layoutProviderRegistry.getProvider(repository.getLayout()); final RepositoryPath artifactPath = layoutProvider.resolve(repository).resolve(path); artifactByteStreamsCopyStrategyDeterminator.determine(repository).copy(is, tempPathOs, artifactPath); } ResourceCloser.close(is, logger); return Files.newInputStream(tempPath); }
Source:
<code>public static boolean copyFile(InputStream inputStream, OutputStream out) { Logger.log(TAG, "File server copying file"); if (inputStream == null) { Logger.log(TAG, "Input stream null"); <START> return false; <END> } byte buf[] = new byte[1024]; int len; try { while ((len = inputStream.read(buf)) != -1) { out.write(buf, 0, len); } out.close(); inputStream.close(); } catch (IOException e) { Logger.log(TAG, "Copy in File Server failed with exception " + e); return false; } Logger.log(TAG, "Copy in File Server successful"); return true; }</code><technical_language>This a functional change, a logging change</technical_language>

Target:
public static void copyFile(InputStream inputStream, OutputStream out) throws IOException { Logger.log(TAG, "File server copying file"); if (inputStream == null) { Logger.log(TAG, "Input stream null"); throw new IOException("Got null input stream"); } byte buf[] = new byte[1024]; int len; try { while ((len = inputStream.read(buf)) != -1) { out.write(buf, 0, len); } out.close(); inputStream.close(); } catch (IOException e) { Logger.exception("Copy in File Server failed with exception " + e, e); throw e; } Logger.log(TAG, "Copy in File Server successful"); }
Source:
<code><START> private Class<?> compile(String src, String name) throws Exception { <END> File directory = createTempDir().toFile(); File srcFile = new File(directory, name + ".java"); try (PrintWriter pw = new PrintWriter(new FileWriter(srcFile))) { pw.append(src); } JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); assertEquals(0, javac.run(null, null, null, srcFile.getCanonicalPath())); srcFile.delete(); File classFile = new File(directory, name + ".class"); byte[] bytes; try (DataInputStream dis = new DataInputStream(new FileInputStream(classFile))) { bytes = new byte[dis.available()]; dis.readFully(bytes); } classFile.delete(); return defineClass(name, bytes, 0, bytes.length); }</code><technical_language>a <LINK_2> <LINK_1> <LINK_0></technical_language>

Target:
private Class<?> compile(String src, String name) throws Exception { File directory = createTempDir().toFile(); File srcFile = new File(directory, name + ".java"); Files.write(srcFile.toPath(), src.getBytes(), StandardOpenOption.CREATE_NEW); JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); assertEquals(0, javac.run(null, null, null, srcFile.getCanonicalPath())); srcFile.delete(); File classFile = new File(directory, name + ".class"); byte[] bytes = Files.readAllBytes(classFile.toPath()); classFile.delete(); return defineClass(name, bytes, 0, bytes.length); }
Source:
<code>public void testConnectionsByClientMetric() throws Exception { String node = "0"; <START> Map<String, String> unknownNameAndVersion = softwareNameAndVersionTags("unknown", "unknown"); <END> Map<String, String> knownNameAndVersion = softwareNameAndVersionTags("A", "B"); try (ServerSocketChannel ss = ServerSocketChannel.open()) { ss.bind(new InetSocketAddress(0)); InetSocketAddress serverAddress = (InetSocketAddress) ss.getLocalAddress(); Thread sender = createSender(serverAddress, randomPayload(1)); sender.start(); SocketChannel channel = ss.accept(); channel.configureBlocking(false); selector.register(node, channel); assertEquals(1, getMetric("connections", unknownNameAndVersion).metricValue()); assertEquals(ClientInformation.EMPTY, selector.channel(node).channelMetadataRegistry().clientInformation()); ClientInformation clientInformation = new ClientInformation("A", "B"); selector.channel(node).channelMetadataRegistry() .registerClientInformation(clientInformation); assertEquals(clientInformation, selector.channel(node).channelMetadataRegistry().clientInformation()); assertEquals(0, getMetric("connections", unknownNameAndVersion).metricValue()); assertEquals(1, getMetric("connections", knownNameAndVersion).metricValue()); selector.close(node); assertEquals(0, getMetric("connections", knownNameAndVersion).metricValue()); } }</code><technical_language>constant here</technical_language>

Target:
public void testConnectionsByClientMetric() throws Exception { String node = "0"; Map<String, String> unknownNameAndVersion = softwareNameAndVersionTags( ClientInformation.UNKNOWN_NAME_OR_VERSION, ClientInformation.UNKNOWN_NAME_OR_VERSION); Map<String, String> knownNameAndVersion = softwareNameAndVersionTags("A", "B"); try (ServerSocketChannel ss = ServerSocketChannel.open()) { ss.bind(new InetSocketAddress(0)); InetSocketAddress serverAddress = (InetSocketAddress) ss.getLocalAddress(); Thread sender = createSender(serverAddress, randomPayload(1)); sender.start(); SocketChannel channel = ss.accept(); channel.configureBlocking(false); selector.register(node, channel); assertEquals(1, getMetric("connections", unknownNameAndVersion).metricValue()); assertEquals(ClientInformation.EMPTY, selector.channel(node).channelMetadataRegistry().clientInformation()); ClientInformation clientInformation = new ClientInformation("A", "B"); selector.channel(node).channelMetadataRegistry() .registerClientInformation(clientInformation); assertEquals(clientInformation, selector.channel(node).channelMetadataRegistry().clientInformation()); assertEquals(0, getMetric("connections", unknownNameAndVersion).metricValue()); assertEquals(1, getMetric("connections", knownNameAndVersion).metricValue()); selector.close(node); assertEquals(0, getMetric("connections", knownNameAndVersion).metricValue()); } }
Source:
<code>private static Archive<?> getDeployment() { WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME); war.addPackage(AsyncServlet.class.getPackage()); war.setWebXML(SimpleServlet.class.getPackage(), "web.xml"); <START> war.addAsWebInfResource(DistributableTestCase.class.getPackage(), "jboss-all_fine.xml", "jboss-all.xml"); <END> return war; }</code><technical_language>This test jboss-all_fine.xml file FineWebFailoverTestCase.java, a new for covering reference existing server profile a jboss-all.xml file? (at present distributable-web.xml file in testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/web/persistence/distributable-web.xml)</technical_language>

Target:
private static Archive<?> getDeployment() { WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME); war.addPackage(AsyncServlet.class.getPackage()); war.setWebXML(SimpleServlet.class.getPackage(), "web.xml"); war.addAsWebInfResource(AsyncServletTestCase.class.getPackage(), "jboss-all.xml", "jboss-all.xml"); return war; }
Source:
<code>public void registerRecipeSerialziers(RegistryEvent.Register<IRecipeSerializer<?>> event) { CraftingHelper.register(AndCondition.Serializer.INSTANCE); CraftingHelper.register(FalseCondition.Serializer.INSTANCE); CraftingHelper.register(ItemExistsCondition.Serializer.INSTANCE); CraftingHelper.register(ModLoadedCondition.Serializer.INSTANCE); CraftingHelper.register(NotCondition.Serializer.INSTANCE); CraftingHelper.register(OrCondition.Serializer.INSTANCE); CraftingHelper.register(TrueCondition.Serializer.INSTANCE); <START> CraftingHelper.register(new ResourceLocation("forge", "compound"), IngredientNBT.Serializer.INSTANCE); <END> CraftingHelper.register(new ResourceLocation("forge", "nbt"), CompoundIngredient.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("minecraft", "item"), VanillaIngredientSerializer.INSTANCE); event.getRegistry().register(new ConditionalRecipe.Serializer<IRecipe<?>>().setRegistryName(new ResourceLocation("forge", "conditional"))); }</code><technical_language>front. Is this correct</technical_language>

Target:
public void registerRecipeSerialziers(RegistryEvent.Register<IRecipeSerializer<?>> event) { CraftingHelper.register(AndCondition.Serializer.INSTANCE); CraftingHelper.register(FalseCondition.Serializer.INSTANCE); CraftingHelper.register(ItemExistsCondition.Serializer.INSTANCE); CraftingHelper.register(ModLoadedCondition.Serializer.INSTANCE); CraftingHelper.register(NotCondition.Serializer.INSTANCE); CraftingHelper.register(OrCondition.Serializer.INSTANCE); CraftingHelper.register(TrueCondition.Serializer.INSTANCE); CraftingHelper.register(TagEmptyCondition.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("forge", "compound"), CompoundIngredient.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("forge", "nbt"), IngredientNBT.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("minecraft", "item"), VanillaIngredientSerializer.INSTANCE); event.getRegistry().register(new ConditionalRecipe.Serializer<IRecipe<?>>().setRegistryName(new ResourceLocation("forge", "conditional"))); }
Source:
<code>public TmfExperiment(final Class<? extends ITmfEvent> type, final String path, final ITmfTrace[] traces, final int indexPageSize, final @Nullable IResource resource) { initExperiment(type, path, traces, indexPageSize, resource, <START> null); <END> }</code><technical_language>pass TmfTraceType.DEFAULT_EXPERIMENT_TYPE instead</technical_language>

Target:
public TmfExperiment(final Class<? extends ITmfEvent> type, final String path, final ITmfTrace[] traces, final int indexPageSize, final @Nullable IResource resource) { initExperiment(type, path, traces, indexPageSize, resource); }
Source:
<code>public static TransitiveClosureGraph accessClosureGraph(final ISearchContext context, final CallOperationHelper helper) { <START> String id = TransitiveClosureGraph.class.getSimpleName() + "::" + helper.getCalledQuery().getFullyQualifiedName(); <END> return context.accessBackendLevelCache(id, TransitiveClosureGraph.class, new IProvider<TransitiveClosureGraph>() { @Override public TransitiveClosureGraph get() { try { return new TransitiveClosureGraph(helper, context); } catch (LocalSearchException e) { throw new RuntimeException(e); } } }); }</code><technical_language>This method is called operation call for IMHO a string concatenation expensive. cache API allows usage of Object keys, a single object (or a Pair of class+helper.getCalledQuery) instead</technical_language>

Target:
public static TransitiveClosureGraph accessClosureGraph(final ISearchContext context, final CallOperationHelper helper) { return context.accessBackendLevelCache(new TransitiveClosureGraphKey(helper.getCalledQuery()), TransitiveClosureGraph.class, new IProvider<TransitiveClosureGraph>() { @Override public TransitiveClosureGraph get() { try { return new TransitiveClosureGraph(helper, context); } catch (LocalSearchException e) { throw new RuntimeException(e); } } }); }
Source:
<code>public static KinesisRegion fromString(String value) { return EnumSet.allOf(KinesisRegion.class) .stream() <START> .filter(x -> x.toString().equals(value)) <END> .findFirst() .orElseThrow(() -> new IAE("Region must be one of: %s", getNames())); }</code><technical_language>sense convert upper case characters</technical_language>

Target:
public static KinesisRegion fromString(String value) { return EnumSet.allOf(KinesisRegion.class) .stream() .filter(x -> x.serialize().equals(value)) .findFirst() .orElseThrow(() -> new IAE("Invalid region %s, region must be one of: %s", value, getNames())); }
Source:
<code>private static FileDialog createNewFileDialog(Shell parent, int style) { String desiredPath = fOverridePath; fOverride = false; return new FileDialog(parent, style) { @Override public String open() { return <START> desiredPath; <END> } @Override public String getFileName() { return desiredPath != null ? desiredPath.substring(FILE_SEPARATOR + 1) : null; } @Override public String[] getFilterNames() { return desiredPath == null ? null : desiredPath.split(LIST_SEPARATOR); } }; }</code><technical_language>selected file</technical_language>

Target:
private static FileDialog createNewFileDialog(Shell parent, int style) { String[] desiredPath = fOverridePath; fOverride = false; return new FileDialog(parent, style) { @Override public String open() { return desiredPath != null ? desiredPath[0] : null; } @Override protected void checkSubclass() { } @Override public String getFileName() { return desiredPath != null ? desiredPath[0].substring(desiredPath[0].lastIndexOf(FILE_SEPARATOR) + 1) : null; } @Override public String[] getFileNames() { return desiredPath; } }; }
Source:
<code>void refreshPoolsForMasterPool(Pool pool, boolean updateStackDerived, boolean lazy, Map<String, Product> changedProducts) { List<Pool> subscriptionPools; <START> pool.setLocked(true); <END> if (pool.getSubscriptionId() != null) { subscriptionPools = this.poolCurator.getPoolsBySubscriptionId(pool.getSubscriptionId()).list(); } else { subscriptionPools = pool.getId() != null ? Collections.<Pool>singletonList(this.poolCurator.get(pool.getId())) : Collections.<Pool>singletonList(pool); } log.debug("Found pools for subscription {}", subscriptionPools.size(), pool.getSubscriptionId()); if (log.isDebugEnabled()) { for (Pool p : subscriptionPools) { log.debug(" owner={} - {}", p.getOwner().getKey(), p); } } for (Pool subPool : subscriptionPools) { Product product = subPool.getProduct(); if (product != null) { Product update = changedProducts.get(product.getId()); if (update != null) { subPool.setProduct(update); } } product = subPool.getDerivedProduct(); if (product != null) { Product update = changedProducts.get(product.getId()); if (update != null) { subPool.setDerivedProduct(update); } } } removeAndDeletePoolsOnOtherOwners(subscriptionPools, pool); Long originalQuantity = pool.getQuantity(); createAndEnrichPools(pool, subscriptionPools); Set<String> updatedMasterPools = updatePoolsForMasterPool( subscriptionPools, pool, originalQuantity, updateStackDerived, changedProducts); regenerateCertificatesByEntIds(updatedMasterPools, lazy); }</code><technical_language>Try interlace logical blocks operations. This is right in middle of declaration for pools code populates whitespace separate visually</technical_language>

Target:
void refreshPoolsForMasterPool(Pool pool, boolean updateStackDerived, boolean lazy, Map<String, Product> changedProducts) { List<Pool> subscriptionPools; if (pool.getSubscriptionId() != null) { subscriptionPools = this.poolCurator.getPoolsBySubscriptionId(pool.getSubscriptionId()).list(); } else { subscriptionPools = pool.getId() != null ? Collections.<Pool>singletonList(this.poolCurator.get(pool.getId())) : Collections.<Pool>singletonList(pool); } log.debug("Found pools for subscription {}", subscriptionPools.size(), pool.getSubscriptionId()); if (log.isDebugEnabled()) { for (Pool p : subscriptionPools) { log.debug(" owner={} - {}", p.getOwner().getKey(), p); } } for (Pool subPool : subscriptionPools) { Product product = subPool.getProduct(); if (product != null) { Product update = changedProducts.get(product.getId()); if (update != null) { subPool.setProduct(update); } } product = subPool.getDerivedProduct(); if (product != null) { Product update = changedProducts.get(product.getId()); if (update != null) { subPool.setDerivedProduct(update); } } if (pool.isLocked()) { subPool.setLocked(true); } } removeAndDeletePoolsOnOtherOwners(subscriptionPools, pool); Long originalQuantity = pool.getQuantity(); createAndEnrichPools(pool, subscriptionPools); Set<String> updatedMasterPools = updatePoolsForMasterPool( subscriptionPools, pool, originalQuantity, updateStackDerived, changedProducts); regenerateCertificatesByEntIds(updatedMasterPools, lazy); }
Source:
<code>public ZkBaseDataAccessor<byte[]> getByteArrayZkBaseDataAccessor() { ZkBaseDataAccessor<byte[]> byteArrayZkBaseDataAccessor = _byteArrayZkBaseDataAccessor; if (byteArrayZkBaseDataAccessor != null) { return byteArrayZkBaseDataAccessor; } synchronized (this) { if (_byteArrayZkBaseDataAccessor == null) { _byteArrayZkBaseDataAccessor = new ZkBaseDataAccessor<>(_zkAddr, new ZkSerializer() { @Override public byte[] serialize(Object o) throws ZkMarshallingError { <START> throw new UnsupportedOperationException("serialize() is not supported yet!"); <END> } @Override public Object deserialize(byte[] bytes) throws ZkMarshallingError { return bytes; } }); } return _byteArrayZkBaseDataAccessor; } }</code><technical_language>nit, I "yet" is necessary. "serialize() is supported!" "write is supported!"</technical_language>

Target:
public ZkBaseDataAccessor<byte[]> getByteArrayZkBaseDataAccessor() { ZkBaseDataAccessor<byte[]> byteArrayZkBaseDataAccessor = _byteArrayZkBaseDataAccessor; if (byteArrayZkBaseDataAccessor != null) { return byteArrayZkBaseDataAccessor; } synchronized (this) { if (_byteArrayZkBaseDataAccessor == null) { _byteArrayZkBaseDataAccessor = new ZkBaseDataAccessor<>(_zkAddr, new ZkSerializer() { @Override public byte[] serialize(Object o) throws ZkMarshallingError { throw new UnsupportedOperationException("serialize() is not supported."); } @Override public Object deserialize(byte[] bytes) throws ZkMarshallingError { return bytes; } }); } return _byteArrayZkBaseDataAccessor; } }
Source:
<code>public void init() throws Exception { final File file = new File("src/test/resources/com/puppycrawl/tools/" <START> + "checkstyle/xpath/InputXpathQueryGenerator.java"); <END> rootAst = TestUtils.parseFile(file); }</code><technical_language>Class extend AbstractPathTestSupport directory path defined in getPath</technical_language>

Target:
public void init() throws Exception { final File file = new File(getPath("InputXpathQueryGenerator.java")); rootAst = TestUtils.parseFile(file); }
Source:
<code>public String printMatchingStats() { String stats = ""; for (int i = 0; i<fTraces.length; i++) { <START> stats += "Trace " + i + ": " + fUnmatched[i].size() + " unmatched events"; END> } return stats; }</code><technical_language>Instead of String += otherString, more efficient a StringBuilder .append() (especially in a loop), return sb.toString() end</technical_language>

Target:
public String printMatchingStats() { StringBuilder b = new StringBuilder(); for (int i = 0; i < fTraces.length; i++) { b.append("Trace " + i + ": " + fUnmatched[i].size() + " unmatched events"); } return b.toString(); }
Source:
<code>public void onLocationChanged(Location l) { boolean firstFix = false; if (mLastLocation == null) { firstFix = true; } mLastLocation = l; if (mListener != null) { mListener.onLocationChanged(l); } if (firstFix) { setMyLocation(true, false); <START> onFocusChanged(null,null,l); <END> } }</code><technical_language>realized this change is in this branch. changed this model in a previous PR this callback GPS fix, this branch rebased develop advantage of new structure. wait do this merge other PR for scripting Amazon classes debasing is done in step</technical_language>

Target:
public void onLocationChanged(Location l) { boolean firstFix = false; if (mLastLocation == null) { firstFix = true; } mLastLocation = l; if (mListener != null) { mListener.onLocationChanged(l); } if (firstFix) { setMyLocation(true, false); } }
Source:
<code>public XmlResponseQueueTransformer( Parser parser, PrintWriterProvider pwp, MetacardMarshaller mcm, MimeType mimeType) { super(parser); this.fjp = <START> new ForkJoinPool( <END> Math.min(0x7fff, Runtime.getRuntime().availableProcessors()), new ForkJoinPoolFactory(), null, false); geometryTransformer = new GeometryTransformer(parser); this.printWriterProvider = pwp; this.metacardMarshaller = mcm; this.mimeType = mimeType; try { mimeType.setPrimaryType("text"); mimeType.setSubType("xml"); } catch (MimeTypeParseException e) { LOGGER.info("Failure creating MIME type", e); throw new ExceptionInInitializerError(e); } }</code><technical_language>extract this a factory method, possibly ForkJoinPoolFactory class itself. need for this in other places time extracting out a method easier turn factory a common utility class</technical_language>

Target:
public XmlResponseQueueTransformer( Parser parser, PrintWriterProvider pwp, MetacardMarshaller mcm, MimeType mimeType) { super(parser); this.fjp = ForkJoinPoolFactory.getNewForkJoinPool(null, false); geometryTransformer = new GeometryTransformer(parser); this.printWriterProvider = pwp; this.metacardMarshaller = mcm; this.mimeType = mimeType; try { mimeType.setPrimaryType("text"); mimeType.setSubType("xml"); } catch (MimeTypeParseException e) { LOGGER.info("Failure creating MIME type", e); throw new ExceptionInInitializerError(e); } }
Source:
<code>public void testEarlySubscribe() { PublishSubscribeChannel channel = new PublishSubscribeChannel(mock(Executor.class)); try { <START> channel.subscribe(mock(MessageHandler.class)); <END> fail("expected Exception"); } catch (IllegalStateException e) { assertThat(e.getMessage(), equalTo("When providing an Executor, you cannot subscribe() until the channel " + "bean is fully initialized by the framework. Do not subscribe in a @Bean definition")); } channel.setBeanFactory(mock(BeanFactory.class)); channel.afterPropertiesSet(); channel.subscribe(mock(MessageHandler.class)); }</code><technical_language>Mock? pretty simple Lambda: channel.subscribe(m -> {}); :smile:</technical_language>

Target:
public void testEarlySubscribe() { PublishSubscribeChannel channel = new PublishSubscribeChannel(mock(Executor.class)); try { channel.subscribe(m -> { }); channel.setBeanFactory(mock(BeanFactory.class)); channel.afterPropertiesSet(); fail("expected Exception"); } catch (IllegalStateException e) { assertThat(e.getMessage(), equalTo("When providing an Executor, you cannot subscribe() until the channel " + "bean is fully initialized by the framework. Do not subscribe in a @Bean definition")); } }
Source:
<code>public static Filter createFilterFromFilterSpec(Description description, String filterSpec) throws FilterFactoryNotCreatedException { if (filterSpec.contains("=")) { String[] tuple = filterSpec.split("=", 2); <START> return createFilter(tuple[0], new FilterFactoryParams(description, tuple[1])); <END> } else { return createFilter(filterSpec, new FilterFactoryParams(description)); } }</code><technical_language>@kcooney, is this hoping add descriptions, Noel hold add descriptions this is done</technical_language>

Target:
public static Filter createFilterFromFilterSpec(Description description, String filterSpec) throws FilterFactory.FilterNotCreatedException { String[] tuple; if (filterSpec.contains("=")) { tuple = filterSpec.split("=", 2); } else { tuple = new String[]{ filterSpec, "" }; } return createFilter(tuple[0], new FilterFactoryParams(tuple[1])); }
Source:
<code>Observable<Output> play( Observable<String> words, Observable<String> letters) { return Observable .combineLatest( words, letters.startWith(""), (word, letter) -> new AbstractMap.SimpleEntry<>(word, letter)) .scan( <START> new Output( null, null, Collections.emptySet(), Collections.emptySet(), Collections.emptyList(), null), <END> (state, entry) -> { System.out.println(state + " -> " + entry); if (state == null || state.status != Status.PLAYING) { return createNewGame(entry.getKey()); } else { return processNewLetter(state, entry.getValue()); } }) .skip(1); }</code><technical_language>Constructors require pass in null for some of parameters is pretty good sign (1) constructor overloads (2) static factory methods. Constructor overloads: java Output() { // pass another method set some fields this(...); } Static factory method: java static Output empty() { return new Output(...empty fields...); }</technical_language>

Target:
Observable<Output> play( Observable<String> words, Observable<String> letters) { return Observable .combineLatest( words, letters.startWith(""), (word, letter) -> new AbstractMap.SimpleEntry<>(word, letter)) .scan( Output.empty(), (state, entry) -> { System.out.println(state + " -> " + entry); if (state == null || state.status != Status.PLAYING) { return createNewGame(entry.getKey()); } else { return processNewLetter(state, entry.getValue()); } }) .skip(1); }
Source:
<code>public void testPrefixHeaderArgsHandlesNestedHeaderFilePaths() { <START> String headerPathStr = "include/subdir/stdafx.h"; <END> Path headerPath = Paths.get(headerPathStr); assertThat(windowsPreprocessor.prefixHeaderArgs(headerPath), contains("/Yc", headerPathStr)); }</code><technical_language>for forth. windows builds <LINK_0> kinda broken I missed error here. windows paths "\" opposed "/". this is for Visual C++, is windows, "\" Junit Assume(Platform.detect == Platform.WINDOWS), com.facebook.buck.util.environment.Platform test runs windows. include target in BUCK file</technical_language>

Target:
public void testPrefixHeaderArgsHandlesNestedHeaderFilePaths() { Assume.assumeThat(Platform.detect(), is(WINDOWS)); String headerPathStr = "include\\subdir\\stdafx.h"; Path headerPath = Paths.get(headerPathStr); assertThat(windowsPreprocessor.prefixHeaderArgs(headerPath), contains("/Yc", headerPathStr)); }