You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Rick Hillegas <Ri...@Sun.COM> on 2007/09/17 18:15:52 UTC

Requiring Java 5 compiler

I would like to start writing Derby code which makes use of Java 5 
features. More specifically:

1) I would like to take advantage of the Java 5 extensions for 
ease-of-use and stronger type checking.

2) I would like to be able to write regression tests which verify that 
user-written Java 5 code runs correctly as Derby functions and procedures.

Would anyone object to our requiring that developers use a Java 5 or 
later compiler to build Derby? I believe that we would still require the 
presence of the 1.4 libraries and the expectation would continue to be 
that the compiler must compile down to 1.4 classes.

Thanks,
-Rick



Re: Requiring Java 5 compiler

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Stan,

With the Java 5 compiler, we will still compile the J2ME support. That 
won't change. This proposal does not introduce any issues for people who 
use the small platform.

For the record, a release manager could use the Java 5 (or 6) compiler 
today to build a fully competent Derby distribution which would run 
everywhere that 10.3 does.

This proposal is not about removing capabilities. It is about adding new 
capabilities.

Hope this is more clear.

Regards,
-Rick

Stanley Bradbury wrote:
> I am concerned that this proposal includes dropping support for J2ME 
> from Derby.    I would like to see a standard vote if this does mean 
> dropping the J2ME platform.  IMHO it would also be good to poll the 
> User community specifically about the use of J2ME to determine if such 
> a change will leave some applications without an upgrade path.
>
> Rick Hillegas wrote:
>> Rick Hillegas wrote:
>>> I would like to start writing Derby code which makes use of Java 5 
>>> features. More specifically:
>>>
>>> 1) I would like to take advantage of the Java 5 extensions for 
>>> ease-of-use and stronger type checking.
>>>
>>> 2) I would like to be able to write regression tests which verify 
>>> that user-written Java 5 code runs correctly as Derby functions and 
>>> procedures.
>>>
>>> Would anyone object to our requiring that developers use a Java 5 or 
>>> later compiler to build Derby? I believe that we would still require 
>>> the presence of the 1.4 libraries and the expectation would continue 
>>> to be that the compiler must compile down to 1.4 classes.
>>>
>>> Thanks,
>>> -Rick
>>>
>>>
>> Discussion on this thread has died down so I would like to summarize 
>> what has been said so far:
>>
>> a) Java 5 source can't be compiled down to 1.4 class files. This 
>> means that any code which is necessary for Derby to operate must be 
>> 1.4 source. This means that mandatory code cannot take advantage of 
>> Java 5 features such as enums, generics, annotations, and varargs.
>>
>> b) The CDC small device platforms require 1.4 level class files. Java 
>> 5 class files will not run on CDC platforms.
>>
>> c) There is no problem with using the Java 5 compiler to compile 1.4 
>> source into 1.4 targets. This already works today for those of us 
>> whose default compiler is Java 5 or Java 6.
>>
>> d) Java 5 is available on all likely development platforms, including 
>> Windows, Linux, Mac OS X, and Solaris.
>>
>> e) If we required Java 5 (or higher) in order to compile Derby, then 
>> we could use Java 5 features in optional engine code and in optional 
>> tests.
>>
>> I propose that we require Java 5 (or higher) in order to build Derby. 
>> If there are no objections and no further discussion, then I intend 
>> to call a lazy consensus vote on this proposal.
>>
>> Regards,
>> -Rick
>>
>
>


Re: Requiring Java 5 compiler

Posted by Kathey Marsden <km...@sbcglobal.net>.
Rick Hillegas wrote:
> I hope this is clearer.
>
Yes, thanks Rick.




Re: Requiring Java 5 compiler

Posted by Rick Hillegas <Ri...@Sun.COM>.
Kathey Marsden wrote:
> Stanley Bradbury wrote:
>> I am concerned that this proposal includes dropping support for J2ME 
>> from Derby.    I would like to see a standard vote if this does mean 
>> dropping the J2ME platform.  IMHO it would also be good to poll the 
>> User community specifically about the use of J2ME to determine if 
>> such a change will leave some applications without an upgrade path.
> Rick could you clarify this. I had thought that  that we would still  
> support J2ME and jdk 1.4.2 and that this is  a change that would only 
> affect developers building Derby, not users running Derby. Is that 
> correct?
>
> Thanks
>
> Kathey
>
Hi Kathey,

