Actually, no qualifier means that it has package visibility.  So it should be visible to any class in the same package.  I'm not sure if semantic knows the package for a java class, but it should not be difficult to determine it.


On Fri, Jun 15, 2012 at 10:17 PM, Eric M. Ludlam <> wrote:
On 06/08/2012 03:22 AM, Fredrik Malmros wrote:
> Hi,
> There seems to be an issue with visibility when completing members with
> default visibility i.e. members or classes without access modifier in Java.
> When calling semantic-analyze-possible-completion with point at ^ in the
> class below, I get:
> void baz(), but I expect to get both void baz() and void bar() since bar
> is visible in Foo (and all other classes in the same package as Foo).
> public class Foo {
>       void bar () {}
>       private void baz () {
> b
>            ^
>      }
> }


Sorry for the late reply.

The java utilities return the protection of 'bar' as being 'nil', and
'baz' as being 'private'.  I think all that is needed is for java to
override semantic-tag-protection to return private if nothing was
specified.  (If private is the right thing.  I'm not that familiar with

This patch should solve the problem if 'private is the right answer.
Please let me know if unspecified protection means private.



=== modified file 'lisp/cedet/semantic/java.el'
*** lisp/cedet/semantic/java.el 2011-11-07 20:57:12 +0000
--- lisp/cedet/semantic/java.el 2012-06-16 02:14:07 +0000
*** 173,178 ****
--- 173,187 ----
             'type (semantic-find-tag-by-overlay point))))

+ ;; Tag Protection
+ ;;
+ (define-mode-local-override semantic-tag-protection
+   java-mode (tag &optional parent)
+   "Return the protection of TAG in PARENT.
+ Override function for `semantic-tag-protection'."
+   (let ((prot (semantic-tag-protection-default tag parent)))
+     (or prot 'private)))
  ;; Prototype handler
  (defun semantic-java-prototype-function (tag &optional parent color)

Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
cedet-semantic mailing list