This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 54465 - Remove implementation dependency on xml modules
Summary: Remove implementation dependency on xml modules
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Petr Jiricka
URL:
Keywords:
Depends on: 63543 68861
Blocks: 52155
  Show dependency tree
 
Reported: 2005-02-03 13:37 UTC by Jaroslav Tulach
Modified: 2006-09-01 12:31 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The new API utility class that returns action classes needed by other modules. (1.22 KB, text/plain)
2005-09-14 19:53 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2005-02-03 13:37:15 UTC
Intercluster implementation dependencies have to
be prohibited, so please remove those on xml modules.
Comment 1 Pavel Buzek 2005-02-03 16:52:09 UTC
Cannot be solved in 4.1 because xml module has no public API.
I will ask for 4.1 waiver as soon as 4.0_WAIVER_REQUEST keyword is
created.

In promo-F we have to figure out how to solve this. I would prefer to
publish the de facto xml API as it is now because we do not plan to do
any major work on it.
Comment 2 Pavel Buzek 2005-02-10 09:18:49 UTC
DevRev agreed this can be downgraded to P2.
Comment 3 Petr Jiricka 2005-03-04 10:40:42 UTC
Waiver for NetBeans 4.1 aproved.
Comment 4 Pavel Buzek 2005-08-24 21:18:04 UTC
Petr offered to take a look at this. Thanks!
Comment 5 Petr Jiricka 2005-08-25 18:18:29 UTC
Starting to work on friend API for xml/core.

The following packages are used outside xml/core, and they are the candidates
for public packages:

org.netbeans.modules.xml.api.cookies
org.netbeans.modules.xml.api.model
org.netbeans.modules.xml.api.scenario
org.netbeans.modules.xml.spi.dom
org.netbeans.modules.xml.spi.model
org.netbeans.modules.xml.dtd.grammar

However, some cleanup is desirable before these are declared public. I suggest
the following changes:

1/ Remove org.netbeans.modules.xml.api.cookies and
org.netbeans.modules.xml.api.scenario, as these are used by dead code that is
not used in the IDE. This dead code (scenario support) would also be removed.

2/ Make class org.netbeans.modules.xml.dtd.grammar.DTDGrammar package private -
currently it is public

3/ Move class org.netbeans.modules.xml.spi.model.EmptyQuery to the xml/text-edit
module, which is the only place where it is used.

4/ Undeprecate the remaining public classes

This will get rid of the following packages:

org.netbeans.modules.xml.api.cookies
org.netbeans.modules.xml.api.scenario
org.netbeans.modules.xml.spi.model

Comment 6 Jesse Glick 2005-08-25 18:24:44 UTC
Fine with me, if you update various client modules accordingly to use the friend
API rather than an impl deps - see all xml.core usages in impl-deps.txt.

BTW any plans to make xml/tax have a friend API? Would be nice for apisupport.
Comment 7 Petr Jiricka 2005-08-26 16:07:15 UTC
Items 2/, 3/ and 4/ are done.

Checking in core/src/org/netbeans/modules/xml/api/model/GrammarEnvironment.java;
/cvs/xml/core/src/org/netbeans/modules/xml/api/model/GrammarEnvironment.java,v 
<--  GrammarEnvironment.java
new revision: 1.2; previous revision: 1.1
done
Checking in core/src/org/netbeans/modules/xml/api/model/GrammarQuery.java;
/cvs/xml/core/src/org/netbeans/modules/xml/api/model/GrammarQuery.java,v  <-- 
GrammarQuery.java
new revision: 1.7; previous revision: 1.6
done
Checking in core/src/org/netbeans/modules/xml/api/model/GrammarQueryManager.java;
/cvs/xml/core/src/org/netbeans/modules/xml/api/model/GrammarQueryManager.java,v
 <--  GrammarQueryManager.java
new revision: 1.5; previous revision: 1.4
done
Checking in core/src/org/netbeans/modules/xml/api/model/GrammarResult.java;
/cvs/xml/core/src/org/netbeans/modules/xml/api/model/GrammarResult.java,v  <-- 
GrammarResult.java
new revision: 1.4; previous revision: 1.3
done
Checking in core/src/org/netbeans/modules/xml/api/model/HintContext.java;
/cvs/xml/core/src/org/netbeans/modules/xml/api/model/HintContext.java,v  <-- 
HintContext.java
new revision: 1.3; previous revision: 1.2
done
Checking in core/src/org/netbeans/modules/xml/dtd/grammar/DTDGrammar.java;
/cvs/xml/core/src/org/netbeans/modules/xml/dtd/grammar/DTDGrammar.java,v  <-- 
DTDGrammar.java
new revision: 1.20; previous revision: 1.19
done
Removing core/src/org/netbeans/modules/xml/spi/model/EmptyQuery.java;
/cvs/xml/core/src/org/netbeans/modules/xml/spi/model/EmptyQuery.java,v  <-- 
EmptyQuery.java
new revision: delete; previous revision: 1.5
done
Removing core/src/org/netbeans/modules/xml/spi/model/package.html;
/cvs/xml/core/src/org/netbeans/modules/xml/spi/model/package.html,v  <-- 
package.html
new revision: delete; previous revision: 1.6
done
Removing tax/lib/src/org/netbeans/tax/grammar/DTDGrammar.java;
/cvs/xml/tax/lib/src/org/netbeans/tax/grammar/DTDGrammar.java,v  <-- 
DTDGrammar.java
new revision: delete; previous revision: 1.3
done
Removing tax/lib/src/org/netbeans/tax/grammar/DTDValidator.java;
/cvs/xml/tax/lib/src/org/netbeans/tax/grammar/DTDValidator.java,v  <-- 
DTDValidator.java
new revision: delete; previous revision: 1.3
done
Checking in text-edit/src/org/netbeans/modules/xml/text/completion/EmptyQuery.java;
/cvs/xml/text-edit/src/org/netbeans/modules/xml/text/completion/EmptyQuery.java,v
 <--  EmptyQuery.java
