Skip to content

Commit a61c06a

Browse files
Reduced max-line-length to 125
1 parent 1315d07 commit a61c06a

File tree

1,001 files changed

+10845
-8525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,001 files changed

+10845
-8525
lines changed

codingstyle/soot_checkstyle_checks.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<property name="allowNonPrintableEscapes" value="true"/>
4444
</module>
4545
<module name="LineLength">
46-
<property name="max" value="200"/>
46+
<property name="max" value="125"/>
4747
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
4848
</module>
4949
<module name="AvoidStarImport"/>

codingstyle/soot_eclipse_formatter.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
7373
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
7474
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
75-
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="150"/>
75+
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="125"/>
7676
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
7777
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
7878
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
@@ -138,7 +138,7 @@
138138
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
139139
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
140140
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
141-
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
141+
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
142142
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
143143
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
144144
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
@@ -198,7 +198,7 @@
198198
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
199199
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
200200
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
201-
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
201+
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="true"/>
202202
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
203203
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="9"/>
204204
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
@@ -308,7 +308,7 @@
308308
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
309309
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
310310
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
311-
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="150"/>
311+
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="125"/>
312312
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
313313
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
314314
</profile>

src/main/java/soot/AbstractASMBackend.java

+36-32
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@
5757
import soot.util.backend.SootASMClassWriter;
5858

