Consistently use com.google.inject.Inject instead of javax.inject.Inject
JEE containers intercept JSR330 annotations and are failing to deploy gerrit.war, here example of Wildfly 8: [1]. This change rectifies it by using consistently Guice's own annotations to prevent it. Here is fixed deployment on Wildfly [2], note that weld service was started successfully. [1] http://paste.openstack.org/show/117008 [2] http://paste.openstack.org/show/117014 Change-Id: Idedd9e44352ced5166b62fa09c4b42971e666aaa
This commit is contained in:
@@ -27,6 +27,7 @@ import com.google.gerrit.server.ssh.SshKeyCache;
|
||||
import com.google.gerrit.server.util.TimeUtil;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.gwtorm.server.SchemaFactory;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import com.jcraft.jsch.JSch;
|
||||
import com.jcraft.jsch.JSchException;
|
||||
@@ -36,8 +37,6 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Collections;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class AccountCreator {
|
||||
|
||||
private SchemaFactory<ReviewDb> reviewDbProvider;
|
||||
|
@@ -18,12 +18,11 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gerrit.extensions.registration.DynamicSet;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* Universal implementation of the AuthBackend that works with the injected
|
||||
* set of AuthBackends.
|
||||
|
@@ -16,12 +16,11 @@ package com.google.gerrit.server.change;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@Singleton
|
||||
class MergeabilityCheckQueue {
|
||||
private final Set<Change.Id> pending = Sets.newHashSet();
|
||||
|
@@ -17,6 +17,7 @@ package com.google.gerrit.server.git.validators;
|
||||
import com.google.gerrit.extensions.registration.DynamicSet;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.server.validators.ValidationException;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
@@ -27,8 +28,6 @@ import org.eclipse.jgit.transport.UploadPack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class UploadValidators implements PreUploadHook {
|
||||
|
||||
private final DynamicSet<UploadValidationListener> uploadValidationListeners;
|
||||
|
@@ -40,6 +40,7 @@ import com.google.gerrit.server.util.ThreadLocalRequestContext;
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Binding;
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.Key;
|
||||
import com.google.inject.Module;
|
||||
@@ -56,7 +57,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@@ -16,12 +16,11 @@ package com.google.gerrit.sshd;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.gerrit.extensions.annotations.PluginName;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.binder.LinkedBindingBuilder;
|
||||
|
||||
import org.apache.sshd.server.Command;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public abstract class PluginCommandModule extends CommandModule {
|
||||
private CommandName command;
|
||||
|
||||
|
@@ -16,12 +16,11 @@ package com.google.gerrit.sshd;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.gerrit.extensions.annotations.PluginName;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.binder.LinkedBindingBuilder;
|
||||
|
||||
import org.apache.sshd.server.Command;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* Binds one SSH command to the plugin name itself.
|
||||
* <p>
|
||||
|
@@ -17,6 +17,7 @@ package com.google.gerrit.sshd;
|
||||
import com.google.gerrit.server.plugins.Plugin;
|
||||
import com.google.gerrit.server.plugins.ReloadPluginListener;
|
||||
import com.google.gerrit.server.plugins.StartPluginListener;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Key;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.Singleton;
|
||||
@@ -25,8 +26,6 @@ import org.apache.sshd.server.Command;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@Singleton
|
||||
class SshPluginStarterCallback
|
||||
implements StartPluginListener, ReloadPluginListener {
|
||||
|
@@ -29,14 +29,13 @@ import com.google.gerrit.server.ioutil.ColumnFormatter;
|
||||
import com.google.gerrit.sshd.CommandMetaData;
|
||||
import com.google.gerrit.sshd.SshCommand;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.kohsuke.args4j.Argument;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* Implements a command that allows the user to see the members of a group.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user