git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1437268 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -57,6 +57,7 @@ Christopher Charlier | |||||
| Clark Archer | Clark Archer | ||||
| Clemens Hammacher | Clemens Hammacher | ||||
| Clement OUDOT | Clement OUDOT | ||||
| Clive Brettingham-Moore | |||||
| Conor MacNeill | Conor MacNeill | ||||
| Craeg Strong | Craeg Strong | ||||
| Craig Cottingham | Craig Cottingham | ||||
| @@ -72,6 +72,9 @@ Fixed bugs: | |||||
| * Depend task does not handle invokeDynamic constant pool entries - java.lang.ClassFormatError: Invalid Constant Pool entry Type 18 | * Depend task does not handle invokeDynamic constant pool entries - java.lang.ClassFormatError: Invalid Constant Pool entry Type 18 | ||||
| Bugzilla Report 54090 | Bugzilla Report 54090 | ||||
| * Base64Converter not properly handling bytes with MSB set (not masking byte to int conversion) | |||||
| Bugzilla Report 54460 | |||||
| Other changes: | Other changes: | ||||
| -------------- | -------------- | ||||
| @@ -250,6 +250,10 @@ | |||||
| <first>Clement</first> | <first>Clement</first> | ||||
| <last>OUDOT</last> | <last>OUDOT</last> | ||||
| </name> | </name> | ||||
| <name> | |||||
| <first>Clive</first> | |||||
| <last>Brettingham-Moore</last> | |||||
| </name> | |||||
| <name> | <name> | ||||
| <first>Conor</first> | <first>Conor</first> | ||||
| <last>MacNeill</last> | <last>MacNeill</last> | ||||
| @@ -83,7 +83,7 @@ public class Base64Converter { | |||||
| // store the octets | // store the octets | ||||
| bits24 = (octetString[i++] & BYTE_MASK) << WORD; | bits24 = (octetString[i++] & BYTE_MASK) << WORD; | ||||
| bits24 |= (octetString[i++] & BYTE_MASK) << BYTE; | bits24 |= (octetString[i++] & BYTE_MASK) << BYTE; | ||||
| bits24 |= octetString[i++]; | |||||
| bits24 |= octetString[i++] & BYTE_MASK; | |||||
| bits6 = (bits24 & POS_3_MASK) >> POS_3_SHIFT; | bits6 = (bits24 & POS_3_MASK) >> POS_3_SHIFT; | ||||
| out[outIndex++] = ALPHABET[bits6]; | out[outIndex++] = ALPHABET[bits6]; | ||||
| @@ -0,0 +1,44 @@ | |||||
| /* | |||||
| * Licensed to the Apache Software Foundation (ASF) under one or more | |||||
| * contributor license agreements. See the NOTICE file distributed with | |||||
| * this work for additional information regarding copyright ownership. | |||||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | |||||
| * (the "License"); you may not use this file except in compliance with | |||||
| * the License. You may obtain a copy of the License at | |||||
| * | |||||
| * http://www.apache.org/licenses/LICENSE-2.0 | |||||
| * | |||||
| * Unless required by applicable law or agreed to in writing, software | |||||
| * distributed under the License is distributed on an "AS IS" BASIS, | |||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| * See the License for the specific language governing permissions and | |||||
| * limitations under the License. | |||||
| * | |||||
| */ | |||||
| package org.apache.tools.ant.util; | |||||
| import junit.framework.TestCase; | |||||
| import java.util.Calendar; | |||||
| import java.util.TimeZone; | |||||
| /** | |||||
| * TestCase for Base64Converter. | |||||
| * | |||||
| */ | |||||
| public class Base64ConverterTest extends TestCase { | |||||
| public Base64ConverterTest(String s) { | |||||
| super(s); | |||||
| } | |||||
| public void testOneValue() { | |||||
| byte[] mybytes = {0, 0, (byte)0xFF}; | |||||
| Base64Converter base64Converter = new Base64Converter(); | |||||
| assertEquals("AAD/",base64Converter.encode(mybytes)); | |||||
| } | |||||
| public void testHelloWorld() { | |||||
| byte[] mybytes = "Hello World".getBytes(); | |||||
| Base64Converter base64Converter = new Base64Converter(); | |||||
| assertEquals("SGVsbG8gV29ybGQ=", base64Converter.encode(mybytes)); | |||||
| } | |||||
| } | |||||