Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36222 > unrolled thread

Re: Type conversions with the empty string

Started byRobert Klemme <shortcutter@googlemail.com>
First post2017-01-29 17:57 +0100
Last post2017-02-13 12:46 -0500
Articles 20 on this page of 48 — 8 participants

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Type conversions with the empty string Robert Klemme <shortcutter@googlemail.com> - 2017-01-29 17:57 +0100
    Re: Type conversions with the empty string Joerg Meier <joergmmeier@arcor.de> - 2017-01-30 07:39 +0100
      Re: Type conversions with the empty string Robert Klemme <shortcutter@googlemail.com> - 2017-01-30 10:08 +0100
        Re: Type conversions with the empty string Joerg Meier <joergmmeier@arcor.de> - 2017-02-07 09:26 +0100
          Re: Type conversions with the empty string Andreas Leitgeb <avl@logic.at> - 2017-02-07 08:34 +0000
          Re: Type conversions with the empty string lewbloch@gmail.com - 2017-02-12 11:20 -0800
            Re: Type conversions with the empty string Joerg Meier <joergmmeier@arcor.de> - 2017-02-13 08:40 +0100
              Re: Type conversions with the empty string Andreas Leitgeb <avl@logic.at> - 2017-02-13 17:38 +0000
                Re: Type conversions with the empty string Andreas Leitgeb <avl@logic.at> - 2017-02-13 17:48 +0000
                  Re: Type conversions with the empty string Robert Klemme <shortcutter@googlemail.com> - 2017-02-16 10:53 +0100
                  Re: Type conversions with the empty string lewbloch@gmail.com - 2017-02-19 02:42 -0800
                    Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-19 08:45 -0500
                      Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 09:20 -0500
                        Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 09:21 -0500
                        Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-19 10:51 -0500
                          Re: Type conversions with the empty string Robert Klemme <shortcutter@googlemail.com> - 2017-02-19 19:55 +0100
                            Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-19 15:55 -0500
                          Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 23:31 -0500
                            Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 08:39 -0500
                              Re: Type conversions with the empty string Eric Douglas <e.d.programmer@gmail.com> - 2017-02-20 06:10 -0800
                                Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 09:54 -0500
                              Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-20 10:25 -0500
                                Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 11:02 -0500
                                  Re: Type conversions with the empty string Eric Douglas <e.d.programmer@gmail.com> - 2017-02-20 08:45 -0800
                                    Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 14:46 -0500
                                      Re: Type conversions with the empty string Eric Douglas <e.d.programmer@gmail.com> - 2017-02-20 12:23 -0800
                                        Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 16:31 -0500
                                  Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-20 11:58 -0500
                                    Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 14:46 -0500
                                      Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-20 15:45 -0500
                                        Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-20 15:54 -0500
                                          Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 20:31 -0500
                    Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 09:13 -0500
                      Re: Type conversions with the empty string Martin Gregorie <martin@address-in-sig.invalid> - 2017-02-19 14:43 +0000
                        Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 10:11 -0500
                          Re: Type conversions with the empty string Martin Gregorie <martin@address-in-sig.invalid> - 2017-02-19 15:20 +0000
                      Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-19 10:53 -0500
                        Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-19 23:24 -0500
                          Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 08:43 -0500
                            Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-20 10:16 -0500
                              Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 11:03 -0500
                                Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-20 12:00 -0500
                                  Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-20 14:49 -0500
                                    Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-20 15:47 -0500
                                      Re: Type conversions with the empty string lewbloch@gmail.com - 2017-02-20 22:18 -0800
                                        Re: Type conversions with the empty string Jerry Stuckle <jstucklex@attglobal.net> - 2017-02-21 08:23 -0500
              Re: Type conversions with the empty string lewbloch@gmail.com - 2017-02-19 02:39 -0800
          Re: Type conversions with the empty string Arne Vajhøj <arne@vajhoej.dk> - 2017-02-13 12:46 -0500

Page 1 of 3  [1] 2 3  Next page →


#36222 — Re: Type conversions with the empty string

FromRobert Klemme <shortcutter@googlemail.com>
Date2017-01-29 17:57 +0100
SubjectRe: Type conversions with the empty string
Message-ID<ef6l8kF5p6bU1@mid.individual.net>
On 28.01.2017 14:43, Stefan Ram wrote:

>   I'd say that
>
> "".valueOf( 123 )
>
>   is even more robust than
>
> String.valueOf( 123 )
>
>   because the former is still working when a file »String.class«
>   is found early enough in the class path.

What do you mean by that?  Why would the second form be less robust? 
This does not make any sense to me as the same class is used.

Regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [next] | [standalone]


#36223

FromJoerg Meier <joergmmeier@arcor.de>
Date2017-01-30 07:39 +0100
Message-ID<gkienx5o72gf.r7zyv6z3bfpc.dlg@40tude.net>
In reply to#36222
On Sun, 29 Jan 2017 17:57:55 +0100, Robert Klemme wrote:

> On 28.01.2017 14:43, Stefan Ram wrote:
>>   I'd say that

>> "".valueOf( 123 )

>>   is even more robust than

>> String.valueOf( 123 )

>>   because the former is still working when a file »String.class«
>>   is found early enough in the class path.
> What do you mean by that?  Why would the second form be less robust? 
> This does not make any sense to me as the same class is used.

Check http://ideone.com/9xXYpi

		System.out.println("" + 123);
		System.out.println(String.valueOf(123));
		
ends up printing out:

123
15129

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#36224

FromRobert Klemme <shortcutter@googlemail.com>
Date2017-01-30 10:08 +0100
Message-ID<ef8e4gFgaq3U1@mid.individual.net>
In reply to#36223
On 30.01.2017 07:39, Joerg Meier wrote:
> On Sun, 29 Jan 2017 17:57:55 +0100, Robert Klemme wrote:
>
>> On 28.01.2017 14:43, Stefan Ram wrote:
>>>   I'd say that
>
>>> "".valueOf( 123 )
>
>>>   is even more robust than
>
>>> String.valueOf( 123 )
>
>>>   because the former is still working when a file »String.class«
>>>   is found early enough in the class path.
>> What do you mean by that?  Why would the second form be less robust?
>> This does not make any sense to me as the same class is used.
>
> Check http://ideone.com/9xXYpi
>
> 		System.out.println("" + 123);
> 		System.out.println(String.valueOf(123));
> 		
> ends up printing out:
>
> 123
> 15129

Your remark about class path mislead me.  This is not about class path 
but about namespaces.

Come on.  This is a constructed edge case for various reasons:

  - Although it is of course perfectly legal to implement a class called 
"String" in any other package someone who does that would have to have 
very good reasons to do it - especially since it makes any reference to 
java.lang.String extremely tedious.
  - Even more so as it shadows methods in java.lang.String with methods 
having the same name but incompatible semantics.
  - PrintStream.println(int) does exist, so would have been the much 
more reasonable and concise choice which does not fall into this trap.

https://docs.oracle.com/javase/8/docs/api/java/io/PrintStream.html#print-int-

Basically you are using a String constant as a shortcut for the full 
qualified class name java.lang.String.

Btw. that class could still have used java.lang.String.valueOf() and 
avoided the String constant:

class String {
   public static java.lang.String valueOf(int i) {
     return java.lang.String.valueOf(i * i);
   }
}

For me this edge case is so obscure that it does not warrant digressing 
from what a reasonable programmer would do and to avoid the use of a 
String constant here.

This case does exhibit a interesting detail of the Java compiler in 
Eclipse Mars 4.5.2: even though invocation of static methods on 
instances is set to be flagged as warning it does /not/ bark on the line 
with "" + 123.  That is odd.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#36243

FromJoerg Meier <joergmmeier@arcor.de>
Date2017-02-07 09:26 +0100
Message-ID<15m3gy8mef7tv$.93ppj4f0t83$.dlg@40tude.net>
In reply to#36224
On Mon, 30 Jan 2017 10:08:30 +0100, Robert Klemme wrote:

> On 30.01.2017 07:39, Joerg Meier wrote:
>> On Sun, 29 Jan 2017 17:57:55 +0100, Robert Klemme wrote:
>>> On 28.01.2017 14:43, Stefan Ram wrote:
>>>>   I'd say that

>>>> "".valueOf( 123 )

>>>>   is even more robust than

>>>> String.valueOf( 123 )

>>>>   because the former is still working when a file »String.class«
>>>>   is found early enough in the class path.
>>> What do you mean by that?  Why would the second form be less robust?
>>> This does not make any sense to me as the same class is used.
>> Check http://ideone.com/9xXYpi
> Your remark about class path mislead me.  This is not about class path 
> but about namespaces.