Yes, that's correct. Product code will continue to be at 1.4 source 
level, it will be compiled down to 1.4 class targets, and the resulting 
product classes will continue to run on J2ME and on jdk1.4. Derby 10.4 
will run on all of the platforms that 10.3 does.

It should be possible, however, to build optional Java 5 code. Derby 
would only use this code if Derby detected that it was running on a Java 
5 (or later) platform.

I hope this is clearer.

Regards,
-Rick

Re: Requiring Java 5 compiler

Posted by Kathey Marsden <km...@sbcglobal.net>.
Stanley Bradbury wrote:
> I am concerned that this proposal includes dropping support for J2ME 
> from Derby.    I would like to see a standard vote if this does mean 
> dropping the J2ME platform.  IMHO it would also be good to poll the 
> User community specifically about the use of J2ME to determine if such 
> a change will leave some applications without an upgrade path.
Rick could you clarify this. I had thought that  that we would still  
support J2ME and jdk 1.4.2 and that this is  a change that would only 
affect developers building Derby, not users running Derby. Is that correct?

Thanks

Kathey


Re: Requiring Java 5 compiler

Posted by Stanley Bradbury <St...@gmail.com>.
I am concerned that this proposal includes dropping support for J2ME 
from Derby.    I would like to see a standard vote if this does mean 
dropping the J2ME platform.  IMHO it would also be good to poll the User 
community specifically about the use of J2ME to determine if such a 
change will leave some applications without an upgrade path.

Rick Hillegas wrote:
> Rick Hillegas wrote:
>> I would like to start writing Derby code which makes use of Java 5 
>> features. More specifically:
>>
>> 1) I would like to take advantage of the Java 5 extensions for 
>> ease-of-use and stronger type checking.
>>
>> 2) I would like to be able to write regression tests which verify 
>> that user-written Java 5 code runs correctly as Derby functions and 
>> procedures.
>>
>> Would anyone object to our requiring that developers use a Java 5 or 
>> later compiler to build Derby? I believe that we would still require 
>> the presence of the 1.4 libraries and the expectation would continue 
>> to be that the compiler must compile down to 1.4 classes.
>>
>> Thanks,
>> -Rick
>>
>>
> Discussion on this thread has died down so I would like to summarize 
> what has been said so far:
>
> a) Java 5 source can't be compiled down to 1.4 class files. This means 
> that any code which is necessary for Derby to operate must be 1.4 
> source. This means that mandatory code cannot take advantage of Java 5 
> features such as enums, generics, annotations, and varargs.
>
> b) The CDC small device platforms require 1.4 level class files. Java 
> 5 class files will not run on CDC platforms.
>
> c) There is no problem with using the Java 5 compiler to compile 1.4 
> source into 1.4 targets. This already works today for those of us 
> whose default compiler is Java 5 or Java 6.
>
> d) Java 5 is available on all likely development platforms, including 
> Windows, Linux, Mac OS X, and Solaris.
>
> e) If we required Java 5 (or higher) in order to compile Derby, then 
> we could use Java 5 features in optional engine code and in optional 
> tests.
>
> I propose that we require Java 5 (or higher) in order to build Derby. 
> If there are no objections and no further discussion, then I intend to 
> call a lazy consensus vote on this proposal.
>
> Regards,
> -Rick
>



Re: Requiring Java 5 compiler

Posted by Julius Stroffek <Ju...@Sun.COM>.
Rick, thanks for the explanations.

Cheers

Julo

