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.
Summary: | Add constants for execution/debugging of a single test method | ||
---|---|---|---|
Product: | projects | Reporter: | Marian Petras <mpetras> |
Component: | Generic Infrastructure | Assignee: | Milos Kleint <mkleint> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | Keywords: | API, API_REVIEW_FAST |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://wiki.netbeans.org/APIReview137191 | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 160649 | ||
Bug Blocks: | 72080 | ||
Attachments: |
diff of the suggested changes
updated diff of the suggested changes (mostly in apichanges.xml) updated diff of the suggested changes (SingleMethod is now top-level) |
Description
Marian Petras
2008-06-13 17:35:47 UTC
Created attachment 62823 [details]
diff of the suggested changes
I wrote a wiki page about the suggested API change: http://wiki.netbeans.org/APIReview137191 Created attachment 62825 [details]
updated diff of the suggested changes (mostly in apichanges.xml)
[JG01] As mentioned on nbdev, I am -1 on the proposed use of Lookup.Item.id. Much clearer and simpler to specify what object in the context will define the method name. If that needs to be a new struct class defined in the same place as the new command constants, fine. Simplest would be to just add to some package: public final class SingleMethod { public SingleMethod(/*?*/FileObject file, String name); public FileObject getFile(); public String getName(); public static final String COMMAND_ETC = "..."; } which keeps the command names and the struct itself conveniently together. OK, I decided to go the way you suggested. public interface ActionProvider { /*...*/ public static final class SingleMethod { private FileObject file; private String methodName; public SingleMethod(FileObject file, String methodName) { this.file = file; this.methodName = methodName; } public FileObject getFile() { return file; } public String getMethodName() { return methodName; } public static final String COMMAND_RUN_SINGLE_METHOD = "run.single.method"; public static final String COMMAND_DEBUG_SINGLE_METHOD = "debug.single.method"; public boolean equals(Object obj) { /*...*/ } public int hashCode() { /*...*/ } } /* comments and checks of values are stripped */ } Is it OK? Seems straightforward and clear. Instances of the new class would be placed in the Lookup context instead of raw FileObject or DataObject, correct? [JG02] Probably prefer for it to be a top-level class (generally we discourage public nested classes in APIs), with a @see from ActionProvider. instead of raw FileObject or DataObject, correct? ... YES re [JG02] ... OK, I will make it a top-level class (in package org.netbeans.spi.project) I will prepare a complete patch (with changes to manifest.mf, apichanges, etc.) and attach it here. Created attachment 64209 [details]
updated diff of the suggested changes (SingleMethod is now top-level)
Committed, pushed. Changeset Id: 18189187ad48 (http://hg.netbeans.org/main/rev/18189187ad48) New and modified files: projectapi/src/org/netbeans/spi/project/SingleMethod.java (new) projectapi/src/org/netbeans/spi/project/ActionProvider.java projectapi/manifest.mf projectapi/apichanges.xml Integrated into 'main-golden', available in NB_Trunk_Production #311 build Changeset: http://hg.netbeans.org/main/rev/18189187ad48 User: Marian Petras <mpetras@netbeans.org> Log: API change - added class SingleMethod for support of execution of a single method (issue #137191) |