Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
b29610b3
Commit
b29610b3
authored
Feb 25, 2004
by
Anthony Green
Committed by
Anthony Green
Feb 25, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
de-pessimization
From-SVN: r78447
parent
7b79fe71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
libjava/ChangeLog
+6
-0
libjava/java/lang/StringBuffer.java
+21
-4
No files found.
libjava/ChangeLog
View file @
b29610b3
2004-02-24 Anthony Green <green@redhat.com>
* java/lang/StringBuffer.java: No need to NULL out remainder of
buffer since ensureCapacity_unsynchronized will have done this for
us.
2004-02-20 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/jar/Handler.java
...
...
libjava/java/lang/StringBuffer.java
View file @
b29610b3
/* StringBuffer.java -- Growable strings
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GNU Classpath.
...
...
@@ -205,10 +206,26 @@ public final class StringBuffer implements Serializable, CharSequence
if
(
newLength
<
0
)
throw
new
StringIndexOutOfBoundsException
(
newLength
);
int
valueLength
=
value
.
length
;
/* Always call ensureCapacity_unsynchronized in order to preserve
copy-on-write semantics. */
ensureCapacity_unsynchronized
(
newLength
);
while
(
count
<
newLength
)
value
[
count
++]
=
'\0'
;
count
=
newLength
;
if
(
newLength
<
valueLength
)
{
/* If the StringBuffer's value just grew, then we know that
value is newly allocated and the region between count and
newLength is filled with '\0'. */
count
=
newLength
;
}
else
{
/* The StringBuffer's value doesn't need to grow. However,
we should clear out any cruft that may exist. */
while
(
count
<
newLength
)
value
[
count
++]
=
'\0'
;
}
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment