broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(desc, is_static):
    names = {'B': 'byte', 'C': 'char', 'D': 'double', 'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short', 'Z': 'boolean'}
    def field(i, allow_void):
        dims = 0
        while i < len(desc) and desc[i] == '[':
            dims += 1
            i += 1
        if dims > 255 or i >= len(desc):
            return None, i, 0
        c = desc[i]
        if c == 'L':
            j = desc.find(';', i)
            if j < 0 or j == i + 1:
                return None, i, 0
            base = desc[i + 1:j].replace('/', '.')
            i = j + 1
        elif c in names:
            base = names[c]
            i += 1
        elif c == 'V' and allow_void and dims == 0:
            base = 'void'
            i += 1
        else:
            return None, i, 0
        width = 2 if dims == 0 and c in 'JD' else 1
        return base + '[]' * dims, i, width
    if not desc.startswith('('):
        return ['ClassFormatError', 0]
    i = 1
    args = []
    slots = 0
    while i < len(desc) and desc[i] != ')':
        t, i, w = field(i, False)
        if t is None:
            return ['ClassFormatError', i]
        args.append(t)
        slots += w
    if i >= len(desc):
        return ['ClassFormatError', i]
    ret, j, _ = field(i + 1, True)
    if ret is None or j != len(desc):
        return ['ClassFormatError', j]
    return {'args': args, 'slots': slots, 'ret': ret}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;I)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}),
  ('instance method reserves this slot',
   ('(JDI)J', False),
   {'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}),
  ('void array return rejected', ('(I)[V', True), ['ClassFormatError', 4]),
  ('void argument rejected', ('(IV)V', True), ['ClassFormatError', 2]),
  ('empty class name rejected', ('(IL;)V', False), ['ClassFormatError', 2]),
  ('trailing characters rejected', ('(ILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 17]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int'],
    'ret': 'void',
    'slots': 2}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;II)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int'],
    'ret': 'void',
    'slots': 9}),
  ('instance method reserves this slot',
   ('(JDII)J', False),
   {'args': ['long', 'double', 'int', 'int'], 'ret': 'long', 'slots': 7}),
  ('void array return rejected', ('(II)[V', True), ['ClassFormatError', 5]),
  ('void argument rejected', ('(IIV)V', True), ['ClassFormatError', 3]),
  ('empty class name rejected', ('(IIL;)V', False), ['ClassFormatError', 3]),
  ('trailing characters rejected', ('(IILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 18]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int'],
    'ret': 'void',
    'slots': 3}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;III)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 10}),
  ('instance method reserves this slot',
   ('(JDIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int'], 'ret': 'long', 'slots': 8}),
  ('void array return rejected', ('(III)[V', True), ['ClassFormatError', 6]),
  ('void argument rejected', ('(IIIV)V', True), ['ClassFormatError', 4]),
  ('empty class name rejected', ('(IIIL;)V', False), ['ClassFormatError', 4]),
  ('trailing characters rejected', ('(IIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 19]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 4}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 11}),
  ('instance method reserves this slot',
   ('(JDIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 9}),
  ('void array return rejected', ('(IIII)[V', True), ['ClassFormatError', 7]),
  ('void argument rejected', ('(IIIIV)V', True), ['ClassFormatError', 5]),
  ('empty class name rejected', ('(IIIIL;)V', False), ['ClassFormatError', 5]),
  ('trailing characters rejected', ('(IIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 20]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 5}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 12}),
  ('instance method reserves this slot',
   ('(JDIIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 10}),
  ('void array return rejected', ('(IIIII)[V', True), ['ClassFormatError', 8]),
  ('void argument rejected', ('(IIIIIV)V', True), ['ClassFormatError', 6]),
  ('empty class name rejected', ('(IIIIIL;)V', False), ['ClassFormatError', 6]),
  ('trailing characters rejected', ('(IIIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 21]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 6}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(desc, is_static):
    names = {'B': 'byte', 'C': 'char', 'D': 'double', 'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short', 'Z': 'boolean'}
    def field(i, allow_void):
        dims = 0
        while i < len(desc) and desc[i] == '[':
            dims += 1
            i += 1
        if dims > 255 or i >= len(desc):
            return None, i, 0
        c = desc[i]
        if c == 'L':
            j = desc.find(';', i)
            if j < 0 or j == i + 1:
                return None, i, 0
            base = desc[i + 1:j].replace('/', '.')
            i = j + 1
        elif c in names:
            base = names[c]
            i += 1
        elif c == 'V' and allow_void and dims == 0:
            base = 'void'
            i += 1
        else:
            return None, i, 0
        width = 2 if dims == 0 and c in 'JD' else 1
        return base + '[]' * dims, i, width
    if not desc.startswith('('):
        return ['ClassFormatError', 0]
    i = 1
    args = []
    slots = 1
    while i < len(desc) and desc[i] != ')':
        t, i, w = field(i, False)
        if t is None:
            return ['ClassFormatError', i]
        args.append(t)
        slots += w
    if i >= len(desc):
        return ['ClassFormatError', i]
    ret, j, _ = field(i + 1, True)
    if ret is None or j != len(desc):
        return ['ClassFormatError', j]
    return {'args': args, 'slots': slots, 'ret': ret}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;I)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}),
  ('instance method reserves this slot',
   ('(JDI)J', False),
   {'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}),
  ('void array return rejected', ('(I)[V', True), ['ClassFormatError', 4]),
  ('void argument rejected', ('(IV)V', True), ['ClassFormatError', 2]),
  ('empty class name rejected', ('(IL;)V', False), ['ClassFormatError', 2]),
  ('trailing characters rejected', ('(ILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 17]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int'],
    'ret': 'void',
    'slots': 2}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;II)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int'],
    'ret': 'void',
    'slots': 9}),
  ('instance method reserves this slot',
   ('(JDII)J', False),
   {'args': ['long', 'double', 'int', 'int'], 'ret': 'long', 'slots': 7}),
  ('void array return rejected', ('(II)[V', True), ['ClassFormatError', 5]),
  ('void argument rejected', ('(IIV)V', True), ['ClassFormatError', 3]),
  ('empty class name rejected', ('(IIL;)V', False), ['ClassFormatError', 3]),
  ('trailing characters rejected', ('(IILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 18]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int'],
    'ret': 'void',
    'slots': 3}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;III)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 10}),
  ('instance method reserves this slot',
   ('(JDIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int'], 'ret': 'long', 'slots': 8}),
  ('void array return rejected', ('(III)[V', True), ['ClassFormatError', 6]),
  ('void argument rejected', ('(IIIV)V', True), ['ClassFormatError', 4]),
  ('empty class name rejected', ('(IIIL;)V', False), ['ClassFormatError', 4]),
  ('trailing characters rejected', ('(IIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 19]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 4}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 11}),
  ('instance method reserves this slot',
   ('(JDIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 9}),
  ('void array return rejected', ('(IIII)[V', True), ['ClassFormatError', 7]),
  ('void argument rejected', ('(IIIIV)V', True), ['ClassFormatError', 5]),
  ('empty class name rejected', ('(IIIIL;)V', False), ['ClassFormatError', 5]),
  ('trailing characters rejected', ('(IIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 20]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 5}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 12}),
  ('instance method reserves this slot',
   ('(JDIIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 10}),
  ('void array return rejected', ('(IIIII)[V', True), ['ClassFormatError', 8]),
  ('void argument rejected', ('(IIIIIV)V', True), ['ClassFormatError', 6]),
  ('empty class name rejected', ('(IIIIIL;)V', False), ['ClassFormatError', 6]),
  ('trailing characters rejected', ('(IIIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 21]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 6}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Local 0 of instance methods is assigned to the first declared parameter.

Parse a method descriptor "(args)ret". Field types: B C D F I J S Z, L<binary name>; with a non-empty name, and up to 255 leading "[" dimensions. V is allowed only as a non-array return type. Local-slot count: one extra slot for "this" unless static; J and D take two slots unless they are array element types. Return {args (readable names, "[]" per dimension), slots, ret} or ["ClassFormatError", position].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(desc, is_static):
    names = {'B': 'byte', 'C': 'char', 'D': 'double', 'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short', 'Z': 'boolean'}
    def field(i, allow_void):
        dims = 0
        while i < len(desc) and desc[i] == '[':
            dims += 1
            i += 1
        if dims > 255 or i >= len(desc):
            return None, i, 0
        c = desc[i]
        if c == 'L':
            j = desc.find(';', i)
            if j < 0 or j == i + 1:
                return None, i, 0
            base = desc[i + 1:j].replace('/', '.')
            i = j + 1
        elif c in names:
            base = names[c]
            i += 1
        elif c == 'V' and allow_void:
            base = 'void'
            i += 1
        else:
            return None, i, 0
        width = 2 if dims == 0 and c in 'JD' else 1
        return base + '[]' * dims, i, width
    if not desc.startswith('('):
        return ['ClassFormatError', 0]
    i = 1
    args = []
    slots = 0 if is_static else 1
    while i < len(desc) and desc[i] != ')':
        t, i, w = field(i, False)
        if t is None:
            return ['ClassFormatError', i]
        args.append(t)
        slots += w
    if i >= len(desc):
        return ['ClassFormatError', i]
    ret, j, _ = field(i + 1, True)
    if ret is None or j != len(desc):
        return ['ClassFormatError', j]
    return {'args': args, 'slots': slots, 'ret': ret}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;I)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}),
  ('instance method reserves this slot',
   ('(JDI)J', False),
   {'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}),
  ('void array return rejected', ('(I)[V', True), ['ClassFormatError', 4]),
  ('void argument rejected', ('(IV)V', True), ['ClassFormatError', 2]),
  ('empty class name rejected', ('(IL;)V', False), ['ClassFormatError', 2]),
  ('trailing characters rejected', ('(ILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 17]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int'],
    'ret': 'void',
    'slots': 2}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;II)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int'],
    'ret': 'void',
    'slots': 9}),
  ('instance method reserves this slot',
   ('(JDII)J', False),
   {'args': ['long', 'double', 'int', 'int'], 'ret': 'long', 'slots': 7}),
  ('void array return rejected', ('(II)[V', True), ['ClassFormatError', 5]),
  ('void argument rejected', ('(IIV)V', True), ['ClassFormatError', 3]),
  ('empty class name rejected', ('(IIL;)V', False), ['ClassFormatError', 3]),
  ('trailing characters rejected', ('(IILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 18]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int'],
    'ret': 'void',
    'slots': 3}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;III)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 10}),
  ('instance method reserves this slot',
   ('(JDIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int'], 'ret': 'long', 'slots': 8}),
  ('void array return rejected', ('(III)[V', True), ['ClassFormatError', 6]),
  ('void argument rejected', ('(IIIV)V', True), ['ClassFormatError', 4]),
  ('empty class name rejected', ('(IIIL;)V', False), ['ClassFormatError', 4]),
  ('trailing characters rejected', ('(IIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 19]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 4}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 11}),
  ('instance method reserves this slot',
   ('(JDIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 9}),
  ('void array return rejected', ('(IIII)[V', True), ['ClassFormatError', 7]),
  ('void argument rejected', ('(IIIIV)V', True), ['ClassFormatError', 5]),
  ('empty class name rejected', ('(IIIIL;)V', False), ['ClassFormatError', 5]),
  ('trailing characters rejected', ('(IIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 20]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 5}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 12}),
  ('instance method reserves this slot',
   ('(JDIIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 10}),
  ('void array return rejected', ('(IIIII)[V', True), ['ClassFormatError', 8]),
  ('void argument rejected', ('(IIIIIV)V', True), ['ClassFormatError', 6]),
  ('empty class name rejected', ('(IIIIIL;)V', False), ['ClassFormatError', 6]),
  ('trailing characters rejected', ('(IIIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 21]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 6}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(desc, is_static):
    names = {'B': 'byte', 'C': 'char', 'D': 'double', 'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short', 'Z': 'boolean'}
    def field(i, allow_void):
        dims = 0
        while i < len(desc) and desc[i] == '[':
            dims += 1
            i += 1
        if dims > 255 or i >= len(desc):
            return None, i, 0
        c = desc[i]
        if c == 'L':
            j = desc.find(';', i)
            if j < 0 or j == i + 1:
                return None, i, 0
            base = desc[i + 1:j].replace('/', '.')
            i = j + 1
        elif c in names:
            base = names[c]
            i += 1
        elif c == 'V' and dims == 0:
            base = 'void'
            i += 1
        else:
            return None, i, 0
        width = 2 if dims == 0 and c in 'JD' else 1
        return base + '[]' * dims, i, width
    if not desc.startswith('('):
        return ['ClassFormatError', 0]
    i = 1
    args = []
    slots = 0 if is_static else 1
    while i < len(desc) and desc[i] != ')':
        t, i, w = field(i, False)
        if t is None:
            return ['ClassFormatError', i]
        args.append(t)
        slots += w
    if i >= len(desc):
        return ['ClassFormatError', i]
    ret, j, _ = field(i + 1, True)
    if ret is None or j != len(desc):
        return ['ClassFormatError', j]
    return {'args': args, 'slots': slots, 'ret': ret}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;I)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}),
  ('instance method reserves this slot',
   ('(JDI)J', False),
   {'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}),
  ('void array return rejected', ('(I)[V', True), ['ClassFormatError', 4]),
  ('void argument rejected', ('(IV)V', True), ['ClassFormatError', 2]),
  ('empty class name rejected', ('(IL;)V', False), ['ClassFormatError', 2]),
  ('trailing characters rejected', ('(ILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 17]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int'],
    'ret': 'void',
    'slots': 2}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;II)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int'],
    'ret': 'void',
    'slots': 9}),
  ('instance method reserves this slot',
   ('(JDII)J', False),
   {'args': ['long', 'double', 'int', 'int'], 'ret': 'long', 'slots': 7}),
  ('void array return rejected', ('(II)[V', True), ['ClassFormatError', 5]),
  ('void argument rejected', ('(IIV)V', True), ['ClassFormatError', 3]),
  ('empty class name rejected', ('(IIL;)V', False), ['ClassFormatError', 3]),
  ('trailing characters rejected', ('(IILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 18]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int'],
    'ret': 'void',
    'slots': 3}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;III)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 10}),
  ('instance method reserves this slot',
   ('(JDIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int'], 'ret': 'long', 'slots': 8}),
  ('void array return rejected', ('(III)[V', True), ['ClassFormatError', 6]),
  ('void argument rejected', ('(IIIV)V', True), ['ClassFormatError', 4]),
  ('empty class name rejected', ('(IIIL;)V', False), ['ClassFormatError', 4]),
  ('trailing characters rejected', ('(IIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 19]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 4}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 11}),
  ('instance method reserves this slot',
   ('(JDIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 9}),
  ('void array return rejected', ('(IIII)[V', True), ['ClassFormatError', 7]),
  ('void argument rejected', ('(IIIIV)V', True), ['ClassFormatError', 5]),
  ('empty class name rejected', ('(IIIIL;)V', False), ['ClassFormatError', 5]),
  ('trailing characters rejected', ('(IIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 20]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 5}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 12}),
  ('instance method reserves this slot',
   ('(JDIIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 10}),
  ('void array return rejected', ('(IIIII)[V', True), ['ClassFormatError', 8]),
  ('void argument rejected', ('(IIIIIV)V', True), ['ClassFormatError', 6]),
  ('empty class name rejected', ('(IIIIIL;)V', False), ['ClassFormatError', 6]),
  ('trailing characters rejected', ('(IIIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 21]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 6}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A descriptor returning [V loads as returning an array of void.

Parse a method descriptor "(args)ret". Field types: B C D F I J S Z, L<binary name>; with a non-empty name, and up to 255 leading "[" dimensions. V is allowed only as a non-array return type. Local-slot count: one extra slot for "this" unless static; J and D take two slots unless they are array element types. Return {args (readable names, "[]" per dimension), slots, ret} or ["ClassFormatError", position].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(desc, is_static):
    names = {'B': 'byte', 'C': 'char', 'D': 'double', 'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short', 'Z': 'boolean'}
    def field(i, allow_void):
        dims = 0
        while i < len(desc) and desc[i] == '[':
            dims += 1
            i += 1
        if dims > 255 or i >= len(desc):
            return None, i, 0
        c = desc[i]
        if c == 'L':
            j = desc.find(';', i)
            if j < 0:
                return None, i, 0
            base = desc[i + 1:j].replace('/', '.')
            i = j + 1
        elif c in names:
            base = names[c]
            i += 1
        elif c == 'V' and allow_void and dims == 0:
            base = 'void'
            i += 1
        else:
            return None, i, 0
        width = 2 if dims == 0 and c in 'JD' else 1
        return base + '[]' * dims, i, width
    if not desc.startswith('('):
        return ['ClassFormatError', 0]
    i = 1
    args = []
    slots = 0 if is_static else 1
    while i < len(desc) and desc[i] != ')':
        t, i, w = field(i, False)
        if t is None:
            return ['ClassFormatError', i]
        args.append(t)
        slots += w
    if i >= len(desc):
        return ['ClassFormatError', i]
    ret, j, _ = field(i + 1, True)
    if ret is None or j != len(desc):
        return ['ClassFormatError', j]
    return {'args': args, 'slots': slots, 'ret': ret}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;I)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}),
  ('instance method reserves this slot',
   ('(JDI)J', False),
   {'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}),
  ('void array return rejected', ('(I)[V', True), ['ClassFormatError', 4]),
  ('void argument rejected', ('(IV)V', True), ['ClassFormatError', 2]),
  ('empty class name rejected', ('(IL;)V', False), ['ClassFormatError', 2]),
  ('trailing characters rejected', ('(ILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 17]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int'],
    'ret': 'void',
    'slots': 2}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;II)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int'],
    'ret': 'void',
    'slots': 9}),
  ('instance method reserves this slot',
   ('(JDII)J', False),
   {'args': ['long', 'double', 'int', 'int'], 'ret': 'long', 'slots': 7}),
  ('void array return rejected', ('(II)[V', True), ['ClassFormatError', 5]),
  ('void argument rejected', ('(IIV)V', True), ['ClassFormatError', 3]),
  ('empty class name rejected', ('(IIL;)V', False), ['ClassFormatError', 3]),
  ('trailing characters rejected', ('(IILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 18]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int'],
    'ret': 'void',
    'slots': 3}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;III)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 10}),
  ('instance method reserves this slot',
   ('(JDIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int'], 'ret': 'long', 'slots': 8}),
  ('void array return rejected', ('(III)[V', True), ['ClassFormatError', 6]),
  ('void argument rejected', ('(IIIV)V', True), ['ClassFormatError', 4]),
  ('empty class name rejected', ('(IIIL;)V', False), ['ClassFormatError', 4]),
  ('trailing characters rejected', ('(IIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 19]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 4}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 11}),
  ('instance method reserves this slot',
   ('(JDIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 9}),
  ('void array return rejected', ('(IIII)[V', True), ['ClassFormatError', 7]),
  ('void argument rejected', ('(IIIIV)V', True), ['ClassFormatError', 5]),
  ('empty class name rejected', ('(IIIIL;)V', False), ['ClassFormatError', 5]),
  ('trailing characters rejected', ('(IIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 20]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 5}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 12}),
  ('instance method reserves this slot',
   ('(JDIIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 10}),
  ('void array return rejected', ('(IIIII)[V', True), ['ClassFormatError', 8]),
  ('void argument rejected', ('(IIIIIV)V', True), ['ClassFormatError', 6]),
  ('empty class name rejected', ('(IIIIIL;)V', False), ['ClassFormatError', 6]),
  ('trailing characters rejected', ('(IIIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 21]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 6}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(desc, is_static):
    names = {'B': 'byte', 'C': 'char', 'D': 'double', 'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short', 'Z': 'boolean'}
    def field(i, allow_void):
        dims = 0
        while i < len(desc) and desc[i] == '[':
            dims += 1
            i += 1
        if dims > 255 or i >= len(desc):
            return None, i, 0
        c = desc[i]
        if c == 'L':
            j = desc.find(';', i)
            if j < 0 or j == i:
                return None, i, 0
            base = desc[i + 1:j].replace('/', '.')
            i = j + 1
        elif c in names:
            base = names[c]
            i += 1
        elif c == 'V' and allow_void and dims == 0:
            base = 'void'
            i += 1
        else:
            return None, i, 0
        width = 2 if dims == 0 and c in 'JD' else 1
        return base + '[]' * dims, i, width
    if not desc.startswith('('):
        return ['ClassFormatError', 0]
    i = 1
    args = []
    slots = 0 if is_static else 1
    while i < len(desc) and desc[i] != ')':
        t, i, w = field(i, False)
        if t is None:
            return ['ClassFormatError', i]
        args.append(t)
        slots += w
    if i >= len(desc):
        return ['ClassFormatError', i]
    ret, j, _ = field(i + 1, True)
    if ret is None or j != len(desc):
        return ['ClassFormatError', j]
    return {'args': args, 'slots': slots, 'ret': ret}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;I)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}),
  ('instance method reserves this slot',
   ('(JDI)J', False),
   {'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}),
  ('void array return rejected', ('(I)[V', True), ['ClassFormatError', 4]),
  ('void argument rejected', ('(IV)V', True), ['ClassFormatError', 2]),
  ('empty class name rejected', ('(IL;)V', False), ['ClassFormatError', 2]),
  ('trailing characters rejected', ('(ILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 17]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int'],
    'ret': 'void',
    'slots': 2}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;II)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int'],
    'ret': 'void',
    'slots': 9}),
  ('instance method reserves this slot',
   ('(JDII)J', False),
   {'args': ['long', 'double', 'int', 'int'], 'ret': 'long', 'slots': 7}),
  ('void array return rejected', ('(II)[V', True), ['ClassFormatError', 5]),
  ('void argument rejected', ('(IIV)V', True), ['ClassFormatError', 3]),
  ('empty class name rejected', ('(IIL;)V', False), ['ClassFormatError', 3]),
  ('trailing characters rejected', ('(IILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 18]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int'],
    'ret': 'void',
    'slots': 3}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;III)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 10}),
  ('instance method reserves this slot',
   ('(JDIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int'], 'ret': 'long', 'slots': 8}),
  ('void array return rejected', ('(III)[V', True), ['ClassFormatError', 6]),
  ('void argument rejected', ('(IIIV)V', True), ['ClassFormatError', 4]),
  ('empty class name rejected', ('(IIIL;)V', False), ['ClassFormatError', 4]),
  ('trailing characters rejected', ('(IIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 19]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 4}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 11}),
  ('instance method reserves this slot',
   ('(JDIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 9}),
  ('void array return rejected', ('(IIII)[V', True), ['ClassFormatError', 7]),
  ('void argument rejected', ('(IIIIV)V', True), ['ClassFormatError', 5]),
  ('empty class name rejected', ('(IIIIL;)V', False), ['ClassFormatError', 5]),
  ('trailing characters rejected', ('(IIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 20]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 5}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 12}),
  ('instance method reserves this slot',
   ('(JDIIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 10}),
  ('void array return rejected', ('(IIIII)[V', True), ['ClassFormatError', 8]),
  ('void argument rejected', ('(IIIIIV)V', True), ['ClassFormatError', 6]),
  ('empty class name rejected', ('(IIIIIL;)V', False), ['ClassFormatError', 6]),
  ('trailing characters rejected', ('(IIIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 21]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 6}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A parameter written as "L;" parses as a class with an empty name.

Parse a method descriptor "(args)ret". Field types: B C D F I J S Z, L<binary name>; with a non-empty name, and up to 255 leading "[" dimensions. V is allowed only as a non-array return type. Local-slot count: one extra slot for "this" unless static; J and D take two slots unless they are array element types. Return {args (readable names, "[]" per dimension), slots, ret} or ["ClassFormatError", position].

split: open-access