My I Copy Code From the JDK Into My Own Classes?

P

Peter Müller

I want to copy the source code from some JDK classes into my own project
and modify the code. The new classes resides in com*. I use the runtime
enviroment from Sun.
I have already looked in LICESENE.rtf but haven't found anything
considering the problem.

The modified source code will not be distributed. The result is a
commercial application.
 
L

Lew

Peter said:
I want to copy the source code from some JDK classes into my own project
and modify the code. The new classes resides in com*.  I use the runtime
enviroment from Sun [sic].
I have already looked in LICESENE.rtf [sic] but haven't found anything
considering the problem.

The modified source code will not be distributed. The result is a
commercial application.

No.
 
D

Daniele Futtorovic

The modified source code will not be distributed. The result is a
commercial application.

A commercial application that won't be distributed?
 
P

Paul Cager

I want to copy the source code from some JDK classes into my own project
and modify the code. The new classes resides in com*.  I use the runtime
enviroment from Sun.
I have already looked in LICESENE.rtf but haven't found anything
considering the problem.

The modified source code will not be distributed. The result is a
commercial application.

It depends on the license of each individual file. E.g most of the
ones in com.sun.org.apache package can be modified and distributed
with or without source code.

But the great majority of files cannot be modified and distributed
(supplemental terms in http://java.sun.com/javase/6/jdk-6u3-license.txt).
 
A

Arne Vajhøj

I want to copy the source code from some JDK classes into my own project
and modify the code. The new classes resides in com*. I use the runtime
enviroment from Sun.
I have already looked in LICESENE.rtf but haven't found anything
considering the problem.

The fact that there there is nothing there means that you cannot
do it.

Copyright works so that unless you have a license then you
can not use the code.

It should be pretty obvious because Oracle sued
Google for allegedly copying JDK code for Android.
No decision about whether that is indeed the case
yet, but the lawsuit would not make any sense if
anyone could copy and use the JDK code as they
want to.

Arne
 
J

javax.swing.JSnarker

I want to copy the source code from some JDK classes into my own project
and modify the code. The new classes resides in com*. I use the runtime
enviroment from Sun.
I have already looked in LICESENE.rtf but haven't found anything
considering the problem.

The modified source code will not be distributed. The result is a
commercial application.

Probably not. Non-OpenJDK JDK code is not licensed for this sort of use
(unless you pay Oracle, perhaps). If OpenJDK code is under any of the
GPL/LGPL family of licenses, then distributing a closed-source
derivative work violates the license.

If there's any JDK/OpenJDK code under something like the BSD or Apache
license it may be redistributable under those terms.
 
E

Eric Sosman

I want to copy the source code from some JDK classes into my own project
and modify the code. The new classes resides in com*. I use the runtime
enviroment from Sun.
I have already looked in LICESENE.rtf but haven't found anything
considering the problem.

The modified source code will not be distributed. The result is a
commercial application.

"Go not to the Elves for counsel, for they will say both yes and no."

Go not to programming forums for legal counsel, for they will answer
with great authority about what they know not. And when Oracle takes
you to court (see the track record), "Somebody on alt.opinion.groundless
told me it's OK; I don't actually know who the Hell he is but he posts
under the name JavaNitwit and writes funny flames" is probably not the
defense your attorney will wish he could mount on your behalf.
 
N

Nigel Wade

I want to copy the source code from some JDK classes into my own project
and modify the code. The new classes resides in com*. I use the runtime
enviroment from Sun.
I have already looked in LICESENE.rtf but haven't found anything
considering the problem.

The modified source code will not be distributed. The result is a
commercial application.

IANAL, but...

if you require legal advice ask a lawyer, not a programmer.
 
R

Roedy Green

I want to copy the source code from some JDK classes into my own project
and modify the code. The new classes resides in com*. I use the runtime
enviroment from Sun.
I have already looked in LICESENE.rtf but haven't found anything
considering the problem.

The proper OO way to do that is to extend the class and override some
methods. You can do that so long as the base class is not final.

When I wrote LEDataStream, I could not do that because InputDataStream
and OutputDataStream were final. So I had to use delegation.

--
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..
 
L

Lew

Roedy said:
Peter Müller wrote, quoted or indirectly quoted someone who said :


The proper OO way to do that is to extend the class and override some
methods.  You can do that so long as the base class is not final.  

When I wrote LEDataStream, I could not do that because InputDataStream
and OutputDataStream were final. So I had to use delegation.

Roedy makes a really good point. Even if you were allowed to copy the
JDK code a smart programmer wouldn't want to.

If you're not modifying the code, then you just use the binaries and
you have no work to do.
 
A

Andreas Leitgeb

Lew said:
Roedy makes a really good point. Even if you were allowed to copy the
JDK code a smart programmer wouldn't want to.

I once had a problem that I solved with rip-from-jsl & mod:
For jsl's PriorityQueue I needed a new operation: remove the
top item, and add a new one. Algorithmically, doing the removal
and insertion separately is a waste of effort: on removal, the
element at the end of the storage is placed to the front, and then
shifted back into a consistent state. After that, a new element is
added to the end, and shifted forward into a consistent state.

Instead, I copied the code of the PQ to a new class and added a
replace-method, that would remove the top element, place the new
element into top-position and shift that back into a consistent
state.

Deriving from PriorityQueue wouldn't have given me access to the
actual storage array, and it turned out that it was indeed worth
the trouble, according to measurements made before and afterwards)