Rick Hillegas wrote:
> Hi Julo,
>
> The Java 5 compiler lets us write product and test code which is 
> optional--that is, the code only runs if the VM is sufficiently 
> advanced. This has the following benefits:
>
> 1) For runtime-optional code, we can take advantage of optimizations 
> introduced by the Java 5 libraries.
>
> 2) For runtime-optional code, we can take advantage of the extra type 
> checking introduced by Java 5.
>
> 3) We can write runtime-optional tests which verify that Derby plays 
> well with customer-written code on advanced VMs.
>
> The net effect of 1-3 is better Derby performance and quality when run 
> on advanced VMs. In addition,
>
> 4) It moves us further toward a standard build environment. That, in 
> the long run, will improve the out-of-box experience for newcomers to 
> derby-dev. It also reduces the release-time thrashing caused by the 
> fact that the release manager's environment is so different from the 
> environment of the average developer.
>
> 5) It moves more of the onus of build failures onto the developers who 
> make the build-breaking changes.
>
> The net effect of 4-5 is reduced thrashing during development and 
> release.
>
> Hope this helps,
> -Rick
>
>
>
> Julius Stroffek wrote:
>> Hi Rick,
>>
>> I am just thinking what exact benefits will derby gain when using 
>> java 5 features.
>>
>> Both Java 1.4 and Java 1.5 use JDBC3 interface and therefore I would 
>> expect derby to behave the same way on both java versions. Is this 
>> supposed somehow to change? Which derby features would be affected by 
>> this? Any plans for near future?
>>
>> Thanks
>>
>> Julo
>>
>>
>> Rick Hillegas wrote:
>>> Rick Hillegas wrote:
>>>> I would like to start writing Derby code which makes use of Java 5 
>>>> features. More specifically:
>>>>
>>>> 1) I would like to take advantage of the Java 5 extensions for 
>>>> ease-of-use and stronger type checking.
>>>>
>>>> 2) I would like to be able to write regression tests which verify 
>>>> that user-written Java 5 code runs correctly as Derby functions and 
>>>> procedures.
>>>>
>>>> Would anyone object to our requiring that developers use a Java 5 
>>>> or later compiler to build Derby? I believe that we would still 
>>>> require the presence of the 1.4 libraries and the expectation would 
>>>> continue to be that the compiler must compile down to 1.4 classes.
>>>>
>>>> Thanks,
>>>> -Rick
>>>>
>>>>
>>> Discussion on this thread has died down so I would like to summarize 
>>> what has been said so far:
>>>
>>> a) Java 5 source can't be compiled down to 1.4 class files. This 
>>> means that any code which is necessary for Derby to operate must be 
>>> 1.4 source. This means that mandatory code cannot take advantage of 
>>> Java 5 features such as enums, generics, annotations, and varargs.
>>>
>>> b) The CDC small device platforms require 1.4 level class files. 
>>> Java 5 class files will not run on CDC platforms.
>>>
>>> c) There is no problem with using the Java 5 compiler to compile 1.4 
>>> source into 1.4 targets. This already works today for those of us 
>>> whose default compiler is Java 5 or Java 6.
>>>
>>> d) Java 5 is available on all likely development platforms, 
>>> including Windows, Linux, Mac OS X, and Solaris.
>>>
>>> e) If we required Java 5 (or higher) in order to compile Derby, then 
>>> we could use Java 5 features in optional engine code and in optional 
>>> tests.
>>>
>>> I propose that we require Java 5 (or higher) in order to build 
>>> Derby. If there are no objections and no further discussion, then I 
>>> intend to call a lazy consensus vote on this proposal.
>>>
>>> Regards,
>>> -Rick
>>
>

Re: Requiring Java 5 compiler

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Julo,

The Java 5 compiler lets us write product and test code which is 
optional--that is, the code only runs if the VM is sufficiently 
advanced. This has the following benefits:

1) For runtime-optional code, we can take advantage of optimizations 
introduced by the Java 5 libraries.

2) For runtime-optional code, we can take advantage of the extra type 
checking introduced by Java 5.

3) We can write runtime-optional tests which verify that Derby plays 
well with customer-written code on advanced VMs.

The net effect of 1-3 is better Derby performance and quality when run 
on advanced VMs. In addition,

4) It moves us further toward a standard build environment. That, in the 
long run, will improve the out-of-box experience for newcomers to 
derby-dev. It also reduces the release-time thrashing caused by the fact 
that the release manager's environment is so different from the 
environment of the average developer.

5) It moves more of the onus of build failures onto the developers who 
make the build-breaking changes.

The net effect of 4-5 is reduced thrashing during development and release.

Hope this helps,
-Rick



