Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Controlling access of packages(Change the visibility od packages)
Controlling access of packages [message #1130228] Wed, 09 October 2013 06:37
Pierrick MARIE is currently offline Pierrick MARIE
Messages: 1
Registered: October 2013
Junior Member

With the Eclipse Java editor it is possible to change the visibility of declared packages like this :

private package com.mypackage

class Foo {
 // say hello

With Eclipse, this piece of code is executed normally with no problem. Whatever the keyword before the package declaration (private, protected or public) the compilation and the execution produce the same result.

But, as it is specified by Java, it is impossible to change the visibility of packages, see :
If I compile manually this code I have an error :

$ javac com.mypackage.Foo error: class, interface, or enum expected
private package com.monsuperpackage;
1 error

I don't understand why it is possible to change the visibility of packages with the Eclipse Java editor (and only with it). What is the feature ?

ps : I use the version 1.7.0_25 of javac.

Thank you.
Previous Topic:Whats going wrong?
Next Topic:Is the Workbench guaranteed to be available when a plugin with dependency on org.eclipse.ui starts?
Goto Forum:

Current Time: Sat Aug 30 18:24:14 EDT 2014

Powered by FUDForum. Page generated in 0.01478 seconds