struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dakota Jack <>
Subject Re: [OT] Re: WeakReference
Date Thu, 02 Dec 2004 19:56:31 GMT
Paul and Craig

I am getting what I expect with the following code (see below), thanks
to Craig, but not with the code which you can find at and I am not sure what the
difference is.  Essentially, I am trying to keep a WeakReference to
Point classes so that when I update the Point.class I can change the
classes for all the PointImpl objects out there.  Not sure what is
going wrong.  If you could take a peek, that would be great.  Thanks.


package com.crackwillow.deploy;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;

public class MyReference {
  public static void main(String [] params) {
    CheckPlease cp = new CheckPlease();
    WeakReference wr = new WeakReference(cp);

class CheckPlease {
  private String bill = "0.00";

  public void setBill(String add) {
    if(add == null) add = "freebee";
    else bill += " + " + add;

  public String getBill() {
    return bill;

  public String toString() {
    return bill;

"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message