From e65ef1354c6eb015f9cf361c623b2a74a253d853 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 26 Feb 2020 09:41:30 +0000 Subject: [PATCH] HHH-13876 Delete the immutable SingletonStack implementation as its no longer used --- .../util/collections/SingletonStack.java | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 hibernate-core/src/main/java/org/hibernate/internal/util/collections/SingletonStack.java diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/collections/SingletonStack.java b/hibernate-core/src/main/java/org/hibernate/internal/util/collections/SingletonStack.java deleted file mode 100644 index f1c0a00b04..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/collections/SingletonStack.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later - * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html - */ -package org.hibernate.internal.util.collections; - -import java.util.function.Consumer; -import java.util.function.Function; - -/** - * @author Steve Ebersole - */ -public class SingletonStack implements Stack { - private final T instance; - - public SingletonStack(T instance) { - this.instance = instance; - } - - @Override - public void push(T newCurrent) { - throw new UnsupportedOperationException( "Cannot push to a singleton Stack" ); - } - - @Override - public T pop() { - throw new UnsupportedOperationException( "Cannot pop from a singleton Stack" ); - } - - @Override - public T getCurrent() { - return instance; - } - - @Override - public int depth() { - return 1; - } - - @Override - public boolean isEmpty() { - return false; - } - - @Override - public void clear() { - } - - @Override - public void visitCurrentFirst(Consumer action) { - action.accept( instance ); - } - - @Override - public X findCurrentFirst(Function action) { - return action.apply( instance ); - } -}