Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #911

Re: Object copies?

Date 2011-07-31 16:26 -0700
From Patricia Shanahan <pats@acm.org>
Newsgroups comp.lang.java.help
Subject Re: Object copies?
References <j14moo$5cf$1@dont-email.me>
Message-ID <gfKdnX26Z5AseajTnZ2dnUVZ_jednZ2d@earthlink.com> (permalink)

Show all headers | View raw


On 7/31/2011 3:59 PM, Knute Johnson wrote:
> I need a copy of a String that contains the same data as the original. I
> need to keep the reference to the original String. The copy's reference
> I'm going to use to get a modified String by applying methods of the
> String class. If I just create a new String with the String(String str)
> constructor, FindBugs complains. Is there another way to get a copy?
>
> Thanks,
>

FindBugs is probably complaining because you probably do not need to
copy. Remember that none of the String methods modifies the String on
which it is called.

Patricia

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Object copies? Knute Johnson <september@knutejohnson.com> - 2011-07-31 15:59 -0700
  Re: Object copies? Patricia Shanahan <pats@acm.org> - 2011-07-31 16:26 -0700
    Re: Object copies? Knute Johnson <september@knutejohnson.com> - 2011-07-31 16:38 -0700
      Re: Object copies? markspace <-@.> - 2011-07-31 16:47 -0700
        Re: Object copies? Knute Johnson <september@knutejohnson.com> - 2011-07-31 17:14 -0700
  Re: Object copies? Roedy Green <see_website@mindprod.com.invalid> - 2011-08-01 08:45 -0700

csiph-web