Browse Source

Enable <get> compilation without Sun classes.

PR: 16006
Submitted by:	Dalibor Topic <robilad at yahoo dot com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273785 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
feb447ccc1
3 changed files with 9 additions and 6 deletions
  1. +3
    -0
      WHATSNEW
  2. +0
    -1
      build.xml
  3. +6
    -5
      src/main/org/apache/tools/ant/taskdefs/Get.java

+ 3
- 0
WHATSNEW View File

@@ -85,6 +85,9 @@ Fixed bugs:
elements in Ant and the refid attribute didn't point to an existing
project reference.

* The <get> task can now be compiled (and Ant thus bootstrapped) using
Kaffee.

Other changes:
--------------
* The filesetmanifest attribute of <jar> has been reenabled.


+ 0
- 1
build.xml View File

@@ -169,7 +169,6 @@
</selector>
<selector id="needs.sun.b64">
<or>
<filename name="${ant.package}/taskdefs/Get*"/>
<filename name="${optional.package}/splash/SplashTask*"/>
</or>
</selector>


+ 6
- 5
src/main/org/apache/tools/ant/taskdefs/Get.java View File

@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -146,10 +146,11 @@ public class Get extends Task {
String encoding;
// check to see if sun's Base64 encoder is available.
try {
sun.misc.BASE64Encoder encoder =
(sun.misc.BASE64Encoder)
Class.forName("sun.misc.BASE64Encoder").newInstance();
encoding = encoder.encode (up.getBytes());
Object encoder =
Class.forName("sun.misc.BASE64Encoder").newInstance();
encoding = (String)
encoder.getClass().getMethod("encode", new Class[] {byte[].class})
.invoke(encoder, new Object[] {up.getBytes()});

} catch (Exception ex) { // sun's base64 encoder isn't available
Base64Converter encoder = new Base64Converter();


Loading…
Cancel
Save