Skip to content

Commit

Permalink
WELD-2199 remove unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
tremes authored and mkouba committed Aug 2, 2016
1 parent 8818a22 commit b6580d1
Show file tree
Hide file tree
Showing 21 changed files with 9 additions and 272 deletions.
@@ -1,8 +1,6 @@
package org.jboss.weld.environment.logging;


import java.net.URL;

import javax.enterprise.inject.UnsatisfiedResolutionException;

import org.jboss.logging.Logger;
Expand Down Expand Up @@ -47,9 +45,7 @@ public interface CommonLogger extends WeldEnvironmentLogger {
@Message(id = 7, value = "Error handling file path\n File: {0}\n Path: {1}", format = Format.MESSAGE_FORMAT)
void cannotHandleFilePath(Object file, Object path, @Cause Throwable cause);

@LogMessage(level = Level.ERROR)
@Message(id = 8, value = "Error loading file {0}", format = Format.MESSAGE_FORMAT)
void errorLoadingFile(Object param1);
// log message with id 8 was removed

@LogMessage(level = Level.WARN)
@Message(id = 10, value = "Could not open the stream on the url {0} when adding to the jandex index.", format = Format.MESSAGE_FORMAT)
Expand Down Expand Up @@ -85,13 +81,8 @@ public interface CommonLogger extends WeldEnvironmentLogger {
@Message(id = 20, value = "Using jandex for bean discovery", format = Format.MESSAGE_FORMAT)
void usingJandex();

@LogMessage(level = Level.WARN)
@Message(id = 21, value = "Could not close the stream for of the jandex index file for {0}.", format = Format.MESSAGE_FORMAT)
void couldNotCloseStreamOfJandexIndex(Object param1, @Cause Throwable cause);

@LogMessage(level = Level.INFO)
@Message(id = 22, value = "Found jandex index at {0}", format = Format.MESSAGE_FORMAT)
void foundJandexIndex(URL url);
// log message with id 21 was removed
// log message with id 22 was removed

@LogMessage(level = Level.DEBUG)
@Message(id = 23, value = "Archive isolation disabled - only one bean archive will be created", format = Format.MESSAGE_FORMAT)
Expand Down
Expand Up @@ -56,9 +56,7 @@ public interface WeldServletLogger extends WeldEnvironmentLogger {
@Message(id = 1004, value = "Found both WEB-INF/beans.xml and WEB-INF/classes/META-INF/beans.xml. It is not portable to use both locations at the same time. Weld is going to use: {0}", format = Format.MESSAGE_FORMAT)
void foundBothConfiguration(Object param1);

@LogMessage(level = Level.TRACE)
@Message(id = 1005, value = "Exactly one constructor ({0}) annotated with @Inject defined, using it as the bean constructor for {1}", format = Format.MESSAGE_FORMAT)
void foundOneInjectableConstructor(Object param1, Object param2);
// log message with id 1005 was removed

@LogMessage(level = Level.INFO)
@Message(id = 1006, value = "org.jboss.weld.environment.servlet.EnhancedListener used for ServletContext notifications")
Expand Down Expand Up @@ -112,11 +110,8 @@ public interface WeldServletLogger extends WeldEnvironmentLogger {
@Message(id = 1019, value = "Error creating JNDI context")
IllegalStateException errorCreatingJNDIContext(@Cause Throwable cause);

@Message(id = 1020, value = "Cannot instantiate instance of {0} with no-argument constructor.", format = Format.MESSAGE_FORMAT)
IllegalStateException cannotInstantiateInstance(Object param1, @Cause Throwable cause);

@Message(id = 1021, value = "Cannot load class for {0}.", format = Format.MESSAGE_FORMAT)
IllegalStateException cannotLoadClass(Object param1, @Cause Throwable cause);
// log message with id 1020 was removed
// log message with id 1021 was removed

@Message(id = 1022, value = "No ServiceLoader class available!")
IllegalStateException noServiceLoaderClassAvailable();
Expand All @@ -130,8 +125,7 @@ public interface WeldServletLogger extends WeldEnvironmentLogger {
@Message(id = 1025, value = "Could not create InitialContext to bind BeanManager reference in JNDI: {0}.", format = Format.MESSAGE_FORMAT)
RuntimeException couldNotCreateInitialContext(Object param1);

@Message(id = 1027, value = "Error loading Weld listener, check that Weld is on the classpath.")
IllegalStateException errorLoadingWeldListener(@Cause Throwable cause);
// log message with id 1027 was removed

@Message(id = 1028, value = "Error loading Weld ELContext Listener, check that Weld is on the classpath.")
IllegalStateException errorLoadingWeldELContextListener(@Cause Throwable cause);
Expand Down
Expand Up @@ -111,14 +111,6 @@ private static <E> Object getContextFieldValue(E obj, Class<E> clazz) throws NoS
return field.get(obj);
}

public static void restoreInstanceManager(ServletContext context) {
StandardContext stdContext = getStandardContext(context);
InstanceManager im = getInstanceManager(stdContext);
if (im instanceof WeldForwardingInstanceManager) {
setInstanceManager(stdContext, ((WeldForwardingInstanceManager) im).firstProcessor);
}
}

private static InstanceManager getInstanceManager(StandardContext stdContext) {
try {
Method method = SecurityActions.lookupMethod(stdContext.getClass(), INSTANCE_MANAGER_GETTER_NAME);
Expand Down
Expand Up @@ -6,7 +6,6 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.Asset;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.impl.BeansXml;

Expand Down Expand Up @@ -84,10 +83,6 @@ public static String extendDefaultWebXml(String extension) {
return DEFAULT_WEB_XML_PREFIX + extension + DEFAULT_WEB_XML_SUFFIX;
}

public static <T extends Archive<T>> T skipProcessor(T archive) {
return archive.add(EmptyAsset.INSTANCE, MARKER_SKIP_PROCESSOR);
}

public static <T extends Archive<?>> boolean isProcessorSkipped(T archive) {
return archive.contains(Deployments.MARKER_SKIP_PROCESSOR);
}
Expand Down
Expand Up @@ -404,11 +404,6 @@ public Class<?> getBeanType() {
return proxiedBeanType;
}

@Override
protected boolean isCreatingProxy() {
return false;
}

@Override
protected Class<? extends MethodHandler> getMethodHandlerType() {
return CombinedInterceptorAndDecoratorStackMethodHandler.class;
Expand Down
24 changes: 0 additions & 24 deletions impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java
Expand Up @@ -299,10 +299,6 @@ private static String getEnclosingPrefix(Class<?> clazz) {
return encl == null ? "" : getEnclosingPrefix(encl) + encl.getSimpleName() + '$';
}

protected boolean isCreatingProxy() {
return true;
}

/**
* Adds an additional interface that the proxy should implement. The default
* implementation will be to forward invocations to the bean instance.
Expand Down Expand Up @@ -375,15 +371,6 @@ public Class<T> getProxyClass() {
return proxyClass;
}

protected Class<T> getCachedProxyClass(String proxyClassName) {
try {
// Check to see if we already have this proxy class
return cast(classLoader.loadClass(proxyClassName));
} catch (ClassNotFoundException e) {
return null;
}
}

/**
* Returns the package and base name for the proxy class.
*
Expand All @@ -393,17 +380,6 @@ protected String getBaseProxyName() {
return baseProxyName;
}

/**
* Convenience method to determine if an object is a proxy generated by this
* factory or any derived factory.
*
* @param proxySuspect the object suspected of being a proxy
* @return true only if it is a proxy object
*/
public static boolean isProxy(Object proxySuspect) {
return proxySuspect instanceof ProxyObject;
}

/**
* Convenience method to set the underlying bean instance for a proxy.
*
Expand Down
Expand Up @@ -41,7 +41,6 @@
import org.jboss.weld.bean.InterceptorImpl;
import org.jboss.weld.bean.ManagedBean;
import org.jboss.weld.bean.NewBean;
import org.jboss.weld.bean.NewManagedBean;
import org.jboss.weld.bean.ProducerField;
import org.jboss.weld.bean.ProducerMethod;
import org.jboss.weld.bean.RIBean;
Expand Down Expand Up @@ -208,10 +207,6 @@ public void addSessionBean(SessionBean<?> bean) {
addAbstractClassBean((AbstractClassBean<?>) bean);
}

public void addNewManagedBean(NewManagedBean<?> bean) {
beans.add(bean);
}

protected void addAbstractBean(AbstractBean<?, ?> bean) {
beans.add(bean);
}
Expand Down
Expand Up @@ -321,12 +321,6 @@ public void preloadProcessBeanAttributes(Type type) {
}
}

public void preloadProcessInjectionPoint(Type... typeParameters) {
if (preloader != null && isProcessInjectionPointObserved()) {
preloader.preloadContainerLifecycleEvent(ProcessInjectionPoint.class, typeParameters);
}
}

public void preloadProcessInjectionTarget(Class<?> type) {
if (preloader != null && isProcessInjectionTargetObserved()) {
preloader.preloadContainerLifecycleEvent(ProcessInjectionTarget.class, type);
Expand Down
Expand Up @@ -20,7 +20,6 @@
import static org.jboss.weld.util.Observers.validateObserverMethod;

import java.lang.reflect.Type;
import java.util.List;

import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.Extension;
Expand All @@ -33,7 +32,6 @@
import org.jboss.weld.exceptions.IllegalStateException;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Preconditions;
import org.jboss.weld.util.collections.WeldCollections;

/**
* Implementation of the event used to notify observers for each observer method that is added.
Expand Down Expand Up @@ -80,10 +78,6 @@ public ObserverMethod<T> getObserverMethod() {
return observerMethod;
}

public List<Throwable> getDefinitionErrors() {
return WeldCollections.immutableListView(getErrors());
}

@Override
public void setObserverMethod(ObserverMethod<T> observerMethod) {
// TODO CDI-596
Expand Down
Expand Up @@ -16,8 +16,6 @@
*/
package org.jboss.weld.bootstrap.events;

import static org.jboss.weld.util.reflection.Reflections.cast;

import java.lang.reflect.Type;

import javax.enterprise.inject.spi.AnnotatedType;
Expand All @@ -41,10 +39,6 @@ private ProcessSessionBeanImpl(BeanManagerImpl beanManager, SessionBean<Object>
super(beanManager, ProcessSessionBean.class, new Type[]{bean.getAnnotated().getBaseType()}, bean);
}

public AnnotatedType<X> getAnnotatedSessionBeanClass() {
return cast(getBean().getAnnotated());
}

public String getEjbName() {
checkWithinObserverNotification();
return getBean().getEjbDescriptor().getEjbName();
Expand Down
Expand Up @@ -46,8 +46,6 @@ public interface WeldCreationalContext<T> extends org.jboss.weld.construction.ap

<S> S getIncompleteInstance(Contextual<S> bean);

boolean containsIncompleteInstance(Contextual<?> bean);

void addDependentInstance(ContextualInstance<?> contextualInstance);

void release();
Expand Down
Expand Up @@ -203,10 +203,6 @@ protected String createTypeId(RIBean<?> declaringBean) {
return injectionPoints;
}

public Set<WeldInjectionPointAttributes<?, ?>> getNewInjectionPoints() {
return newInjectionPoints;
}

/**
* Performs validation of the observer method for compliance with the specifications.
*/
Expand Down
Expand Up @@ -67,10 +67,6 @@ protected int getThreadPoolSize() {
return threadPoolSize;
}

public long getKeepAliveTime() {
return keepAliveTime;
}

@Override
public String toString() {
return String.format("TimingOutFixedThreadPoolExecutorServices [threadPoolSize=%s, keepAliveTime=%s]", threadPoolSize,
Expand Down
Expand Up @@ -53,10 +53,6 @@ public static <T> BasicInjectionTarget<T> create(EnhancedAnnotatedType<T> type,
return new BasicInjectionTarget<T>(type, bean, beanManager, injector, invoker);
}

public static <T> BasicInjectionTarget<T> createDefault(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager) {
return new BasicInjectionTarget<T>(type, bean, beanManager, null);
}

public static <T> BasicInjectionTarget<T> createDefault(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Instantiator<T> instantiator) {
return new BasicInjectionTarget<T>(type, bean, beanManager, instantiator);
}
Expand Down
Expand Up @@ -18,12 +18,8 @@

import static org.jboss.weld.util.reflection.Reflections.cast;

import java.util.Collections;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.Interceptor;

/**
Expand Down Expand Up @@ -52,14 +48,6 @@ public void preDestroy(T instance, Instantiator<T> instantiator) {
// noop
}

public List<AnnotatedMethod<? super T>> getPreDestroyMethods() {
return Collections.emptyList();
}

public List<AnnotatedMethod<? super T>> getPostConstructMethods() {
return Collections.emptyList();
}

@Override
public boolean hasPreDestroyMethods() {
return true; // we cannot say no for sure
Expand Down
7 changes: 2 additions & 5 deletions impl/src/main/java/org/jboss/weld/logging/UtilLogger.java
Expand Up @@ -29,7 +29,6 @@
import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.exceptions.IllegalArgumentException;
import org.jboss.weld.exceptions.IllegalStateException;
import org.jboss.weld.exceptions.UnsupportedOperationException;
import org.jboss.weld.exceptions.WeldException;

/**
Expand All @@ -44,8 +43,7 @@ public interface UtilLogger extends WeldLogger {

UtilLogger LOG = Logger.getMessageLogger(UtilLogger.class, Category.UTIL.getName());

@Message(id = 802, value = "XML DOM is readonly")
UnsupportedOperationException xmlDomReadonly();
// log message with id 802 was removed

@Message(id = 804, value = "{0} is not an enum", format = Format.MESSAGE_FORMAT)
IllegalArgumentException classNotEnum(Object param1);
Expand Down Expand Up @@ -101,8 +99,7 @@ public interface UtilLogger extends WeldLogger {
@Message(id = 827, value = "Initializer method may not be a generic method: {0}\n\tat {1}\n StackTrace:", format = Format.MESSAGE_FORMAT)
DefinitionException initializerMethodIsGeneric(Object param1, Object param2);

@Message(id = 832, value = "Unable to load the cache value for the key {0}", format = Format.MESSAGE_FORMAT)
WeldException unableToLoadCacheValue(Object param1, @Cause Throwable cause);
// log message with id 832 was removed

@Message(id = 833, value = "Resource injection point represents a method which doesn't follow JavaBean conventions {0}", format = Format.MESSAGE_FORMAT)
DefinitionException resourceSetterInjectionNotAJavabean(Object param1);
Expand Down

This file was deleted.

0 comments on commit b6580d1

Please sign in to comment.