Skip to content

Commit

Permalink
Fix CheckStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Aug 21, 2021
1 parent a75f2ef commit 4e13edd
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

<module name="RegexpMultiline">
<property name="id" value="RegexpMultilineEmptyRowAfterClassDef"/>
<property name="format" value="^([^\r\n]* )*(class|interface|@interface|enum) [^{]*\{[\r]?\n[^\r\n}]"/>
<property name="format" value="^([^\r\n*]* )*(class|interface|@interface|enum) [^{]*\{[\r]?\n[^\r\n}]"/>
<property name="message" value="Leave empty row after class/interface/@interface/enum definition!"/>
<property name="severity" value="error"/>
<property name="fileExtensions" value="groovy,java"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import org.objectweb.asm.tree.TryCatchBlockNode;
import org.objectweb.asm.util.Printer;

// CHECKSTYLE:OFF

/**
* <b>get from asm example</b>
* <p>
Expand Down Expand Up @@ -74,9 +72,6 @@
*
* @author Eric Bruneton
*/

// CHECKSTYLE:ON

public class JasminDumper implements Opcodes {

private static final Set<String> ACCESS_KWS = new HashSet<>(Arrays
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public void accept(DexFileVisitor dfv) {

@Override
public DexAnnotationVisitor visitAnnotation(String name, Visibility visibility) {
if (name.equals("Lkotlin/Metadata;")) return null; // clean kotlin metadata
if (name.equals("Lkotlin/Metadata;")) {
return null; // clean kotlin metadata
}
if (anns == null) {
anns = new ArrayList<>(5);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public void visitDexFileVersion(int version) {

@Override
public DexClassVisitor visit(int accessFlags, String className, String superClass, String[] interfaceNames) {
if (className.startsWith("Landroidx/") || className.startsWith("Lcom/google/android/material/")) return null;
if (className.startsWith("Landroidx/") || className.startsWith("Lcom/google/android/material/")) {
return null;
}
DexClassNode cn = new DexClassNode(accessFlags, className, superClass, interfaceNames);
clzs.add(cn);
return cn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import sun.security.pkcs.SignerInfo;
import sun.security.x509.AlgorithmId;
import sun.security.x509.X500Name;

// CHECKSTYLE:ON

public class SunJarSignImpl extends AbstractJarSign {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TryCatchBlockNode;

// CHECKSTYLE:OFF

/**
* 1. Replace class A by another class B, include superclass, new for
* <p/>
Expand Down Expand Up @@ -105,9 +103,6 @@
* }
* </pre>
*/

// CHECKSTYLE:ON

public class InvocationWeaver extends BaseWeaver implements Opcodes {

private static final Type OBJECT_TYPE = Type.getType(Object.class);
Expand Down
13 changes: 2 additions & 11 deletions dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2Asm.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ private static MethodVisitor collectBasicMethodInfo(DexMethodNode methodNode, Cl
}
int access = methodNode.access;
// clear ACC_DECLARED_SYNCHRONIZED, ACC_CONSTRUCTOR and ACC_SYNTHETIC from method flags
final int cleanFlag = ~((DexConstants.ACC_DECLARED_SYNCHRONIZED | DexConstants.ACC_CONSTRUCTOR | Opcodes.ACC_SYNTHETIC));
final int cleanFlag = ~((DexConstants.ACC_DECLARED_SYNCHRONIZED | DexConstants.ACC_CONSTRUCTOR
| Opcodes.ACC_SYNTHETIC));
access &= cleanFlag;
return cv.visitMethod(access, methodNode.method.getName(), methodNode.method.getDesc(), signature, xthrows);
}
Expand Down Expand Up @@ -738,8 +739,6 @@ public void optimize(IrMethod irMethod) {
T_IR_2_J_REG_ASSIGN.transform(irMethod);
}

// CHECKSTYLE:OFF

/**
* For structure
*
Expand All @@ -762,9 +761,6 @@ public void optimize(IrMethod irMethod) {
* <p>
* to WeAreHere.class
*/

// CHECKSTYLE:ON

private static void searchEnclosing(Clz clz, List<InnerClassNode> innerClassNodes) {
Set<Clz> visitedClz = new HashSet<>();
for (Clz p = clz; p != null; p = p.enclosingClass) {
Expand All @@ -789,8 +785,6 @@ private static void searchEnclosing(Clz clz, List<InnerClassNode> innerClassNode
}
}

// CHECKSTYLE:OFF

/**
* For structure
*
Expand All @@ -814,9 +808,6 @@ private static void searchEnclosing(Clz clz, List<InnerClassNode> innerClassNode
* <p>
* to WeAreHere.class
*/

// CHECKSTYLE:ON

private static void searchInnerClass(Clz clz, List<InnerClassNode> innerClassNodes,
String className) {
Set<Clz> visited = new HashSet<>();
Expand Down

0 comments on commit 4e13edd

Please sign in to comment.