Use block comments for multi-line comments

Signed-off-by: Graham <gpe@openrs2.org>
Graham 4 years ago
parent 4ccebc7ef8
commit 7b6c0cf1fd
  1. 14
      archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt
  2. 6
      cache/src/main/kotlin/org/openrs2/cache/Group.kt
  3. 6
      deob-ast/src/main/kotlin/org/openrs2/deob/ast/transform/RedundantCastTransformer.kt
  4. 6
      deob-bytecode/src/main/kotlin/org/openrs2/deob/bytecode/transform/OpaquePredicateTransformer.kt

@ -274,9 +274,11 @@ public class CacheImporter @Inject constructor(
stmt.executeBatch() stmt.executeBatch()
} }
// we deliberately ignore groups with truncated versions here and /*
// re-download them, just in case there's a (crc32, truncated version) * We deliberately ignore groups with truncated versions here and
// collision * re-download them, just in case there's a (crc32, truncated version)
* collision.
*/
connection.prepareStatement( connection.prepareStatement(
""" """
SELECT t.group_id SELECT t.group_id
@ -475,8 +477,10 @@ public class CacheImporter @Inject constructor(
var versionTruncated = true var versionTruncated = true
val encrypted = Js5Compression.isEncrypted(buf.slice()) val encrypted = Js5Compression.isEncrypted(buf.slice())
// grab the non-truncated version from the Js5Index if we can /*
// confirm the group on disk matches the group in the index * Grab the non-truncated version from the Js5Index if we can
* confirm the group on disk matches the group in the index.
*/
if (index != null) { if (index != null) {
val entry = index[group] val entry = index[group]
if (entry != null && entry.checksum == buf.crc32() && (entry.version and 0xFFFF) == version) { if (entry != null && entry.checksum == buf.crc32() && (entry.version and 0xFFFF) == version) {

@ -65,8 +65,10 @@ public object Group {
} }
} }
// TODO(gpe): support multiple stripes (tricky, as the best sizes are /*
// probably specific to the format we're packing...) * TODO(gpe): support multiple stripes (tricky, as the best sizes are
* probably specific to the format we're packing...)
*/
public fun pack(files: Int2ObjectSortedMap<ByteBuf>): ByteBuf { public fun pack(files: Int2ObjectSortedMap<ByteBuf>): ByteBuf {
require(files.isNotEmpty()) require(files.isNotEmpty())

@ -89,8 +89,10 @@ public class RedundantCastTransformer : Transformer() {
} }
} }
// replace casts with widening/narrowing conversions /*
// see https://docs.oracle.com/javase/specs/jls/se11/html/jls-5.html * replace casts with widening/narrowing conversions
* see https://docs.oracle.com/javase/specs/jls/se11/html/jls-5.html
*/
unit.walk { expr: CastExpr -> unit.walk { expr: CastExpr ->
expr.parentNode.ifPresent { parent -> expr.parentNode.ifPresent { parent ->
if (parent !is AssignExpr && parent !is CastExpr) { if (parent !is AssignExpr && parent !is CastExpr) {

@ -46,8 +46,10 @@ public class OpaquePredicateTransformer : Transformer() {
val putstatic = match.last() as FieldInsnNode val putstatic = match.last() as FieldInsnNode
flowObstructors.add(MemberRef(putstatic)) flowObstructors.add(MemberRef(putstatic))
// remove initializer (except the opaque predicate at the start, /*
// which we treat like any other) * remove initializer (except the opaque predicate at the start,
* which we treat like any other)
*/
match.drop(2).forEach(method.instructions::remove) match.drop(2).forEach(method.instructions::remove)
// remove field // remove field

Loading…
Cancel
Save