Bug 139056 - Compile errors against Foundation 1.0: org.eclipse.update.core
Summary: Compile errors against Foundation 1.0: org.eclipse.update.core
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 3.2 RC3   Edit
Assignee: Branko Tripkovic CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 139488
  Show dependency tree
 
Reported: 2006-04-27 15:57 EDT by DJ Houghton CLA
Modified: 2006-05-04 17:24 EDT (History)
2 users (show)

See Also:


Attachments
fix jarprocessor compile problems (2.63 KB, patch)
2006-05-03 10:28 EDT, Andrew Niefer CLA
no flags Details | Diff
vm 1.4 Exceptions removed (5.64 KB, patch)
2006-05-04 13:57 EDT, Branko Tripkovic CLA
no flags Details | Diff
patch for org.eclipse.update.core (11.84 KB, patch)
2006-05-04 16:36 EDT, DJ Houghton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2006-04-27 15:57:50 EDT
n0426

When compiling the org.eclipse.update.core project with Foundation 1.0 class libraries, we get the following compile errors due to use of JDK 1.4 APIs.

Also there is use of java.nio, java.net.URI, and java.net.URISyntaxException which are only available in JDK 1.4 and greater. If this use is correct, then the code should protect against the code running when these classes are not available.



The method getCause() is undefined for the type CoreException
org.eclipse.update.core/src/org/eclipse/update/internal/mirror
MirrorSite.java
line 249

The method getCause() is undefined for the type CoreException
org.eclipse.update.core/src/org/eclipse/update/internal/mirror
MirrorSite.java
line 249

The method getCause() is undefined for the type CoreException
org.eclipse.update.core/src/org/eclipse/update/internal/mirror
MirrorSite.java
line 296

The method getCause() is undefined for the type CoreException
org.eclipse.update.core/src/org/eclipse/update/internal/mirror
MirrorSite.java
line 296

The method getCause() is undefined for the type Throwable
org.eclipse.update.core/src/org/eclipse/update/core
Utilities.java
line 225

The method getChannel() is undefined for the type FileInputStream
org.eclipse.update.core/src/org/eclipse/update/internal/core
JarDeltaInstallHandler.java
line 94

The method getChannel() is undefined for the type FileOutputStream
org.eclipse.update.core/src/org/eclipse/update/internal/core
JarDeltaInstallHandler.java
line 95

The method getStackTrace() is undefined for the type Throwable
org.eclipse.update.core/src/org/eclipse/update/core
Utilities.java
line 229

The method initCause(Throwable) is undefined for the type CoreException
org.eclipse.update.core/src/org/eclipse/update/core
Utilities.java
line 227

The method split(String) is undefined for the type String
org.eclipse.update.core/src/org/eclipse/update/internal/jarprocessor
PackStep.java
line 94

The method split(String) is undefined for the type String
org.eclipse.update.core/src/org/eclipse/update/internal/jarprocessor
Utils.java
line 154

The method split(String) is undefined for the type String
org.eclipse.update.core/src/org/eclipse/update/internal/jarprocessor
Utils.java
line 169
Comment 1 Andrew Niefer CLA 2006-05-03 10:28:26 EDT
Created attachment 40204 [details]
fix jarprocessor compile problems

This patch fixes the 3 compile problems in the jarprocessor package
Comment 2 Branko Tripkovic CLA 2006-05-03 14:39:29 EDT
Released
Comment 3 Jeff McAffer CLA 2006-05-03 21:00:50 EDT
retro +1.  would be good to get someone else...
Comment 4 Dejan Glozic CLA 2006-05-03 21:06:56 EDT
+1
Comment 5 Branko Tripkovic CLA 2006-05-04 13:57:08 EDT
Created attachment 40391 [details]
vm 1.4 Exceptions removed

This patch takes out getCause(), initCause(),  getStackTrace(), usage from exception handling in MirrorSite and Utilities.
This is the last patch this bug needs so please look at it soon.
Comment 6 DJ Houghton CLA 2006-05-04 14:31:54 EDT
What is the goal of the patch? There are still references to java.nio.* and java.net.* classes that don't exist in foundation. So we still have to compile against the foundation class libraries. Or is that ok and are we just trying to remove some of the references now and will fix the rest later?

The calls to the java.nio.* classes/methods are wrapped in a try/catch block to protect against calling them when they aren't there, but the other code is not protected.

As for the patch itself it looks good except the new class needs a copyright notice.
Comment 7 DJ Houghton CLA 2006-05-04 16:36:54 EDT
Created attachment 40424 [details]
patch for org.eclipse.update.core

Here is a new patch for the project. 

After Branko's changes to remove the references to URI, there were only 6 references to 1.4 APIs. (java.nio.* code) I looked into this and they were isolated to a single class which was just using FileChannel#transferTo.

Based on the comments in bug 137336 comment #19, and based on the fact that if we remove these nio references then we can compile against straight foundation (+xml), I have modified the code to do this.

I also added the copyright to the new exception class.
Comment 8 Dejan Glozic CLA 2006-05-04 17:20:34 EDT
+1 - I think we are ready to go here.
Comment 9 Branko Tripkovic CLA 2006-05-04 17:24:45 EDT
Committed.