First, let me start by saying that despite both of us being from Germany, I
am not Stefan. That being said:

>   - Although it is of course perfectly legal to implement a class called 
> "String" in any other package someone who does that would have to have 
> very good reasons to do it - especially since it makes any reference to 
> java.lang.String extremely tedious.

You misunderstood. You can literally have a class named java.lang.String,
and if it is early enough on the class path, it can override "the"
java.lang.String. Due to j.l.String being final, this is (short of evil
Reflection magic) the only way to add or change behaviour of the String
class that still works with classes accepting only String as a parameter.

Now, clearly, that is not a GOOD programming practice, but not everyone
writes code for noble reasons. This line of thinking is more about attack
vectors and less about accidental mistakes.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#36244

FromAndreas Leitgeb <avl@logic.at>
Date2017-02-07 08:34 +0000
Message-ID<slrno9j1n8.pvm.avl@logic.at>
In reply to#36243
Joerg Meier <joergmmeier@arcor.de> wrote:
> You misunderstood. You can literally have a class named java.lang.String,
> and if it is early enough on the class path, it can override "the"
> java.lang.String.

If this is possible (maybe by patching the JVM), then wouldn't "" be of
that other j.l.String type, too?

[toc] | [prev] | [next] | [standalone]


#36248

Fromlewbloch@gmail.com
Date2017-02-12 11:20 -0800
Message-ID<7fa3ca72-434c-4a41-88d4-1dfe900903f2@googlegroups.com>
In reply to#36243
On Tuesday, February 7, 2017 at 12:27:10 AM UTC-8, Joerg Meier wrote:
> On Mon, 30 Jan 2017 10:08:30 +0100, Robert Klemme wrote:
> 
> > On 30.01.2017 07:39, Joerg Meier wrote:
> >> On Sun, 29 Jan 2017 17:57:55 +0100, Robert Klemme wrote:
> >>> On 28.01.2017 14:43, Stefan Ram wrote:
> >>>>   I'd say that
> 
> >>>> "".valueOf( 123 )
> 
> >>>>   is even more robust than
> 
> >>>> String.valueOf( 123 )
> 
> >>>>   because the former is still working when a file »String.class«
> >>>>   is found early enough in the class path.
> >>> What do you mean by that?  Why would the second form be less robust?
> >>> This does not make any sense to me as the same class is used.
> >> Check http://ideone.com/9xXYpi
> > Your remark about class path mislead me.  This is not about class path 
> > but about namespaces.
> 
> First, let me start by saying that despite both of us being from Germany, I
> am not Stefan. That being said:
> 
> >   - Although it is of course perfectly legal to implement a class called 
> > "String" in any other package someone who does that would have to have 
> > very good reasons to do it - especially since it makes any reference to 
> > java.lang.String extremely tedious.
> 
> You misunderstood. You can literally have a class named java.lang.String,
> and if it is early enough on the class path, it can override "the"
> java.lang.String. Due to j.l.String being final, this is (short of evil
> Reflection magic) the only way to add or change behaviour of the String
> class that still works with classes accepting only String as a parameter.
> 
> Now, clearly, that is not a GOOD programming practice, but not everyone
> writes code for noble reasons. This line of thinking is more about attack
> vectors and less about accidental mistakes.

Anyone who puts classes in `java.lang....` like that is evil and breaking the law.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#36249

FromJoerg Meier <joergmmeier@arcor.de>
Date2017-02-13 08:40 +0100
Message-ID<fp2cxqhix1oj$.kdivdylq22jv$.dlg@40tude.net>
In reply to#36248
On Sun, 12 Feb 2017 11:20:49 -0800 (PST), lewbloch@gmail.com wrote:

> Anyone who puts classes in `java.lang....` like that is evil and
> breaking the law.

What law ?

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#36251

FromAndreas Leitgeb <avl@logic.at>
Date2017-02-13 17:38 +0000
Message-ID<slrnoa3rso.pvm.avl@logic.at>
In reply to#36249
Joerg Meier <joergmmeier@arcor.de> wrote:
> On Sun, 12 Feb 2017 11:20:49 -0800 (PST), lewbloch@gmail.com wrote:
>> Anyone who puts classes in `java.lang....` like that is evil and
>> breaking the law.
> What law ?

