Some const correctness in the Java pseudo core.

This commit is contained in:
2025-08-21 17:17:43 -04:00
parent 455169074a
commit b934b115ed
11 changed files with 35 additions and 23 deletions

View File

@ -75,17 +75,13 @@ Object *Object::clone()
/**
* \brief Use object::Object::intoStringBuffer to return a textual
* representation of the object.
*
* The caller does not have to free the memory, object::Object is responsible
* for this.
*/
const char *Object::toString()
std::string
Object::toString() const
{
/** \todo garbage! */
misc::StringBuffer sb;
intoStringBuffer(&sb);
char *s = dStrdup(sb.getChars());
return s;
return sb.getChars();
}
/**
@ -93,7 +89,8 @@ const char *Object::toString()
*
* This is used by object::Object::toString.
*/
void Object::intoStringBuffer(misc::StringBuffer *sb)
void
Object::intoStringBuffer(misc::StringBuffer *sb) const
{
sb->append("<not further specified object ");
sb->appendPointer(this);