Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

squid:S1118 - Utility classes should not have public constructors #1051

Merged
merged 1 commit into from
Feb 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package br.com.caelum.vraptor.observer.download;

import com.thoughtworks.xstream.InitializationException;

import static com.google.common.base.Objects.firstNonNull;
import static java.util.Objects.requireNonNull;

Expand All @@ -20,6 +22,10 @@
@Vetoed
public final class DownloadBuilder {

private DownloadBuilder () {
throw new InitializationException("Not allowed to initialize");
}

/**
* Creates an instance for build a {@link FileDownload}.<br>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import javax.enterprise.inject.Vetoed;

import com.thoughtworks.xstream.InitializationException;
import org.jboss.weld.bean.proxy.ProxyObject;
import org.jboss.weld.interceptor.util.proxy.TargetInstanceProxy;

Expand All @@ -30,6 +31,9 @@
*/
@Vetoed
public final class CDIProxies {
private CDIProxies(){
throw new InitializationException("Not allowed to initialize");
}

public static boolean isCDIProxy(Class<?> type) {
return ProxyObject.class.isAssignableFrom(type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package br.com.caelum.vraptor.util;

import com.thoughtworks.xstream.InitializationException;

import java.util.ArrayList;
import java.util.List;

Expand All @@ -28,8 +30,11 @@
* @author Lucas Cavalcanti
*/
@Vetoed
public class StringUtils {
public final class StringUtils {

private StringUtils(){
throw new InitializationException("Not allowed to initialize");
}
public static String decapitalize(String name) {
if (name.length() == 1) {
return name.toLowerCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@
import br.com.caelum.vraptor.serialization.JSONSerialization;
import br.com.caelum.vraptor.serialization.RepresentationResult;
import br.com.caelum.vraptor.serialization.XMLSerialization;
import com.thoughtworks.xstream.InitializationException;

/**
* Some common results for most web based logics.
*
* @author Guilherme Silveira
*/
@Vetoed
public class Results {
public final class Results {

private Results(){
throw new InitializationException("Not allowed to initialize");
}
/**
* Offers server side forward and include for web pages.<br>
* Should be used only with end results (not logics), otherwise you might
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Collections;
import java.util.ResourceBundle;

import com.thoughtworks.xstream.InitializationException;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
Expand All @@ -32,7 +33,11 @@
import br.com.caelum.vraptor.http.route.Route;
import br.com.caelum.vraptor.validator.Message;

public class VRaptorMatchers {
public final class VRaptorMatchers {
private VRaptorMatchers(){
throw new InitializationException("Not allowed to initialize");
}

public static Matcher<Collection<?>> hasOneCopyOf(final Object item) {
return new TypeSafeMatcher<Collection<?>>(){

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.lang.reflect.Method;

import com.thoughtworks.xstream.InitializationException;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
Expand All @@ -33,8 +34,10 @@
*
* @author Guilherme Silveira
*/
public class VRaptorMatchers {

public final class VRaptorMatchers {
private VRaptorMatchers(){
throw new InitializationException("Not allowed to initialize");
}
public static TypeSafeMatcher<ControllerMethod> controllerMethod(final Method method) {
return new TypeSafeMatcher<ControllerMethod>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
package br.com.caelum.vraptor.ioc.fixture;

import br.com.caelum.vraptor.Result;
import com.thoughtworks.xstream.InitializationException;

public class HasConstructor {
public final class HasConstructor {
private HasConstructor(){
throw new InitializationException("Not allowed to initialize");
}

public HasConstructor(Result result) {
}
Expand Down