Julius Stroffek wrote:
> Hi Rick,
>
> I am just thinking what exact benefits will derby gain when using java 
> 5 features.
>
> Both Java 1.4 and Java 1.5 use JDBC3 interface and therefore I would 
> expect derby to behave the same way on both java versions. Is this 
> supposed somehow to change? Which derby features would be affected by 
> this? Any plans for near future?
>
> Thanks
>
> Julo
>
>
> Rick Hillegas wrote:
>> Rick Hillegas wrote:
>>> I would like to start writing Derby code which makes use of Java 5 
>>> features. More specifically:
>>>
>>> 1) I would like to take advantage of the Java 5 extensions for 
>>> ease-of-use and stronger type checking.
>>>
>>> 2) I would like to be able to write regression tests which verify 
>>> that user-written Java 5 code runs correctly as Derby functions and 
>>> procedures.
>>>
>>> Would anyone object to our requiring that developers use a Java 5 or 
>>> later compiler to build Derby? I believe that we would still require 
>>> the presence of the 1.4 libraries and the expectation would continue 
>>> to be that the compiler must compile down to 1.4 classes.
>>>
>>> Thanks,
>>> -Rick
>>>
>>>
>> Discussion on this thread has died down so I would like to summarize 
>> what has been said so far:
>>
>> a) Java 5 source can't be compiled down to 1.4 class files. This 
>> means that any code which is necessary for Derby to operate must be 
>> 1.4 source. This means that mandatory code cannot take advantage of 
>> Java 5 features such as enums, generics, annotations, and varargs.
>>
>> b) The CDC small device platforms require 1.4 level class files. Java 
>> 5 class files will not run on CDC platforms.
>>
>> c) There is no problem with using the Java 5 compiler to compile 1.4 
>> source into 1.4 targets. This already works today for those of us 
>> whose default compiler is Java 5 or Java 6.
>>
>> d) Java 5 is available on all likely development platforms, including 
>> Windows, Linux, Mac OS X, and Solaris.
>>
>> e) If we required Java 5 (or higher) in order to compile Derby, then 
>> we could use Java 5 features in optional engine code and in optional 
>> tests.
>>
>> I propose that we require Java 5 (or higher) in order to build Derby. 
>> If there are no objections and no further discussion, then I intend 
>> to call a lazy consensus vote on this proposal.
>>
>> Regards,
>> -Rick
>


Re: Requiring Java 5 compiler

Posted by Julius Stroffek <Ju...@Sun.COM>.
Hi Rick,

I am just thinking what exact benefits will derby gain when using java 5 
features.

Both Java 1.4 and Java 1.5 use JDBC3 interface and therefore I would 
expect derby to behave the same way on both java versions. Is this 
supposed somehow to change? Which derby features would be affected by 
this? Any plans for near future?

Thanks

Julo


Rick Hillegas wrote:
> Rick Hillegas wrote:
>> I would like to start writing Derby code which makes use of Java 5 
>> features. More specifically:
>>
>> 1) I would like to take advantage of the Java 5 extensions for 
>> ease-of-use and stronger type checking.
>>
>> 2) I would like to be able to write regression tests which verify 
>> that user-written Java 5 code runs correctly as Derby functions and 
>> procedures.
>>
>> Would anyone object to our requiring that developers use a Java 5 or 
>> later compiler to build Derby? I believe that we would still require 
>> the presence of the 1.4 libraries and the expectation would continue 
>> to be that the compiler must compile down to 1.4 classes.
>>
>> Thanks,
>> -Rick
>>
>>
> Discussion on this thread has died down so I would like to summarize 
> what has been said so far:
>
> a) Java 5 source can't be compiled down to 1.4 class files. This means 
> that any code which is necessary for Derby to operate must be 1.4 
> source. This means that mandatory code cannot take advantage of Java 5 
> features such as enums, generics, annotations, and varargs.
>
> b) The CDC small device platforms require 1.4 level class files. Java 
> 5 class files will not run on CDC platforms.
>
> c) There is no problem with using the Java 5 compiler to compile 1.4 
> source into 1.4 targets. This already works today for those of us 
> whose default compiler is Java 5 or Java 6.
>
> d) Java 5 is available on all likely development platforms, including 
> Windows, Linux, Mac OS X, and Solaris.
>
> e) If we required Java 5 (or higher) in order to compile Derby, then 
> we could use Java 5 features in optional engine code and in optional 
> tests.
>
> I propose that we require Java 5 (or higher) in order to build Derby. 
> If there are no objections and no further discussion, then I intend to 
> call a lazy consensus vote on this proposal.
>
> Regards,
> -Rick


Re: Requiring Java 5 compiler

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> Could you run the 10.2 build experiment on your machine and let me know 
> how it works for you: Bring up a new shell window, set it to operate in 
> a Java 5 environment, then try building 10.2.

Works fine, Rick! Thanks for helping me think through this issue. I see
no problems with your proposal.

bryan


Re: Requiring Java 5 compiler

