-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPARK-1926, SPARK-1927, SPARK-1928, SPARK-1929, SPARK-1938 and SPARK-1937 #344
SPARK-1926, SPARK-1927, SPARK-1928, SPARK-1929, SPARK-1938 and SPARK-1937 #344
Conversation
Now also SPARK-1940. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yey! The first bit of work for GSoC! \o/
In short: There's nothing wrong with this code that I can see. Good job! I do have a couple of suggestions for improvement:
You appear to be applying an MVC pattern, correct? If so, please add that to your javadoc. It will help others that, at some point in the future, want to build further on this code!
It is probably a good idea to do input validation on the argument values in constructors and methods - make sure that what you think you receive, is actually what you do receive. This can be very simple: define, for each parameter, if the value can be null (and document that in javadoc), and in the first few lines, check if the value is valid. You can simply throw a runtime exception if it is not. You can throw a runtime/unchecked exception, as such a condition is a clear violation of the API 'contract' (the javadoc that you'll write) - a programming bug. I most of the time use an IllegalArgumentException when an argument has an illegal value, but you can also use an exception that is more specific to the type of violation. For instance: NullPointerException, IndexOutOfBoundsException, etc). It is primarily a matter of taste. Whatever you think is best (but I advice you to not spend to much time on this. Exception handling is good to have, but in itself, it is not the purpose of your project).
There's not a lot of logic yet, so this might simply not have come up yet, but: use logging! And not to stdout please, but use the logfiles. :)
I think your editor wraps comments/javadoc at 80 characters width? I'd change that to 120 or 160. No-one is using text terminals any more. ;)
It might be worth to combine somehow the existing 'PKI' tab, and your new 'certificates' tab. They both relate to 'private key infrastructure' - although I'm not sure yet exactly how these should be combined. Food for thought, perhaps.
I'm very happy to see that you immediately placed the files in logical packages, and used the translation files instead of hard-coding text strings. Small things like that show that you have a pretty good overview of the project already!
I'm looking forward to see more from you!
Let's merge this code, after you build in something that, while under construction, does not show the new features, without toggling a property. I think you already did most of that work with your addition to |
…ocs and additional field in CertificateModel.
Yes, I added note in Javadocs about it.
Done
Already I am doing that when catching exceptions. I am not sure if I should do it also somewhere else.
Oh, yeah my comments/javadocs were only 80 while rest of the code 120. I changed it :)
I thought about it, but I am not sure how it will be combined well with panel for mutual authentication that I will need to add somewhere later in project. In any case it shouldn't be a problem to combine things from PKI tab with new panels in later.
It seems that the simplest is commenting out addition of that tab, which now I have done. |
@@ -86,7 +86,7 @@ public boolean invoke( JFrame owner ) | |||
} | |||
if ( !Default.getBoolean(Default.CERTIFICATES_MANAGER_DISABLED)) | |||
{ | |||
tabbedPane.addTab( Res.getString( "tab.certificates" ), certManager ); | |||
// tabbedPane.addTab( Res.getString( "tab.certificates" ), certManager ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this will obviously do the trick, isn't the purpose of this if
statement to enable/disable things, from the value of CERTIFICATES_MANAGER_DISABLED
? Shouldn't we use that?
Now I think it's fine. |
Excellent. Let's not forget to switch this back after you're done with the project :) |
I didn't done nothing more than adding certificates tab, what would be visible for users with old panels. It seems I can reduce a bit that spacing between options. As I am checking older versions it doesn't appear for me as this dialog become stretched, but I can try to size it down. |
The UI will look very differently, depending on what OS you're using, and what theme/style gets enabled. Let's go with @wrooot 's suggestion, and "anchor" the content (but not the buttons on the bottom) to the top-left corner (instead of 'stretching' it over the entire height). That should give you 'empty space' between the checkboxes and the Ok/Cancel/UseDefault buttons, if the window is larger than the content. |
SPARK-1926, SPARK-1927, SPARK-1928, SPARK-1929, SPARK-1938 and (here might be some changes in future) SPARK-1937.