From a1f90ce376a82a862ffb7180e39f8f13e64488f6 Mon Sep 17 00:00:00 2001 From: shreyax Date: Thu, 15 Feb 2018 12:05:13 -0800 Subject: 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 --- .../devtools/build/lib/vfs/Canonicalizer.java | 36 ---------------------- 1 file changed, 36 deletions(-) delete mode 100644 src/main/java/com/google/devtools/build/lib/vfs/Canonicalizer.java (limited to 'src/main/java/com/google/devtools/build/lib/vfs/Canonicalizer.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 { - - private static final Interner FRAGMENT_INTERNER = - BlazeInterners.newWeakInterner(); - - /** - * Creates an instance of Canonicalizer tracking path fragments. - */ - public static Interner fragments() { - return FRAGMENT_INTERNER; - } - - private Canonicalizer() { - } -} -- cgit v1.2.3