Article View: comp.lang.java.programmer
Article #295Re: Bizarre import weirdness
From: Jon Skeet
Date: Tue, 04 Dec 2001 18:12
Date: Tue, 04 Dec 2001 18:12
42 lines
2564 bytes
2564 bytes
Ron Albright <moron(at)pobox.com> <Ron Albright <moron(at)pobox.com>>
wrote:
> I just switched to JBuilder 6 Ent from JBuilder 5. Same
> project using Sun JDK 1.3.1-b24 in both cases to build. On
> JBuilder 6 the following class only builds if the explicit
> import of base class
> com.greenbird.persistence.PersistentRdbmsObject is
> uncommented. com.greenbird.persistence is a required
> library. What's even weirder is that there are several other
> classes from the com.greenbird.persistence lib being
> referenced in the class definition. Why is an explicit
> import of the base class required?
Because otherwise the compiler has no idea what you mean by
"PersistentRdbmsObject". There could be any number of classes with that
name in various packages.
> Why would JBuilder have anything to do with this when the build
> is being done using a Sun JDK?
I don't see why it should ever have built in anything else, frankly.
> package com.greenbird.persistence.test;
>
> import java.sql.*;
> import java.lang.reflect.Field;
>
> // Builds only if the following line is uncommented
> //import com.greenbird.persistence.PersistentRdbmsObject;
>
> import com.greenbird.persistence.*;
>
> public class Jdbc_Test extends PersistentRdbmsObject
> {
> ....< Class definition includes references to
> com.greenbird.persistence.PersistenceException >....
> }
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Technical Details
Message-ID:
<MPG.1677224fb3f43e5198a676@mrmog.peramon.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!62.112.0.25!newsfeed.online.be!195.129.110.18.MISMATCH!bnewspeer00.bru.ops.eu.uu.net!bnewsifeed00.bru.ops.eu.uu.net!lnewspost00.lnd.ops.eu.uu.net!emea.uu.net!not-for-mailReferences:
<612q0uggd5qbghbdj3dm16vet63el85a34@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa3e3,b03b9f2c50f270a6 X-Google-Attributes: gidfa3e3,public X-Google-Thread: 10a146,b03b9f2c50f270a6 X-Google-Attributes: gid10a146,public X-Google-ArrivalTime: 2001-12-04 10:12:13 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!62.112.0.25!newsfeed.online.be!195.129.110.18.MISMATCH!bnewspeer00.bru.ops.eu.uu.net!bnewsifeed00.bru.ops.eu.uu.net!lnewspost00.lnd.ops.eu.uu.net!emea.uu.net!not-for-mail From: Jon Skeet <skeet@pobox.com> Newsgroups: comp.lang.java.programmer,borland.public.jbuilder.ide Subject: Re: Bizarre import weirdness Date: Tue, 4 Dec 2001 18:12:08 -0000 Message-ID: <MPG.1677224fb3f43e5198a676@mrmog.peramon.com> References: <612q0uggd5qbghbdj3dm16vet63el85a34@4ax.com> Organization: Peramon Technology Ltd. X-Newsreader: MicroPlanet Gravity v2.30 Lines: 42 NNTP-Posting-Host: fw1.peramon.com X-Trace: 1007489531 reading.news.pipex.net 8512 193.132.195.113 X-Complaints-To: abuse@uk.uu.net