aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java
diff options
context:
space:
mode:
authorGravatar gregce <gregce@google.com>2018-01-16 13:04:56 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-01-16 13:06:21 -0800
commit47ef92d437972aee06ab2caff2cb12cd617adc9a (patch)
tree41008957feccdf3d3473402957a8e0855d97d26a /src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java
parent225b57bfbb74a62a3212c7013ef92ce95ceaf79e (diff)
Remove ConfigurationTransitionProxy.NULL
PiperOrigin-RevId: 182099803
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java
new file mode 100644
index 0000000000..2edbb9fb0f
--- /dev/null
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java
@@ -0,0 +1,36 @@
+// Copyright 2018 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.analysis.config.transitions;
+
+import com.google.devtools.build.lib.analysis.config.BuildOptions;
+
+/**
+ * A {@link PatchTransition} to a null configuration.
+ */
+public class NullTransition implements PatchTransition {
+
+ public static final NullTransition INSTANCE = new NullTransition();
+
+ private NullTransition() {
+ }
+
+ @Override
+ public BuildOptions apply(BuildOptions options) {
+ throw new UnsupportedOperationException(
+ "This is only referenced in a few places, so it's easier and more efficient to optimize "
+ + "Blaze's transition logic in the presence of null transitions vs. actually call this "
+ + "method to get results we know ahead of time. If there's ever a need to properly "
+ + "implement this method we can always do so.");
+ }
+}