Archives for: June 2006, 01

Jun 01, 2006 : Target gift registries suck

A friend is getting married soon and is registered at Target. I went to Target tonight and 2 of the 3 registry printing machines were out of service, and the one that did work only did so when it felt like it. Seems like you had to wait a few minutes between each use. And Customer Service can't print any on their own computers. Then when I find a product and go to buy it, it isn't recognized as being on the list. I say "whatever" and buy it anyway, because it is on the list. I just compared model numbers online and it turns out the only difference is I bought a black item and they registered for gray. It's cookware, it doesn't matter! Grr...

So the moral of the story: register at Bed Bath and Beyond, even though that's what everyone does. At least they can print registries for you, do free gift wrapping, and ask a million times if you need any help.

: Java "copy constructor"

Well, of course you can just Foo myFoo = (Foo) theirFoo.clone(); to copy an object.

But I want to create an ExtendedFoo out of a Foo. I can't cast the foo (or cloned foo) into an ExtendedFoo because it's not one. I need to create a new ExtendedFoo and copy all of the important stuff from the "foo" object into the "extendedFoo" object. Here's how I did it:

import org.apache.commons.beanutils.BeanUtils;

public class ExtendedFoo extends Foo {

	public ExtendedFoo(Foo source) throws IllegalAccessException, InvocationTargetException {
		BeanUtils.copyProperties(this, source);
	}
	...
}

Isn't that easy?

<  June 2006  >
Mon Tue Wed Thu Fri Sat Sun
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Categories


Archives

Misc

Syndicate this blog XML

powered by
b2evolution