5959
/**
60-
* Abstract super-class for ASM-based back-ends. Generates byte-code for everything except the method bodies, as they are dependent on the IR.
61-
*
60+
* Abstract super-class for ASM-based back-ends. Generates byte-code for everything except the method bodies, as they are
61+
* dependent on the IR.
62+
*
6263
* @author Tobias Hamann, Florian Kuebler, Dominik Helm, Lukas Sommer
63-
*
64+
*
6465
*/
6566
public abstract class AbstractASMBackend {
6667

@@ -75,11 +76,12 @@ public abstract class AbstractASMBackend {
7576

7677
/**
7778
* Creates a new ASM backend
78-
*
79+
*
7980
* @param sc
8081
* The SootClass that is to be converted into bytecode
8182
* @param javaVersion
82-
* A particular Java version enforced by the user, may be 0 for automatic detection, must not be lower than necessary for all features used
83+
* A particular Java version enforced by the user, may be 0 for automatic detection, must not be lower than
84+
* necessary for all features used
8385
*/
8486
public AbstractASMBackend(SootClass sc, int javaVersion) {
8587
this.sc = sc;
@@ -91,8 +93,8 @@ public AbstractASMBackend(SootClass sc, int javaVersion) {
9193
}
9294

9395
if (javaVersion != Options.java_version_default && javaVersion < minVersion) {
94-
throw new IllegalArgumentException("Enforced Java version " + translateJavaVersion(javaVersion) + " too low to support required features ("
95-
+ translateJavaVersion(minVersion) + " required)");
96+
throw new IllegalArgumentException("Enforced Java version " + translateJavaVersion(javaVersion)
97+
+ " too low to support required features (" + translateJavaVersion(minVersion) + " required)");
9698
}
9799

98100
javaVersion = Math.max(javaVersion, minVersion);
@@ -126,9 +128,9 @@ public AbstractASMBackend(SootClass sc, int javaVersion) {
126128
}
127129

128130
/**
129-
* Gets the baf body for the given SootMethod. This method will first check whether the method already has a baf body. If not, it will query the
130-
* local cache. If this fails as well, it will construct a new baf body.
131-
*
131+
* Gets the baf body for the given SootMethod. This method will first check whether the method already has a baf body. If
132+
* not, it will query the local cache. If this fails as well, it will construct a new baf body.
133+
*
132134
* @param method
133135
* The method for which to obtain a baf body
134136
* @return The baf body for the given method
@@ -156,7 +158,7 @@ protected BafBody getBafBody(SootMethod method) {
156158

157159
/**
158160
* Determines the minimum Java version required for the bytecode of the given SootClass
159-
*
161+
*
160162
* @param sc
161163
* The SootClass the minimum Java version is to be determined for
162164
* @return The minimum Java version required for the given SootClass
@@ -211,9 +213,9 @@ private int getMinJavaVersion(SootClass sc) {
211213
}
212214

213215
/**
214-
* Determines the minimum Java version required for the bytecode of the given SootMethod Subclasses should override this method to suit their needs,
215-
* otherwise Java 1.7 is assumed for compatibility with invokeDynamic
216-
*
216+
* Determines the minimum Java version required for the bytecode of the given SootMethod Subclasses should override this
217+
* method to suit their needs, otherwise Java 1.7 is assumed for compatibility with invokeDynamic
218+
*
217219
* @param sm
218220
* The SootMethod the minimum Java version is to be determined for
219221
* @return The minimum Java version required for the given SootMethod
@@ -224,7 +226,7 @@ protected int getMinJavaVersion(SootMethod sm) {
224226

225227
/**
226228
* Outputs the bytecode generated as a class file
227-
*
229+
*
228230
* @param os
229231
* The OutputStream the class file is written to
230232
*/
@@ -241,7 +243,7 @@ public void generateClassFile(OutputStream os) {
241243

242244
/**
243245
* Outputs the bytecode generated as a textual representation
244-
*
246+
*
245247
* @param pw
246248
* The PrintWriter the textual representation is written to
247249
*/
@@ -287,9 +289,9 @@ protected void generateByteCode() {
287289
}
288290

289291
/**
290-
* Comparatator that is used to sort the methods before they are written out. This is mainly used to enforce a deterministic output between runs
291-
* which we need for testing.
292-
*
292+
* Comparatator that is used to sort the methods before they are written out. This is mainly used to enforce a
293+
* deterministic output between runs which we need for testing.
294+
*
293295
* @author Steven Arzt
294296
*
295297
*/
@@ -355,7 +357,8 @@ protected void generateMethods() {
355357
continue;
356358
}
357359
for (AnnotationTag at : va.getAnnotations()) {
358-
AnnotationVisitor av = mv.visitParameterAnnotation(j, at.getType(), (va.getVisibility() == AnnotationConstants.RUNTIME_VISIBLE));
360+
AnnotationVisitor av = mv.visitParameterAnnotation(j, at.getType(),
361+
(va.getVisibility() == AnnotationConstants.RUNTIME_VISIBLE));
359362
generateAnnotationElems(av, at.getElems(), true);
360363
}
361364
}
@@ -406,9 +409,9 @@ protected void generateFields() {
406409
}
407410

408411
/**
409-
* Comparatator that is used to sort the inner class references before they are written out. This is mainly used to enforce a deterministic output
410-
* between runs which we need for testing.
411-
*
412+
* Comparatator that is used to sort the inner class references before they are written out. This is mainly used to enforce
413+
* a deterministic output between runs which we need for testing.
414+
*
412415
* @author Steven Arzt
413416
*
414417
*/
@@ -452,7 +455,7 @@ protected void generateAttributes() {
452455

453456
/**
454457
* Emits the bytecode for all attributes of a field
455-
*
458+
*
456459
* @param fv
457460
* The FieldVisitor to emit the bytecode to
458461
* @param f
@@ -469,7 +472,7 @@ protected void generateAttributes(FieldVisitor fv, SootField f) {
469472

470473
/**
471474
* Emits the bytecode for all attributes of a method
472-
*
475+
*
473476
* @param fv
474477
* The MethodVisitor to emit the bytecode to
475478
* @param f
@@ -486,7 +489,7 @@ protected void generateAttributes(MethodVisitor mv, SootMethod m) {
486489

487490
/**
488491
* Emits the bytecode for all annotations of a class, field or method
489-
*
492+
*
490493
* @param visitor
491494
* A ClassVisitor, FieldVisitor or MethodVisitor to emit the bytecode to
492495
* @param host
@@ -512,8 +515,8 @@ protected void generateAnnotations(Object visitor, Host host) {
512515
}
513516
}
514517
/*
515-
* Here TypeAnnotations could be visited potentially. Currently (2015/02/03) they are not supported by the ASM-front-end and their information
516-
* is not accessible.
518+
* Here TypeAnnotations could be visited potentially. Currently (2015/02/03) they are not supported by the
519+
* ASM-front-end and their information is not accessible.
517520
*/
518521

519522
// Visit AnnotationDefault on methods
@@ -528,7 +531,7 @@ else if (host instanceof SootMethod && t instanceof AnnotationDefaultTag) {
528531

529532
/**
530533
* Emits the bytecode for the values of an annotation
531-
*
534+
*
532535
* @param av
533536
* The AnnotationVisitor to emit the bytecode to
534537
* @param elements
@@ -665,7 +668,7 @@ protected void generateClassHeader() {
665668

666669
/**
667670
* Utility method to get the access modifiers of a Host
668-
*
671+
*
669672
* @param modVal
670673
* The bitset representation of the Host's modifiers
671674
* @param host
@@ -724,7 +727,8 @@ protected static int getModifiers(int modVal, Host host) {
724727
modifier |= Opcodes.ACC_STRICT;
725728
}
726729
/*
727-
* Retrieve synthetic-modifier. Class not present in source-code but generated by e.g. compiler TODO Do we need both checks?
730+
* Retrieve synthetic-modifier. Class not present in source-code but generated by e.g. compiler TODO Do we need both
731+
* checks?
728732
*/
729733
if (Modifier.isSynthetic(modVal) || host.hasTag("SyntheticTag")) {
730734
modifier |= Opcodes.ACC_SYNTHETIC;
@@ -742,7 +746,7 @@ protected static int getModifiers(int modVal, Host host) {
742746

743747
/**
744748
* Emits the bytecode for the body of a single method Has to be implemented by subclasses to suit their needs
745-
*
749+
*
746750
* @param mv
747751
* The MethodVisitor to emit the bytecode to
748752
* @param method

src/main/java/soot/AbstractJasminClass.java

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Soot - a J*va Optimization Framework
2-
*
3-
*
2+
*
3+
*
44
* Copyright (C) 1999 Patrick Lam, Patrick Pominville and Raja Vallee-Rai
55
* Copyright (C) 2004 Jennifer Lhotak, Ondrej Lhotak
66
*
@@ -21,7 +21,7 @@
2121
*/
2222

2323
/*
24-
* Modified by the Sable Research Group and others 1997-1999.
24+
* Modified by the Sable Research Group and others 1997-1999.
2525
* See the 'credits' file distributed with Soot for the complete list of
2626
* contributors. (Soot is distributed at http://www.sable.mcgill.ca/soot)
2727
*/
@@ -97,8 +97,10 @@ public abstract class AbstractJasminClass {
9797
protected Map<Object, Integer> groupToColorCount;
9898
protected Map<Local, Integer> localToColor;
9999

100-
protected Map<Block, Integer> blockToStackHeight = new HashMap<Block, Integer>(); // maps a block to the stack height upon entering it
101-
protected Map<Block, Integer> blockToLogicalStackHeight = new HashMap<Block, Integer>(); // maps a block to the logical stack height upon entering
100+
protected Map<Block, Integer> blockToStackHeight = new HashMap<Block, Integer>(); // maps a block to the stack height upon
101+
// entering it
102+
protected Map<Block, Integer> blockToLogicalStackHeight = new HashMap<Block, Integer>(); // maps a block to the logical
103+
// stack height upon entering
102104
// it
103105

104106
public static String slashify(String s) {
@@ -550,7 +552,8 @@ public AbstractJasminClass(SootClass sootClass) {
550552

551553
if (field.hasTag("StringConstantValueTag")) {
552554
fieldString += " = ";
553-
fieldString += soot.util.StringTools.getQuotedStringOf(((StringConstantValueTag) field.getTag("StringConstantValueTag")).getStringValue());
555+
fieldString += soot.util.StringTools
556+
.getQuotedStringOf(((StringConstantValueTag) field.getTag("StringConstantValueTag")).getStringValue());
554557
} else if (field.hasTag("IntegerConstantValueTag")) {
555558
fieldString += " = ";
556559
fieldString += ((IntegerConstantValueTag) field.getTag("IntegerConstantValueTag")).getIntValue();
@@ -593,7 +596,8 @@ public AbstractJasminClass(SootClass sootClass) {
593596
while (attributeIt.hasNext()) {
594597
Tag tag = (Tag) attributeIt.next();
595598
if (tag instanceof Attribute) {
596-
emit(".field_attribute " + tag.getName() + " \"" + new String(Base64.encode(((Attribute) tag).getValue())) + "\"");
599+
emit(".field_attribute " + tag.getName() + " \"" + new String(Base64.encode(((Attribute) tag).getValue()))
600+
+ "\"");
597601
}
598602
}
599603

@@ -684,7 +688,8 @@ protected void emitMethod(SootMethod method) {
684688
}
685689

686690
// Emit prologue
687-
emit(".method " + Modifier.toString(method.getModifiers()) + " " + method.getName() + jasminDescriptorOf(method.makeRef()));
691+
emit(".method " + Modifier.toString(method.getModifiers()) + " " + method.getName()
692+
+ jasminDescriptorOf(method.makeRef()));
688693

689694
Iterator<SootClass> throwsIt = method.getExceptions().iterator();
690695
while (throwsIt.hasNext()) {

src/main/java/soot/AbstractSootFieldRef.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
import soot.options.Options;
2828

2929
/**
30-
* Representation of a reference to a field as it appears in a class file. Note that the field directly referred to may not actually exist; the actual
31-
* target of the reference is determined according to the resolution procedure in the Java Virtual Machine Specification, 2nd ed, section 5.4.3.2.
30+
* Representation of a reference to a field as it appears in a class file. Note that the field directly referred to may not
31+
* actually exist; the actual target of the reference is determined according to the resolution procedure in the Java Virtual
32+
* Machine Specification, 2nd ed, section 5.4.3.2.
3233
*/
3334

3435
public class AbstractSootFieldRef implements SootFieldRef {
@@ -82,12 +83,13 @@ public String getSignature() {
8283

8384
public class FieldResolutionFailedException extends ResolutionFailedException {
8485
/**
85-
*
86+
*
8687
*/
8788
private static final long serialVersionUID = -4657113720516199499L;
8889

8990
public FieldResolutionFailedException() {
90-
super("Class " + declaringClass + " doesn't have field " + name + " : " + type + "; failed to resolve in superclasses and interfaces");
91+
super("Class " + declaringClass + " doesn't have field " + name + " : " + type
92+
+ "; failed to resolve in superclasses and interfaces");
9193
}
9294

9395
@Override
@@ -105,7 +107,8 @@ public SootField resolve() {
105107
}
106108

107109
private SootField checkStatic(SootField ret) {
108-
if (Options.v().wrong_staticness() == Options.wrong_staticness_fail || Options.v().wrong_staticness() == Options.wrong_staticness_fixstrict) {
110+
if (Options.v().wrong_staticness() == Options.wrong_staticness_fail
111+
|| Options.v().wrong_staticness() == Options.wrong_staticness_fixstrict) {
109112
if (ret.isStatic() != isStatic() && !ret.isPhantom()) {
110113
throw new ResolutionFailedException("Resolved " + this + " to " + ret + " which has wrong static-ness");
111114
}
@@ -220,7 +223,8 @@ protected SootField handleFieldTypeMismatch(SootField clField) {
220223
case Options.field_type_mismatches_null:
221224
return null;
222225
}
223-
throw new RuntimeException(String.format("Unsupported option for handling field type mismatches: %d", Options.v().field_type_mismatches()));
226+
throw new RuntimeException(
227+
String.format("Unsupported option for handling field type mismatches: %d", Options.v().field_type_mismatches()));
224228
}
225229

226230
@Override

src/main/java/soot/AbstractUnit.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Modified by the Sable Research Group and others 1997-1999.
21+
* Modified by the Sable Research Group and others 1997-1999.
2222
* See the 'credits' file distributed with Soot for the complete list of
2323
* contributors. (Soot is distributed at http://www.sable.mcgill.ca/soot)
2424
*/
@@ -40,25 +40,26 @@ public abstract class AbstractUnit extends AbstractHost implements Unit {
4040
public abstract Object clone();
4141

4242
/**
43-
* Returns a list of Boxes containing Values used in this Unit. The list of boxes is dynamically updated as the structure changes. Note that they
44-
* are returned in usual evaluation order. (this is important for aggregation)
43+
* Returns a list of Boxes containing Values used in this Unit. The list of boxes is dynamically updated as the structure
44+
* changes. Note that they are returned in usual evaluation order. (this is important for aggregation)
4545
*/
4646
@Override
4747
public List<ValueBox> getUseBoxes() {
4848
return Collections.emptyList();
4949
}
5050

5151
/**
52-
* Returns a list of Boxes containing Values defined in this Unit. The list of boxes is dynamically updated as the structure changes.
52+
* Returns a list of Boxes containing Values defined in this Unit. The list of boxes is dynamically updated as the
53+
* structure changes.
5354
*/
5455
@Override
5556
public List<ValueBox> getDefBoxes() {
5657
return Collections.emptyList();
5758
}
5859

5960
/**
60-
* Returns a list of Boxes containing Units defined in this Unit; typically branch targets. The list of boxes is dynamically updated as the
61-
* structure changes.
61+
* Returns a list of Boxes containing Units defined in this Unit; typically branch targets. The list of boxes is
62+
* dynamically updated as the structure changes.
6263
*/
6364
@Override
6465
public List<UnitBox> getUnitBoxes() {

0 commit comments

Comments
 (0)