Skip to content

Commit 1ebf15a

Browse files
committed
Merge pull request #288 from DevFactory/release/adding-private-constructor-fix-1
Utility classes should not have public constructors
2 parents e473236 + 28ee5ee commit 1ebf15a

11 files changed

Lines changed: 37 additions & 4 deletions

File tree

src/main/java/com/googlecode/objectify/cache/CachingDatastoreServiceFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
public class CachingDatastoreServiceFactory
2020
{
2121
private static String defaultMemcacheNamespace = ObjectifyFactory.MEMCACHE_NAMESPACE;
22-
22+
23+
private CachingDatastoreServiceFactory() {
24+
}
25+
2326
/**
2427
* The default namespace is the one used by Objectify for its cache. You can reset it.
2528
*/

src/main/java/com/googlecode/objectify/impl/TypeUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ public class TypeUtils
2727
PRIMITIVE_TO_WRAPPER.put(char.class, Character.class);
2828
}
2929

30+
private TypeUtils() {
31+
}
32+
3033
/**
3134
* Throw an IllegalStateException if the class does not have a no-arg constructor.
3235
*/

src/main/java/com/googlecode/objectify/impl/translate/opt/joda/JodaMoneyTranslators.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
public class JodaMoneyTranslators
1717
{
18+
private JodaMoneyTranslators() {
19+
}
20+
1821
public static void add(ObjectifyFactory fact) {
1922
fact.getTranslators().add(new MoneyStringTranslatorFactory());
2023
fact.getTranslators().add(new BigMoneyStringTranslatorFactory());

src/main/java/com/googlecode/objectify/impl/translate/opt/joda/JodaTimeTranslators.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
public class JodaTimeTranslators
1717
{
18+
private JodaTimeTranslators() {
19+
}
20+
1821
public static void add(ObjectifyFactory fact) {
1922
fact.getTranslators().add(new ReadableInstantTranslatorFactory());
2023
fact.getTranslators().add(new ReadablePartialTranslatorFactory());

src/main/java/com/googlecode/objectify/repackaged/gentyref/GenericTypeReflector.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
*/
2222
public class GenericTypeReflector {
2323
private static final Type UNBOUND_WILDCARD = new WildcardTypeImpl(new Type[]{Object.class}, new Type[]{});
24-
24+
25+
private GenericTypeReflector() {
26+
}
27+
2528
/**
2629
* Returns the erasure of the given type.
2730
*/

src/main/java/com/googlecode/objectify/repackaged/gentyref/TypeFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
*/
1616
public class TypeFactory {
1717
private static final WildcardType UNBOUND_WILDCARD = new WildcardTypeImpl(new Type[]{Object.class}, new Type[]{});
18-
18+
19+
private TypeFactory() {
20+
}
21+
1922
/**
2023
* Creates a type of class <tt>clazz</tt> with <tt>arguments</tt> as type arguments.
2124
* <p>

src/main/java/com/googlecode/objectify/util/DatastoreIntrospector.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ public class DatastoreIntrospector
3939
}
4040
}
4141
}
42+
43+
private DatastoreIntrospector() {
44+
}
4245
}

src/main/java/com/googlecode/objectify/util/DatastoreUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
*/
2020
public class DatastoreUtils
2121
{
22+
private DatastoreUtils() {
23+
}
24+
2225
/**
2326
* Turn a list of refs into a list of raw keys.
2427
*/

src/main/java/com/googlecode/objectify/util/FutureHelper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919
public class FutureHelper
2020
{
21+
private FutureHelper() {
22+
}
23+
2124
/** Quietly perform the get() on a future */
2225
public static <T> T quietGet(Future<T> future)
2326
{

src/main/java/com/googlecode/objectify/util/GenericUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
*/
1111
public class GenericUtils
1212
{
13+
private GenericUtils() {
14+
}
15+
1316
/**
1417
* Get the component type of a Collection.
1518
*/

0 commit comments

Comments
 (0)