Re: Trouble with Java package imports
David Ventimiglia <[email protected]> Sun, 30 Oct 2016 04:39:03 -0700
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <CALaE=t_RdONkwRGGBX=bN0BVAgDDq_5Q76Qq4uinu-a5h=iS3Q@mail.gmail.com> |
--===============6844624303899464730== Content-Type: multipart/alternative; boundary=94eb2c07d4f2fe7c850540138a29 --94eb2c07d4f2fe7c850540138a29 Content-Type: text/plain; charset=UTF-8 Hi Edward, That's great! Nice work. It sounds like the first bug, while niggling, isn't as severe and in my particular case was only revealed when I made my test classes end in numerals, something I and few other people would actually do in real code. It sounds like the second bug probably is the one that interfered with completion for me in the first place. I'll pull and look for your patches. Thanks, again! Warm regards, David On Sat, Oct 29, 2016 at 3:40 AM, Edward John Steere <[email protected] > wrote: > > Hi Edward, > > > > Thanks for the reply. Sorry for the delay; I was on vacation, I'm > afraid. In any case, I took your advice and am publishing it in the usual > way, which is to push an update to my Docker image dventimi/docker-emacs. > It has these changes. > > > > 1 In ~/Scratch/emacs/ there are new files: Greet1.java, Greet2.java, and > greeter.jar > > 2 In ~/.emacs the ede-java-root-project form includes the > :localclasspath keyword, set to '("greeter.java"). > > > > Here's what's going on. The greeter.jar file contains two compiled class > files, Greeter1.class and Greeter2.class, both of which are in the > "greeter" package. They both define methods "hello" and "goodbye." Moving > on, the Greet1.java and Greet2.java files > > are, naturally, almost identical, and are simple "Hello, World" style > programs just to test completion. Both of these use (or try to use) the > Greeter1 class, which is in the supplied greeter.jar file. Minor point: the > Greeter2 class is kinda superfluous, except I wanted > > to have a JAR file that had more than one class. Anyway, Greet1 and > Greet2 take two different approaches. The former has an "import > greeter.Greeter1" declaration, while the latter has an "import greeter.*" > declaration, i.e. the former imports just a class while > > the latter imports the whole package. Nothing imports or makes use of > classes in the standard library and nothing makes use of either Generics or > Annotations. This is my attempt at replicating it with the smallest > possible example of the problem. The result is > > that semantic is able to complete symbols (there are just two, hello() > and goodbye()) when in Greet1.java it does "import greeter.Greeter1," but > it is not able to complete anything when in Greet2.java it does "import > greeter.*" > > > > I hope that makes sense. :) > > > > I haven't yet tried to debug this. I will do that now, but will be > unsurprised if I encounter the same underlying factors listed above. Again, > the Docker image can be pulled with > > > > docker pull dventimi/docker-emacs > > > > and Emacs can be launched on the problematic Greet2.java file with > > > > docker run -t -i dventimi/docker-emacs emacs /root/Scratch/Greet2.java > > > > Warm regards, > > David > > > > On Tue, Oct 4, 2016 at 11:09 AM, Edward John Steere < > [email protected]> wrote: > > > > > I've a few clues about the error with Java package includes. > > > > > > First, with a package include (i.e., "include java.util.*") the tag > at point has a proxy (:proxy keyword)--whatever that is--that sends us down > a branch starting with semanticdb-javap-resolve-proxy. Without a package > include (i.e., "include java.util.Map") > > the proxy > > > is nil, there's no proxy-function, and we steam on ahead. See > semantic-tag-resolve-proxy in tag.el: > > > > > > (defun semantic-tag-resolve-proxy (tag) > > > "Resolve the proxy in TAG. > > > The return value is whatever format the proxy was setup as. > > > It should be a list of complete tags. > > > If TAG has no proxy, then just return tag." > > > (let* ((proxy (semantic--tag-get-property tag :proxy)) > > > (function (get proxy 'proxy-function)) > > > (data (get proxy 'proxy-data))) > > > (if proxy > > > (funcall function data tag) > > > tag))) > > > > > > In that branch, we eventually end up in semanticdb-normalize-tags in > db-javap.el where a let* binds realtable to the value of > (semanticdb-jar-extract-and-save-tags obj tfn), which is determined to > set it to nil. The problem is that the next let* expression > > binds > > > foundtags to (semanticdb-find-tags-by-name-method realtable > (semantic-tag-name T)), and realtable has just been set to nil. See > semanticdb-normalize-tags in db-javap.el: > > > > > > (defmethod semanticdb-normalize-tags ((obj semanticdb-table-jar-directory) > tags) > > > "Convert tags found by our java directory table into a complete tag. > > > The default tag just has a name, type, and the filename. Normalize by > > > loading in the file it belongs to, and looking up that symbol in the > file > > > and returning that tag instead." > > > (let ((tagret nil) > > > (parentdb (oref obj parent-db))) > > > (dolist (T tags) > > > (let* ((tfn (semantic-tag-file-name T)) > > > (realtable (semanticdb-jar-extract-and-save-tags obj tfn)) > > > (foundtags (semanticdb-find-tags-by-name-method > > > realtable (semantic-tag-name T)))) > > > (dolist (FT foundtags) > > > (semantic--tag-put-property FT :filename tfn) > > > (setq tagret (cons FT tagret))))) > > > tagret)) > > > > > > Some questions leap to mind. > > > > > > 1 What is a tag proxy and is it correct for the tag to have one with > a package import (i.e., "import java.util.*") and not have one otherwise? > > > 2 Is it correct for semanticdb-jar-extract-and-save-tags to return > nil in this case? > > > 3 Should semanticdb-find-tags-by-name-method be able to cope with a > nil argument to the realtable parameter, without throwing an error? > > > 4 If it were able to cope such that execution would continue, would > the analyzer do the right thing for a package import, or would it break > somewhere else down the line? > > > > > > I'll try to answer these questions in the coming days. Stay tuned! > > > > > > Cheers, > > > David > > > > > > On Sun, Sep 18, 2016 at 11:57 AM, David Ventimiglia < > [email protected]> wrote: > > > > > > Hi! > > > > > > I'm having trouble with the Semantic Analyzer and "package imports" > for Java programs. I've an example Java program that looks like this: > > > > > > import java.util.*; > > > import java.util.HashMap; > > > public class HelloWorld2 { > > > public static void main (String[] args) { > > > System.out.println("Hello, World!"); > > > Map m = new HashMap(); > > > m. > > > } > > > } > > > > > > When I put point after the "m." and try semantic-ia-complete-symbol-menu > (for example) it fails with this message: > > > > > > Cannot find types for `"m"' > > > > > > If I try semantic-analyze-current-context, the output indicates that > it encountered this error (full message below): > > > > > > Method semanticdb-find-tags-by-name-method called on nil > > > > > > These problems don't occur if I replace the "import java.util.*;" in > the Java file with "import java.utl.Map" and so I'd never encounter them if > I didn't used wildcards in the import statements. > > > > > > Any idea what's going on here? > > > > > > I have a Docker image that reproduces this behavior, if anyone's game > for trying it out. It uses Ubuntu, Emacs 24.5.1, the latest CEDET (as of > 2016/09/18), and OpenJDK 8. If you have Docker installed, you should be ale > to get the image with this > > > command: > > > > > > docker pull dventimi/docker-emacs > > > > > > You can then launch a container that opens Emacs on a version of the > Java file with package imports, with this command: > > > > > > docker run -t -i dventimi/docker-emacs emacs > /root/Scratch/HelloWorld2.java > > > > > > Likewise, you can launch a container that opens Emacs on a version of > the Java file without package imports, with this command: > > > > > > docker run -t -i dventimi/docker-emacs emacs > /root/Scratch/HelloWorld.java > > > > > > The Semantic Analyzer works in the second case, but not in the first > case. I've been groping my way through this with the debugger, and will > continue to do so, but I thought I'd throw this out there to see if anyone > else has a clue as to what the problem > > > might be. Thanks! > > > > > > Best, > > > David > > > > > > ====== Output of semantic-analyze-current-context ======= > > > > > > Context Type: #<semantic-analyze-context context> > > > Bounds: (186 . 186) > > > Prefix: "m" > > > "" > > > Prefix Classes: 'function > > > 'variable > > > 'type > > > Prefix Types: <none> > > > Encountered Errors: '(error "Method semanticdb-find-tags-by-name-method > called on nil") > > > -------- > > > -> ScopeTypes: class HelloWorld2 > > > -> Parents: class HelloWorld2 > > > -> Scope: void main(String[]) > > > -> Local Args: String[] args > > > -> Local Vars: String[] args > > > this > > > Map m > > > > > > > > > ------------------------------------------------------------ > ------------------ > > > > > > _______________________________________________ > > > cedet-semantic mailing list > > > [email protected] > > > https://lists.sourceforge.net/lists/listinfo/cedet-semantic > > > > Hi David, > > > > Without debugging this myself I really can't say. Before you start > > debugging though I would recommend that you try to replicate it with the > > smallest possible example of the problem. i.e. jar up a package with a > > few classes you wrote and see whether it finds definitions from a star > > import of the package in that jar. I think that you might be running > > into other issues which could be clouding the actual problem. > > > > There are, for example, some features of modern Java which the current > > grammar doesn't support (e.g. annotations.) I've done some work on > > getting the parser to recognise annotations (I don't think that it's > > ready yet.) In my experience problems with the grammar can sometimes > > cause entire files to not be parsed correctly and although I'm not sure > > what impact that would have on db-javap it does seem like something > > worth eliminating first. > > > > If I get some time over the weekend then I'll see what I can find. > > > > Kind regards, > > > > Edward Steere > > > > ------------------------------------------------------------ > ------------------ > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > _______________________________________________ > > cedet-semantic mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/cedet-semantic > > Hi David, > > I've solved it :) . Thanks for the minimal example it really made it > much easier to debug this one. There are two problems here: > > 1. semanticdb-java-jar-package-files > > This method looks for files which match a package directory from a > jar. It does so with a regular expression. Because your classes > end in numerals it failed to find matching classes. I wrote the > following regular expression to fix the bug: > "\\(\\([a-zA-Z_][a-zA-Z_0-9]*\\.class$\\)\\|\\([a-zA-Z_]*\\. > class$\\)\\)" > For reference, it used to be: "[a-zA-Z_]*\\.class$". > > 2. semanticdb-normalize-tags > > The override of this method for javap jar directories had a bug in > which it wouldn't supply the fully qualified name of a jar to the > method which extracts tags from a jar. Furthermore, when > subsequently searching for a tag it supplied incorrect arguments to > the search method. > > I've not yet created tests for these two fixes. I'll work on > implementing tests and uploading a patch as soon as I can (maybe today > if I have the time.) I did however test it with both the jar with your > classes in it and the example which used Map from rt.jar and both > worked. > > Kind regards, > > Edward Steere > --94eb2c07d4f2fe7c850540138a29 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi Edward,<div><br></div><div>That's great!=C2=A0 Nice= work.=C2=A0 It sounds like the first bug, while niggling, isn't as sev= ere and in my particular case was only revealed when I made my test classes= end in numerals, something I and few other people would actually do in rea= l code.=C2=A0 It sounds like the second bug probably is the one that interf= ered with completion for me in the first place.=C2=A0 I'll pull and loo= k for your patches.=C2=A0 Thanks, again!</div><div><br></div><div>Warm rega= rds,</div><div>David=C2=A0</div></div><div class=3D"gmail_extra"><br><div c= lass=3D"gmail_quote">On Sat, Oct 29, 2016 at 3:40 AM, Edward John Steere <s= pan dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_b= lank">[email protected]</a>></span> wrote:<br><blockquote class=3D= "gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding= -left:1ex"><span class=3D"">> Hi Edward,<br> ><br> > Thanks for the reply. Sorry for the delay; I was on vacation, I'm = afraid. In any case, I took your advice and am publishing it in the usual w= ay, which is to push an update to my Docker image dventimi/docker-emacs. It= has these changes.<br> ><br> </span>> 1 In ~/Scratch/emacs/ there are new files: Greet1.java, Greet2.= java, and greeter.jar<br> > 2 In ~/.emacs the ede-java-root-project form includes the :localclassp= ath keyword, set to '("greeter.java").<br> <div><div class=3D"h5">><br> > Here's what's going on. The greeter.jar file contains two comp= iled class files, Greeter1.class and Greeter2.class, both of which are in t= he "greeter" package. They both define methods "hello" = and "goodbye." Moving on, the Greet1.java and Greet2.java files<b= r> > are, naturally, almost identical, and are simple "Hello, World&qu= ot; style programs just to test completion. Both of these use (or try to us= e) the Greeter1 class, which is in the supplied greeter.jar file. Minor poi= nt: the Greeter2 class is kinda superfluous, except I wanted<br> > to have a JAR file that had more than one class. Anyway, Greet1 and Gr= eet2 take two different approaches. The former has an "import greeter.= Greeter1" declaration, while the latter has an "import greeter.*&= quot; declaration, i.e. the former imports just a class while<br> > the latter imports the whole package. Nothing imports or makes use of = classes in the standard library and nothing makes use of either Generics or= Annotations. This is my attempt at replicating it with the smallest possib= le example of the problem. The result is<br> > that semantic is able to complete symbols (there are just two, hello()= and goodbye()) when in Greet1.java it does "import greeter.Greeter1,&= quot; but it is not able to complete anything when in Greet2.java it does &= quot;import greeter.*"<br> ><br> > I hope that makes sense. :)<br> ><br> > I haven't yet tried to debug this. I will do that now, but will be= unsurprised if I encounter the same underlying factors listed above. Again= , the Docker image can be pulled with<br> ><br> >=C2=A0 docker pull dventimi/docker-emacs<br> ><br> > and Emacs can be launched on the problematic Greet2.java file with<br> ><br> >=C2=A0 docker run -t -i dventimi/docker-emacs emacs /root/Scratch/Greet= 2.java<br> ><br> > Warm regards,<br> > David<br> ><br> > On Tue, Oct 4, 2016 at 11:09 AM, Edward John Steere <<a href=3D"mai= lto:[email protected]">[email protected]</a>> wrote:<br> ><br> >=C2=A0 > I've a few clues about the error with Java package incl= udes.<br> >=C2=A0 ><br> >=C2=A0 > First, with a package include (i.e., "include java.uti= l.*") the tag at point has a proxy (:proxy keyword)--whatever that is-= -that sends us down a branch starting with semanticdb-javap-resolve-<wbr>pr= oxy. Without a package include (i.e., "include java.util.Map")<br= > >=C2=A0 the proxy<br> >=C2=A0 > is nil, there's no proxy-function, and we steam on ahea= d. See semantic-tag-resolve-proxy in tag.el:<br> >=C2=A0 ><br> >=C2=A0 > (defun semantic-tag-resolve-proxy (tag)<br> >=C2=A0 > "Resolve the proxy in TAG.<br> >=C2=A0 > The return value is whatever format the proxy was setup as.= <br> >=C2=A0 > It should be a list of complete tags.<br> >=C2=A0 > If TAG has no proxy, then just return tag."<br> >=C2=A0 > (let* ((proxy (semantic--tag-get-property tag :proxy))<br> >=C2=A0 > (function (get proxy 'proxy-function))<br> >=C2=A0 > (data (get proxy 'proxy-data)))<br> >=C2=A0 > (if proxy<br> >=C2=A0 > (funcall function data tag)<br> >=C2=A0 > tag)))<br> >=C2=A0 ><br> >=C2=A0 > In that branch, we eventually end up in semanticdb-normaliz= e-tags in db-javap.el where a let* binds realtable to the value of (semanti= cdb-jar-extract-and-<wbr>save-tags obj tfn), which is determined to set it = to nil. The problem is that the next let* expression<br> >=C2=A0 binds<br> >=C2=A0 > foundtags to (semanticdb-find-tags-by-name-<wbr>method real= table (semantic-tag-name T)), and realtable has just been set to nil. See s= emanticdb-normalize-tags in db-javap.el:<br> >=C2=A0 ><br> >=C2=A0 > (defmethod semanticdb-normalize-tags ((obj semanticdb-table= -jar-<wbr>directory) tags)<br> >=C2=A0 > "Convert tags found by our java directory table into a= complete tag.<br> >=C2=A0 > The default tag just has a name, type, and the filename. No= rmalize by<br> >=C2=A0 > loading in the file it belongs to, and looking up that symb= ol in the file<br> >=C2=A0 > and returning that tag instead."<br> >=C2=A0 > (let ((tagret nil)<br> >=C2=A0 > (parentdb (oref obj parent-db)))<br> >=C2=A0 > (dolist (T tags)<br> >=C2=A0 > (let* ((tfn (semantic-tag-file-name T))<br> >=C2=A0 > (realtable (semanticdb-jar-extract-and-<wbr>save-tags obj t= fn))<br> >=C2=A0 > (foundtags (semanticdb-find-tags-by-name-<wbr>method<br> >=C2=A0 > realtable (semantic-tag-name T))))<br> >=C2=A0 > (dolist (FT foundtags)<br> >=C2=A0 > (semantic--tag-put-property FT :filename tfn)<br> >=C2=A0 > (setq tagret (cons FT tagret)))))<br> >=C2=A0 > tagret))<br> >=C2=A0 ><br> >=C2=A0 > Some questions leap to mind.<br> >=C2=A0 ><br> >=C2=A0 > 1 What is a tag proxy and is it correct for the tag to have= one with a package import (i.e., "import java.util.*") and not h= ave one otherwise?<br> >=C2=A0 > 2 Is it correct for semanticdb-jar-extract-and-<wbr>save-ta= gs to return nil in this case?<br> >=C2=A0 > 3 Should semanticdb-find-tags-by-name-<wbr>method be able t= o cope with a nil argument to the realtable parameter, without throwing an = error?<br> >=C2=A0 > 4 If it were able to cope such that execution would continu= e, would the analyzer do the right thing for a package import, or would it = break somewhere else down the line?<br> >=C2=A0 ><br> >=C2=A0 > I'll try to answer these questions in the coming days. = Stay tuned!<br> >=C2=A0 ><br> >=C2=A0 > Cheers,<br> >=C2=A0 > David<br> >=C2=A0 ><br> >=C2=A0 > On Sun, Sep 18, 2016 at 11:57 AM, David Ventimiglia <<a = href=3D"mailto:[email protected]">[email protected]</a>> wrote:<br> >=C2=A0 ><br> >=C2=A0 > Hi!<br> >=C2=A0 ><br> >=C2=A0 > I'm having trouble with the Semantic Analyzer and "= ;package imports" for Java programs. I've an example Java program = that looks like this:<br> >=C2=A0 ><br> >=C2=A0 > import java.util.*;<br> >=C2=A0 > import java.util.HashMap;<br> >=C2=A0 > public class HelloWorld2 {<br> >=C2=A0 > public static void main (String[] args) {<br> >=C2=A0 > System.out.println("Hello, World!");<br> >=C2=A0 > Map m =3D new HashMap();<br> >=C2=A0 > m.<br> >=C2=A0 > }<br> >=C2=A0 > }<br> >=C2=A0 ><br> >=C2=A0 > When I put point after the "m." and try semantic-= ia-complete-symbol-<wbr>menu (for example) it fails with this message:<br> >=C2=A0 ><br> >=C2=A0 > Cannot find types for `"m"'<br> >=C2=A0 ><br> >=C2=A0 > If I try semantic-analyze-current-<wbr>context, the output = indicates that it encountered this error (full message below):<br> >=C2=A0 ><br> >=C2=A0 > Method semanticdb-find-tags-by-name-<wbr>method called on n= il<br> >=C2=A0 ><br> >=C2=A0 > These problems don't occur if I replace the "impor= t java.util.*;" in the Java file with "import java.utl.Map" = and so I'd never encounter them if I didn't used wildcards in the i= mport statements.<br> >=C2=A0 ><br> >=C2=A0 > Any idea what's going on here?<br> >=C2=A0 ><br> >=C2=A0 > I have a Docker image that reproduces this behavior, if any= one's game for trying it out. It uses Ubuntu, Emacs 24.5.1, the latest = CEDET (as of 2016/09/18), and OpenJDK 8. If you have Docker installed, you = should be ale to get the image with this<br> >=C2=A0 > command:<br> >=C2=A0 ><br> >=C2=A0 > docker pull dventimi/docker-emacs<br> >=C2=A0 ><br> >=C2=A0 > You can then launch a container that opens Emacs on a versi= on of the Java file with package imports, with this command:<br> >=C2=A0 ><br> >=C2=A0 > docker run -t -i dventimi/docker-emacs emacs /root/Scratch/= HelloWorld2.java<br> >=C2=A0 ><br> >=C2=A0 > Likewise, you can launch a container that opens Emacs on a = version of the Java file without package imports, with this command:<br> >=C2=A0 ><br> >=C2=A0 > docker run -t -i dventimi/docker-emacs emacs /root/Scratch/= HelloWorld.java<br> >=C2=A0 ><br> >=C2=A0 > The Semantic Analyzer works in the second case, but not in = the first case. I've been groping my way through this with the debugger= , and will continue to do so, but I thought I'd throw this out there to= see if anyone else has a clue as to what the problem<br> >=C2=A0 > might be. Thanks!<br> >=C2=A0 ><br> >=C2=A0 > Best,<br> >=C2=A0 > David<br> >=C2=A0 ><br> >=C2=A0 > =3D=3D=3D=3D=3D=3D Output of semantic-analyze-current-<wbr>= context =3D=3D=3D=3D=3D=3D=3D<br> >=C2=A0 ><br> >=C2=A0 > Context Type: #<semantic-analyze-context context><br> >=C2=A0 > Bounds: (186 . 186)<br> >=C2=A0 > Prefix: "m"<br> >=C2=A0 > ""<br> >=C2=A0 > Prefix Classes: 'function<br> >=C2=A0 > 'variable<br> >=C2=A0 > 'type<br> >=C2=A0 > Prefix Types: <none><br> >=C2=A0 > Encountered Errors: '(error "Method semanticdb-fin= d-tags-by-name-<wbr>method called on nil")<br> >=C2=A0 > --------<br> >=C2=A0 > -> ScopeTypes: class HelloWorld2<br> >=C2=A0 > -> Parents: class HelloWorld2<br> >=C2=A0 > -> Scope: void main(String[])<br> >=C2=A0 > -> Local Args: String[] args<br> >=C2=A0 > -> Local Vars: String[] args<br> >=C2=A0 > this<br> >=C2=A0 > Map m<br> >=C2=A0 ><br> >=C2=A0 ><br> >=C2=A0 > ------------------------------<wbr>------------------------= ------<wbr>------------------<br> >=C2=A0 ><br> >=C2=A0 > ______________________________<wbr>_________________<br> >=C2=A0 > cedet-semantic mailing list<br> >=C2=A0 > <a href=3D"mailto:[email protected]">ced= et-semantic@lists.<wbr>sourceforge.net</a><br> >=C2=A0 > <a href=3D"https://lists.sourceforge.net/lists/listinfo/ced= et-semantic" rel=3D"noreferrer" target=3D"_blank">https://lists.sourceforge= .net/<wbr>lists/listinfo/cedet-semantic</a><br> ><br> >=C2=A0 Hi David,<br> ><br> >=C2=A0 Without debugging this myself I really can't say. Before you= start<br> >=C2=A0 debugging though I would recommend that you try to replicate it = with the<br> >=C2=A0 smallest possible example of the problem. i.e. jar up a package = with a<br> >=C2=A0 few classes you wrote and see whether it finds definitions from = a star<br> >=C2=A0 import of the package in that jar. I think that you might be run= ning<br> >=C2=A0 into other issues which could be clouding the actual problem.<br= > ><br> >=C2=A0 There are, for example, some features of modern Java which the c= urrent<br> >=C2=A0 grammar doesn't support (e.g. annotations.) I've done so= me work on<br> >=C2=A0 getting the parser to recognise annotations (I don't think t= hat it's<br> >=C2=A0 ready yet.) In my experience problems with the grammar can somet= imes<br> >=C2=A0 cause entire files to not be parsed correctly and although I'= ;m not sure<br> >=C2=A0 what impact that would have on db-javap it does seem like someth= ing<br> >=C2=A0 worth eliminating first.<br> ><br> >=C2=A0 If I get some time over the weekend then I'll see what I can= find.<br> ><br> >=C2=A0 Kind regards,<br> ><br> >=C2=A0 Edward Steere<br> ><br> >=C2=A0 ------------------------------<wbr>-----------------------------= -<wbr>------------------<br> >=C2=A0 Check out the vibrant tech community on one of the world's m= ost<br> >=C2=A0 engaging tech sites, SlashDot.org! <a href=3D"http://sdm.link/sl= ashdot" rel=3D"noreferrer" target=3D"_blank">http://sdm.link/slashdot</a><b= r> >=C2=A0 ______________________________<wbr>_________________<br> >=C2=A0 cedet-semantic mailing list<br> >=C2=A0 <a href=3D"mailto:[email protected]">cedet-se= mantic@lists.<wbr>sourceforge.net</a><br> >=C2=A0 <a href=3D"https://lists.sourceforge.net/lists/listinfo/cedet-se= mantic" rel=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/= <wbr>lists/listinfo/cedet-semantic</a><br> <br> </div></div>Hi David,<br> <br> I've solved it :) .=C2=A0 Thanks for the minimal example it really made= it<br> much easier to debug this one.=C2=A0 There are two problems here:<br> <br> =C2=A01.=C2=A0 semanticdb-java-jar-package-<wbr>files<br> <br> =C2=A0 =C2=A0 =C2=A0This method looks for files which match a package direc= tory from a<br> =C2=A0 =C2=A0 =C2=A0jar.=C2=A0 It does so with a regular expression.=C2=A0 = Because your classes<br> =C2=A0 =C2=A0 =C2=A0end in numerals it failed to find matching classes.=C2= =A0 I wrote the<br> =C2=A0 =C2=A0 =C2=A0following regular expression to fix the bug:<br> =C2=A0 =C2=A0 =C2=A0"\\(\\([a-zA-Z_][a-zA-Z_0-9]*\<wbr>\.class$\\)\\|\= \([a-zA-Z_]*\\.<wbr>class$\\)\\)"<br> =C2=A0 =C2=A0 =C2=A0For reference, it used to be: "[a-zA-Z_]*\\.class$= ".<br> <br> =C2=A0 2. semanticdb-normalize-tags<br> <br> =C2=A0 =C2=A0 =C2=A0The override of this method for javap jar directories h= ad a bug in<br> =C2=A0 =C2=A0 =C2=A0which it wouldn't supply the fully qualified name o= f a jar to the<br> =C2=A0 =C2=A0 =C2=A0method which extracts tags from a jar.=C2=A0 Furthermor= e, when<br> =C2=A0 =C2=A0 =C2=A0subsequently searching for a tag it supplied incorrect = arguments to<br> =C2=A0 =C2=A0 =C2=A0the search method.<br> <br> I've not yet created tests for these two fixes.=C2=A0 I'll work on<= br> implementing tests and uploading a patch as soon as I can (maybe today<br> if I have the time.)=C2=A0 I did however test it with both the jar with you= r<br> classes in it and the example which used Map from rt.jar and both<br> worked.<br> <br> Kind regards,<br> <br> Edward Steere<br> </blockquote></div><br></div> --94eb2c07d4f2fe7c850540138a29-- --===============6844624303899464730== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ The Command Line: Reinvented for Modern Developers Did the resurgence of CLI tooling catch you by surprise? Reconnect with the command line and become more productive. Learn the new .NET and ASP.NET CLI. Get your free copy! http://sdm.link/telerik --===============6844624303899464730== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ cedet-semantic mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cedet-semantic --===============6844624303899464730==--