Posted by Rick Hillegas <Ri...@Sun.COM>.
Bryan Pendleton wrote:
>> o The shell window which runs the build has to be running with Java 5 
>> or higher. That is, $JAVA_HOME needs to point at a Java 5 or Java 6 
>> installation and when you type javac in that shell window, this 
>> should resolve to the corresponding (Java 5 or Java 6) compiler.
>
> Hi Rick, that seems fine, but does it mean that I have to use
> a different shell window for building the trunk than I use for
> building 10.3? (Or, at least, that I have to reset my shell
> environment when I switch from branch to branch?)
>
> Or is it OK if Java 5 is my default Java environment when I
> build 10.2 and 10.3 (maybe this is already true? I haven't checked.)
Hi Bryan,

I am able to successfully build the 10.3 branch when my shell is 
operating in a Java 5 environment. I can't answer your question about 
10.2 because I am compiling on Mac OS X--in that environment I find that 
I have to change my ant.properties when switching between building 10.2 
and 10.3.

Could you run the 10.2 build experiment on your machine and let me know 
how it works for you: Bring up a new shell window, set it to operate in 
a Java 5 environment, then try building 10.2.

Thanks,
-Rick
>
> thanks,
>
> bryan
>


Re: Requiring Java 5 compiler

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> o The shell window which runs the build has to be running with Java 5 or 
> higher. That is, $JAVA_HOME needs to point at a Java 5 or Java 6 
> installation and when you type javac in that shell window, this should 
> resolve to the corresponding (Java 5 or Java 6) compiler.

Hi Rick, that seems fine, but does it mean that I have to use
a different shell window for building the trunk than I use for
building 10.3? (Or, at least, that I have to reset my shell
environment when I switch from branch to branch?)

Or is it OK if Java 5 is my default Java environment when I
build 10.2 and 10.3 (maybe this is already true? I haven't checked.)

thanks,

bryan


Re: Requiring Java 5 compiler

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Bryan,

I was thinking of something even simpler, but I don't know if this will 
work for you. Let me know if this is too simple:

o Joe Developer has to install Java 5 on his machine.

o The shell window which runs the build has to be running with Java 5 or 
higher. That is, $JAVA_HOME needs to point at a Java 5 or Java 6 
installation and when you type javac in that shell window, this should 
resolve to the corresponding (Java 5 or Java 6) compiler.

Will this work for you?

Thanks,
-Rick

Bryan Pendleton wrote:
>> Thanks, Bryan. I was thinking of wiring a check into the "init" 
>> target of the top level build.xml. The build would fail if the 
>> compiler wasn't advanced enough. Would that satisfy your build 
>> requirements?
>
> Sure, that sounds good!
>
> I'm thinking out loud here, but my expectation is that, once you've
> made your change, the impact on me ("Average Joe Derby Developer") is:
>
>  - I have to install Java 1.5 on my machine if I haven't already
>  - I have to add the line
>        j15lib=/path/to/java1.5/jre/lib
>    into my ant.properties
>  - I can continue using the same ant.properties for all my 10.2, 10.3,
>    and trunk builds
>  - I use the same build commands (ant 
> clobber/all/buildjars/junitreport/etc)
>    that I currently use
>  - If I do either of the first two steps wrong, I get a friendly message.
>
> Is that more or less the way you envision this? If so, sounds fine to me!
>
> thanks,
>
> bryan
>


Re: Requiring Java 5 compiler

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> Thanks, Bryan. I was thinking of wiring a check into the "init" target 
> of the top level build.xml. The build would fail if the compiler wasn't 
> advanced enough. Would that satisfy your build requirements?

Sure, that sounds good!

I'm thinking out loud here, but my expectation is that, once you've
made your change, the impact on me ("Average Joe Derby Developer") is:

  - I have to install Java 1.5 on my machine if I haven't already
  - I have to add the line
        j15lib=/path/to/java1.5/jre/lib
    into my ant.properties
  - I can continue using the same ant.properties for all my 10.2, 10.3,
    and trunk builds
  - I use the same build commands (ant clobber/all/buildjars/junitreport/etc)
    that I currently use
  - If I do either of the first two steps wrong, I get a friendly message.

Is that more or less the way you envision this? If so, sounds fine to me!

thanks,

bryan


Re: Requiring Java 5 compiler

Posted by Rick Hillegas <Ri...@Sun.COM>.
Bryan Pendleton wrote:
>> I propose that we require Java 5 (or higher) in order to build Derby. 
>
> This is mostly an implementation issue, but it would be nice if you
> could make the build files be as careful as possible about giving a
> good message when the environment is incorrect.
>
> I find myself periodically jumping around between builds of 10.2,
> 10.3, and the trunk, and I'm hoping to minimize the amount of
> build environment re-jiggering that I have to do when I do this.
>
> For example, it would be nice if I could maintain a single ant.properties
> file and have it work for both my trunk builds and my 10.2/10.3 builds.
>
> thanks,
>
> bryan
>
Thanks, Bryan. I was thinking of wiring a check into the "init" target 
of the top level build.xml. The build would fail if the compiler wasn't 
advanced enough. Would that satisfy your build requirements?

Thanks,
-Rick

Re: Requiring Java 5 compiler

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> I propose that we require Java 5 (or higher) in order to build Derby. 

This is mostly an implementation issue, but it would be nice if you
could make the build files be as careful as possible about giving a
good message when the environment is incorrect.

I find myself periodically jumping around between builds of 10.2,
10.3, and the trunk, and I'm hoping to minimize the amount of
build environment re-jiggering that I have to do when I do this.

For example, it would be nice if I could maintain a single ant.properties
file and have it work for both my trunk builds and my 10.2/10.3 builds.

thanks,

bryan


Re: Requiring Java 5 compiler

Posted by Rick Hillegas <Ri...@Sun.COM>.
Rick Hillegas wrote:
> I would like to start writing Derby code which makes use of Java 5 
> features. More specifically:
>
> 1) I would like to take advantage of the Java 5 extensions for 
> ease-of-use and stronger type checking.
>
> 2) I would like to be able to write regression tests which verify that 
> user-written Java 5 code runs correctly as Derby functions and 
> procedures.
>
> Would anyone object to our requiring that developers use a Java 5 or 
> later compiler to build Derby? I believe that we would still require 
> the presence of the 1.4 libraries and the expectation would continue 
> to be that the compiler must compile down to 1.4 classes.
>
> Thanks,
> -Rick
>
>
Discussion on this thread has died down so I would like to summarize 
what has been said so far:

a) Java 5 source can't be compiled down to 1.4 class files. This means 
that any code which is necessary for Derby to operate must be 1.4 
source. This means that mandatory code cannot take advantage of Java 5 
features such as enums, generics, annotations, and varargs.

b) The CDC small device platforms require 1.4 level class files. Java 5 
class files will not run on CDC platforms.

c) There is no problem with using the Java 5 compiler to compile 1.4 
source into 1.4 targets. This already works today for those of us whose 
default compiler is Java 5 or Java 6.

d) Java 5 is available on all likely development platforms, including 
Windows, Linux, Mac OS X, and Solaris.

e) If we required Java 5 (or higher) in order to compile Derby, then we 
could use Java 5 features in optional engine code and in optional tests.

I propose that we require Java 5 (or higher) in order to build Derby. If 
there are no objections and no further discussion, then I intend to call 
a lazy consensus vote on this proposal.

Regards,
-Rick

Re: Requiring Java 5 compiler

Posted by David Van Couvering <da...@vancouvering.com>.
I think J2ME support is very important.

As another data point, NB requires that you build in JDK 1.5 just for
the reason you state, Mike: to avoid accidental use and checkin of JDK
1.6-specific features.  The ant script actually prevents you from
compiling with JDK 1.6 unless you set a specific property that
basically is like you signing a form saying "I know this is dangerous,
I'm willing to take the risk."

At the same time, oddly enough, it is a requirement that even though
you shouldn't compile in JDK 1.6, we should be able to.  It's
considered a P2 bug if the compile breaks on 1.6.

I learned this the hard way when we had some rowset code that didn't
implement the new ResultSet methods in JDBC.

David

On 9/18/07, Mike Matrigali <mi...@sbcglobal.net> wrote:
>
>
> Rick Hillegas wrote:
> > Mike Matrigali wrote:
> >> What about requiring jdk1.5 or higher for both building and running
> >> for the next release made off of trunk?
> >> /mikem
> > Would this involve abandoning support for small devices? I think that
> > CDC is still based on the 1.4 platform.
>
> This is a good question, we should resolve this before going forward.  I
> don't know the answer.  It would seem like a good thing to allow future
> versions for derby to support JSR169/J2ME - does anyone know if this can
> be done with jdk1.5 compiler/libraries.  This is a nice feature for
> an open source db that can't be provided by a lot of other db's.
>
> Maybe it can be done, but it has always seemed safer to me to always
> support building in the lowest jvm environment that we support running
> in.  If we really want to support building in 1.5 but running in 1.4
> how do make sure we don't have 1.5 library dependencies in critical
> portions of the code.
>
> Depending on the j2me answer i think the time is soon to move our
> minimum support from jdk14 to jdk15.  The question is if the next major
> release is too soon or not.  It seems like we should move either in
> the next release or the one after that.  More and more useful features
> are being added that require jdk15 support and people have to jump
> some hoops to use these (alternate build targets, multiple
> implementations, call by reflection, ...).
> >
> > Thanks,
> > -Rick
> >>
> >> Rick Hillegas wrote:
> >>> I would like to start writing Derby code which makes use of Java 5
> >>> features. More specifically:
> >>>
> >>> 1) I would like to take advantage of the Java 5 extensions for
> >>> ease-of-use and stronger type checking.
> >>>
> >>> 2) I would like to be able to write regression tests which verify
> >>> that user-written Java 5 code runs correctly as Derby functions and
> >>> procedures.
> >>>
> >>> Would anyone object to our requiring that developers use a Java 5 or
> >>> later compiler to build Derby? I believe that we would still require
> >>> the presence of the 1.4 libraries and the expectation would continue
> >>> to be that the compiler must compile down to 1.4 classes.
> >>>
> >>> Thanks,
> >>> -Rick
> >>>
> >>>
> >>>
> >
> >
>