new revision: 1.5; previous revision: 1.4
done
Checking in
text-edit/src/org/netbeans/modules/xml/text/completion/GrammarManager.java;
/cvs/xml/text-edit/src/org/netbeans/modules/xml/text/completion/GrammarManager.java,v
 <--  GrammarManager.java
new revision: 1.9; previous revision: 1.8
done

One other thing I am thinking about is:

5/ Create a new class DTDUtil in package org.netbeans.modules.xml.api.model with
the following method:

public static GrammarQuery parseDTD(boolean dtdOnly, InputSource inputSource)

This would allow replacing the usages of package
org.netbeans.modules.xml.dtd.grammar from other modules by this class. So
package org.netbeans.modules.xml.dtd.grammar would not need to be exposed as
friend package.

To Jesse's questions:

> update various client modules accordingly to use the friend API rather than an
> impl deps

Yes, I plan to do this.

> BTW any plans to make xml/tax have a friend API? Would be nice for apisupport.

Agree it would be nice, but I am not sure if I can get to this in this release.
Comment 8 Petr Jiricka 2005-08-31 22:59:03 UTC
Item 5/ is done. One more thing:

6/ Add new class org.netbeans.modules.xml.api.EncodingUtil, which would be an
interface to class o.m.m.x.core.lib.EncodingHelper, exposing the two public
static methods. These are used by other modules.

Also removing the API_REVIEW_FAST keyword, will file a separate task for the
review itself.
Comment 9 Petr Jiricka 2005-09-01 22:05:57 UTC
Filed an API review request for xml/core - issue 63543.
Comment 10 Petr Jiricka 2005-09-14 19:50:26 UTC
Now regarding the dependency on xml/tools: Other modules use the action classes
from this module (Check XML, Validate XML) that are used in the popup menu of
other files based on XML (deployment descriptors, tag library descriptor, Struts
or JSF configuration file and others). I suggest eliminating the implementation
dependency by introducing a utility class with static methods that return these
classes. This hides the implementation of the action - only exposes them as
generic SystemActions. I will attach the suggested new utility class.
Comment 11 Petr Jiricka 2005-09-14 19:53:23 UTC
Created attachment 24813 [details]
The new API utility class that returns action classes needed by other modules.
Comment 12 Jesse Glick 2005-09-14 22:08:43 UTC
I would suggest the signature look like e.g.

public static Action checkAction();

Compare e.g.:

http://www.netbeans.org/download/dev/javadoc/org-netbeans-modules-projectuiapi/org/netbeans/spi/project/ui/support/CommonProjectActions.html#customizeProjectAction()
Comment 13 Jaroslav Tulach 2005-09-15 10:15:58 UTC
I bit better is imho to use ContextAwareAction in the signature as in 
http://www.netbeans.org/download/dev/javadoc/org-netbeans-modules-refactoring/org/netbeans/modules/refactoring/api/ui/RefactoringActionsFactory.html 
otherwise people do not find out that they can pass it the context... 
Comment 14 Petr Jiricka 2005-11-13 19:56:27 UTC
All implementation dependencies on xml/tools were removed.

Checking in nbproject/project.xml;
/cvs/websvc/core/nbproject/project.xml,v  <--  project.xml
new revision: 1.32; previous revision: 1.31
done
Checking in cluster-deps.txt;
/cvs/ide/golden/cluster-deps.txt,v  <--  cluster-deps.txt
new revision: 1.41; previous revision: 1.40
done
Checking in cluster-impl-deps.txt;
/cvs/ide/golden/cluster-impl-deps.txt,v  <--  cluster-impl-deps.txt
new revision: 1.7; previous revision: 1.6
done
Checking in deps.txt;
/cvs/ide/golden/deps.txt,v  <--  deps.txt
new revision: 1.253; previous revision: 1.252
done
Checking in impl-deps.txt;
/cvs/ide/golden/impl-deps.txt,v  <--  impl-deps.txt
new revision: 1.42; previous revision: 1.41
done

The only remaining cross-cluster dependency is on xml/text, will investigate this.
Comment 15 Pavel Buzek 2005-11-15 15:53:25 UTC
The dependency on xml/text is for the TokenContext. See that java/editor is
exposing its JavaTokenContext in API. The same in html, html/lib is exposing
HTMLTokenContext in API. So we should expose the XMLDefaultTokenContext in
xml/text-edit API. I would move it into a separate package, e.g.
org.netbeans.modules.xml.text.api to limit the API just to this class. Since the
only usage is in web/jspsyntax and this is impl dep I see not problem changing
it now.

Jardo, Jesse, do we need another API review for this?
Comment 16 Petr Jiricka 2005-11-16 23:08:51 UTC
Agreed with exposing XMLDefaultTokenContext as friend API, filed as a separate
task 68861.
Comment 17 Petr Jiricka 2005-11-24 17:43:37 UTC
All the subissues have been fixed, so marking this one as fixed as well.
Comment 18 Dan Kolar 2006-09-01 12:31:00 UTC
v.