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.

View | Details | Raw Unified | Return to bug 36064
Collapse All | Expand All

(-)core/src/org/netbeans/core/modules/NbEvents.java (-1 / +1 lines)
Lines 269-275 Link Here
269
            if (sv != null) {
269
            if (sv != null) {
270
                buf.append(sv);
270
                buf.append(sv);
271
            }
271
            }
272
            String iv = m.getImplementationVersion();
272
            String iv = m.getBuildVersion();
273
            if (iv != null) {
273
            if (iv != null) {
274
                buf.append(' '); // NOI18N
274
                buf.append(' '); // NOI18N
275
                buf.append(iv);
275
                buf.append(iv);
(-)core/src/org/netbeans/core/ui/Bundle.properties (+2 lines)
Lines 197-202 Link Here
197
HINT_modules_specversion=Version of module specification.
197
HINT_modules_specversion=Version of module specification.
198
PROP_modules_implversion=Version (Implementation)
198
PROP_modules_implversion=Version (Implementation)
199
HINT_modules_implversion=Version of module implementation.
199
HINT_modules_implversion=Version of module implementation.
200
PROP_modules_buildversion=Build Number
201
HINT_modules_buildversion=Identification of module's build number.
200
PROP_modules_jar=Module JAR
202
PROP_modules_jar=Module JAR
201
HINT_modules_jar=Location of module JAR archive.
203
HINT_modules_jar=Location of module JAR archive.
202
PROP_modules_classpath=Effective Classpath
204
PROP_modules_classpath=Effective Classpath
(-)core/src/org/netbeans/core/ui/ModuleBean.java (-1 / +8 lines)
Lines 41-46 Link Here
41
    private String codeNameBase;
41
    private String codeNameBase;
42
    private String specVers;
42
    private String specVers;
43
    private String implVers;
43
    private String implVers;
44
    private String buildVers;
44
    private String[] provides;
45
    private String[] provides;
45
    private File jar;
46
    private File jar;
46
    private boolean enabled;
47
    private boolean enabled;
Lines 80-86 Link Here
80
        codeNameBase = module.getCodeNameBase();
81
        codeNameBase = module.getCodeNameBase();
81
        SpecificationVersion sv = module.getSpecificationVersion();
82
        SpecificationVersion sv = module.getSpecificationVersion();
82
        specVers = (sv == null ? null : sv.toString());
83
        specVers = (sv == null ? null : sv.toString());
83
        implVers = (String)module.getAttribute("OpenIDE-Module-Implementation-Version"); // NOI18N
84
        implVers = module.getImplementationVersion ();
85
        buildVers = module.getBuildVersion ();
84
        provides = module.getProvides();
86
        provides = module.getProvides();
85
        jar = module.getJarFile();
87
        jar = module.getJarFile();
86
        enabled = module.isEnabled();
88
        enabled = module.isEnabled();
Lines 130-135 Link Here
130
    /** Get the implementation version, or null. */
132
    /** Get the implementation version, or null. */
131
    public String getImplementationVersion() {
133
    public String getImplementationVersion() {
132
        return implVers;
134
        return implVers;
135
    }
136
    
137
    /** Get the build version, or null. */
138
    public String getBuildVersion() {
139
        return buildVers;
133
    }
140
    }
134
    
141
    
135
    /** Get a list of provided tokens (never null, maybe empty). */
142
    /** Get a list of provided tokens (never null, maybe empty). */
(-)core/src/org/netbeans/core/ui/ModuleNode.java (+6 lines)
Lines 348-353 Link Here
348
                    p.setDisplayName(bundle.getString ("PROP_modules_implversion"));
348
                    p.setDisplayName(bundle.getString ("PROP_modules_implversion"));
349
                    p.setShortDescription(bundle.getString ("HINT_modules_implversion"));
349
                    p.setShortDescription(bundle.getString ("HINT_modules_implversion"));
350
                    sse.put(p);
350
                    sse.put(p);
351
                    p = new PropertySupport.Reflection(item, String.class, "getBuildVersion", null); // NOI18N
352
                    p.setValue("suppressCustomEditor",Boolean.TRUE);
353
                    p.setName("buildVersion"); // NOI18N
354
                    p.setDisplayName(bundle.getString ("PROP_modules_buildversion"));
355
                    p.setShortDescription(bundle.getString ("HINT_modules_buildversion"));
356
                    sse.put(p);
351
                    p = new PropertySupport.Reflection(item, String.class, "getShortDescription", null); // NOI18N
357
                    p = new PropertySupport.Reflection(item, String.class, "getShortDescription", null); // NOI18N
352
                    p.setValue("suppressCustomEditor",Boolean.TRUE);
358
                    p.setValue("suppressCustomEditor",Boolean.TRUE);
353
                    p.setName("shortDescription"); // NOI18N
359
                    p.setName("shortDescription"); // NOI18N
(-)core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java (+31 lines)
Lines 400-405 Link Here
400
            mgr.mutexPrivileged().exitWriteAccess();
400
            mgr.mutexPrivileged().exitWriteAccess();
401
        }
401
        }