It was just for private fun (no re-distribution intended), so I had
no issues with license. I know, this is of no direct help to the OP.
Its just one example of where mere derivation didn't quite cut it.
 
L

Lew

I once had a problem that I solved with rip-from-jsl & mod:
For jsl's PriorityQueue I needed a new operation: remove the
top item, and add a new one.  Algorithmically, doing the removal
and insertion separately is a waste of effort: on removal, the
element at the end of the storage is placed to the front, and then
shifted back into a consistent state. After that, a new element is
added to the end, and shifted forward into a consistent state.

Instead, I copied the code of the PQ to a new class and added a
replace-method, that would remove the top element, place the new
element into top-position and shift that back into a consistent
state.

Deriving from PriorityQueue wouldn't have given me access to the
actual storage array, and it turned out that it was indeed worth
the trouble, according to measurements made before and afterwards)

It was just for private fun (no re-distribution intended), so I had
no issues with license. I know, this is of no direct help to the OP.
Its just one example of where mere derivation didn't quite cut it.

Good point but not relevant to the OP's scenario.

Had you intended the code for reuse, as the OP maybe does, you might
have used an open-source PriorityQueue as the starting point, or gone
to a good algorithms book and clean-room it, avoiding license
conflicts altogether.
http://www.amazon.com/Introduction-Algorithms-Third-Thomas-Cormen/dp/0262033844/
 
A

Andreas Leitgeb

Lew said:
I once had a problem that I solved with rip-from-jsl & mod: [...]

It was just for private fun (no re-distribution intended), so I had
no issues with license. I know, this is of no direct help to the OP.
Its just one example of where mere derivation didn't quite cut it.
Good point but not relevant to the OP's scenario.

Thanks & Yep (that's what I wrote)
Had you intended the code for reuse, as the OP maybe does, you might
have used an open-source PriorityQueue as the starting point, or gone
to a good algorithms book and clean-room it, avoiding license
conflicts altogether.

Has he posted, which jls class he actually fancied to modifiy?
 
S

Stanimir Stamenkov

Thu, 03 Mar 2011 22:31:09 +0100, /Daniele Futtorovic/:
A commercial application that won't be distributed?

It could be a server-application communicating with the client using
possibly platform independent protocol, i.e. no code (source or
complied form) gets distributed - just the service output.
 
A

Arne Vajhøj

Thu, 03 Mar 2011 22:31:09 +0100, /Daniele Futtorovic/:

It could be a server-application communicating with the client using
possibly platform independent protocol, i.e. no code (source or complied
form) gets distributed - just the service output.

Well - he actually wrote that the source code would not
be distributed.

That is the standard for commercial apps.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top