Changeset 38912 in vbox
- Timestamp:
- Sep 30, 2011 9:52:49 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/glue-java.xsl
r38799 r38912 50 50 * Copyright (C) 2010-2011 Oracle Corporation 51 51 * 52 * This file is part of VirtualBox Open Source Edition (OSE), as 53 * available from http://www.virtualbox.org. This file is free software; 54 * you can redistribute it and/or modify it under the terms of the GNU 55 * General Public License (GPL) as published by the Free Software 56 * Foundation, in version 2 as it comes in the "COPYING" file of the 57 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 58 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 52 * This file is part of the VirtualBox SDK, as available from 53 * http://www.virtualbox.org. This library is free software; you can 54 * redistribute it and/or modify it under the terms of the GNU Lesser General 55 * Public License as published by the Free Software Foundation, in version 2.1 56 * as it comes in the "COPYING.LIB" file of the VirtualBox SDK distribution. 57 * This library is distributed in the hope that it will be useful, but WITHOUT 58 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 59 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 60 * License for more details. 59 61 * 60 62 </xsl:text> … … 678 680 <xsl:param name="type" /> 679 681 <xsl:param name="safearray" /> 680 <xsl:param name="forceelem" /> 681 682 <xsl:choose> 682 <xsl:param name="forceelem" /> 683 684 <xsl:choose> 683 685 <xsl:when test="($G_vboxGlueStyle='xpcom')"> 684 686 <xsl:variable name="needarray" select="($safearray='yes') and not($forceelem='yes')" /> … … 759 761 <xsl:when test="($G_vboxGlueStyle='jaxws')"> 760 762 <xsl:variable name="needarray" select="($safearray='yes' and not($type='octet')) and not($forceelem='yes')" /> 761 763 762 764 <xsl:if test="$needarray"> 763 765 <xsl:value-of select="'List<'" /> … … 3614 3616 } 3615 3617 } 3616 3618 3617 3619 /* Pretty naive Base64 encoder/decoder. */ 3618 3620 private static final char[] valToChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); 3619 3621 private static final int[] charToVal = new int[256]; 3620 3622 3621 /* Initialize recoding alphabet. */ 3622 static 3623 /* Initialize recoding alphabet. */ 3624 static 3623 3625 { 3624 3626 for (int i = 0; i < charToVal.length; i++) … … 3654 3656 result[stringIndex++] = valToChar[ch3 & 0x3f]; 3655 3657 } 3656 3658 3657 3659 switch (data.length - dataIndex) 3658 3660 { … … 3698 3700 if (str == null) 3699 3701 return null; 3700 3702 3701 3703 int stringLength = str.length(); 3702 3704 if (stringLength == 0) … … 3714 3716 padChars++; 3715 3717 } 3716 3718 3717 3719 if ((validChars * 3 % 4) != 0) 3718 3720 throw new RuntimeException("invalid encoded string "+str); … … 3736 3738 3737 3739 result[dataIndex++] = (byte)(((charToVal[ch1] << 2) | charToVal[ch2] >> 4) & 0xff); 3738 /* we check this to ensure that we don't override data with '=' padding. */ 3740 /* we check this to ensure that we don't override data with '=' padding. */ 3739 3741 if (dataIndex < result.length) 3740 3742 result[dataIndex++] = (byte)(((charToVal[ch2] << 4) | charToVal[ch3] >> 2) & 0xff); … … 3742 3744 result[dataIndex++] = (byte)(((charToVal[ch3] << 6) | charToVal[ch4]) & 0xff); 3743 3745 } 3744 3746 3745 3747 return result; 3746 3748 }
Note:
See TracChangeset
for help on using the changeset viewer.