// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst 
// Source File Name:   StructDescriptor.java
// Class Version:      45.3

package oracle.sql;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintStream;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLInput;
import java.sql.SQLOutput;
import java.sql.Statement;
import java.util.Map;
import java.util.Vector;
import oracle.jdbc.OracleConnection;
import oracle.jdbc.OracleTypes;
import oracle.jdbc.dbaccess.DBError;
import oracle.jdbc.driver.OracleLog;
import oracle.jdbc.driver.StructMetaData;
import oracle.jdbc.oracore.OracleNamedType;
import oracle.jdbc.oracore.OracleType;
import oracle.jdbc.oracore.OracleTypeADT;

// Referenced classes of package oracle.sql:
//            TypeDescriptor, ArrayDescriptor, Datum, OpaqueDescriptor, 
//            OracleJdbc2SQLInput, OracleSQLOutput, SQLName, STRUCT

// flag ACC_SUPER is set
public class StructDescriptor extends TypeDescriptor
    implements Serializable
{
    // Constants:          524
    // Interfaces:         1
    // Fields:             7
    // Methods:            48
    // Class Attributes:   1


    static final boolean DEBUG = false;
    static final long serialVersionUID = 0xe122c1707c9af97L;
    transient Boolean m_isInstanciable;
    transient String m_supertype;
    transient int m_numLocalAttrs;
    transient String m_subtypes[];
    transient String m_attrJavaNames[];

    // Decompiling method: <init>  Signature: (Ljava/lang/String;Ljava/sql/Connection;)V
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 36 bytes, Code offset: 7376
    // Line Number Table found: 8 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 36 Range 0 35 Init 0 fixed
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 36 Range 0 35 Init 0
    // Parameter  2 added: Name connection Type Ljava/sql/Connection; At 0 36 Range 0 35 Init 0
    // RetValue   3 added: Name <returnValue> Type V At 0 36 Range 0 35 Init 0 fixed
    public StructDescriptor(String s, Connection connection)
        throws SQLException
    {
        super(s, connection);
        m_isInstanciable = null;
        m_supertype = null;
        m_numLocalAttrs = -1;
        m_subtypes = null;
        m_attrJavaNames = null;
        initPickler();
        return;
    }

    // Decompiling method: <init>  Signature: (Loracle/jdbc/oracore/OracleTypeADT;Ljava/sql/Connection;)V
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 32 bytes, Code offset: 7488
    // Line Number Table found: 7 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 32 Range 0 31 Init 0 fixed
    // Parameter  1 added: Name oracletypeadt Type Loracle/jdbc/oracore/OracleTypeADT; At 0 32 Range 0 31 Init 0
    // Parameter  2 added: Name connection Type Ljava/sql/Connection; At 0 32 Range 0 31 Init 0
    // RetValue   3 added: Name <returnValue> Type V At 0 32 Range 0 31 Init 0 fixed
    public StructDescriptor(OracleTypeADT oracletypeadt, Connection connection)
        throws SQLException
    {
        super(oracletypeadt, connection);
        m_isInstanciable = null;
        m_supertype = null;
        m_numLocalAttrs = -1;
        m_subtypes = null;
        m_attrJavaNames = null;
        return;
    }

    // Decompiling method: <init>  Signature: (Loracle/sql/SQLName;Ljava/sql/Connection;)V
    // Max stack: 3, #locals: 3, #params: 3
    // Code length: 36 bytes, Code offset: 7592
    // Line Number Table found: 8 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 36 Range 0 35 Init 0 fixed
    // Parameter  1 added: Name sqlname Type Loracle/sql/SQLName; At 0 36 Range 0 35 Init 0
    // Parameter  2 added: Name connection Type Ljava/sql/Connection; At 0 36 Range 0 35 Init 0
    // RetValue   3 added: Name <returnValue> Type V At 0 36 Range 0 35 Init 0 fixed
    public StructDescriptor(SQLName sqlname, Connection connection)
        throws SQLException
    {
        super(sqlname, connection);
        m_isInstanciable = null;
        m_supertype = null;
        m_numLocalAttrs = -1;
        m_subtypes = null;
        m_attrJavaNames = null;
        initPickler();
        return;
    }

    // Decompiling method: <init>  Signature: (Loracle/sql/SQLName;Loracle/jdbc/oracore/OracleTypeADT;Ljava/sql/Connection;)V
    // Max stack: 4, #locals: 4, #params: 4
    // Code length: 33 bytes, Code offset: 7704
    // Line Number Table found: 7 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 33 Range 0 32 Init 0 fixed
    // Parameter  1 added: Name sqlname Type Loracle/sql/SQLName; At 0 33 Range 0 32 Init 0
    // Parameter  2 added: Name oracletypeadt Type Loracle/jdbc/oracore/OracleTypeADT; At 0 33 Range 0 32 Init 0
    // Parameter  3 added: Name connection Type Ljava/sql/Connection; At 0 33 Range 0 32 Init 0
    // RetValue   4 added: Name <returnValue> Type V At 0 33 Range 0 32 Init 0 fixed
    public StructDescriptor(SQLName sqlname, OracleTypeADT oracletypeadt, Connection connection)
        throws SQLException
    {
        super(sqlname, oracletypeadt, connection);
        m_isInstanciable = null;
        m_supertype = null;
        m_numLocalAttrs = -1;
        m_subtypes = null;
        m_attrJavaNames = null;
        return;
    }

    // Decompiling method: createDescriptor  Signature: (Ljava/lang/String;Ljava/sql/Connection;)Loracle/sql/StructDescriptor;
    // Max stack: 4, #locals: 5, #params: 2
    // Code length: 86 bytes, Code offset: 7809
    // Line Number Table found: 10 entries
    // Parameter  0 added: Name s Type Ljava/lang/String; At 0 86 Range 0 85 Init 0
    // Parameter  1 added: Name connection Type Ljava/sql/Connection; At 0 86 Range 0 85 Init 0
    // RetValue   5 added: Name <returnValue> Type Loracle/sql/StructDescriptor; At 0 86 Range 0 85 Init 0 fixed
    // LocalVar   2 added: Name sqlname Type Loracle/sql/SQLName; At 34 31 Range 34 64 Init 34
    // LocalVar   3 added: Name s1 Type Ljava/lang/String; At 39 37 Range 39 75 Init 39
    // LocalVar   4 added: Name structdescriptor Type Loracle/sql/StructDescriptor; At 53 32 Range 53 84 Init 53
    public static StructDescriptor createDescriptor(String s, Connection connection)
        throws SQLException
    {
        if(s == null || s.length() == 0 || connection == null)
        {
            DBError.check_error(60, "Invalid arguments");
        }
        SQLName sqlname = new SQLName(s, (OracleConnection)connection);
        String s1 = sqlname.getName();
        StructDescriptor structdescriptor = (StructDescriptor)((OracleConnection)connection).getDescriptor(s1);
        if(structdescriptor == null)
        {
            structdescriptor = new StructDescriptor(sqlname, connection);
            ((OracleConnection)connection).putDescriptor(s1, structdescriptor);
        }
        return structdescriptor;
    }

    // Decompiling method: descType  Signature: ()Ljava/lang/String;
    // Max stack: 3, #locals: 2, #params: 1
    // Code length: 15 bytes, Code offset: 7979
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 15 Range 0 14 Init 0 fixed
    // RetValue   2 added: Name <returnValue> Type Ljava/lang/String; At 0 15 Range 0 14 Init 0 fixed
    // LocalVar   1 added: Name stringbuffer Type Ljava/lang/StringBuffer; At 7 3 Range 7 9 Init 7
    public String descType()
        throws SQLException
    {
        StringBuffer stringbuffer = new StringBuffer();
        return descType(stringbuffer, 0);
    }

    // Decompiling method: descType  Signature: (Ljava/lang/StringBuffer;I)Ljava/lang/String;
    // Max stack: 4, #locals: 11, #params: 3
    // Code length: 385 bytes, Code offset: 8046
    // Line Number Table found: 42 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 385 Range 0 384 Init 0 fixed
    // Parameter  1 added: Name stringbuffer Type Ljava/lang/StringBuffer; At 0 385 Range 0 384 Init 0
    // Parameter  2 added: Name i Type I At 0 385 Range 0 384 Init 0
    // RetValue  11 added: Name <returnValue> Type Ljava/lang/String; At 0 385 Range 0 384 Init 0 fixed
    // LocalVar   3 added: Name s Type Ljava/lang/String; At 2 81 Range 2 82 Init 2
    // LocalVar   4 added: Name flag Type Z At 4 30 Range 4 33 Init 4
    // LocalVar   4 chged: Name j Oname flag Type I At 32 2 Range 4 33 Init 4
    // LocalVar   5 added: Name s1 Type Ljava/lang/String; At 57 286 Range 57 342 Init 57
    // LocalVar   6 added: Name resultsetmetadata Type Ljava/sql/ResultSetMetaData; At 179 171 Range 179 349 Init 179
    // LocalVar   7 added: Name k Type I At 188 189 Range 188 376 Init 188
    // LocalVar   8 added: Name flag Type Z At 191 184 Range 191 374 Init 191
    // LocalVar   8 chged: Name l Oname flag Type I At 373 2 Range 191 374 Init 191
    // LocalVar   9 added: Name i1 Type I At 207 94 Range 207 300 Init 207
    // LocalVar  10 added: Name structdescriptor Type Loracle/sql/StructDescriptor; At 243 4 Range 243 246 Init 243
    // LocalVar  10 added: Name arraydescriptor Type Loracle/sql/ArrayDescriptor; At 284 4 Range 284 287 Init 284
    // LocalVar  10 added: Name opaquedescriptor Type Loracle/sql/OpaqueDescriptor; At 325 4 Range 325 328 Init 325
    String descType(StringBuffer stringbuffer, int i)
        throws SQLException
    {
        String s = "";
        for(int j = 0; j < i; j++)
        {
            s = s + "  ";
        }

        String s1 = s + "  ";
        stringbuffer.append(s);
        stringbuffer.append(getTypeName());
        stringbuffer.append("\n");
        stringbuffer.append(s);
        stringbuffer.append("Subtype=" + getOracleTypeADT().isSubType());
        stringbuffer.append(" JavaObject=" + getOracleTypeADT().isJavaObject());
        stringbuffer.append(" FinalType=" + getOracleTypeADT().isFinalType());
        stringbuffer.append("\n");
        ResultSetMetaData resultsetmetadata = getMetaData();
        int k = resultsetmetadata.getColumnCount();
        for(int l = 0; l < k; l++)
        {
            int i1 = resultsetmetadata.getColumnType(l + 1);
            if(i1 == 2002 || i1 == 2008)
            {
                StructDescriptor structdescriptor = createDescriptor(resultsetmetadata.getColumnTypeName(l + 1), m_conn);
                structdescriptor.descType(stringbuffer, i + 1);
            } else
            if(i1 == 2003)
            {
                ArrayDescriptor arraydescriptor = ArrayDescriptor.createDescriptor(resultsetmetadata.getColumnTypeName(l + 1), m_conn);
                arraydescriptor.descType(stringbuffer, i + 1);
            } else
            if(i1 == 2007)
            {
                OpaqueDescriptor opaquedescriptor = OpaqueDescriptor.createDescriptor(resultsetmetadata.getColumnTypeName(l + 1), m_conn);
                opaquedescriptor.descType(stringbuffer, i + 1);
            } else
            {
                stringbuffer.append(s1);
                stringbuffer.append(resultsetmetadata.getColumnTypeName(l + 1));
                stringbuffer.append("\n");
            }
        }

        return stringbuffer.toString();
    }

    // Decompiling method: getAttributeJavaName  Signature: (I)Ljava/lang/String;
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 27 bytes, Code offset: 8643
    // Line Number Table found: 4 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 27 Range 0 26 Init 0 fixed
    // Parameter  1 added: Name i Type I At 0 27 Range 0 26 Init 0
    // RetValue   2 added: Name <returnValue> Type Ljava/lang/String; At 0 27 Range 0 26 Init 0 fixed
    public String getAttributeJavaName(int i)
        throws SQLException
    {
        if(isJavaObject())
        {
            if(m_attrJavaNames == null)
            {
                initMetaData3();
            }
            return m_attrJavaNames[i];
        } else
        {
            return null;
        }
    }

    // Decompiling method: getAttributeJavaNames  Signature: ()[Ljava/lang/String;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 28 bytes, Code offset: 8730
    // Line Number Table found: 4 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 28 Range 0 27 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type [Ljava/lang/String; At 0 28 Range 0 27 Init 0 fixed
    public String[] getAttributeJavaNames()
        throws SQLException
    {
        if(isJavaObject())
        {
            if(m_attrJavaNames == null)
            {
                initMetaData3();
            }
            return m_attrJavaNames;
        } else
        {
            return new String[0];
        }
    }

    // Decompiling method: getClass  Signature: (Ljava/util/Map;)Ljava/lang/Class;
    // Max stack: 4, #locals: 6, #params: 2
    // Code length: 275 bytes, Code offset: 8818
    // Line Number Table found: 18 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 275 Range 0 274 Init 0 fixed
    // Parameter  1 added: Name map Type Ljava/util/Map; At 0 275 Range 0 274 Init 0
    // RetValue   6 added: Name <returnValue> Type Ljava/lang/Class; At 0 275 Range 0 274 Init 0 fixed
    // LocalVar   2 added: Name s Type Ljava/lang/String; At 4 3 Range 4 6 Init 4
    // LocalVar   3 added: Name class1 Type Ljava/lang/Class; At 15 259 Range 15 273 Init 15
    // LocalVar   4 added: Name s1 Type Ljava/lang/String; At 20 215 Range 20 234 Init 20
    // LocalVar   5 added: Name s2 Type Ljava/lang/String; At 26 227 Range 26 252 Init 26
    public Class getClass(Map map)
        throws SQLException
    {
        String s = getName();
        Class class1 = (Class)map.get(s);
        String s1 = getSchemaName();
        String s2 = getTypeName();
        if(class1 == null && m_conn.getUserName().equals(s1))
        {
            class1 = (Class)map.get(s2);
        }
        if(!SQLName.s_parseAllFormat)
        {
            return class1;
        }
        if(class1 == null && m_conn.getUserName().equals(s1))
        {
            class1 = (Class)map.get("\"" + s2 + "\"");
        }
        if(class1 == null)
        {
            class1 = (Class)map.get("\"" + s1 + "\"" + "." + "\"" + s2 + "\"");
        }
        if(class1 == null)
        {
            class1 = (Class)map.get("\"" + s1 + "\"" + "." + s2);
        }
        if(class1 == null)
        {
            class1 = (Class)map.get(s1 + "." + "\"" + s2 + "\"");
        }
        return class1;
    }

    // Decompiling method: getFieldTypes  Signature: ()[Loracle/jdbc/oracore/OracleType;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 11 bytes, Code offset: 9209
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 11 Range 0 10 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type [Loracle/jdbc/oracore/OracleType; At 0 11 Range 0 10 Init 0 fixed
    private OracleType[] getFieldTypes()
        throws SQLException
    {
        return ((OracleTypeADT)m_pickler).getAttrTypes();
    }

    // Decompiling method: getJavaClassName  Signature: ()Ljava/lang/String;
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 18 bytes, Code offset: 9268
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 18 Range 0 17 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/lang/String; At 0 18 Range 0 17 Init 0 fixed
    public String getJavaClassName()
        throws SQLException
    {
        if(isJavaObject())
        {
            return getJavaObjectClassName(m_conn, this);
        } else
        {
            return null;
        }
    }

    // Decompiling method: getJavaObjectClassName  Signature: (Ljava/sql/Connection;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    // Max stack: 3, #locals: 5, #params: 3
    // Code length: 87 bytes, Code offset: 9342
    // Exception table: 1 entries
    //           start  5 end 57 handler 57 type SQLException
    // Line Number Table found: 13 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 87 Range 0 86 Init 0
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 87 Range 0 86 Init 0
    // Parameter  2 added: Name s1 Type Ljava/lang/String; At 0 87 Range 0 86 Init 0
    // RetValue   5 added: Name <returnValue> Type Ljava/lang/String; At 0 87 Range 0 86 Init 0 fixed
    // LocalVar   3 added: Name obj Type A At 1 74 Range 1 74 Init 1
    // LocalVar   4 added: Name obj1 Type A At 3 62 Range 3 64 Init 3
    // LocalVar   3 chged: Name preparedstatement Oname obj Type Ljava/sql/PreparedStatement; At 13 18 Range 1 74 Init 1
    // LocalVar   4 chged: Name resultset Oname obj1 Type Ljava/sql/ResultSet; At 36 14 Range 3 64 Init 3
    public static String getJavaObjectClassName(Connection connection, String s, String s1)
        throws SQLException
    {
        PreparedStatement preparedstatement = null;
        ResultSet resultset = null;
        try
        {
            preparedstatement = connection.prepareStatement("select external_name from all_sqlj_types where owner = ? and type_name = ?");
            preparedstatement.setString(1, s);
            preparedstatement.setString(2, s1);
            resultset = preparedstatement.executeQuery();
            if(resultset.next())
            {
                return resultset.getString(1);
            }
        }
        catch(SQLException _ex)
        {
            if(resultset != null)
            {
                resultset.close();
            }
            if(preparedstatement != null)
            {
                preparedstatement.close();
            }
        }
        DBError.throwSqlException(100);
        return null;
    }

    // Decompiling method: getJavaObjectClassName  Signature: (Ljava/sql/Connection;Loracle/sql/StructDescriptor;)Ljava/lang/String;
    // Max stack: 3, #locals: 2, #params: 2
    // Code length: 13 bytes, Code offset: 9533
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name connection Type Ljava/sql/Connection; At 0 13 Range 0 12 Init 0
    // Parameter  1 added: Name structdescriptor Type Loracle/sql/StructDescriptor; At 0 13 Range 0 12 Init 0
    // RetValue   2 added: Name <returnValue> Type Ljava/lang/String; At 0 13 Range 0 12 Init 0 fixed
    public static String getJavaObjectClassName(Connection connection, StructDescriptor structdescriptor)
        throws SQLException
    {
        return getJavaObjectClassName(connection, structdescriptor.getSchemaName(), structdescriptor.getTypeName());
    }

    // Decompiling method: getLanguage  Signature: ()Ljava/lang/String;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 13 bytes, Code offset: 9594
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 13 Range 0 12 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/lang/String; At 0 13 Range 0 12 Init 0 fixed
    public String getLanguage()
        throws SQLException
    {
        if(isJavaObject())
        {
            return "JAVA";
        } else
        {
            return "SQL";
        }
    }

    // Decompiling method: getLength  Signature: ()I
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 6 bytes, Code offset: 9659
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 6 Range 0 5 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type I At 0 6 Range 0 5 Init 0 fixed
    public int getLength()
        throws SQLException
    {
        return getFieldTypes().length;
    }

    // Decompiling method: getLocalAttributeCount  Signature: ()I
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 33 bytes, Code offset: 9713
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 33 Range 0 32 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type I At 0 33 Range 0 32 Init 0 fixed
    public int getLocalAttributeCount()
        throws SQLException
    {
        if(!isSubtype())
        {
            return getOracleTypeADT().getAttrTypes().length;
        }
        if(m_numLocalAttrs == -1)
        {
            initMetaData1();
        }
        return m_numLocalAttrs;
    }

    // Decompiling method: getMetaData  Signature: ()Ljava/sql/ResultSetMetaData;
    // Max stack: 3, #locals: 1, #params: 1
    // Code length: 9 bytes, Code offset: 9802
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 9 Range 0 8 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/sql/ResultSetMetaData; At 0 9 Range 0 8 Init 0 fixed
    public ResultSetMetaData getMetaData()
        throws SQLException
    {
        return new StructMetaData(this);
    }

    // Decompiling method: getOracleTypeADT  Signature: ()Loracle/jdbc/oracore/OracleTypeADT;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 9859
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 8 Range 0 7 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Loracle/jdbc/oracore/OracleTypeADT; At 0 8 Range 0 7 Init 0 fixed
    public OracleTypeADT getOracleTypeADT()
    {
        return (OracleTypeADT)m_pickler;
    }

    // Decompiling method: getSubtypeNames  Signature: ()[Ljava/lang/String;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 16 bytes, Code offset: 9905
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 16 Range 0 15 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type [Ljava/lang/String; At 0 16 Range 0 15 Init 0 fixed
    public String[] getSubtypeNames()
        throws SQLException
    {
        if(m_subtypes == null)
        {
            initMetaData2();
        }
        return m_subtypes;
    }

    // Decompiling method: getSupertypeName  Signature: ()Ljava/lang/String;
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 25 bytes, Code offset: 9973
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 25 Range 0 24 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/lang/String; At 0 25 Range 0 24 Init 0 fixed
    public String getSupertypeName()
        throws SQLException
    {
        if(!isSubtype())
        {
            return null;
        }
        if(m_supertype == null)
        {
            initMetaData1();
        }
        return m_supertype;
    }

    // Decompiling method: getTypeCode  Signature: ()I
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 10054
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 8 Range 0 7 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type I At 0 8 Range 0 7 Init 0 fixed
    public int getTypeCode()
        throws SQLException
    {
        return m_pickler.getTypeCode();
    }

    // Decompiling method: getTypeVersion  Signature: ()I
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 10110
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 8 Range 0 7 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type I At 0 8 Range 0 7 Init 0 fixed
    public int getTypeVersion()
        throws SQLException
    {
        return m_pickler.getTypeVersion();
    }

    // Decompiling method: initMetaData1  Signature: ()V
    // Max stack: 2, #locals: 2, #params: 1
    // Code length: 32 bytes, Code offset: 10166
    // Line Number Table found: 6 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 32 Range 0 31 Init 0 fixed
    // RetValue   2 added: Name <returnValue> Type V At 0 32 Range 0 31 Init 0 fixed
    // LocalVar   1 added: Name word0 Type S At 12 2 Range 12 13 Init 12
    private void initMetaData1()
        throws SQLException
    {
        short word0 = ((oracle.jdbc.internal.OracleConnection)getConnection()).getVersionNumber();
        if(word0 >= 9000)
        {
            initMetaData1_9_0();
        } else
        {
            initMetaData1_pre_9_0();
        }
        return;
    }

    // Decompiling method: initMetaData1_9_0  Signature: ()V
    // Max stack: 5, #locals: 10, #params: 1
    // Code length: 233 bytes, Code offset: 10266
    // Exception table: 3 entries
    //           start  28 end 168 handler 174 type any
    //           start  11 end 216 handler 221 type any
    //           start  7 end 224 handler 229 type any
    // Line Number Table found: 27 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 233 Range 0 232 Init 0 fixed
    // RetValue  10 added: Name <returnValue> Type V At 0 233 Range 0 232 Init 0 fixed
    // LocalVar   1 added: Name oracleconnection Type Loracle/jdbc/OracleConnection; At 4 226 Range 4 229 Init 4
    // LocalVar   3 added: Name structdescriptor Type Loracle/sql/StructDescriptor; At 8 214 Range 8 221 Init 8
    // LocalVar   5 added: Name obj Type A At 20 183 Range 20 202 Init 20
    // LocalVar   6 added: Name obj1 Type A At 23 168 Range 23 190 Init 23
    // LocalVar   7 added: Name byte0 Type B At 26 187 Range 26 212 Init 26
    // LocalVar   5 chged: Name preparedstatement Oname obj Type Ljava/sql/PreparedStatement; At 39 164 Range 20 202 Init 20
    // LocalVar   6 chged: Name resultset Oname obj1 Type Ljava/sql/ResultSet; At 72 119 Range 23 190 Init 23
    // LocalVar   7 chged: Name i Oname byte0 Type I At 157 56 Range 26 212 Init 26
    // LocalVar   9 added: Name local Type @ At 182 28 Range 182 209 Init 182
    // LocalVar   8 added: Name exception Type Ljava.lang.Exception; At 174 7 Range 174 180 Init 174
    // LocalVar   2 hasn't been used
    // LocalVar   4 hasn't been used
    private void initMetaData1_9_0()
        throws SQLException
    {
        synchronized(m_conn)
        {
            synchronized(this)
            {
                if(m_numLocalAttrs == -1)
                {
                    PreparedStatement preparedstatement = null;
                    ResultSet resultset = null;
                    int i = -1;
                    try
                    {
                        preparedstatement = m_conn.prepareStatement("select INSTANTIABLE, supertype_owner, supertype_name, LOCAL_ATTRIBUTES from all_types where type_name = ? and owner = ? ");
                        preparedstatement.setString(1, getTypeName());
                        preparedstatement.setString(2, getSchemaName());
                        resultset = preparedstatement.executeQuery();
                        if(resultset.next())
                        {
                            m_isInstanciable = new Boolean(resultset.getString(1).equals("YES"));
                            m_supertype = resultset.getString(2) + "." + resultset.getString(3);
                            i = resultset.getInt(4);
                        } else
                        {
                            DBError.throwSqlException(1, "Inconsistent catalog view");
                        }
                    }
                    finally
                    {
                        if(resultset != null)
                        {
                            resultset.close();
                        }
                        if(preparedstatement != null)
                        {
                            preparedstatement.close();
                        }
                    }
                    m_numLocalAttrs = i;
                }
            }
        }
        return;
    }

    // Decompiling method: initMetaData1_pre_9_0  Signature: ()V
    // Max stack: 4, #locals: 1, #params: 1
    // Code length: 24 bytes, Code offset: 10675
    // Line Number Table found: 4 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 24 Range 0 23 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type V At 0 24 Range 0 23 Init 0 fixed
    private synchronized void initMetaData1_pre_9_0()
        throws SQLException
    {
        m_isInstanciable = new Boolean(true);
        m_supertype = "";
        m_numLocalAttrs = 0;
        return;
    }

    // Decompiling method: initMetaData2  Signature: ()V
    // Max stack: 2, #locals: 2, #params: 1
    // Code length: 32 bytes, Code offset: 10759
    // Line Number Table found: 6 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 32 Range 0 31 Init 0 fixed
    // RetValue   2 added: Name <returnValue> Type V At 0 32 Range 0 31 Init 0 fixed
    // LocalVar   1 added: Name word0 Type S At 12 2 Range 12 13 Init 12
    private void initMetaData2()
        throws SQLException
    {
        short word0 = ((oracle.jdbc.internal.OracleConnection)getConnection()).getVersionNumber();
        if(word0 >= 9000)
        {
            initMetaData2_9_0();
        } else
        {
            initMetaData2_pre_9_0();
        }
        return;
    }

    // Decompiling method: initMetaData2_9_0  Signature: ()V
    // Max stack: 5, #locals: 12, #params: 1
    // Code length: 252 bytes, Code offset: 10859
    // Exception table: 3 entries
    //           start  27 end 187 handler 193 type any
    //           start  11 end 235 handler 240 type any
    //           start  7 end 243 handler 248 type any
    // Line Number Table found: 31 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 252 Range 0 251 Init 0 fixed
    // RetValue  12 added: Name <returnValue> Type V At 0 252 Range 0 251 Init 0 fixed
    // LocalVar   1 added: Name oracleconnection Type Loracle/jdbc/OracleConnection; At 4 245 Range 4 248 Init 4
    // LocalVar   3 added: Name structdescriptor Type Loracle/sql/StructDescriptor; At 8 233 Range 8 240 Init 8
    // LocalVar   5 added: Name obj Type A At 19 203 Range 19 221 Init 19
    // LocalVar   6 added: Name obj1 Type A At 22 188 Range 22 209 Init 22
    // LocalVar   7 added: Name obj2 Type A At 25 2 Range 25 26 Init 25
    // LocalVar   5 chged: Name preparedstatement Oname obj Type Ljava/sql/PreparedStatement; At 38 184 Range 19 221 Init 19
    // LocalVar   6 chged: Name resultset Oname obj1 Type Ljava/sql/ResultSet; At 71 139 Range 22 209 Init 22
    // LocalVar  10 added: Name vector Type Ljava/util/Vector; At 80 101 Range 80 180 Init 80
    // LocalVar   7 added: Name as Type [Ljava/lang/String; At 145 87 Range 145 231 Init 145
    // LocalVar  11 added: Name flag Type Z At 148 25 Range 148 172 Init 148
    // LocalVar  11 chged: Name i Oname flag Type I At 171 2 Range 148 172 Init 148
    // LocalVar  10 added: Name obj Type A At 185 2 Range 185 186 Init 185
    // LocalVar   9 added: Name local Type @ At 201 28 Range 201 228 Init 201
    // LocalVar   8 added: Name exception Type Ljava.lang.Exception; At 193 7 Range 193 199 Init 193
    // LocalVar   2 hasn't been used
    // LocalVar   4 hasn't been used
    // LocalVar   7 chged: Name as1 Oname obj2 Type [Ljava/lang/String; At 25 2 Range 25 26 Init 25
    // LocalVar   7 name as([Ljava/lang/String;) merged out into as1([Ljava/lang/String;)
    // LocalVar  10 name obj(A) merged out into vector(Ljava/util/Vector;)
    private void initMetaData2_9_0()
        throws SQLException
    {
        synchronized(m_conn)
        {
            synchronized(this)
            {
                if(m_subtypes == null)
                {
                    PreparedStatement preparedstatement = null;
                    ResultSet resultset = null;
                    String as[] = null;
                    try
                    {
                        preparedstatement = m_conn.prepareStatement("select owner, type_name from all_types where supertype_name = ? and supertype_owner = ?");
                        preparedstatement.setString(1, getTypeName());
                        preparedstatement.setString(2, getSchemaName());
                        resultset = preparedstatement.executeQuery();
                        Vector vector = new Vector();
                        for(; resultset.next(); vector.addElement(resultset.getString(1) + "." + resultset.getString(2))) { }
                        as = new String[vector.size()];
                        for(int i = 0; i < as.length; i++)
                        {
                            as[i] = (String)vector.elementAt(i);
                        }

                        vector.removeAllElements();
                        vector = null;
                    }
                    finally
                    {
                        if(resultset != null)
                        {
                            resultset.close();
                        }
                        if(preparedstatement != null)
                        {
                            preparedstatement.close();
                        }
                    }
                    m_subtypes = as;
                }
            }
        }
        return;
    }

    // Decompiling method: initMetaData2_pre_9_0  Signature: ()V
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 9 bytes, Code offset: 11303
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 9 Range 0 8 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type V At 0 9 Range 0 8 Init 0 fixed
    private void initMetaData2_pre_9_0()
        throws SQLException
    {
        m_subtypes = new String[0];
        return;
    }

    // Decompiling method: initMetaData3  Signature: ()V
    // Max stack: 4, #locals: 11, #params: 1
    // Code length: 183 bytes, Code offset: 11364
    // Exception table: 3 entries
    //           start  27 end 118 handler 124 type any
    //           start  11 end 166 handler 171 type any
    //           start  7 end 174 handler 179 type any
    // Line Number Table found: 25 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 183 Range 0 182 Init 0 fixed
    // RetValue  11 added: Name <returnValue> Type V At 0 183 Range 0 182 Init 0 fixed
    // LocalVar   1 added: Name oracleconnection Type Loracle/jdbc/OracleConnection; At 4 176 Range 4 179 Init 4
    // LocalVar   3 added: Name structdescriptor Type Loracle/sql/StructDescriptor; At 8 164 Range 8 171 Init 8
    // LocalVar   5 added: Name obj Type A At 19 2 Range 19 20 Init 19
    // LocalVar   6 added: Name obj1 Type A At 22 131 Range 22 152 Init 22
    // LocalVar   7 added: Name obj2 Type A At 25 116 Range 25 140 Init 25
    // LocalVar   6 chged: Name preparedstatement Oname obj1 Type Ljava/sql/PreparedStatement; At 38 115 Range 22 152 Init 22
    // LocalVar   7 chged: Name resultset Oname obj2 Type Ljava/sql/ResultSet; At 71 70 Range 25 140 Init 25
    // LocalVar   5 added: Name as Type [Ljava/lang/String; At 84 79 Range 84 162 Init 84
    // LocalVar  10 added: Name flag Type Z At 87 21 Range 87 107 Init 87
    // LocalVar   9 added: Name local Type @ At 132 28 Range 132 159 Init 132
    // LocalVar  10 chged: Name i Oname flag Type I At 94 2 Range 87 107 Init 87
    // LocalVar   8 added: Name exception Type Ljava.lang.Exception; At 124 7 Range 124 130 Init 124
    // LocalVar   2 hasn't been used
    // LocalVar   4 hasn't been used
    // LocalVar   5 chged: Name as1 Oname obj Type [Ljava/lang/String; At 19 2 Range 19 20 Init 19
    // LocalVar   5 name as([Ljava/lang/String;) merged out into as1([Ljava/lang/String;)
    private void initMetaData3()
        throws SQLException
    {
        synchronized(m_conn)
        {
            synchronized(this)
            {
                if(m_attrJavaNames == null)
                {
                    String as[] = null;
                    PreparedStatement preparedstatement = null;
                    ResultSet resultset = null;
                    try
                    {
                        preparedstatement = m_conn.prepareStatement("select EXTERNAL_ATTR_NAME from all_sqlj_type_attrs where owner = ? and type_name = ?");
                        preparedstatement.setString(1, getSchemaName());
                        preparedstatement.setString(2, getTypeName());
                        resultset = preparedstatement.executeQuery();
                        as = new String[getOracleTypeADT().getAttrTypes().length];
                        for(int i = 0; resultset.next(); i++)
                        {
                            as[i] = resultset.getString(1);
                        }

                    }
                    finally
                    {
                        if(resultset != null)
                        {
                            resultset.close();
                        }
                        if(preparedstatement != null)
                        {
                            preparedstatement.close();
                        }
                    }
                    m_attrJavaNames = as;
                }
            }
        }
        return;
    }

    // Decompiling method: initPickler  Signature: ()V
    // Max stack: 5, #locals: 2, #params: 1
    // Code length: 90 bytes, Code offset: 11715
    // Exception table: 1 entries
    //           start  0 end 44 handler 47 type Exception
    // Line Number Table found: 12 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 90 Range 0 89 Init 0 fixed
    // RetValue   2 added: Name <returnValue> Type V At 0 90 Range 0 89 Init 0 fixed
    // LocalVar   1 added: Name exception Type Ljava/lang/Exception; At 47 9 Range 47 55 Init 47
    private void initPickler()
        throws SQLException
    {
        try
        {
            m_pickler = new OracleTypeADT(getName(), m_conn);
            ((OracleTypeADT)m_pickler).init((oracle.jdbc.driver.OracleConnection)m_conn);
            m_pickler.setDescriptor(this);
        }
        catch(Exception exception)
        {
            if(exception instanceof SQLException)
            {
                throw (SQLException)exception;
            }
            DBError.throwSqlException(60, "Unable to resolve type \"" + getName() + "\"");
        }
        return;
    }

    // Decompiling method: isFinalType  Signature: ()Z
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 11905
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 8 Range 0 7 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Z At 0 8 Range 0 7 Init 0 fixed
    public boolean isFinalType()
        throws SQLException
    {
        return getOracleTypeADT().isFinalType();
    }

    // Decompiling method: isInHierarchyOf  Signature: (Ljava/lang/String;)Z
    // Max stack: 2, #locals: 4, #params: 2
    // Code length: 50 bytes, Code offset: 11961
    // Line Number Table found: 9 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 50 Range 0 49 Init 0 fixed
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 50 Range 0 49 Init 0
    // RetValue   4 added: Name <returnValue> Type Z At 0 50 Range 0 49 Init 0 fixed
    // LocalVar   2 added: Name structdescriptor Type Loracle/sql/StructDescriptor; At 1 17 Range 1 17 Init 1
    // LocalVar   3 added: Name s1 Type Ljava/lang/String; At 6 3 Range 6 8 Init 6
    // LocalVar   3 added: Name s2 Type Ljava/lang/String; At 21 18 Range 21 38 Init 21
    public boolean isInHierarchyOf(String s)
        throws SQLException
    {
        StructDescriptor structdescriptor = this;
        String s1 = structdescriptor.getName();
        if(s.equals(s1))
        {
            return true;
        }
        do
        {
            String s2 = structdescriptor.getSupertypeName();
            if(s2 == null)
            {
                return false;
            }
            if(s.equals(s2))
            {
                return true;
            }
            structdescriptor = createDescriptor(s2, getConnection());
        } while(true);
    }

    // Decompiling method: isInstantiable  Signature: ()Z
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 19 bytes, Code offset: 12091
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 19 Range 0 18 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Z At 0 19 Range 0 18 Init 0 fixed
    public boolean isInstantiable()
        throws SQLException
    {
        if(m_isInstanciable == null)
        {
            initMetaData1();
        }
        return m_isInstanciable.booleanValue();
    }

    // Decompiling method: isJavaObject  Signature: ()Z
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 12162
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 8 Range 0 7 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Z At 0 8 Range 0 7 Init 0 fixed
    public boolean isJavaObject()
        throws SQLException
    {
        return getOracleTypeADT().isJavaObject();
    }

    // Decompiling method: isSubtype  Signature: ()Z
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 8 bytes, Code offset: 12218
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 8 Range 0 7 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Z At 0 8 Range 0 7 Init 0 fixed
    public boolean isSubtype()
        throws SQLException
    {
        return getOracleTypeADT().isSubType();
    }

    // Decompiling method: readObject  Signature: (Ljava/io/ObjectInputStream;)V
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 15 bytes, Code offset: 12274
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 15 Range 0 14 Init 0 fixed
    // Parameter  1 added: Name objectinputstream Type Ljava/io/ObjectInputStream; At 0 15 Range 0 14 Init 0
    // RetValue   2 added: Name <returnValue> Type V At 0 15 Range 0 14 Init 0 fixed
    private void readObject(ObjectInputStream objectinputstream)
        throws IOException, ClassNotFoundException
    {
        if(TypeDescriptor.DEBUG_SERIALIZATION)
        {
            System.out.println("StructDescriptor::readObject");
        }
        return;
    }

    // Decompiling method: toArray  Signature: (Loracle/sql/STRUCT;Ljava/util/Map;Z)[Ljava/lang/Object;
    // Max stack: 7, #locals: 6, #params: 4
    // Code length: 211 bytes, Code offset: 12347
    // Line Number Table found: 24 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 211 Range 0 210 Init 0 fixed
    // Parameter  1 added: Name struct Type Loracle/sql/STRUCT; At 0 211 Range 0 210 Init 0
    // Parameter  2 added: Name map Type Ljava/util/Map; At 0 211 Range 0 210 Init 0
    // Parameter  3 added: Name flag Type Z At 0 211 Range 0 210 Init 0
    // RetValue   6 added: Name <returnValue> Type [Ljava/lang/Object; At 0 211 Range 0 210 Init 0 fixed
    // LocalVar   4 added: Name obj Type A At 1 209 Range 1 209 Init 1
    // LocalVar   4 chged: Name aobj Oname obj Type [Ljava/lang/Object; At 25 185 Range 1 209 Init 1
    // LocalVar   5 added: Name flag1 Type Z At 28 70 Range 28 97 Init 28
    // LocalVar   5 chged: Name i Oname flag1 Type I At 96 2 Range 28 97 Init 28
    Object[] toArray(STRUCT struct, Map map, boolean flag)
        throws SQLException
    {
        Object aobj[] = null;
        if(struct.m_objArray == null)
        {
            if(struct.m_datumArray != null)
            {
                aobj = new Object[struct.m_datumArray.length];
                for(int i = 0; i < struct.m_datumArray.length; i++)
                {
                    if(struct.m_datumArray[i] != null)
                    {
                        if(struct.m_datumArray[i] instanceof STRUCT)
                        {
                            aobj[i] = ((STRUCT)struct.m_datumArray[i]).toJdbc(map);
                        } else
                        {
                            aobj[i] = struct.m_datumArray[i].toJdbc();
                        }
                    }
                }

            } else
            if(struct.shareBytes() != null)
            {
                if((struct.shareBytes()[0] & 0x80) <= 0 && ((OracleTypeADT)m_pickler).isEmbeddedADT())
                {
                    m_pickler = OracleTypeADT.shallow_clone((OracleTypeADT)m_pickler);
                }
                m_pickler.unlinearize(struct.shareBytes(), struct.m_imgOffset, struct, 2, map);
                aobj = struct.m_objArray;
                struct.m_objArray = null;
            } else
            {
                DBError.throwSqlException(1);
            }
        } else
        {
            aobj = (Object[])((Object) (struct.m_objArray)).clone();
        }
        return aobj;
    }

    // Decompiling method: toArray  Signature: ([B)[Loracle/sql/Datum;
    // Max stack: 5, #locals: 3, #params: 2
    // Code length: 21 bytes, Code offset: 12698
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 21 Range 0 20 Init 0 fixed
    // Parameter  1 added: Name abyte0 Type [B At 0 21 Range 0 20 Init 0
    // RetValue   3 added: Name <returnValue> Type [Loracle/sql/Datum; At 0 21 Range 0 20 Init 0 fixed
    // LocalVar   2 added: Name struct Type Loracle/sql/STRUCT; At 13 3 Range 13 15 Init 13
    public Datum[] toArray(byte abyte0[])
        throws SQLException
    {
        STRUCT struct = new STRUCT(this, abyte0, m_conn);
        return toOracleArray(struct, false);
    }

    // Decompiling method: toArray  Signature: ([Ljava/lang/Object;)[Loracle/sql/Datum;
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 6 bytes, Code offset: 12771
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 6 Range 0 5 Init 0 fixed
    // Parameter  1 added: Name aobj Type [Ljava/lang/Object; At 0 6 Range 0 5 Init 0
    // RetValue   2 added: Name <returnValue> Type [Loracle/sql/Datum; At 0 6 Range 0 5 Init 0 fixed
    public Datum[] toArray(Object aobj[])
        throws SQLException
    {
        return toOracleArray(aobj);
    }

    // Decompiling method: toBytes  Signature: (Loracle/sql/STRUCT;Z)[B
    // Max stack: 6, #locals: 5, #params: 3
    // Code length: 157 bytes, Code offset: 12825
    // Line Number Table found: 25 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 157 Range 0 156 Init 0 fixed
    // Parameter  1 added: Name struct Type Loracle/sql/STRUCT; At 0 157 Range 0 156 Init 0
    // Parameter  2 added: Name flag Type Z At 0 157 Range 0 156 Init 0
    // RetValue   5 added: Name <returnValue> Type [B At 0 157 Range 0 156 Init 0 fixed
    // LocalVar   3 added: Name abyte0 Type [B At 4 152 Range 4 155 Init 4
    // LocalVar   4 added: Name abyte1 Type [B At 125 29 Range 125 153 Init 125
    byte[] toBytes(STRUCT struct, boolean flag)
        throws SQLException
    {
        byte abyte0[] = struct.shareBytes();
        if(abyte0 == null)
        {
            if(struct.m_datumArray != null)
            {
                abyte0 = m_pickler.linearize(struct);
                if(!flag)
                {
                    struct.setShareBytes(null);
                }
            } else
            if(struct.m_objArray != null)
            {
                struct.m_datumArray = toOracleArray(struct.m_objArray);
                abyte0 = m_pickler.linearize(struct);
                if(!flag)
                {
                    struct.m_datumArray = null;
                    struct.setShareBytes(null);
                }
            } else
            {
                DBError.throwSqlException(1);
            }
        } else
        if(struct.m_imgLength != 0L && (struct.m_imgOffset != 0L || struct.m_imgLength != (long)abyte0.length))
        {
            byte abyte1[] = new byte[(int)struct.m_imgLength];
            System.arraycopy(abyte0, (int)struct.m_imgOffset, abyte1, 0, (int)struct.m_imgLength);
            struct.setImage(abyte1, 0L, 0L);
            abyte0 = abyte1;
        }
        return abyte0;
    }

    // Decompiling method: toBytes  Signature: ([Ljava/lang/Object;)[B
    // Max stack: 2, #locals: 3, #params: 2
    // Code length: 12 bytes, Code offset: 13126
    // Line Number Table found: 2 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 12 Range 0 11 Init 0 fixed
    // Parameter  1 added: Name aobj Type [Ljava/lang/Object; At 0 12 Range 0 11 Init 0
    // RetValue   3 added: Name <returnValue> Type [B At 0 12 Range 0 11 Init 0 fixed
    // LocalVar   2 added: Name adatum Type [Loracle/sql/Datum; At 5 3 Range 5 7 Init 5
    public byte[] toBytes(Object aobj[])
        throws SQLException
    {
        Datum adatum[] = toOracleArray(aobj);
        return toBytes(adatum);
    }

    // Decompiling method: toBytes  Signature: ([Loracle/sql/Datum;)[B
    // Max stack: 5, #locals: 3, #params: 2
    // Code length: 28 bytes, Code offset: 13190
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 28 Range 0 27 Init 0 fixed
    // Parameter  1 added: Name adatum Type [Loracle/sql/Datum; At 0 28 Range 0 27 Init 0
    // RetValue   3 added: Name <returnValue> Type [B At 0 28 Range 0 27 Init 0 fixed
    // LocalVar   2 added: Name struct Type Loracle/sql/STRUCT; At 13 11 Range 13 23 Init 13
    public byte[] toBytes(Datum adatum[])
        throws SQLException
    {
        STRUCT struct = new STRUCT(this, null, m_conn);
        struct.setDatumArray(adatum);
        return m_pickler.linearize(struct);
    }

    // Decompiling method: toJdbc2SQLInput  Signature: (Loracle/sql/STRUCT;Ljava/util/Map;)Ljava/sql/SQLInput;
    // Max stack: 5, #locals: 3, #params: 3
    // Code length: 19 bytes, Code offset: 13274
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 19 Range 0 18 Init 0 fixed
    // Parameter  1 added: Name struct Type Loracle/sql/STRUCT; At 0 19 Range 0 18 Init 0
    // Parameter  2 added: Name map Type Ljava/util/Map; At 0 19 Range 0 18 Init 0
    // RetValue   3 added: Name <returnValue> Type Ljava/sql/SQLInput; At 0 19 Range 0 18 Init 0 fixed
    public SQLInput toJdbc2SQLInput(STRUCT struct, Map map)
        throws SQLException
    {
        return new OracleJdbc2SQLInput(toOracleArray(struct, false), map, m_conn);
    }

    // Decompiling method: toJdbc2SQLOutput  Signature: ()Ljava/sql/SQLOutput;
    // Max stack: 4, #locals: 1, #params: 1
    // Code length: 13 bytes, Code offset: 13341
    // Line Number Table found: 1 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 13 Range 0 12 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type Ljava/sql/SQLOutput; At 0 13 Range 0 12 Init 0 fixed
    public SQLOutput toJdbc2SQLOutput()
        throws SQLException
    {
        return new OracleSQLOutput(this, m_conn);
    }

    // Decompiling method: toOracleArray  Signature: (Loracle/sql/STRUCT;Z)[Loracle/sql/Datum;
    // Max stack: 7, #locals: 4, #params: 3
    // Code length: 134 bytes, Code offset: 13402
    // Line Number Table found: 18 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 134 Range 0 133 Init 0 fixed
    // Parameter  1 added: Name struct Type Loracle/sql/STRUCT; At 0 134 Range 0 133 Init 0
    // Parameter  2 added: Name flag Type Z At 0 134 Range 0 133 Init 0
    // RetValue   4 added: Name <returnValue> Type [Loracle/sql/Datum; At 0 134 Range 0 133 Init 0 fixed
    // LocalVar   3 added: Name adatum Type [Loracle/sql/Datum; At 4 129 Range 4 132 Init 4
    Datum[] toOracleArray(STRUCT struct, boolean flag)
        throws SQLException
    {
        Datum adatum[] = struct.m_datumArray;
        if(adatum == null)
        {
            if(struct.m_objArray != null)
            {
                adatum = toOracleArray(struct.m_objArray);
            } else
            if(struct.shareBytes() != null)
            {
                if((struct.shareBytes()[0] & 0x80) <= 0 && ((OracleTypeADT)m_pickler).isEmbeddedADT())
                {
                    m_pickler = OracleTypeADT.shallow_clone((OracleTypeADT)m_pickler);
                }
                m_pickler.unlinearize(struct.shareBytes(), struct.m_imgOffset, struct, 1, null);
                adatum = struct.m_datumArray;
                if(!flag)
                {
                    struct.m_datumArray = null;
                }
            } else
            {
                DBError.throwSqlException(1);
            }
        }
        if(flag)
        {
            struct.m_datumArray = adatum;
            return (Datum[])adatum.clone();
        } else
        {
            return adatum;
        }
    }

    // Decompiling method: toOracleArray  Signature: ([Ljava/lang/Object;)[Loracle/sql/Datum;
    // Max stack: 5, #locals: 6, #params: 2
    // Code length: 73 bytes, Code offset: 13652
    // Line Number Table found: 10 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 73 Range 0 72 Init 0 fixed
    // Parameter  1 added: Name aobj Type [Ljava/lang/Object; At 0 73 Range 0 72 Init 0
    // RetValue   6 added: Name <returnValue> Type [Loracle/sql/Datum; At 0 73 Range 0 72 Init 0 fixed
    // LocalVar   2 added: Name aoracletype Type [Loracle/jdbc/oracore/OracleType; At 10 33 Range 10 42 Init 10
    // LocalVar   3 added: Name i Type I At 13 54 Range 13 66 Init 13
    // LocalVar   4 added: Name adatum Type [Loracle/sql/Datum; At 30 42 Range 30 71 Init 30
    // LocalVar   5 added: Name flag Type Z At 33 33 Range 33 65 Init 33
    // LocalVar   5 chged: Name j Oname flag Type I At 64 2 Range 33 65 Init 33
    public Datum[] toOracleArray(Object aobj[])
        throws SQLException
    {
        if(aobj == null)
        {
            return null;
        }
        OracleType aoracletype[] = getFieldTypes();
        int i = aoracletype.length;
        if(aobj.length != i)
        {
            DBError.check_error(49, null);
        }
        Datum adatum[] = new Datum[i];
        for(int j = 0; j < i; j++)
        {
            adatum[j] = aoracletype[j].toDatum(aobj[j], (oracle.jdbc.driver.OracleConnection)m_conn);
        }

        return adatum;
    }

    // Decompiling method: writeObject  Signature: (Ljava/io/ObjectOutputStream;)V
    // Max stack: 2, #locals: 2, #params: 2
    // Code length: 15 bytes, Code offset: 13809
    // Line Number Table found: 3 entries
    // Parameter  0 added: Name this Type Loracle/sql/StructDescriptor; At 0 15 Range 0 14 Init 0 fixed
    // Parameter  1 added: Name objectoutputstream Type Ljava/io/ObjectOutputStream; At 0 15 Range 0 14 Init 0
    // RetValue   2 added: Name <returnValue> Type V At 0 15 Range 0 14 Init 0 fixed
    private void writeObject(ObjectOutputStream objectoutputstream)
        throws IOException
    {
        if(TypeDescriptor.DEBUG_SERIALIZATION)
        {
            System.out.println("StructDescriptor::writeObject");
        }
        return;
    }
}
