diff options
author | 2017-04-04 17:11:39 +0000 | |
---|---|---|
committer | 2017-04-05 15:18:20 +0200 | |
commit | b4060b6e53944a7c3bdc5e62b288e7293a87652a (patch) | |
tree | 59b0f1f3d3e8e99412e060bb98b5a37fe90d9b6e /src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java | |
parent | 3ac77cb94a4cf1bd1993a97fe79f2005b2b1a711 (diff) |
Refactor all ctor callsites of PathFragment to instead call a static 'create' method.
This paves the way for changing PathFragment to e.g. an abstract class with multiple subclasses. This way we can split out the windows-specific stuff into one of these concrete classes, making the code more readable and also saving memory (since the shallow heap size of the NonWindowsPathFragment subclass will hopefully be smaller than that of the current PathFragment).
This also lets us pursue gc churn optimizations. We can now do interning in PathFragment#create and can also get rid of unnecessary intermediate PathFragment allocations.
RELNOTES: None
PiperOrigin-RevId: 152145768
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java index 892f72126f..8aad421603 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java @@ -261,8 +261,8 @@ public class SkyframeLabelVisitorTest extends SkyframeLabelVisitorTestCase { scratch.file("x/y/BUILD", "sh_library(name = 'z')"); syncPackages( ModifiedFileSet.builder() - .modify(new PathFragment("x/y")) - .modify(new PathFragment("x/y/BUILD")) + .modify(PathFragment.create("x/y")) + .modify(PathFragment.create("x/y/BUILD")) .build()); reporter.removeHandler(failFastHandler); // expect errors @@ -281,7 +281,7 @@ public class SkyframeLabelVisitorTest extends SkyframeLabelVisitorTestCase { assertContainsEvent("Label '//x:y/z' crosses boundary of subpackage 'x/y'"); scratch.deleteFile("x/y/BUILD"); - syncPackages(ModifiedFileSet.builder().modify(new PathFragment("x/y/BUILD")).build()); + syncPackages(ModifiedFileSet.builder().modify(PathFragment.create("x/y/BUILD")).build()); reporter.addHandler(failFastHandler); // don't expect errors assertLabelsVisited( @@ -474,14 +474,14 @@ public class SkyframeLabelVisitorTest extends SkyframeLabelVisitorTestCase { ImmutableSet.of("//a:a"), ImmutableSet.of("//a:a"), !EXPECT_ERROR, !KEEP_GOING); Path subpackageBuildFile = scratch.file("b/c/BUILD", "exports_files(['foo'])"); - syncPackages(ModifiedFileSet.builder().modify(new PathFragment("b/c/BUILD")).build()); + syncPackages(ModifiedFileSet.builder().modify(PathFragment.create("b/c/BUILD")).build()); reporter.removeHandler(failFastHandler); // expect errors assertLabelsVisitedWithErrors(ImmutableSet.of("//a:a"), ImmutableSet.of("//a:a")); assertContainsEvent("Label '//b:c/d/foo' crosses boundary of subpackage 'b/c'"); subpackageBuildFile.delete(); - syncPackages(ModifiedFileSet.builder().modify(new PathFragment("b/c/BUILD")).build()); + syncPackages(ModifiedFileSet.builder().modify(PathFragment.create("b/c/BUILD")).build()); assertLabelsVisited( ImmutableSet.of("//a:a"), ImmutableSet.of("//a:a"), !EXPECT_ERROR, !KEEP_GOING); |