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: | Provide a Version class | ||
---|---|---|---|
Product: | platform | Reporter: | Petr Hejl <phejl> |
Component: | -- Other -- | Assignee: | Petr Hejl <phejl> |
Status: | NEW --- | ||
Severity: | normal | CC: | jtulach |
Priority: | P2 | Keywords: | API |
Version: | 8.0 | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
Petr Hejl
2014-05-23 15:39:49 UTC
I don't know what is in web.common, but there is http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/SpecificationVersion.html (In reply to Jaroslav Tulach from comment #1) > I don't know what is in web.common, but there is > http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/ > SpecificationVersion.html Thanks for the point Jardo. Though it seems to be too strict regarding the notation :( The Version from web common supports JSR277 notation MAJOR_NUMBER[.MINOR_NUMBER[.MICRO_NUMBER[.UPDATE_NUMBER]]][-QUALIFIER] and also dotted notation used by Oracle MAJOR_NUMBER[.MINOR_NUMBER[.MICRO_NUMBER[.UPDATE_NUMBER[.QUALIFIER]]]] and with limited functionality it can deal with generic string. It should be also extended to be able to parse MAJOR[.MINOR[.MICRO[.QUALIFIER]] used by JBoss. There are just too many formats :/ It is not common requirement to compare and use different formats together. On the other hand I'd prefer one Version class rather than couple of them for each format. I'm not sure whether we can extend SpecificationVersion this way and whether it would be reasonable. Perhaps good enough would be a method returning SpecificationVersion that would parse just MAJOR.MINOR.MICRO ignoring the rest. I believe nobody really depends on update or qualifier right now. Of course such requirement may appear anytime in near future. What do you think? The class is likely to accept only numbers. But without any limit. Extending it to qualifier (compared alphabetically and being last may be an option). Posible having different factory methods for different formats!? |