From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72402: 28.2; Etags does not parse correctly Java source code Date: Thu, 01 Aug 2024 11:16:31 +0300 Message-ID: <86wml0wtcw.fsf@gnu.org> References: <87le1hr38a.fsf@hpg6> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32672"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72402@debbugs.gnu.org To: Daniel =?UTF-8?Q?G=C5=82owacki?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 01 10:17:01 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sZQzd-0008Cl-3v for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Aug 2024 10:17:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZQzP-00086J-A9; Thu, 01 Aug 2024 04:16:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZQzN-000860-P8 for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2024 04:16:45 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sZQzN-0002ts-Fs for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2024 04:16:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=G+u1uv7mAVuS6bnkRqLov5SWUQ1jClYB6gyy5Kc10NE=; b=hmIY36KQFL6Xmyg2WWiAkAELo78CAjLhe1DvaKf/FVmFOLZZ65tGwsa2CXxqzgyyrSqSDqHSIzv1FxpoRGFcT54yRZwnuyOsebi8zWwLbULw6vcIOx+DH32YI45D9mzLx3/GPTtSm9IXaImN11jjYwgWtGDmOz8+kCItxQTEoR+Z6aFsBiPrZ78yE3RetTNbC23+yeBWWHkb3qZ52iQqrg7K4q9gi2Hfowh4jNdGB2NaGqOnzxfWyG8ptGnlhL4/XM9juzqFjFkK+kFiB2lzWFCpJh3iZBWQ5FfnfbdHLDS/6VRtQ+2L5Ljrjb0drbuaBi11aKor9xdyAnMnrU/EFA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sZQze-0004Jc-1S for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2024 04:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Aug 2024 08:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72402 X-GNU-PR-Package: emacs Original-Received: via spool by 72402-submit@debbugs.gnu.org id=B72402.172250021616570 (code B ref 72402); Thu, 01 Aug 2024 08:17:02 +0000 Original-Received: (at 72402) by debbugs.gnu.org; 1 Aug 2024 08:16:56 +0000 Original-Received: from localhost ([127.0.0.1]:50821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZQzY-0004JC-0U for submit@debbugs.gnu.org; Thu, 01 Aug 2024 04:16:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZQzW-0004J0-9I for 72402@debbugs.gnu.org; Thu, 01 Aug 2024 04:16:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZQzA-0002sT-7i; Thu, 01 Aug 2024 04:16:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=G+u1uv7mAVuS6bnkRqLov5SWUQ1jClYB6gyy5Kc10NE=; b=FFms9+py5lSuoVVM7xUu buFzvtn2Jviff8tsXBzScntOGX414FgEEn9Uqk0Rlb5tT5qDZThOlqZHRh9U2h+lBzIEJi/jX8zhv uqbW70zk72490dJsjLl0ET2qRkNQmUNIcueuP+8/sHA4FUo2i0n5lGSS6bgjQWhgU3W2FU9nZkUp/ JCrLFD93lhQtoikvQ47rwKpyYdwWiz7cOc9D26MOoFPJXRVaKyJ/pooPmSj72jgoW8ka8c76EaXCw uBaMk5zT6s9zF9k9Z+1rQKac3it2S8+eY+C56jxvRbbgGDlT65tfYGYufvm73e7g80+QGuFshvM8p a3ddBZhgcKDYBw==; In-Reply-To: <87le1hr38a.fsf@hpg6> (message from Daniel =?UTF-8?Q?G=C5=82owacki?= on Wed, 31 Jul 2024 17:27:33 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289610 Archived-At: > From: Daniel GÅ‚owacki > Date: Wed, 31 Jul 2024 17:27:33 +0200 > > I have found a bug while using 'etags' program for parsing Java files. > Some of Java files are not parsed as they should be. Important parts > of the code is missing. > > Some example below: > =================== > JAVA VERSION: OpendJDK version 22 > SOURCE FILE: $(JAVA_HOME)/lib/src/java.base/java/util/HashMap.java > > ... > > public class HashMap extends AbstractMap > implements Map, Cloneable, Serializable { > > @java.io.Serial > private static final long serialVersionUID = 362498820763181265L; > > ... > > 'TAGS' FILE CREATED BY 'ETAGS': > > ... > > src/java.base/java/util/HashMap.java,2267 > implements Map<Map%1140,6932 > implements Map, Cloneable,140,6932 > final class KeySet 988,39333 > public final int size(989,39381 > public final void clear(990,39446 > public final Iterator iterator(991,39520 > public final boolean contains(992,39598 > public final boolean remove(993,39673 > public final Spliterator spliterator(996,39807 > public Object[] toArray(1000,39938 > public T[] toArray(1004,40035 > public final void forEach(1008,40135 > final class Values 1048,41686 > public final int size(1049,41741 > public final void clear(1050,41806 > public final Iterator iterator(1051,41880 > public final boolean contains(1052,41960 > public final Spliterator spliterator(1053,42037 > public Object[] toArray(1057,42170 > public T[] toArray(1061,42269 > public final void forEach(1065,42371 > final class EntrySet 1102,43948 > public final int size(1103,44011 > public final void clear(1104,44076 > public final Iterator> iterator(1105,44150 > public final boolean contains(1108,44259 > public final boolean remove(1115,44546 > public final Spliterator> spliterator(1123,44858 > public final void forEach(1126,45003 > private static final class UnsafeHolder 1567,60383 > private UnsafeHolder(1568,60429 > static void putLoadFactor(1573,60725 > abstract class HashIterator 1581,60945 > Node<Node%11582,60979 > Node next;1582,60979 > Node<Node%11583,61034 > Node current;1583,61034 > int expectedModCount;1584,61082 > int index;1585,61130 > HashIterator(1587,61178 > public final boolean hasNext(1597,61508 > final Node<Node%11601,61593 > final Node nextNode(1601,61593 > public final void remove(1614,62079 > final class KeyIterator 1626,62481 > public final K next(1628,62563 > final class ValueIterator 1631,62627 > public final V next(1633,62711 > final class EntryIterator 1636,62777 > public final Map.Entry<Entry%11638,62874 > public final Map.Entry next(1638,62874 > > .... > > The class declaration of HashMap is missing. It works for other files, > e.g. ArrayJava.java Hmm... "etags --help" doesn't seem to indicate that classes are tagged: etags --help --lang=c --lang=c++ --lang=java In C code, any C function or typedef is a tag, and so are definitions of 'struct', 'union' and 'enum'. '#define' macro definitions and 'enum' constants are tags unless you specify '--no-defines'. Global variables are tags unless you specify '--no-globals' and so are struct members unless you specify '--no-members'. Use of '--no-globals', '--no-defines' and '--no-members' can make the tags table file much smaller. You can tag function declarations and external variables by using '--declarations'. In C++ code, all the tag constructs of C code are tagged. (Use --help --lang=c --lang=c++ for full help.) In addition to C tags, member functions are also recognized. Member variables are recognized unless you use the '--no-members' option. Tags for variables and functions in classes are named 'CLASS::VARIABLE' and 'CLASS::FUNCTION'. 'operator' definitions have tag names like 'operator+'. In Java code, all the tags constructs of C and C++ code are tagged. (Use --help --lang=c --lang=c++ --lang=java for full help.) It says nothing about classes, only about class members? Can you post a Java file which has more-or-less complete class declarations, including the problematic one, and where some classes are tagged while others aren't? I'd like to try to figure out why some are tagged, but not others, and it's hard without an example. Please post the minimal example, to make stepping through the code easier. Thanks.