| Summary: | [9] Module declaration name should be validated while creation | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Thomas Wenzlaff <eclipse> |
| Component: | UI | Assignee: | Kalyan Prasad Tatavarthi <kalyan_prasad> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, manoj.palat, noopur_gupta, stephan.herrmann |
| Version: | 4.7 | ||
| Target Milestone: | BETA J9 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/102755 https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=6e90489bb8bedb191fdd84efeb8a17859d7dcae4 https://git.eclipse.org/r/103519 https://git.eclipse.org/c/platform/eclipse.platform.images.git/commit/?id=444a228b2769f53a7f81829352f4bc724f68cad4 |
||
| Whiteboard: | |||
| Bug Depends on: | 519442, 519560 | ||
| Bug Blocks: | |||
Similar rules as for naming an automatic module should apply... Requested the corresponding API via bug 519442. *** Bug 519939 has been marked as a duplicate of this bug. *** From bug 519442 comment #6: As discussed in the JDT call, we should provide a dialog to the user while creating module-info.java file to ask for the module name. The name in the dialog will be validated with the API from bug 519560. The initial name provided in the dialog will be the project name (or, a valid suggestion based on the project name when comment #5 is implemented in jdt.ui/core). New Gerrit change created: https://git.eclipse.org/r/102755 (In reply to Eclipse Genie from comment #5) > New Gerrit change created: https://git.eclipse.org/r/102755 Thanks for the patch, Kalyan. General comments: - It doesn't work when Finish is pressed with a warning - no file is created. - It doesn't prefill the text field if validation has an error. We should still prefill the text field to help the user create a valid name from the invalid text. - The wizard looks big - the text field is too long. - We should add an image to the wizard - this can be handled after other comments. Code review comments: Please see Gerrit. This being the first patch from you, I have gone into minute details which are important to maintain the code quality in JDT UI. Please consider this feedback for future patches as well. (In reply to Noopur Gupta from comment #6) > (In reply to Eclipse Genie from comment #5) > > New Gerrit change created: https://git.eclipse.org/r/102755 > > Thanks for the patch, Kalyan. > > General comments: > - It doesn't work when Finish is pressed with a warning - no file is created. > - It doesn't prefill the text field if validation has an error. We should > still prefill the text field to help the user create a valid name from the > invalid text. > - The wizard looks big - the text field is too long. > - We should add an image to the wizard - this can be handled after other > comments. > > Code review comments: > Please see Gerrit. This being the first patch from you, I have gone into > minute details which are important to maintain the code quality in JDT UI. > Please consider this feedback for future patches as well. Modified the Gerrit patch to include 1) The change for handling the case of file creation even if warning is reported. and 2) Handle the Gerit Code Review comments I will be adding a new image to the wizard in the next patch Also, the reason to not prefill the text field if validation has error is that the wizard convention is that it should never be prefilled with any text reporting an error. We have 2 ways to fix this a) To leave the field blank and only enable the finish button when user fills the name.(This is the choice I have used) b) To derive a valid name removing the erronous characters and prefill with a name which is valid ( This would require a bit of JDT core logic for what is allowed in a module name) (In reply to Kalyan Prasad Tatavarthi from comment #7) > Also, the reason to not prefill the text field if validation has error is > that the wizard convention is that it should never be prefilled with any > text reporting an error. > We have 2 ways to fix this > a) To leave the field blank and only enable the finish button when user > fills the name.(This is the choice I have used) > b) To derive a valid name removing the erronous characters and prefill with > a name which is valid ( This would require a bit of JDT core logic for what > is allowed in a module name) b) is bug 519442. Until we get that, we can either prefill it with the error message or leave it blank. Anything is OK for me. The Gerrit patch has been modified to add image to the wizard The patch has been updated to remove an unnecessary function and to update comments Gerrit change https://git.eclipse.org/r/102755 was merged to [BETA_JAVA9]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=6e90489bb8bedb191fdd84efeb8a17859d7dcae4 New Gerrit change created: https://git.eclipse.org/r/103519 The new Gerrit change is to push the new icons to eclipse.platform.images Gerrit change https://git.eclipse.org/r/103519 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.images.git/commit/?id=444a228b2769f53a7f81829352f4bc724f68cad4 Thanks for the patches, Kalyan! |
[1.9] Wrong generate module-info.java with hyphen in project name Sampel Projekt name: opensky-api Project -> Cofigure -> Create module-info module opensky-api {exports de.wenzlaff.tools;exports org.opensky.api;exports org.opensky.model;exports de.wenzlaff.tools;requires java.base;requires java.corba;requires jdk.compiler;}