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.

Bug 255055 - Inspect: JRE Profiles Conformance does not work on project classes
Summary: Inspect: JRE Profiles Conformance does not work on project classes
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
: 254776 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-07 11:09 UTC by MackSix
Modified: 2015-09-18 08:50 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
logfile (57.83 KB, application/octet-stream)
2015-09-07 11:09 UTC, MackSix
Details
Attached Project (67.55 KB, application/x-zip-compressed)
2015-09-09 14:33 UTC, MackSix
Details
result of validation (223.49 KB, image/jpeg)
2015-09-10 12:48 UTC, Svata Dedic
Details
attached screenshot (244.07 KB, image/png)
2015-09-10 13:05 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2015-09-07 11:09:11 UTC
Created attachment 155940 [details]
logfile

1. Open an Ant Java SE project that requires full Java SE profile. 
2. Select project in Project window.
3. Choose Source->Inspect->Configuration:Default
4. Click Manage button.
5. Choose Analyzer:Java SE 8 Profiles Conformance. 
6. Choose Profile to Validate:Profile 1.
7. Click OK.
8. Choose either the Current Folder, Current Project or Open Projects.
8. Click Inspect button.

Results: Nothing.

Expected: Results in Inspector window showing classes that need Full JRE profile.

(This works with Maven Java SE projects)

Product Version: NetBeans IDE Dev (Build 201509060314)
Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Svata Dedic 2015-09-09 12:27:00 UTC
Cannot reproduce. Please make sure that your project uses JDK8 - in JDK7, classes were not assigned to profiles.
Comment 2 MackSix 2015-09-09 13:26:04 UTC
I have an Ant project with Swing forms and it is using JDK 1.8 and source is set to JDK 1.8. and the inspection on any Compact profiles does not complain. If I add JTattoo jar to the Libraries, it will detect deficiencies in them, but not any of my class files. 

Is that how it is supposed to work, only on Libraries?
Comment 3 MackSix 2015-09-09 13:37:30 UTC
This actually behaves the same in Maven projects. I only ran it on Maven projects with jar files added dependencies. The inspection only worked on the dependencies.
Comment 4 Svata Dedic 2015-09-09 14:15:14 UTC
Strange. I've created a fresh project, put a JFrame subclass form into it and run Compact1 profile conformance analysis - I've got many complaints on that source (it wasn't even compiled yet). The feature is also supposed to work on project sources; it is implemented so it uses the indexed class caches though.
Comment 5 Svata Dedic 2015-09-09 14:16:18 UTC
One more question: by Ant project, you mean something like 'Java Application' - or  a freeform project with a pre-existing ant script ?
Comment 6 MackSix 2015-09-09 14:33:28 UTC
(In reply to Svata Dedic from comment #5)
> One more question: by Ant project, you mean something like 'Java
> Application' - or  a freeform project with a pre-existing ant script ?

It's a Java Application. I attached the project. If I add JTattoo jar too it, it will find the decencies in it, but not in the class files under the classes folder nor the classes in the Jar file under the dist folder. 

Same thing with a Maven project with the same packages/folders, the inspection will only find deficiencies in a JTattoo dependency. 

I have JEdit source set up as a free-form project and the inspection runs but I get this exception during the run: https://netbeans.org/bugzilla/show_bug.cgi?id=255136

It only finds defeciencies in the tools.jar library set in the Java Sources Classpath in project properties.
Comment 7 MackSix 2015-09-09 14:33:52 UTC
Created attachment 156018 [details]
Attached Project
Comment 8 Svata Dedic 2015-09-10 12:48:31 UTC
Created attachment 156055 [details]
result of validation

this is a result of validation of the project against Compact1 on my machine - Product Version: NetBeans IDE Dev (Build 20150909-64bcbb2b13ed)
Java: 1.8.0_20; Java HotSpot(TM) 64-Bit Server VM 25.20-b23

I assume you see something different ?
Comment 9 MackSix 2015-09-10 13:05:01 UTC
(In reply to Svata Dedic from comment #8)
> Created attachment 156055 [details]
> result of validation
> 
> this is a result of validation of the project against Compact1 on my machine
> - Product Version: NetBeans IDE Dev (Build 20150909-64bcbb2b13ed)
> Java: 1.8.0_20; Java HotSpot(TM) 64-Bit Server VM 25.20-b23
> 
> I assume you see something different ?

Yes, I see different. I only get results for JTattoo-1.6.9.jar. 

See attached screenshot.
Comment 10 MackSix 2015-09-10 13:05:28 UTC
Created attachment 156057 [details]
attached screenshot
Comment 11 Svata Dedic 2015-09-10 13:06:47 UTC
Does the result change if you clean up NB caches and restart the IDE ?
Comment 12 Svata Dedic 2015-09-10 13:16:23 UTC
Just for curiosity, could you please send me your JDK's ct.sym (the one which positively produces the invalid validation report - please double check project and IDE/platform settings).
Comment 13 MackSix 2015-09-10 13:23:03 UTC
(In reply to Svata Dedic from comment #11)
> Does the result change if you clean up NB caches and restart the IDE ?

I have done all that with no success. I just installed and tried jdk1.8.0_20 with no luck.
Comment 14 MackSix 2015-09-10 13:56:00 UTC
(In reply to Svata Dedic from comment #12)
> Just for curiosity, could you please send me your JDK's ct.sym (the one
> which positively produces the invalid validation report - please double
> check project and IDE/platform settings).

Sure, but it happens with jdk1.8.0_20 and jdk1.8.0_51 too with different ct.sym files. 

It's 3 MB zipped up, if you still want it, do you want me to attach it here or email it to you?
Comment 15 Svata Dedic 2015-09-11 15:20:57 UTC
No, probably a bad idea ... but something must work differently in your installation. Marking as P4, unless it happens on a different machine/installation
Comment 16 MackSix 2015-09-12 03:25:46 UTC
(In reply to Svata Dedic from comment #15)
> No, probably a bad idea ... but something must work differently in your
> installation. Marking as P4, unless it happens on a different
> machine/installation

I just tried it on a new Laptop with Widows 10 and it doesn't work on that machine either. :)
Comment 17 Jiri Prox 2015-09-14 12:11:06 UTC
*** Bug 254776 has been marked as a duplicate of this bug. ***
Comment 18 Svata Dedic 2015-09-14 12:28:59 UTC
Increasing priority - happens on more machines. Jirko thanks - culprit found. The violation was actually detected, but the IDE failed to map .sig filename back to the source because of a leaked platform-specific separator char (\).

Fixed in jet-main#906245a170b6
Comment 19 Quality Engineering 2015-09-17 01:25:50 UTC
Integrated into 'main-silver', will be available in build *201509170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/906245a170b6
User: Svata Dedic <sdedic@netbeans.org>
Log: #255055: platform separator char must be translated prior to pkg name conversion
Comment 20 MackSix 2015-09-18 08:50:45 UTC
v. fixed.