The law of good taste, for example ;-)

[toc] | [prev] | [next] | [standalone]


#36254

FromAndreas Leitgeb <avl@logic.at>
Date2017-02-13 17:48 +0000
Message-ID<slrnoa3sej.pvm.avl@logic.at>
In reply to#36251
Andreas Leitgeb <avl@logic.at> wrote:
> Joerg Meier <joergmmeier@arcor.de> wrote:
>> On Sun, 12 Feb 2017 11:20:49 -0800 (PST), lewbloch@gmail.com wrote:
>>> Anyone who puts classes in `java.lang....` like that is evil and
>>> breaking the law.
>> What law ?
> The law of good taste, for example ;-)

Wait, forget it.  It's not about spelling out the "java.lang." for
class like String or System, it's about putting custom classes into
that package.

I'm too lazy to check if it's relevant for java.lang, but in principle
it's possible to "seal" a package, and then it's against the java
compiler's "law" to add or replace classes in it. Maybe, the Navy
Seals will come to arrest threspassers.

Anyway, that's not the point of a few posts upthread, where the
point was about a scenario of someone messing with the JVM itself,
to get their own java.lang.String dummy in, e.g. to troll some 3rd-
party closed-source code.  People with that agenda are not likely
to care about laws (might even be a case of DMCA-violation for those
who live where it matters - so much for "What law?").

[toc] | [prev] | [next] | [standalone]


#36282

FromRobert Klemme <shortcutter@googlemail.com>
Date2017-02-16 10:53 +0100
Message-ID<eglb3tFj65aU1@mid.individual.net>
In reply to#36254
On 13.02.2017 18:48, Andreas Leitgeb wrote:

> Anyway, that's not the point of a few posts upthread, where the
> point was about a scenario of someone messing with the JVM itself,
> to get their own java.lang.String dummy in, e.g. to troll some 3rd-
> party closed-source code.  People with that agenda are not likely
> to care about laws (might even be a case of DMCA-violation for those
> who live where it matters - so much for "What law?").

But then "" does not help as you have said yourself earlier: that object 
would be of the wrong java.lang.String class as well so Stefan's point 
of ensuring to use the correct (i.e. original) java.lang.String via the 
empty string constant does not work.  That only works if you create a 
String class in a different package which is then used in the scope.

Just to repeat myself: I still find that whole approach to use an 
instance to invoke a static method wrong.  I have yet to see a 
compelling reason to do so.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#36332

Fromlewbloch@gmail.com
Date2017-02-19 02:42 -0800
Message-ID<6174cfc5-83af-4f1c-a83a-2b83a6f9af7a@googlegroups.com>
In reply to#36254
Andreas Leitgeb wrote:
> Andreas Leitgeb wrote:
> > Joerg Meier wrote:
> >> lewbloch wrote:
> >>> Anyone who puts classes in `java.lang....` like that is evil and
> >>> breaking the law.
> >> What law ?

Trademark and copyright law.

> > The law of good taste, for example ;-)
> 
> Wait, forget it.  It's not about spelling out the "java.lang." for
> class like String or System, it's about putting custom classes into
> that package.

Which breaks the law.

> I'm too lazy to check if it's relevant for java.lang, but in principle
> it's possible to "seal" a package, and then it's against the java
> compiler's "law" to add or replace classes in it. Maybe, the Navy
> Seals will come to arrest threspassers [sic].

More like Oracle's lawyers.

> Anyway, that's not the point of a few posts upthread, where the
> point was about a scenario of someone messing with the JVM itself,
> to get their own java.lang.String dummy in, e.g. to troll some 3rd-
> party closed-source code.  People with that agenda are not likely
> to care about laws (might even be a case of DMCA-violation for those
> who live where it matters - so much for "What law?").

As far as I know, not being a lawyer, most countries respect the trademark and copyright laws that protect the use of `java.lang` and `javax.lang` packages.

--
Lew

[toc] | [prev] | [next] | [standalone]


#36333

