Re: Checking for improperly namespaced code?

Andrew Pennebaker <[email protected]> Thu, 7 Nov 2013 13:39:06 -0500
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <CAC7GPxbXJvR3NH7xhL3M6Zc3V5JmcMZJfJvHBmUzXt5EiMS90Q@mail.gmail.com>
--===============2787436657815794013==
Content-Type: multipart/alternative; boundary=089e016816eca80ee004ea9a94fd

--089e016816eca80ee004ea9a94fd
Content-Type: text/plain; charset=ISO-8859-1

Thanks!


On Wed, Nov 6, 2013 at 6:09 PM, Oliver Burn <[email protected]> wrote:

> Look at
> http://checkstyle.sourceforge.net/config_coding.html#PackageDeclaration-- it does exactly what you want!
>
>
> On Thu, Nov 7, 2013 at 5:22 AM, Andrew Pennebaker <[email protected]>wrote:
>
>> A bash script is not a bad idea.
>>
>> Though it would be better to have something platform independent to help
>> Windows developers. Maybe a Java program. Best would be checkstyle rule.
>>
>>
>> On Wed, Nov 6, 2013 at 11:39 AM, <[email protected]> wrote:
>>
>>> Write a bash script?
>>>
>>>
>>>
>>> *From:* Andrew Pennebaker [mailto:[email protected]]
>>> *Sent:* 06 November 2013 16:29
>>> *To:* Checkstyle Users
>>> *Subject:* [Checkstyle-user] Checking for improperly namespaced code?
>>>
>>>
>>>
>>> Improperly namespaced code is giving our Windows developers trouble, but
>>> we don't know which code is to blame, as most of our developers use Mac,
>>> whose version of javac allows improper namespaces.
>>>
>>>
>>>
>>> E.g., Mac javac allows package *org*.blah.blah.blah; in .java files
>>> that reside in src/main/java/*com*/blah/blah/blah/. Windows javac fails
>>> when encountering such a discrepancy.
>>>
>>>
>>>
>>> This leads to much confusion and tearing of hair, as there is much code
>>> on our Macs that will fail to compile when we eventually try it out in
>>> Windows.
>>>
>>>
>>>
>>> Our codebase is getting too large to check each package declaration
>>> manually. Is there was a way to configure checkstyle.xml and/or
>>> maven-checkstyle-plugin to report improper namespacing, when package
>>> declarations don't match up with the actual directory structure?
>>>
>>>
>>>
>>> --
>>>
>>> Cheers,
>>>
>>>
>>>
>>> Andrew Pennebaker
>>>
>>> [email protected]
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> November Webinars for C, C++, Fortran Developers
>>> Accelerate application performance with scalable programming models.
>>> Explore
>>> techniques for threading, error checking, porting, and tuning. Get the
>>> most
>>> from the latest Intel processors and coprocessors. See abstracts and
>>> register
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Checkstyle-user mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>>>
>>>
>>
>>
>> --
>> Cheers,
>>
>> Andrew Pennebaker
>> [email protected]
>>
>>
>> ------------------------------------------------------------------------------
>> November Webinars for C, C++, Fortran Developers
>> Accelerate application performance with scalable programming models.
>> Explore
>> techniques for threading, error checking, porting, and tuning. Get the
>> most
>> from the latest Intel processors and coprocessors. See abstracts and
>> register
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Checkstyle-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>>
>>
>
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models.
> Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and
> register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Checkstyle-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>
>


-- 
Cheers,

Andrew Pennebaker
[email protected]

--089e016816eca80ee004ea9a94fd
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks!</div><div class=3D"gmail_extra"><br><br><div class=
=3D"gmail_quote">On Wed, Nov 6, 2013 at 6:09 PM, Oliver Burn <span dir=3D"l=
tr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">oliver@p=
uppycrawl.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Look at=A0<a href=3D"http:/=
/checkstyle.sourceforge.net/config_coding.html#PackageDeclaration" target=
=3D"_blank">http://checkstyle.sourceforge.net/config_coding.html#PackageDec=
laration</a> -- it does exactly what you want!</div>
<div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_extra">
<br><br><div class=3D"gmail_quote">On Thu, Nov 7, 2013 at 5:22 AM, Andrew P=
ennebaker <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" ta=
rget=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blockquote =
class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid=
;padding-left:1ex">

<div dir=3D"ltr">A bash script is not a bad idea.<div><br></div><div>Though=
 it would be better to have something platform independent to help Windows =
developers. Maybe a Java program. Best would be checkstyle rule.</div></div=
>


<div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote"><div><div>On =
Wed, Nov 6, 2013 at 11:39 AM,  <span dir=3D"ltr">&lt;<a href=3D"mailto:adri=
[email protected]" target=3D"_blank">[email protected]</a>&gt;</span> w=
rote:<br>

</div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div><div>
<div lang=3D"EN-GB" link=3D"blue" vlink=3D"purple"><div><p class=3D"MsoNorm=
al"><span style=3D"font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;col=
or:blue">Write a bash script?<u></u><u></u></span></p><p class=3D"MsoNormal=
"><span style=3D"font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color=
:blue"><u></u>=A0<u></u></span></p>


<p class=3D"MsoNormal"><b><span lang=3D"EN-US" style=3D"font-size:10.0pt;fo=
nt-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span =
lang=3D"EN-US" style=3D"font-size:10.0pt;font-family:&quot;Tahoma&quot;,&qu=
ot;sans-serif&quot;"> Andrew Pennebaker [mailto:<a href=3D"mailto:apennebak=
[email protected]" target=3D"_blank">[email protected]</a>] <br>