Re: Requiring Java 5 compiler

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Mike Matrigali <mi...@sbcglobal.net> writes:

> Rick Hillegas wrote:
>> Mike Matrigali wrote:
>>> What about requiring jdk1.5 or higher for both building and running
>>> for the next release made off of trunk?
>>> /mikem
>> Would this involve abandoning support for small devices? I think
>> that CDC is still based on the 1.4 platform.
>
> This is a good question, we should resolve this before going forward.  I
> don't know the answer.  It would seem like a good thing to allow future
> versions for derby to support JSR169/J2ME - does anyone know if this can
> be done with jdk1.5 compiler/libraries.  This is a nice feature for
> an open source db that can't be provided by a lot of other db's.
>
> Maybe it can be done, but it has always seemed safer to me to always
> support building in the lowest jvm environment that we support running
> in.  If we really want to support building in 1.5 but running in 1.4
> how do make sure we don't have 1.5 library dependencies in critical
> portions of the code.

I don't think this is how it has been done before. Even when we
supported running Derby in 1.3, we required 1.4 to build Derby. The
problem with library dependencies was solved by compiling the Java 1.3
parts with source/target=1.3 and pointing compile.classpath to the 1.3
runtime library.

-- 
Knut Anders

Re: Requiring Java 5 compiler

Posted by Mike Matrigali <mi...@sbcglobal.net>.

Rick Hillegas wrote:
> Mike Matrigali wrote:
>> What about requiring jdk1.5 or higher for both building and running
>> for the next release made off of trunk?
>> /mikem
> Would this involve abandoning support for small devices? I think that 
> CDC is still based on the 1.4 platform.

This is a good question, we should resolve this before going forward.  I
don't know the answer.  It would seem like a good thing to allow future
versions for derby to support JSR169/J2ME - does anyone know if this can
be done with jdk1.5 compiler/libraries.  This is a nice feature for
an open source db that can't be provided by a lot of other db's.

Maybe it can be done, but it has always seemed safer to me to always 
support building in the lowest jvm environment that we support running
in.  If we really want to support building in 1.5 but running in 1.4
how do make sure we don't have 1.5 library dependencies in critical
portions of the code.

Depending on the j2me answer i think the time is soon to move our 
minimum support from jdk14 to jdk15.  The question is if the next major
release is too soon or not.  It seems like we should move either in
the next release or the one after that.  More and more useful features
are being added that require jdk15 support and people have to jump
some hoops to use these (alternate build targets, multiple 
implementations, call by reflection, ...).
> 
> Thanks,
> -Rick
>>
>> Rick Hillegas wrote:
>>> I would like to start writing Derby code which makes use of Java 5 
>>> features. More specifically:
>>>
>>> 1) I would like to take advantage of the Java 5 extensions for 
>>> ease-of-use and stronger type checking.
>>>
>>> 2) I would like to be able to write regression tests which verify 
>>> that user-written Java 5 code runs correctly as Derby functions and 
>>> procedures.
>>>
>>> Would anyone object to our requiring that developers use a Java 5 or 
>>> later compiler to build Derby? I believe that we would still require 
>>> the presence of the 1.4 libraries and the expectation would continue 
>>> to be that the compiler must compile down to 1.4 classes.
>>>
>>> Thanks,
>>> -Rick
>>>
>>>
>>>
> 
> 

Re: Requiring Java 5 compiler

