Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352479 - Move JDT debug to Java 1.5 BREE
Summary: Move JDT debug to Java 1.5 BREE
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.8 M5   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
: 319743 (view as bug list)
Depends on:
Blocks: 352626
  Show dependency tree
 
Reported: 2011-07-19 11:27 EDT by Michael Rennie CLA
Modified: 2012-06-11 13:20 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2011-07-19 11:27:57 EDT
It would be nice to move JDT debug to a 1.5 BREE. Aside from the obvious language benefits, we could investigate using JVMTI alongside JVMDI.

This investigation would require:
1. updating the source to use Java 5 constructs
2. investigate JVMTI to determine if there are new debugger hooks we can use with or without adding a separate agent.
Comment 1 Dani Megert CLA 2011-07-19 11:54:46 EDT
>1. updating the source to use Java 5 constructs
Please talk to Markus about that. He can give useful tips here.
Comment 2 Michael Rennie CLA 2011-09-28 13:40:39 EDT
(In reply to comment #0)
> 2. investigate JVMTI to determine if there are new debugger hooks we can use
> with or without adding a separate agent.

There is really nothing we would gain debugger-wise from creating our own agent to use JVMTI directly since we don't plan to provide profiling / instrumentation / etc support in the Java debugger. Also, the overhead of creating / maintaining native agent libraries for all supported platforms is much more work than the debug team has resources to do.
Comment 3 Dani Megert CLA 2011-09-29 03:59:47 EDT
(In reply to comment #1)
> >1. updating the source to use Java 5 constructs
> Please talk to Markus about that. He can give useful tips here.
See http://wiki.eclipse.org/Generify_A_Java_Project
Comment 4 Michael Rennie CLA 2011-12-14 10:56:09 EST
I have created a new branch to track the migration work called generify_debug.

So far the branch contains changes to the bulk of the JDI interfaces
Comment 5 Michael Rennie CLA 2012-01-09 17:29:57 EST
The code changes are complete and committed to the generify_debug branch (http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/log/?h=generify_debug). 

All tests pass (so far). I will run a test build that we can use for testing.
Comment 6 Michael Rennie CLA 2012-01-18 16:54:59 EST
The changes have been in the N-builds all week and all tests / testing pass. 

Marking fixed.
Comment 7 Dani Megert CLA 2012-01-19 03:08:45 EST
(In reply to comment #6)
> The changes have been in the N-builds all week and all tests / testing pass. 
> 

There are still compile warnings in the official builds:
http://download.eclipse.org/eclipse/downloads/drops/N20120118-2000/testResults.php

They need to get fixed or suppressed.
Comment 8 Markus Keller CLA 2012-01-19 07:09:28 EST
There are multiple problems at work here:

- "javacWarnings..=-unavoidableGenericProblems" only works for source that is compiled into "." (the bundle JAR).
E.g. in /org.eclipse.jdt.debug/build.properties, you need to have "javacWarnings.jdimodel.jar=-unavoidableGenericProblems", and maybe the same for jdi.jar.

- @SuppressWarnings("<xxx>") are marked as unnecessary if the suppressed warning is not enabled in the build (e.g. potential null access, field declaration hides another field, ...). See "Java development user guide > Tasks > Compiling Java code > Using the batch compiler" in the help for the compiler options that have to be added to the "javacWarnings" entries if they are are also enabled in the build.

These problems could be avoided in batch by adding
"javacProjectSettings = true" to build.properties, but we tried to avoid overriding all options so far to keep control of this in the SDK build (and only override the defaults where really necessary).

We could add -warningToken to the SDK build to avoid the @SuppressedWarnings problems globally. These will show up more and more as projects start to enable specific warnings and then suppress some false positives.
Comment 9 Michael Rennie CLA 2012-01-19 16:07:57 EST
(In reply to comment #8)
> There are multiple problems at work here:
> 
> - "javacWarnings..=-unavoidableGenericProblems" only works for source that is
> compiled into "." (the bundle JAR).
> E.g. in /org.eclipse.jdt.debug/build.properties, you need to have
> "javacWarnings.jdimodel.jar=-unavoidableGenericProblems", and maybe the same
> for jdi.jar.
>

I added the following:

jdt.debug.core
  javacWarnings..=-unavoidableGenericProblems
  javacWarnings.jdimodel.jar=-unavoidableGenericProblems
  javacWarnings.jdi.jar=-unavoidableGenericProblems

jdt.debug.tests
  javacWarnings..=-unavoidableGenericProblems
  javacWarnings.javadebugtests.jar=-unavoidableGenericProblems

jdt.debug.ui
  javacWarnings..=-unavoidableGenericProblems
  javacWarnings.snippersupport.jar=-unavoidableGenericProblems

jdt.launching
  javacWarnings..=-unavoidableGenericProblems
  javacWarnings.launchingsupport.jar=-unavoidableGenericProblems

jdt.launching.macosx.core
  javacWarnings..=-unavoidableGenericProblems

jdt.launching.macosx.ui
  javacWarnings..=-unavoidableGenericProblems

> - @SuppressWarnings("<xxx>") are marked as unnecessary if the suppressed
> warning is not enabled in the build (e.g. potential null access, field
> declaration hides another field, ...). See "Java development user guide > 

I changed the project specific settings to ignore the warnings the annotations are suppressing and removed the annotations. Also committed a bit of code clean-up.

pushed changes to: 
http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=e9d411f03fb789569e481bc4c3d5b5e342328b89
Comment 10 Dani Megert CLA 2012-01-20 06:12:31 EST
Verified in N20120119-2000.
Comment 11 Dani Megert CLA 2012-01-24 05:03:00 EST
Compiling the launchingsupport.jar against 1.5 breaks 1.4 JRE detection, see bug 369480.
Comment 12 Michael Rennie CLA 2012-06-11 13:20:42 EDT
*** Bug 319743 has been marked as a duplicate of this bug. ***