402
    }
402
    }
403
404
    public void testBuildVersionCanBeReadOrIsDelegated() throws Exception {
405
        // Cf. #12014.
406
        FakeModuleInstaller installer = new FakeModuleInstaller();
407
        FakeEvents ev = new FakeEvents();
408
        ModuleManager mgr = new ModuleManager(installer, ev);
409
        mgr.mutexPrivileged().enterWriteAccess();
410
        try {
411
            Module cyc1 = mgr.create(new File(jars, "cyclic-1.jar"), null, false, false, false);
412
            Module cyc2 = mgr.create(new File(jars, "cyclic-2.jar"), null, false, false, false);
413
            
414
            
415
            assertEquals (
416
                "cyc1 does not define build version and thus it is same as impl",
417
                cyc1.getImplementationVersion (),
418
                cyc1.getBuildVersion ()
419
            );
420
            
421
            assertEquals (
422
                "cyc2 does define build version",
423
                "this_line_is_here_due_to_yarda",
424
                cyc2.getBuildVersion ()
425
            );
426
            
427
            assertTrue ("Impl and build versions are not same",
428
                cyc2.getImplementationVersion () != cyc2.getBuildVersion ()
429
            );
430
        } finally {
431
            mgr.mutexPrivileged().exitWriteAccess();
432
        }
433
    }
403
    
434
    
404
    public void testLookup() throws Exception {
435
    public void testLookup() throws Exception {
405
        FakeModuleInstaller installer = new FakeModuleInstaller();
436
        FakeModuleInstaller installer = new FakeModuleInstaller();
(-)core/test/unit/src/org/netbeans/core/modules/jars/cyclic-2.mf (+1 lines)
Lines 1-3 Link Here
1
OpenIDE-Module: org.bar.cyclic
1
OpenIDE-Module: org.bar.cyclic
2
OpenIDE-Module-Module-Dependencies: org.foo.cyclic
2
OpenIDE-Module-Module-Dependencies: org.foo.cyclic
3
OpenIDE-Module-Build-Version: this_line_is_here_due_to_yarda
3
4
(-)openide/openide-spec-vers.properties (-1 / +1 lines)
Lines 4-7 Link Here
4
# Must always be numeric (numbers separated by '.', e.g. 4.11).
4
# Must always be numeric (numbers separated by '.', e.g. 4.11).
5
# See http://openide.netbeans.org/versioning-policy.html for more.
5
# See http://openide.netbeans.org/versioning-policy.html for more.
6
6
7
openide.specification.version=4.17
7
openide.specification.version=4.18
(-)openide/api/doc/changes/apichanges.xml (+20 lines)
Lines 113-118 Link Here
113
<!-- ACTUAL CHANGES BEGIN HERE: -->
113
<!-- ACTUAL CHANGES BEGIN HERE: -->
114
114
115
  <changes>
115
  <changes>
116
    <change>
117
        <api name="modules"/>
118
        <summary>Added ModuleInfo.getBuildVersion()</summary>
119
        <version major="4" minor="17"/>
120
        <date day="22" month="12" year="2003"/>
121
        <author login="jtulach"/>
122
        <compatibility addition="yes" />
123
        <description>
124
            The implementation version and the build number of modules can
125
            now be different. One can keep 
126
            <code>OpenIDE-Module-Implementation-Version</code> unchanged
127
            to allow implementation dependencies and still identify the
128
            actual build version by specifying 
129
            <code>OpenIDE-Module-Build-Version</code>. If omited the 
130
            build version is equal to implementation version.
131
        </description>
132
        <class package="org.openide.modules" name="ModuleInfo"/>
133
        <issue number="37445"/>
134
    </change>
135
116
      <change>
136
      <change>
117
        <api name="filesystems"/>
137
        <api name="filesystems"/>
118
        <summary>Added API for finding file relatively to another file</summary>
138
        <summary>Added API for finding file relatively to another file</summary>
(-)openide/src/org/openide/modules/ModuleInfo.java (+10 lines)
Lines 73-78 Link Here
73
        return (String)getAttribute("OpenIDE-Module-Implementation-Version"); // NOI18N
73
        return (String)getAttribute("OpenIDE-Module-Implementation-Version"); // NOI18N
74
    }
74
    }
75
    
75
    
76
    /** The indentification of the build version. Usually build number. 
77
     * If no specific build version is provided than delegates to {@link getImplementationVersion}.
78
     *
79
     * @return textual identification of build version or the value for implementation version
80
     */
81
    public String getBuildVersion() {
82
        String bld = (String)getAttribute("OpenIDE-Module-Build-Version"); // NOI18N
83
        return bld == null ? getImplementationVersion () : bld;
84
    }
85
    
76
    /** Whether the module is currently enabled. */
86
    /** Whether the module is currently enabled. */
77
    public abstract boolean isEnabled();
87
    public abstract boolean isEnabled();
78
    
88
    

Return to bug 36064