FromJerry Stuckle <jstucklex@attglobal.net>
Date2017-02-19 08:45 -0500
Message-ID<o8c7e7$bcf$1@jstuckle.eternal-september.org>
In reply to#36332
On 2/19/2017 5:42 AM, lewbloch@gmail.com wrote:
> Andreas Leitgeb wrote:
>> Andreas Leitgeb wrote:
>>> Joerg Meier wrote:
>>>> lewbloch wrote:
>>>>> Anyone who puts classes in `java.lang....` like that is evil and
>>>>> breaking the law.
>>>> What law ?
> 
> Trademark and copyright law.
> 
>>> The law of good taste, for example ;-)
>>
>> Wait, forget it.  It's not about spelling out the "java.lang." for
>> class like String or System, it's about putting custom classes into
>> that package.
> 
> Which breaks the law.
> 
>> I'm too lazy to check if it's relevant for java.lang, but in principle
>> it's possible to "seal" a package, and then it's against the java
>> compiler's "law" to add or replace classes in it. Maybe, the Navy
>> Seals will come to arrest threspassers [sic].
> 
> More like Oracle's lawyers.
> 
>> Anyway, that's not the point of a few posts upthread, where the
>> point was about a scenario of someone messing with the JVM itself,
>> to get their own java.lang.String dummy in, e.g. to troll some 3rd-
>> party closed-source code.  People with that agenda are not likely
>> to care about laws (might even be a case of DMCA-violation for those
>> who live where it matters - so much for "What law?").
> 
> As far as I know, not being a lawyer, most countries respect the trademark and copyright laws that protect the use of `java.lang` and `javax.lang` packages.
> 
> --
> Lew
> 

You're correct.  You're not a lawyer.  There is nothing in either
trademark or copyright law which prevents you from replacing something,
as long as you don't use the original item.  They only limit what you
can do with the trademarked or copyrighted item.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#36335

FromArne Vajhøj <arne@vajhoej.dk>
Date2017-02-19 09:20 -0500
Message-ID<o8c9jv$6fq$1@gioia.aioe.org>
In reply to#36333
On 2/19/2017 8:45 AM, Jerry Stuckle wrote:
> On 2/19/2017 5:42 AM, lewbloch@gmail.com wrote:
>> Andreas Leitgeb wrote:
>>> Anyway, that's not the point of a few posts upthread, where the
>>> point was about a scenario of someone messing with the JVM
>>> itself, to get their own java.lang.String dummy in, e.g. to troll
>>> some 3rd- party closed-source code.  People with that agenda are
>>> not likely to care about laws (might even be a case of
>>> DMCA-violation for those who live where it matters - so much for
>>> "What law?").
>>
>> As far as I know, not being a lawyer, most countries respect the
>> trademark and copyright laws that protect the use of `java.lang`
>> and `javax.lang` packages.

> You're correct.  You're not a lawyer.  There is nothing in either
> trademark or copyright law which prevents you from replacing
> something, as long as you don't use the original item.  They only
> limit what you can do with the trademarked or copyrighted item.

If we assume Oracle Java (which Lew seems to have done explicitly),
the the logic is rather simple.

The license states:

<quote>
Oracle grants you a non-exclusive, non-transferable, limited license 
without license fees to reproduce and use internally the Software 
complete and unmodified for the sole purpose of running Programs.</quote>

<quote>
Unless enforcement is prohibited by applicable law, you may not modify, 
decompile, or reverse engineer Software.
</quote>

The license prohibits modifications of the software.

So:

replacing java.lang.String => modified software => no Java license => 
usage of all the other Java classes is copyright violation

OpenJDK on the other side is covered by GPL license. So if the fake
java.lang.String is under GPL, then copyright should be good.

Trademark only applies when you try to distribute the non-Java
thing as being Java. But there is a precedent for it costing
20 M$.

Arne


[toc] | [prev] | [next] | [standalone]


#36336

