117 NullPointerException injacob-1.17-M2
This commit is contained in:
@@ -67,6 +67,8 @@ Microsoft Visual C++ 8.0 supports 64 bit builds. so no additional tools are requ
|
||||
<H1>Build Process</H1>
|
||||
The build process is based on ANT.
|
||||
You can run ANT from inside of eclipse or from the command line.
|
||||
Running from inside eclipse means you don't have any installation, pathing or configuration to do.
|
||||
You can just open the xml and then "run as ant" on the selected target in the "outline" pane.
|
||||
The ant process is driven off of a configuration file named
|
||||
<code>compilation_tools.properties</code> that describes the locations of the JDK and Microsoft
|
||||
C++ tools. The <code>build.xml</code> file in the root directory contains examples of the contents
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
<td width="13%" valign="top">111 (new numbers)</td>
|
||||
<td width="87%" valign="top">(M3)m_pDispatch is not 0 if not attached</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="13%" valign="top">117 (new numbers)</td>
|
||||
<td width="87%" valign="top">(M4) NullPointerException injacob-1.17-M2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="13%" valign="top"> </td>
|
||||
<td width="87%" valign="top"> </td>
|
||||
|
||||
@@ -2161,6 +2161,8 @@ public class Variant extends JacobObject {
|
||||
* <li>"null" if VariantEmpty,
|
||||
* <li>"null" if VariantError
|
||||
* <li>"null" if VariantNull
|
||||
* <li>"null" if Variant type didn't convert. This can happen for date
|
||||
* conversions where the returned value was 0.
|
||||
* <li>the value if we know how to describe one of that type
|
||||
* <li>three question marks if can't convert
|
||||
*
|
||||
@@ -2186,7 +2188,11 @@ public class Variant extends JacobObject {
|
||||
try {
|
||||
Object foo = toJavaObject();
|
||||
// rely on java objects to do the right thing
|
||||
return foo.toString();
|
||||
if (foo == null) {
|
||||
return "null";
|
||||
} else {
|
||||
return foo.toString();
|
||||
}
|
||||
} catch (NotImplementedException nie) {
|
||||
// some types do not generate a good description yet
|
||||
return "Description not available for type: " + getvt();
|
||||
|
||||
@@ -253,6 +253,32 @@ public class VariantTest extends BaseTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exercise ToString special cases
|
||||
*/
|
||||
public void testToStringEmptyValues() {
|
||||
Variant v;
|
||||
// create an empty variant
|
||||
v = new Variant();
|
||||
// check date per
|
||||
v.changeType(Variant.VariantDate);
|
||||
assertEquals("null", v.toString());
|
||||
v.putDate(new Date());
|
||||
assertNotNull(v.toString());
|
||||
assertFalse("null".equals(v.toString()));
|
||||
|
||||
v.changeType(Variant.VariantInt);
|
||||
v.putInt(1);
|
||||
|
||||
assertEquals("1", v.toString());
|
||||
v.changeType(Variant.VariantEmpty);
|
||||
assertEquals("null", v.toString());
|
||||
v.changeType(Variant.VariantNull);
|
||||
assertEquals("null", v.toString());
|
||||
v.changeType(Variant.VariantError);
|
||||
assertEquals("null", v.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that booleans can be released. Part of the suite that checks all
|
||||
* types.
|
||||
@@ -465,12 +491,12 @@ public class VariantTest extends BaseTestCase {
|
||||
new BigDecimal(i), v.getDecimal());
|
||||
v.changeType(Variant.VariantFloat);
|
||||
// now see if a float conversion would work
|
||||
assertEquals("conversion to float failed " + i, new Float(i), v
|
||||
.getFloat());
|
||||
assertEquals("conversion to float failed " + i, new Float(i),
|
||||
v.getFloat());
|
||||
// now convert it back to decimal for reassignment
|
||||
v.changeType(Variant.VariantDecimal);
|
||||
assertTrue("Failed conversion of type back to Decimal " + i, v
|
||||
.getvt() == Variant.VariantDecimal);
|
||||
assertTrue("Failed conversion of type back to Decimal " + i,
|
||||
v.getvt() == Variant.VariantDecimal);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -545,9 +571,10 @@ public class VariantTest extends BaseTestCase {
|
||||
.unscaledValue().toString(16) + " scale=: "
|
||||
+ modifiedDecimal.scale());
|
||||
System.out.println("integer piece after rounding with scale 30 is "
|
||||
+ VariantUtilities.roundToMSDecimal(
|
||||
modifiedDecimal.setScale(30)).unscaledValue().toString(
|
||||
16) + " scale=: " + modifiedDecimal.scale());
|
||||
+ VariantUtilities
|
||||
.roundToMSDecimal(modifiedDecimal.setScale(30))
|
||||
.unscaledValue().toString(16) + " scale=: "
|
||||
+ modifiedDecimal.scale());
|
||||
try {
|
||||
testVariant.putDecimal(VariantUtilities
|
||||
.roundToMSDecimal(modifiedDecimal.setScale(30)));
|
||||
@@ -568,9 +595,10 @@ public class VariantTest extends BaseTestCase {
|
||||
.unscaledValue().toString(16) + " scale=: "
|
||||
+ modifiedDecimal.scale());
|
||||
System.out.println("integer piece after rounding with scale 30 is "
|
||||
+ VariantUtilities.roundToMSDecimal(
|
||||
modifiedDecimal.setScale(30)).unscaledValue().toString(
|
||||
16) + " scale=: " + modifiedDecimal.scale());
|
||||
+ VariantUtilities
|
||||
.roundToMSDecimal(modifiedDecimal.setScale(30))
|
||||
.unscaledValue().toString(16) + " scale=: "
|
||||
+ modifiedDecimal.scale());
|
||||
testVariant.putDecimal(VariantUtilities
|
||||
.roundToMSDecimal(modifiedDecimal.setScale(30)));
|
||||
System.out.println("");
|
||||
|
||||
Reference in New Issue
Block a user