Skip to content

Commit

Permalink
SF 1650134 change to putVariant() api
Browse files Browse the repository at this point in the history
  • Loading branch information
clay_shooter committed Apr 18, 2007
1 parent 4dc7dc1 commit e640d9d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions jacob/src/com/jacob/com/Variant.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,18 @@ public void putStringRef(String in){
*
* @throws IllegalArgumentException
* if inVariant = null
* @param inVariant A variant that is to be referenced by this variant
* @param objectToBeWrapped A object that is to be referenced by this variant.
* If objectToBeWrapped is already of type Variant, then it is used.
* If objectToBeWrapped is not Variant then <code>new Variant(objectToBeWrapped)</code>
* is called and the result is passed into the com layer
*/
public void putVariant(Variant inVariant) {
if (inVariant == null) {
public void putVariant(Object objectToBeWrapped) {
if (objectToBeWrapped == null) {
throw new IllegalArgumentException("Cannot put null in as a variant");
} else if (objectToBeWrapped instanceof Variant){
putVariantVariant((Variant)objectToBeWrapped);
} else {
Variant inVariant = new Variant(objectToBeWrapped);
putVariantVariant(inVariant);
}
}
Expand Down

0 comments on commit e640d9d

Please sign in to comment.