Skip to content

Commit 3c32637

Browse files
committed
Address comment
1 parent f0fd310 commit 3c32637

File tree

1 file changed

+14
-27
lines changed

1 file changed

+14
-27
lines changed

buildSrc/src/main/java/com/google/firebase/gradle/plugins/semver/AccessDescriptor.kt

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,21 @@ import org.objectweb.asm.Opcodes
2121
* Opcodes}
2222
*/
2323
class AccessDescriptor(private val access: Int) {
24-
fun isProtected(): Boolean {
25-
return accessIs(Opcodes.ACC_PROTECTED)
26-
}
27-
fun isPublic(): Boolean {
28-
return accessIs(Opcodes.ACC_PUBLIC)
29-
}
30-
fun isStatic(): Boolean {
31-
return accessIs(Opcodes.ACC_STATIC)
32-
}
33-
fun isSynthetic(): Boolean {
34-
return accessIs(Opcodes.ACC_SYNTHETIC)
35-
}
36-
fun isBridge(): Boolean {
37-
return accessIs(Opcodes.ACC_BRIDGE)
38-
}
39-
fun isAbstract(): Boolean {
40-
return accessIs(Opcodes.ACC_ABSTRACT)
41-
}
24+
fun isProtected(): Boolean = accessIs(Opcodes.ACC_PROTECTED)
4225

43-
fun isFinal(): Boolean {
44-
return accessIs(Opcodes.ACC_FINAL)
45-
}
26+
fun isPublic(): Boolean = accessIs(Opcodes.ACC_PUBLIC)
4627

47-
fun isPrivate(): Boolean {
48-
return !this.isProtected() && !this.isPublic()
49-
}
28+
fun isStatic(): Boolean = accessIs(Opcodes.ACC_STATIC)
29+
30+
fun isSynthetic(): Boolean = accessIs(Opcodes.ACC_SYNTHETIC)
31+
32+
fun isBridge(): Boolean = accessIs(Opcodes.ACC_BRIDGE)
33+
34+
fun isAbstract(): Boolean = accessIs(Opcodes.ACC_ABSTRACT)
35+
36+
fun isFinal(): Boolean = accessIs(Opcodes.ACC_FINAL)
37+
38+
fun isPrivate(): Boolean = !this.isProtected() && !this.isPublic()
5039

5140
fun getVerboseDescription(): String {
5241
val outputStringList = mutableListOf<String>()
@@ -71,7 +60,5 @@ class AccessDescriptor(private val access: Int) {
7160
return outputStringList.joinToString(" ")
7261
}
7362
/** Returns true if the given access modifier matches the given opcode. */
74-
fun accessIs(opcode: Int): Boolean {
75-
return (access and opcode) != 0
76-
}
63+
fun accessIs(opcode: Int): Boolean = (access and opcode) != 0
7764
}

0 commit comments

Comments
 (0)