Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 52904 invoked from network); 14 May 2007 22:46:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 May 2007 22:46:59 -0000 Received: (qmail 70098 invoked by uid 500); 14 May 2007 22:47:05 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 69883 invoked by uid 500); 14 May 2007 22:47:05 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 69870 invoked by uid 99); 14 May 2007 22:47:05 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 May 2007 15:47:05 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [32.97.182.143] (HELO e3.ny.us.ibm.com) (32.97.182.143) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 May 2007 15:46:57 -0700 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e3.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l4ELijCg001996 for ; Mon, 14 May 2007 17:44:45 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l4EMkWKo466580 for ; Mon, 14 May 2007 18:46:32 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l4EMkWou020144 for ; Mon, 14 May 2007 18:46:32 -0400 Received: from [127.0.0.1] (sig-9-48-117-105.mts.ibm.com [9.48.117.105]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l4EMkVed020119 for ; Mon, 14 May 2007 18:46:32 -0400 Message-ID: <4648E682.1080102@sbcglobal.net> Date: Mon, 14 May 2007 15:45:22 -0700 From: Mike Matrigali Reply-To: mikem_app@sbcglobal.net User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: DERBY-1478 subtask DERBY-2583 - need help in debugging stack trace thrown during code generation References: <4648DC54.2080000@apache.org> In-Reply-To: <4648DC54.2080000@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Daniel John Debrunner wrote: > Mamta Satoor wrote: > >> Hi, >> >> I checked in code on April 24th revision 532082 for DERBY-2583 "At >> code generation time, look at collation type to determine what kind of >> DVD should get generated for character types." >> >> The intention of the commit was to generate following >> StringDataValueObject.getValue(DataValueFactory.getCharacterCollator(collationType)); >> >> >> This code generation change went in >> BaseTypeCompiler.generateCollationSensitiveDataValue and it looked as >> follows >> protected void generateCollationSensitiveDataValue(MethodBuilder mb, >> int collationType, String className){ if (collationType == >> StringDataValue.COLLATION_TYPE_UCS_BASIC) >> return; >> //In case of character DVDs, for territory based collation, we need to >> //generate DVDs with territory based RuleBasedCollator and hence we >> //need to generate CollatorSQLChar/CollatorSQLVarchar/ >> //CollatorSQLLongvarchar/CollatorSQLClob >> pushDataValueFactory(mb, className); > > > >> Looking at stack trace, it looks like something is wrong in maybe my >> code generation changes and wondered if someone familiar with code >> generation can tell me what I am doing wrong. I will keep debugging >> but any help will be greatly appreciated. > > > The issue may be to do with the method you added to BaseTypeCompiler > > private void pushDataValueFactory(MethodBuilder mb, String className) > > ExpressionClassBuilder already has a pushDataValueFactory(), was there a > need to create another one? Is the idea here that we should add an argument and pass in an ExpressionClassBuilder into things generateNull and generateDataValue, and then use the ExpressionClassBuilder.pushDataValueFactory. > > The problem may be that ExpressionClassBuilder's lifetime is a single > class generation, thus it's fine for its pushDataValueFactory to hold a > reference to a declared method from MethodBuilder.describeMethod(). But > the lifetime of the BaseTypeCompiler objects may be longer, thus it may > be trying to use a reference to one method in one generated class in > another generated class. > > Dan. > > >