FromArne Vajhøj <arne@vajhoej.dk>
Date2017-02-19 09:21 -0500
Message-ID<o8c9m6$6fq$2@gioia.aioe.org>
In reply to#36335
On 2/19/2017 9:20 AM, Arne Vajhøj wrote:
> On 2/19/2017 8:45 AM, Jerry Stuckle wrote:
>> On 2/19/2017 5:42 AM, lewbloch@gmail.com wrote:
>>> Andreas Leitgeb wrote:
>>>> Anyway, that's not the point of a few posts upthread, where the
>>>> point was about a scenario of someone messing with the JVM
>>>> itself, to get their own java.lang.String dummy in, e.g. to troll
>>>> some 3rd- party closed-source code.  People with that agenda are
>>>> not likely to care about laws (might even be a case of
>>>> DMCA-violation for those who live where it matters - so much for
>>>> "What law?").
>>>
>>> As far as I know, not being a lawyer, most countries respect the
>>> trademark and copyright laws that protect the use of `java.lang`
>>> and `javax.lang` packages.
>
>> You're correct.  You're not a lawyer.  There is nothing in either
>> trademark or copyright law which prevents you from replacing
>> something, as long as you don't use the original item.  They only
>> limit what you can do with the trademarked or copyrighted item.
>
> If we assume Oracle Java (which Lew seems to have done explicitly),
> the the logic is rather simple.
>
> The license states:
>
> <quote>
> Oracle grants you a non-exclusive, non-transferable, limited license
> without license fees to reproduce and use internally the Software
> complete and unmodified for the sole purpose of running Programs.</quote>
>
> <quote>
> Unless enforcement is prohibited by applicable law, you may not modify,
> decompile, or reverse engineer Software.
> </quote>
>
> The license prohibits modifications of the software.
>
> So:
>
> replacing java.lang.String => modified software => no Java license =>
> usage of all the other Java classes is copyright violation
>
> OpenJDK on the other side is covered by GPL license. So if the fake
> java.lang.String is under GPL, then copyright should be good.

GPL with classpath exception!

Arne

[toc] | [prev] | [next] | [standalone]


#36340

FromJerry Stuckle <jstucklex@attglobal.net>
Date2017-02-19 10:51 -0500
Message-ID<o8cepp$5gu$1@jstuckle.eternal-september.org>
In reply to#36335
On 2/19/2017 9:20 AM, Arne Vajhøj wrote:
> On 2/19/2017 8:45 AM, Jerry Stuckle wrote:
>> On 2/19/2017 5:42 AM, lewbloch@gmail.com wrote:
>>> Andreas Leitgeb wrote:
>>>> Anyway, that's not the point of a few posts upthread, where the
>>>> point was about a scenario of someone messing with the JVM
>>>> itself, to get their own java.lang.String dummy in, e.g. to troll
>>>> some 3rd- party closed-source code.  People with that agenda are
>>>> not likely to care about laws (might even be a case of
>>>> DMCA-violation for those who live where it matters - so much for
>>>> "What law?").
>>>
>>> As far as I know, not being a lawyer, most countries respect the
>>> trademark and copyright laws that protect the use of `java.lang`
>>> and `javax.lang` packages.
> 
>> You're correct.  You're not a lawyer.  There is nothing in either
>> trademark or copyright law which prevents you from replacing
>> something, as long as you don't use the original item.  They only
>> limit what you can do with the trademarked or copyrighted item.
> 
> If we assume Oracle Java (which Lew seems to have done explicitly),
> the the logic is rather simple.
> 
> The license states:
> 
> <quote>
> Oracle grants you a non-exclusive, non-transferable, limited license
> without license fees to reproduce and use internally the Software
> complete and unmodified for the sole purpose of running Programs.</quote>
> 
> <quote>
> Unless enforcement is prohibited by applicable law, you may not modify,
> decompile, or reverse engineer Software.
> </quote>
> 
> The license prohibits modifications of the software.
>

Adding your own class to your own files is not modification of the software.

> So:
> 
> replacing java.lang.String => modified software => no Java license =>
> usage of all the other Java classes is copyright violation
> 

You have not modified any existing software.  You have replaced a class
with your own.

> OpenJDK on the other side is covered by GPL license. So if the fake
> java.lang.String is under GPL, then copyright should be good.
> 
> Trademark only applies when you try to distribute the non-Java
> thing as being Java. But there is a precedent for it costing
> 20 M$.
> 
> Arne
> 
> 
> 



-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#36344

FromRobert Klemme <shortcutter@googlemail.com>
Date2017-02-19 19:55 +0100
Message-ID<egu80jFd27oU1@mid.individual.net>
In reply to#36340
On 19.02.2017 16:51, Jerry Stuckle wrote:
> On 2/19/2017 9:20 AM, Arne Vajhøj wrote:

>> The license prohibits modifications of the software.
>
> Adding your own class to your own files is not modification of the software.

I think in this case it is because I am almost sure that java.lang 
package is sealed so simply placing something on the class path "early 
enough" is not sufficient.  You would have to unpackage and repackage 
which could be interpreted as a form of reverse engineering.