Posted by Rick Hillegas <Ri...@Sun.COM>.
Mike Matrigali wrote:
> What about requiring jdk1.5 or higher for both building and running
> for the next release made off of trunk?
> /mikem
Would this involve abandoning support for small devices? I think that 
CDC is still based on the 1.4 platform.

Thanks,
-Rick
>
> Rick Hillegas wrote:
>> I would like to start writing Derby code which makes use of Java 5 
>> features. More specifically:
>>
>> 1) I would like to take advantage of the Java 5 extensions for 
>> ease-of-use and stronger type checking.
>>
>> 2) I would like to be able to write regression tests which verify 
>> that user-written Java 5 code runs correctly as Derby functions and 
>> procedures.
>>
>> Would anyone object to our requiring that developers use a Java 5 or 
>> later compiler to build Derby? I believe that we would still require 
>> the presence of the 1.4 libraries and the expectation would continue 
>> to be that the compiler must compile down to 1.4 classes.
>>
>> Thanks,
>> -Rick
>>
>>
>>


Re: Requiring Java 5 compiler

Posted by Mike Matrigali <mi...@sbcglobal.net>.
What about requiring jdk1.5 or higher for both building and running
for the next release made off of trunk?
/mikem

Rick Hillegas wrote:
> I would like to start writing Derby code which makes use of Java 5 
> features. More specifically:
> 
> 1) I would like to take advantage of the Java 5 extensions for 
> ease-of-use and stronger type checking.
> 
> 2) I would like to be able to write regression tests which verify that 
> user-written Java 5 code runs correctly as Derby functions and procedures.
> 
> Would anyone object to our requiring that developers use a Java 5 or 
> later compiler to build Derby? I believe that we would still require the 
> presence of the 1.4 libraries and the expectation would continue to be 
> that the compiler must compile down to 1.4 classes.
> 
> Thanks,
> -Rick
> 
> 
> 

Re: Requiring Java 5 compiler

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Rick Hillegas <Ri...@Sun.COM> writes:

> You are right. The compiler won't let you compile from Java 5 source
> down to 1.4 classes. We would not be able to use Java 5 features in
> our old code. However, using the Java 5 compiler would make the
> following possible:
>
> 1) Optional optimizations of engine code to take advantage of features
> introduced by later VMs.
>
> 2) New tools which take advantage of extensions added in later
> versions of Java. E.g., JMX-based tools--JMX is included in J2SE from
> version 5.0 on.
>
> 3) Tests which verify that user code, built under later versions of
> Java, plays well when it runs inside Derby functions and procedures.

I'm +1 to this. I have added some 1.5 code by piggybacking on the
optional jdk16 target and setting source level to 1.5, which works, but
I think it is cleaner to require a Java 5 compiler. Unless there is a
major development platform that lacks a Java 5 compiler (I'm not aware
of any), I think you should go for it!

-- 
Knut Anders

Re: Requiring Java 5 compiler

Posted by Rick Hillegas <Ri...@Sun.COM>.
Dag H. Wanvik wrote:
> Rick Hillegas <Ri...@Sun.COM> writes:
>
>   
>> Would anyone object to our requiring that developers use a Java 5 or
>> later compiler to build Derby? I believe that we would still require
>> the presence of the 1.4 libraries and the expectation would continue
>> to be that the compiler must compile down to 1.4 classes.
>>     
>
> AFAIK, that's not possible in the general case, cf tools like
> Retroweaver http://retroweaver.sourceforge.net/).
>
> Dag
>   
You are right. The compiler won't let you compile from Java 5 source 
down to 1.4 classes. We would not be able to use Java 5 features in our 
old code. However, using the Java 5 compiler would make the following 
possible:

1) Optional optimizations of engine code to take advantage of features 
introduced by later VMs.

2) New tools which take advantage of extensions added in later versions 
of Java. E.g., JMX-based tools--JMX is included in J2SE from version 5.0 on.

3) Tests which verify that user code, built under later versions of 
Java, plays well when it runs inside Derby functions and procedures.

Thanks,
-Rick

Re: Requiring Java 5 compiler

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Rick Hillegas <Ri...@Sun.COM> writes:

> Would anyone object to our requiring that developers use a Java 5 or
> later compiler to build Derby? I believe that we would still require
> the presence of the 1.4 libraries and the expectation would continue
> to be that the compiler must compile down to 1.4 classes.

AFAIK, that's not possible in the general case, cf tools like
Retroweaver http://retroweaver.sourceforge.net/).

Dag