<b>Sent:</b> 06 November 2013 16:29<br><b>To:</b> Checkstyle Users<br><b>Su=
bject:</b> [Checkstyle-user] Checking for improperly namespaced code?<u></u=
><u></u></span></p><div><div><p class=3D"MsoNormal"><u></u>=A0<u></u></p>
<div><div><p class=3D"MsoNormal">Improperly namespaced code is giving our W=
indows developers trouble, but we don&#39;t know which code is to blame, as=
 most of our developers use Mac, whose version of javac allows improper nam=
espaces.<u></u><u></u></p>


</div><div><p class=3D"MsoNormal"><u></u>=A0<u></u></p></div><p class=3D"Ms=
oNormal">E.g., Mac javac allows package <b>org</b>.blah.blah.blah; in .java=
 files that reside in src/main/java/<b>com</b>/blah/blah/blah/. Windows jav=
ac fails when encountering such a discrepancy.<u></u><u></u></p>


<div><p class=3D"MsoNormal"><u></u>=A0<u></u></p></div><div><p class=3D"Mso=
Normal">This leads to much confusion and tearing of hair, as there is much =
code on our Macs that will fail to compile when we eventually try it out in=
 Windows.<u></u><u></u></p>


</div><div><p class=3D"MsoNormal"><u></u>=A0<u></u></p></div><div><p class=
=3D"MsoNormal">Our codebase is getting too large to check each package decl=
aration manually. Is there was a way to configure checkstyle.xml and/or mav=
en-checkstyle-plugin to report improper namespacing, when package declarati=
ons don&#39;t match up with the actual directory structure?<u></u><u></u></=
p>


<div><div><div><p class=3D"MsoNormal"><u></u>=A0<u></u></p></div><p class=
=3D"MsoNormal">-- <u></u><u></u></p><div><p class=3D"MsoNormal">Cheers,<u><=
/u><u></u></p><div><p class=3D"MsoNormal"><u></u>=A0<u></u></p><div><p clas=
s=3D"MsoNormal">


Andrew Pennebaker<u></u><u></u></p></div><div><p class=3D"MsoNormal"><a hre=
f=3D"mailto:[email protected]" target=3D"_blank">[email protected]<=
/a><u></u><u></u></p></div></div></div></div></div></div></div></div></div>=
</div>


</div><br></div></div>-----------------------------------------------------=
-------------------------<br>
November Webinars for C, C++, Fortran Developers<br>
Accelerate application performance with scalable programming models. Explor=
e<br>
techniques for threading, error checking, porting, and tuning. Get the most=
<br>
from the latest Intel processors and coprocessors. See abstracts and regist=
er<br>
<a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D60136231&amp;iu=
=3D/4140/ostg.clktrk" target=3D"_blank">http://pubads.g.doubleclick.net/gam=
pad/clk?id=3D60136231&amp;iu=3D/4140/ostg.clktrk</a><br>___________________=
____________________________<br>



Checkstyle-user mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta=
rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use=
r</a><br>
<br></blockquote></div><div><br><br clear=3D"all"><div><br></div>-- <br><di=
v dir=3D"ltr">Cheers,<div><br><div>Andrew Pennebaker</div><div><a href=3D"m=
ailto:[email protected]" target=3D"_blank">[email protected]</a></d=
iv>

</div>
</div>
</div></div>
<br>-----------------------------------------------------------------------=
-------<br>
November Webinars for C, C++, Fortran Developers<br>
Accelerate application performance with scalable programming models. Explor=
e<br>
techniques for threading, error checking, porting, and tuning. Get the most=
<br>
from the latest Intel processors and coprocessors. See abstracts and regist=
er<br>
<a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D60136231&amp;iu=
=3D/4140/ostg.clktrk" target=3D"_blank">http://pubads.g.doubleclick.net/gam=
pad/clk?id=3D60136231&amp;iu=3D/4140/ostg.clktrk</a><br>___________________=
____________________________<br>


Checkstyle-user mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta=
rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use=
r</a><br>
<br></blockquote></div><br></div>
</div></div><br>-----------------------------------------------------------=
-------------------<br>
November Webinars for C, C++, Fortran Developers<br>
Accelerate application performance with scalable programming models. Explor=
e<br>
techniques for threading, error checking, porting, and tuning. Get the most=
<br>
from the latest Intel processors and coprocessors. See abstracts and regist=
er<br>
<a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D60136231&amp;iu=
=3D/4140/ostg.clktrk" target=3D"_blank">http://pubads.g.doubleclick.net/gam=
pad/clk?id=3D60136231&amp;iu=3D/4140/ostg.clktrk</a><br>___________________=
____________________________<br>

Checkstyle-user mailing list<br>
<a href=3D"mailto:[email protected]">Checkstyle-user@li=
sts.sourceforge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta=
rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use=
r</a><br>
<br></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div dir=
=3D"ltr">Cheers,<div><br><div>Andrew Pennebaker</div><div><a href=3D"mailto=
:[email protected]" target=3D"_blank">[email protected]</a></div></=
div>
</div>
</div>

--089e016816eca80ee004ea9a94fd--


--===============2787436657815794013==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
--===============2787436657815794013==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Checkstyle-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user

--===============2787436657815794013==--