Cheers

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#36346

FromJerry Stuckle <jstucklex@attglobal.net>
Date2017-02-19 15:55 -0500
Message-ID<o8d0l6$886$1@jstuckle.eternal-september.org>
In reply to#36344
On 2/19/2017 1:55 PM, Robert Klemme wrote:
> On 19.02.2017 16:51, Jerry Stuckle wrote:
>> On 2/19/2017 9:20 AM, Arne Vajhøj wrote:
> 
>>> The license prohibits modifications of the software.
>>
>> Adding your own class to your own files is not modification of the
>> software.
> 
> I think in this case it is because I am almost sure that java.lang
> package is sealed so simply placing something on the class path "early
> enough" is not sufficient.  You would have to unpackage and repackage
> which could be interpreted as a form of reverse engineering.
> 
> Cheers
> 
>     robert
> 

Are you sure?  What happens if you have two classes with the same name
in the classpath?

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#36354

FromArne Vajhøj <arne@vajhoej.dk>
Date2017-02-19 23:31 -0500
Message-ID<o8dre9$qlq$1@gioia.aioe.org>
In reply to#36340
On 2/19/2017 10:51 AM, Jerry Stuckle wrote:
> On 2/19/2017 9:20 AM, Arne Vajhøj wrote:
>> On 2/19/2017 8:45 AM, Jerry Stuckle wrote:
>>> On 2/19/2017 5:42 AM, lewbloch@gmail.com wrote:
>>>> Andreas Leitgeb wrote:
>>>>> Anyway, that's not the point of a few posts upthread, where the
>>>>> point was about a scenario of someone messing with the JVM
>>>>> itself, to get their own java.lang.String dummy in, e.g. to troll
>>>>> some 3rd- party closed-source code.  People with that agenda are
>>>>> not likely to care about laws (might even be a case of
>>>>> DMCA-violation for those who live where it matters - so much for
>>>>> "What law?").
>>>>
>>>> As far as I know, not being a lawyer, most countries respect the
>>>> trademark and copyright laws that protect the use of `java.lang`
>>>> and `javax.lang` packages.
>>
>>> You're correct.  You're not a lawyer.  There is nothing in either
>>> trademark or copyright law which prevents you from replacing
>>> something, as long as you don't use the original item.  They only
>>> limit what you can do with the trademarked or copyrighted item.
>>
>> If we assume Oracle Java (which Lew seems to have done explicitly),
>> the the logic is rather simple.
>>
>> The license states:
>>
>> <quote>
>> Oracle grants you a non-exclusive, non-transferable, limited license
>> without license fees to reproduce and use internally the Software
>> complete and unmodified for the sole purpose of running Programs.</quote>
>>
>> <quote>
>> Unless enforcement is prohibited by applicable law, you may not modify,
>> decompile, or reverse engineer Software.
>> </quote>
>>
>> The license prohibits modifications of the software.
>
> Adding your own class to your own files is not modification of the software.

Of course it is.

We Oracle software which is a Java runtime environment consisting of:
* Oracle JVM
* Oracle java.lang.String class
* rest of Oracle rt.jar
* some other Oracle stuff

We are discussing a new runtime environment with a different behavior
of the String class consisting of:
* Oracle JVM
* somebody elses java.lang.String class
* rest of Oracle rt.jar
* some other Oracle stuff

That runtime environment is a modfied version of Oracle's Java
runtime environment.

>> So:
>>
>> replacing java.lang.String => modified software => no Java license =>
>> usage of all the other Java classes is copyright violation
>>
>
> You have not modified any existing software.  You have replaced a class
> with your own.

The JRE has been modified by replacing the String class.

The license does not talk about modifications of pieces of code. It
talks about "the software" which is the entire JRE.

Arne

[toc] | [prev] | [next] | [standalone]


#36357

