Skip to content

Commit

Permalink
Reducing visibility of utility classes
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Feb 13, 2018
1 parent 5013823 commit 8c17004
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@

/**
* Utility class for converting between JSON and Java Objects.
*
* @deprecated Visisibility will be reduced.
*/
@Deprecated
public class BeanToJsonConverter {
class BeanToJsonConverter {

private static final int MAX_DEPTH = 5;

Expand Down Expand Up @@ -101,7 +98,7 @@ public JsonElement convertObject(Object object) {
}

@SuppressWarnings("unchecked")
private JsonElement convertObject(Object toConvert, int maxDepth) throws Exception {
private JsonElement convertObject(Object toConvert, int maxDepth) {
if (toConvert == null) {
return JsonNull.INSTANCE;
}
Expand Down
20 changes: 5 additions & 15 deletions java/client/src/org/openqa/selenium/json/JsonToBeanConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
Expand All @@ -45,10 +44,9 @@
import java.util.function.Function;

/**
* @deprecated Visibility will be reduced. Use {@link Json#toType(Object, Type)}.
* Utility class for converting between JSON and Java Objects.
*/
@Deprecated
public class JsonToBeanConverter {
class JsonToBeanConverter {

private ErrorCodes errorCodes = new ErrorCodes();

Expand Down Expand Up @@ -238,9 +236,7 @@ private <T> T convert(Class<T> clazz, Object source, int depth) {
private Method getMethod(Class<?> clazz, String methodName) {
try {
return clazz.getMethod(methodName, String.class);
} catch (SecurityException e) {
// fall through
} catch (NoSuchMethodException e) {
} catch (SecurityException | NoSuchMethodException e) {
// fall through
}

Expand Down Expand Up @@ -315,11 +311,7 @@ private <T> T convertBean(Class<T> clazz, JsonObject toConvert, int depth) {
value = null;
}
write.invoke(t, convert(type, value, depth + 1));
} catch (IllegalArgumentException e) {
throw propertyWriteException(property, value, type, e);
} catch (IllegalAccessException e) {
throw propertyWriteException(property, value, type, e);
} catch (InvocationTargetException e) {
} catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
throw propertyWriteException(property, value, type, e);
}
}
Expand All @@ -330,9 +322,7 @@ private <T> T convertBean(Class<T> clazz, JsonObject toConvert, int depth) {
private <T> T newInstance(Class<T> clazz) {
try {
return clazz.newInstance();
} catch (InstantiationException e) {
throw new WebDriverException(e);
} catch (IllegalAccessException e) {
} catch (InstantiationException | IllegalAccessException e) {
throw new WebDriverException(e);
}
}
Expand Down

0 comments on commit 8c17004

Please sign in to comment.