Source:
<code>public static void populateCxxConstructorArg( SourcePathResolver resolver, CxxConstructorArg output, AppleNativeTargetDescriptionArg arg, BuildTarget buildTarget) { Path headerPathPrefix = AppleDescriptions.getHeaderPathPrefix(arg, buildTarget); ImmutableSortedMap<String, SourcePath> headerMap = ImmutableSortedMap.<String, SourcePath>naturalOrder() .putAll( convertAppleHeadersToPublicCxxHeaders( resolver.deprecatedPathFunction(), headerPathPrefix, arg)) .putAll( convertAppleHeadersToPrivateCxxHeaders( resolver.deprecatedPathFunction(), headerPathPrefix, arg)) .build(); if (arg.srcs.isPresent()) { ImmutableSortedSet.Builder<SourceWithFlags> nonSwiftSrcs = ImmutableSortedSet.naturalOrder(); for (SourceWithFlags src: arg.srcs.get()) { <START> if (!MoreStrings.endsWithIgnoreCase(src.getSourcePath().toString(), SWIFT_EXTENSION)) { <END> nonSwiftSrcs.add(src); } } output.srcs = Optional.of(nonSwiftSrcs.build()); } else { output.srcs = Optional.absent(); } output.platformSrcs = arg.platformSrcs; output.headers = Optional.of(SourceList.ofNamedSources(headerMap)); output.platformHeaders = arg.platformHeaders; output.prefixHeader = arg.prefixHeader; output.compilerFlags = arg.compilerFlags; output.platformCompilerFlags = arg.platformCompilerFlags; output.langCompilerFlags = arg.langCompilerFlags; output.preprocessorFlags = arg.preprocessorFlags; output.platformPreprocessorFlags = arg.platformPreprocessorFlags; output.langPreprocessorFlags = arg.langPreprocessorFlags; output.linkerFlags = arg.linkerFlags; output.platformLinkerFlags = arg.platformLinkerFlags; output.frameworks = arg.frameworks; output.libraries = arg.libraries; output.deps = arg.deps; output.headerNamespace = Optional.of(""); output.cxxRuntimeType = arg.cxxRuntimeType; output.tests = arg.tests; }</code><technical_language>MorePaths.getFileExtension(resolver.getAbsolutePath(src.getSourcePath())) is safer</technical_language>

Target:
public static void populateCxxConstructorArg( SourcePathResolver resolver, CxxConstructorArg output, AppleNativeTargetDescriptionArg arg, BuildTarget buildTarget) { Path headerPathPrefix = AppleDescriptions.getHeaderPathPrefix(arg, buildTarget); ImmutableSortedMap<String, SourcePath> headerMap = ImmutableSortedMap.<String, SourcePath>naturalOrder() .putAll( convertAppleHeadersToPublicCxxHeaders( resolver.deprecatedPathFunction(), headerPathPrefix, arg)) .putAll( convertAppleHeadersToPrivateCxxHeaders( resolver.deprecatedPathFunction(), headerPathPrefix, arg)) .build(); if (arg.srcs.isPresent()) { ImmutableSortedSet.Builder<SourceWithFlags> nonSwiftSrcs = ImmutableSortedSet.naturalOrder(); for (SourceWithFlags src: arg.srcs.get()) { if (!MorePaths.getFileExtension(resolver.getAbsolutePath(src.getSourcePath())) .equalsIgnoreCase(SWIFT_EXTENSION)) { nonSwiftSrcs.add(src); } } output.srcs = Optional.of(nonSwiftSrcs.build()); } else { output.srcs = Optional.absent(); } output.platformSrcs = arg.platformSrcs; output.headers = Optional.of(SourceList.ofNamedSources(headerMap)); output.platformHeaders = arg.platformHeaders; output.prefixHeader = arg.prefixHeader; output.compilerFlags = arg.compilerFlags; output.platformCompilerFlags = arg.platformCompilerFlags; output.langCompilerFlags = arg.langCompilerFlags; output.preprocessorFlags = arg.preprocessorFlags; output.platformPreprocessorFlags = arg.platformPreprocessorFlags; output.langPreprocessorFlags = arg.langPreprocessorFlags; output.linkerFlags = arg.linkerFlags; output.platformLinkerFlags = arg.platformLinkerFlags; output.frameworks = arg.frameworks; output.libraries = arg.libraries; output.deps = arg.deps; output.headerNamespace = Optional.of(""); output.cxxRuntimeType = arg.cxxRuntimeType; output.tests = arg.tests; }