FromJerry Stuckle <jstucklex@attglobal.net>
Date2017-02-20 08:39 -0500
Message-ID<o8ereu$ad1$1@jstuckle.eternal-september.org>
In reply to#36354
On 2/19/2017 11:31 PM, Arne Vajhøj wrote:
> On 2/19/2017 10:51 AM, Jerry Stuckle wrote:
>> On 2/19/2017 9:20 AM, Arne Vajhøj wrote:
>>> On 2/19/2017 8:45 AM, Jerry Stuckle wrote:
>>>> On 2/19/2017 5:42 AM, lewbloch@gmail.com wrote:
>>>>> Andreas Leitgeb wrote:
>>>>>> Anyway, that's not the point of a few posts upthread, where the
>>>>>> point was about a scenario of someone messing with the JVM
>>>>>> itself, to get their own java.lang.String dummy in, e.g. to troll
>>>>>> some 3rd- party closed-source code.  People with that agenda are
>>>>>> not likely to care about laws (might even be a case of
>>>>>> DMCA-violation for those who live where it matters - so much for
>>>>>> "What law?").
>>>>>
>>>>> As far as I know, not being a lawyer, most countries respect the
>>>>> trademark and copyright laws that protect the use of `java.lang`
>>>>> and `javax.lang` packages.
>>>
>>>> You're correct.  You're not a lawyer.  There is nothing in either
>>>> trademark or copyright law which prevents you from replacing
>>>> something, as long as you don't use the original item.  They only
>>>> limit what you can do with the trademarked or copyrighted item.
>>>
>>> If we assume Oracle Java (which Lew seems to have done explicitly),
>>> the the logic is rather simple.
>>>
>>> The license states:
>>>
>>> <quote>
>>> Oracle grants you a non-exclusive, non-transferable, limited license
>>> without license fees to reproduce and use internally the Software
>>> complete and unmodified for the sole purpose of running
>>> Programs.</quote>
>>>
>>> <quote>
>>> Unless enforcement is prohibited by applicable law, you may not modify,
>>> decompile, or reverse engineer Software.
>>> </quote>
>>>
>>> The license prohibits modifications of the software.
>>
>> Adding your own class to your own files is not modification of the
>> software.
> 
> Of course it is.
>

Since when does another company control what classes I write for my own
files?  The answer is - they don't.

> We Oracle software which is a Java runtime environment consisting of:
> * Oracle JVM
> * Oracle java.lang.String class
> * rest of Oracle rt.jar
> * some other Oracle stuff
> 
> We are discussing a new runtime environment with a different behavior
> of the String class consisting of:
> * Oracle JVM
> * somebody elses java.lang.String class
> * rest of Oracle rt.jar
> * some other Oracle stuff
> 
> That runtime environment is a modfied version of Oracle's Java
> runtime environment.
> 

And where does it say adding your own class is a modified version of
Oracle's runtime environment?  It doesn't - because you are not
modifying their runtime environment.

What if you called it arne.String?  Is that OK?  If so, then why not
java.lang.String?  Neither Oracle nor anyone else can control what you
call your classes.

>>> So:
>>>
>>> replacing java.lang.String => modified software => no Java license =>
>>> usage of all the other Java classes is copyright violation
>>>
>>
>> You have not modified any existing software.  You have replaced a class
>> with your own.
> 
> The JRE has been modified by replacing the String class.
> 
> The license does not talk about modifications of pieces of code. It
> talks about "the software" which is the entire JRE.
> 
> Arne
> 

Nope.  The class you add is in your own code, not the JRE.  The JRE has
not been modified.

But once again you show you have little knowledge of legal issues,
especially related to copyrights.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#36360

FromEric Douglas <e.d.programmer@gmail.com>
Date2017-02-20 06:10 -0800
Message-ID<3f4ab8a2-a23f-47cd-8e7a-aaa543050350@googlegroups.com>
In reply to#36357
On Monday, February 20, 2017 at 8:39:33 AM UTC-5, Jerry Stuckle wrote:
> 
> Nope.  The class you add is in your own code, not the JRE.  The JRE has
> not been modified.
> 
> But once again you show you have little knowledge of legal issues,
> especially related to copyrights.
> 

While I doubt there are legal experts here, my best guess is you are in violation of Oracle copyright if you distribute a modified version of their JRE, or code that somehow alters their JRE.  You shouldn't be able to alter the functionality of java.lang.String, but if you can load a jar that does that, don't distribute it.  If you run that code for yourself or your employer, at worst it should be unsupported behavior.  I wouldn't recommend it, but what you run in your own house is your problem.  No one's going to track you down for running modified code yourself if you're not using it in connection with anyone else's system, just don't go crying to them if it stops working.

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web