Skip to content

Commit

Permalink
cleanup: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Solntsev committed Sep 18, 2019
1 parent f4dfbcf commit fd13bec
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 216 deletions.
26 changes: 3 additions & 23 deletions framework/src/play/classloading/ApplicationClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import java.util.Map;
import java.util.function.BinaryOperator;

import static java.util.Collections.*;
import static java.util.Collections.emptyList;
import static java.util.Collections.unmodifiableList;
import static java.util.Collections.unmodifiableMap;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
import static org.apache.commons.lang.StringUtils.replace;
Expand Down Expand Up @@ -79,17 +81,6 @@ public Class<?> getClassIgnoreCase(String name) {
return allClassesByNormalizedName().get(nameLowerCased);
}

/**
* Get a class by name
*
* @param name
* The fully qualified class name
* @return The ApplicationClass or null
*/
public Class getApplicationClass(String name) {
return classes().get(name);
}

/**
* Retrieve all application classes with a specific annotation.
*
Expand All @@ -103,17 +94,6 @@ public List<Class> getAnnotatedClasses(Class<? extends Annotation> clazz) {
.collect(toList());
}

/**
* Does this class is already loaded ?
*
* @param name
* The fully qualified class name
* @return true if the class is loaded
*/
public boolean hasClass(String name) {
return classes().containsKey(name);
}

@Override
public String toString() {
return String.format("%s classes", classes().size());
Expand Down
7 changes: 5 additions & 2 deletions framework/src/play/data/binding/As.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import play.mvc.Http;
import play.mvc.Scope;

import java.lang.annotation.*;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Type;
import java.util.Map;

Expand All @@ -14,7 +18,6 @@

String[] value() default {""};
String[] lang() default {"*"};
String[] format() default {"html"};
Class<? extends TypeBinder<?>> binder() default DEFAULT.class;
Class<? extends TypeUnbinder<?>> unbinder() default DEFAULT.class;

Expand Down
4 changes: 0 additions & 4 deletions framework/src/play/data/binding/BindingAnnotations.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ public class BindingAnnotations {
private String[] profiles;
private String[] noBindingProfiles;

public BindingAnnotations() {
this(null);
}

public BindingAnnotations(Annotation[] annotations) {
this.annotations = annotations;
}
Expand Down
9 changes: 0 additions & 9 deletions framework/src/play/data/validation/Check.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ public abstract class Check {

public CheckWithCheck checkWithCheck;

public Check() {

}

public abstract boolean isSatisfied(Object validatedObject, Object value);

public void setMessage(String message, String... vars) {
Expand All @@ -18,9 +14,4 @@ public void setMessage(String message, String... vars) {
}
checkWithCheck.setVariables();
}

public CheckWithCheck getCheckWithCheck() {
return this.checkWithCheck;
}

}
8 changes: 0 additions & 8 deletions framework/src/play/mvc/After.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,4 @@
* @return List of actions to intercept
*/
String[] only() default {};

/**
* Interceptor priority (0 is high priority)
*
* @return The Interceptor priority
*/
int priority() default 0;

}
8 changes: 0 additions & 8 deletions framework/src/play/mvc/Before.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,4 @@
* @return List of actions to intercept
*/
String[] only() default {};

/**
* Interceptor priority (0 is high priority)
*
* @return The Interceptor priority
*/
int priority() default 0;

}
9 changes: 0 additions & 9 deletions framework/src/play/mvc/Catch.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,5 @@
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Catch {

Class<?>[] value() default {};

/**
* Interceptor priority (0 is high priority)
*
* @return The Interceptor priority
*/
int priority() default 0;

}
67 changes: 0 additions & 67 deletions framework/src/play/utils/ANSIConsoleAppender.java

This file was deleted.

72 changes: 0 additions & 72 deletions framework/src/play/utils/SmartFuture.java

This file was deleted.

16 changes: 5 additions & 11 deletions framework/test/play/data/binding/BinderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@
import org.junit.Test;
import play.PlayBuilder;
import play.mvc.Http;
import play.mvc.Scope;
import play.mvc.Scope.Session;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;

import static java.math.BigDecimal.TEN;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
Expand Down Expand Up @@ -142,7 +136,7 @@ public void verifyBindingOfStringMaps() {
}

@Test
public void verify_binding_of_simple_bean_collections() {
public void verify_binding_of_simple_bean_collections() throws NoSuchFieldException {

Map<String, String[]> params = new HashMap<>();

Expand All @@ -164,7 +158,7 @@ public void verify_binding_of_simple_bean_collections() {
RootParamNode rootParamNode = ParamNode.convert(params);

lst = (List<Data2>) Binder.bind(request, session, rootParamNode, "data2", lst.getClass(),
GenericListProvider.class.getDeclaredFields()[0].getGenericType(), noAnnotations);
GenericListProvider.class.getDeclaredField("listOfData2").getGenericType(), noAnnotations);
//check the size and the order
assertThat(lst.size()).isEqualTo(13);
assertThat(lst.get(0).a).isEqualTo("a0");
Expand Down Expand Up @@ -206,7 +200,7 @@ public void test_unbinding_of_collection_of_complex_types() {
d3.b = 3;

Data1[] datasArray = {d1, d2};
List<Data1> datas = Arrays.asList(new Data1[]{d2, d1, d3});
List<Data1> datas = asList(d2, d1, d3);

Map<String, Data1> mapData = new HashMap<>();
mapData.put(d1.a, d1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@

import java.io.*;
import java.text.NumberFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import static java.nio.charset.StandardCharsets.UTF_8;

Expand Down Expand Up @@ -56,7 +60,7 @@ private boolean isKnown(final String path) {

private static final Logger log = LoggerFactory.getLogger(CHtmlToPdfFlyingSaucerTransformer.class);

private static boolean accept(final File dir, final String name) {
private static boolean accept(String name) {
return name.toLowerCase().endsWith(".ttf");
}

Expand All @@ -69,7 +73,7 @@ private static void registerTTF(final File f, final _ITextRenderer renderer) {
}
}
}
else if (accept(f.getParentFile(), f.getName())) {
else if (accept(f.getName())) {
if (!renderer.isKnown(f.getAbsolutePath())) {
try {
renderer.getFontResolver().addFont(f.getAbsolutePath(),
Expand Down

0 comments on commit fd13bec

Please sign in to comment.