aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/vfs
diff options
context:
space:
mode:
authorGravatar shreyax <shreyax@google.com>2018-02-15 12:05:13 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-15 12:07:08 -0800
commita1f90ce376a82a862ffb7180e39f8f13e64488f6 (patch)
treeca325b7e8c1ec972a4c8bb2903cc51e61e8fad46 /src/main/java/com/google/devtools/build/lib/vfs
parentf70aff52a529b3f3b71e8179e52fc2b06835275c (diff)
Don't intern PathFragments when we create PackageIdentifiers. This should be a strict win:
There are only two places Canonicalizer did PathFragment interning: PackageIdentifier creation and Package creation. PackageIdentifiers are always interned by a separate interner, and so the underlying PathFragment will be in 1-1 correspondence with PackageIdentifiers (per repo). Moreover, Packages are created with a PackageIdentifier already existing, so it will use the same PathFragment of the unique PackageIdentifier. PiperOrigin-RevId: 185877942
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs')
-rw-r--r--src/main/java/com/google/devtools/build/lib/vfs/BUILD1
-rw-r--r--src/main/java/com/google/devtools/build/lib/vfs/Canonicalizer.java36
2 files changed, 0 insertions, 37 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/BUILD b/src/main/java/com/google/devtools/build/lib/vfs/BUILD
index b829858847..442a7a3d74 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/BUILD
+++ b/src/main/java/com/google/devtools/build/lib/vfs/BUILD
@@ -7,7 +7,6 @@ filegroup(
)
PATH_FRAGMENT_SOURCES = [
- "Canonicalizer.java",
"PathFragment.java",
"PathFragmentSerializationProxy.java",
"OsPathPolicy.java",
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/Canonicalizer.java b/src/main/java/com/google/devtools/build/lib/vfs/Canonicalizer.java
deleted file mode 100644
index 5243c0b8fa..0000000000
--- a/src/main/java/com/google/devtools/build/lib/vfs/Canonicalizer.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2014 The Bazel Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-package com.google.devtools.build.lib.vfs;
-
-import com.google.common.collect.Interner;
-import com.google.devtools.build.lib.concurrent.BlazeInterners;
-
-/**
- * Static singleton holder for certain interning pools.
- */
-public final class Canonicalizer<E> {
-
- private static final Interner<PathFragment> FRAGMENT_INTERNER =
- BlazeInterners.newWeakInterner();
-
- /**
- * Creates an instance of Canonicalizer tracking path fragments.
- */
- public static Interner<PathFragment> fragments() {
- return FRAGMENT_INTERNER;
- }
-
- private Canonicalizer() {
- }
-}