Author |
Message
|
rglack10 |
Posted: Tue Aug 09, 2011 9:38 am Post subject: Duplicate java package |
|
|
Apprentice
Joined: 06 Jul 2011 Posts: 34
|
Hi,
Not sure if this question is relevant or not...
If importing a package into a JCN and the toolkit is offering two identical imports for the same package but one is:
java.io
and the other is:
com.ibm.jvm.util
1) Is there a difference?
2) Is there a preferrable option?
One would appear to be the proprietary java sun package and the other native to IBM's JRE...
Would there be any performance / any other benefits with the latter or like the V6 broker JRE could there be bugs? Any ideas?
Thanks. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Aug 09, 2011 10:33 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Yes, there is a difference. Choose the library that matches the source code you just scrapped of the internet.
More than likely, more cases than not, it is the one with the shorter package name. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
rglack10 |
Posted: Tue Aug 09, 2011 10:49 am Post subject: |
|
|
Apprentice
Joined: 06 Jul 2011 Posts: 34
|
[quote="lancelotlinc"]Yes, there is a difference. Choose the library that matches the source code you just scrapped of the internet.
Why do you say this? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 09, 2011 10:54 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
rglack10 wrote: |
Why do you say this? |
Just because two classes have the same NAME doesn't mean they do remotely the same things or define remotely the same methods or members. |
|
Back to top |
|
 |
rglack10 |
Posted: Tue Aug 09, 2011 11:01 am Post subject: |
|
|
Apprentice
Joined: 06 Jul 2011 Posts: 34
|
mqjeff wrote: |
rglack10 wrote: |
Why do you say this? |
Just because two classes have the same NAME doesn't mean they do remotely the same things or define remotely the same methods or members. |
Agreed but does it also mean they definitely aren't the same and in the case that they are was maybe the reason for the original question. Where does the presumption come that someone has scraped code off the internet? This I don't understand. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 09, 2011 11:05 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's not clear why you wouldn't know which package to use, if you had written this code yourself.
So that's likely why lancelotlinc is guessing that you have taken this code from somewhere else.
It's, in general, not clear why you don't know which package to use! |
|
Back to top |
|
 |
rglack10 |
Posted: Tue Aug 09, 2011 11:12 am Post subject: |
|
|
Apprentice
Joined: 06 Jul 2011 Posts: 34
|
mqjeff wrote: |
It's not clear why you wouldn't know which package to use, if you had written this code yourself.
So that's likely why lancelotlinc is guessing that you have taken this code from somewhere else.
It's, in general, not clear why you don't know which package to use! |
But of course I know which package to use... I would use the native package for the class when investigating my requirements. That was not the question...
Thanks for the input. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 09, 2011 11:23 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
rglack10 wrote: |
But of course I know which package to use... I would use the native package for the class when investigating my requirements. That was not the question... |
Your question was
rglack10 wrote: |
If importing a package into a JCN and the toolkit is offering two identical imports for the same package
1) Is there a difference?
2) Is there a preferable option? |
How is that *not* the same as "Which of these two packages do I use"?
To specifically answer your question as asked
1) Yes. The two packages represent different implementations of classes that happen to share the same name
2) Yes. The preferable option is to use the CORRECT package for the class that's making the import. |
|
Back to top |
|
 |
rglack10 |
Posted: Tue Aug 09, 2011 12:10 pm Post subject: |
|
|
Apprentice
Joined: 06 Jul 2011 Posts: 34
|
mqjeff wrote: |
rglack10 wrote: |
But of course I know which package to use... I would use the native package for the class when investigating my requirements. That was not the question... |
Your question was
rglack10 wrote: |
If importing a package into a JCN and the toolkit is offering two identical imports for the same package
1) Is there a difference?
2) Is there a preferable option? |
How is that *not* the same as "Which of these two packages do I use"?
To specifically answer your question as asked
1) Yes. The two packages represent different implementations of classes that happen to share the same name
2) Yes. The preferable option is to use the CORRECT package for the class that's making the import. |
Thanks for answering my question. Point 1 of your responses I wasn't 100% about hence the question. |
|
Back to top |
|
 |
|