Permalink
Browse files

Checkstyle fixes

  • Loading branch information...
LadyCailin committed Oct 10, 2018
1 parent dd1ed43 commit 856ba9f69d422b026457fa57e8a55a7fdd426b16
@@ -25,7 +25,7 @@
public final class CClassType extends Construct {
public static final String PATH_SEPARATOR = "::";
private static final Map<String, CClassType> CACHE = new HashMap<>();
@SuppressWarnings("FieldNameHidesFieldInSuperclass")
public static final CClassType TYPE = new CClassType("ms::lang::ClassType", Target.UNKNOWN);
@@ -59,7 +59,7 @@ public int compare(String o1, String o2) {
* @return
*/
public static CClassType get(String type) {
// This must change once user types are added
// This must change once user types are added
type = NativeTypeList.resolveType(type);
assert type != null;
if(!CACHE.containsKey(type)) {
@@ -271,11 +271,11 @@ public boolean unsafeIsExtendedBy(CClassType checkClass) {
}
return t;
}
/**
* Returns the package that this class is in. If the class is not in a package, or if this is a class union, null
* Returns the package that this class is in. If the class is not in a package, or if this is a class union, null
* is returned.
* @return
* @return
*/
public CPackage getPackage() {
if(isTypeUnion) {
@@ -287,11 +287,11 @@ public CPackage getPackage() {
String[] parts = val().split(Pattern.quote(PATH_SEPARATOR));
return new CPackage(Target.UNKNOWN, ArrayUtils.slice(parts, 0, parts.length - 2));
}
/**
* Returns the name of the class type without the package. If this is a type union, then each type is simplified,
* and returned as a string such as "int|string".
* @return
* @return
*/
public String getSimpleName() {
List<String> parts = new ArrayList<>();
@@ -16,10 +16,10 @@
*/
@typeof("ms::lang::Package")
public class CPackage extends Construct {
@SuppressWarnings("FieldNameHidesFieldInSuperclass")
public static final CClassType TYPE = CClassType.get("ms::lang::Package");
public CPackage(Target t, String... parts) {
super(StringUtils.Join(parts, CClassType.PATH_SEPARATOR), Construct.ConstructType.IDENTIFIER, t);
}
@@ -47,6 +47,6 @@ public Version since() {
@Override
public CClassType[] getInterfaces() {
return new CClassType[0];
}
}
}
@@ -30,12 +30,12 @@ public static boolean isInstanceof(Mixed value, String instanceofThis) {
}
return false;
}
/**
* Returns whether or not a given MethodScript value is an instanceof the specified MethodScript type.
* @param value
* @param instanceofThis
* @return
* @return
*/
public static boolean isInstanceof(Mixed value, Class<? extends Mixed> instanceofThis) {
String typeof = typeof(instanceofThis);
@@ -10,7 +10,6 @@
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Predicate;
/**
* A utility class for managing the native class lists.
@@ -24,7 +23,7 @@
* within the native types (not user defined types). If the class can't be found, null is returned,
* but that just means that it's not defined in the native types, not that it doesn't exist at all.
* @param simpleName
* @return
* @return
*/
public static String resolveType(String simpleName) {
// Optimization, using internal members
@@ -42,7 +41,7 @@ public static String resolveType(String simpleName) {
}
return null;
}
/**
* Returns a list of all the known native classes.
*
@@ -9,7 +9,6 @@
import com.laytonsmith.annotations.MEnum;
import com.laytonsmith.annotations.api;
import com.laytonsmith.annotations.core;
import com.laytonsmith.annotations.typeof;
import com.laytonsmith.core.CHVersion;
import com.laytonsmith.core.Optimizable;
import com.laytonsmith.core.ParseTree;
@@ -41,7 +40,6 @@
import com.laytonsmith.core.exceptions.CRE.CREThrowable;
import com.laytonsmith.core.exceptions.ConfigCompileException;
import com.laytonsmith.core.exceptions.ConfigRuntimeException;
import com.laytonsmith.core.natives.interfaces.Mixed;
import com.laytonsmith.persistence.DataSourceFactory;
import com.laytonsmith.persistence.PersistenceNetwork;
@@ -671,7 +669,7 @@ public Version since() {
};
}
}
@api
public static class get_classes extends AbstractFunction {
@@ -724,6 +722,6 @@ public String docs() {
public Version since() {
return CHVersion.V3_3_3;
}
}
}
@@ -42,7 +42,7 @@ public void setUp() {
@Test
public void testBasicKeywordUsage() throws Exception {
assertEquals("complex_try(null,assign(ms::lang::IOException,@e,null),null,assign(ms::lang::Exception,@e,null),null,null)",
assertEquals("complex_try(null,assign(ms::lang::IOException,@e,null),null,assign(ms::lang::Exception,@e,null),null,null)",
optimize("try { } catch (IOException @e){ } catch (Exception @e){ } finally { }"));
}

0 comments on commit 856ba9f

Please sign in to comment.