# Path: pyjvm/prim.py
# PRIMITIVES = {'B': 'byte', 'C': 'char', 'D': 'double',
#               'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short',
#               'Z': 'boolean'}
# 
# Path: pyjvm/utils.py
# def default_for_type(desc):
#     '''Get default value for specific type'''
#     if desc == "I":
#         return 0
#     elif desc == "J":  # long
#         return ("long", 0)
#     elif desc[0] == "[":  # array
#         return None
#     elif desc[0] == 'L':  # object
#         return None
#     elif desc == 'Z':  # boolean
#         return 0
#     elif desc == 'D':  # double
#         return ("double", 0.0)
#     elif desc == 'F':  # float
#         return ("float", 0.0)
#     elif desc == 'C':  # char
#         return 0
#     elif desc == 'B':  # boolean
#         return 0
#     raise Exception("Default value not yet supported for " + desc)


import logging
from pyjvm.prim import PRIMITIVES
from pyjvm.utils import default_for_type

    Lives in heap and has corresponding java_class
    '''
    def __init__(self, jc, vm):
        self.java_class = jc
        self.fields = {}
        self.values = []


def array_class_factory(vm, name):
    assert name[0] == '['
    name = name[1:]
    if name[0] == 'L':
        name = name[1:-1]
        vm.get_class(name)  # make sure it's in
        jc = JavaClass()
        jc.is_array = True
        jc.this_name = "[L" + name + ";"
        jc.super_class = vm.get_class("java/lang/Object")
        jc.interfaces = ["java/lang/Cloneable", "java/io/Serializable"]
        return jc
    if name[0] == '[':
        jc = JavaClass()
        jc.is_array = True
        jc.this_name = "[" + name
        jc.super_class = vm.get_class("java/lang/Object")
        jc.interfaces = ["java/lang/Cloneable", "java/io/Serializable"]
        return jc
    assert name in PRIMITIVES


# Path: pyjvm/prim.py
# PRIMITIVES = {'B': 'byte', 'C': 'char', 'D': 'double',
#               'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short',
#               'Z': 'boolean'}
# 
# Path: pyjvm/utils.py
# def default_for_type(desc):
#     '''Get default value for specific type'''
#     if desc == "I":
#         return 0
#     elif desc == "J":  # long
#         return ("long", 0)
#     elif desc[0] == "[":  # array
#         return None
#     elif desc[0] == 'L':  # object
#         return None
#     elif desc == 'Z':  # boolean
#         return 0
#     elif desc == 'D':  # double
#         return ("double", 0.0)
#     elif desc == 'F':  # float
#         return ("float", 0.0)
#     elif desc == 'C':  # char
#         return 0
#     elif desc == 'B':  # boolean
#         return 0
#     raise Exception("Default value not yet supported for " + desc)


# Path: pyjvm/jvmo.py
import logging
from pyjvm.prim import PRIMITIVES
from pyjvm.utils import default_for_type


    Lives in heap and has corresponding java_class
    '''
    def __init__(self, jc, vm):
        self.java_class = jc
        self.fields = {}
        self.values = []


def array_class_factory(vm, name):
    assert name[0] == '['
    name = name[1:]
    if name[0] == 'L':
        name = name[1:-1]
        vm.get_class(name)  # make sure it's in
        jc = JavaClass()
        jc.is_array = True
        jc.this_name = "[L" + name + ";"
        jc.super_class = vm.get_class("java/lang/Object")
        jc.interfaces = ["java/lang/Cloneable", "java/io/Serializable"]
        return jc
    if name[0] == '[':
        jc = JavaClass()
        jc.is_array = True
        jc.this_name = "[" + name
        jc.super_class = vm.get_class("java/lang/Object")
        jc.interfaces = ["java/lang/Cloneable", "java/io/Serializable"]
        return jc
    assert name in PRIMITIVES


    vm.get_class(PRIMITIVES[name])  # make sure class is in