Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6845711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:32:03+00:00 2026-05-27T00:32:03+00:00

I have many objects with a property description where is like this: description: This

  • 0

I have many objects with a property description where is like this:

description: "This is <strong>my description<strong>"

I build a list A with this objects in a method and I return.
The other list B who is receiving the A list, it hides the html tags.

When I access the same object of list A in list B, the description is like this:

description: "This is my description"

I don’t know if there is a property on maps or lists that lose HTML content when transfering one to another.

Can someone help me?

Code:

def bla {
    def mentions = [:]
    mentions = extractMentionsFromJSON(def json)
    println " 3 " + mentions[0].description
}

def extractMentionsFromJSON(def json){
    def result = []

    json.response.docs.each {
        try {
            Mention m = new Mention()
            m.title = json.highlighting[m.id].'title'.getAt(0)
            println "1 title --> " + m.title
            println "1 title  --> " + m.title.getClass()

            m.description = json.highlighting[m.id].'description'.getAt(0)
            println "1 description --> " + m.description
            println "1 description --> " + m.description.getClass()

            result.add(m)
        } catch (Exception e) {
            println "ERROR" 
        }
        println " 2 "
        result.each { println it.title}
        return result
    }
}

In the print “1” and “2” the object description and title have the correct attributes with html content.
In the prin “3”, no html content.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:32:04+00:00Added an answer on May 27, 2026 at 12:32 am

    When you pass a list around in Groovy or Java, you don’t pass a copy of the list and everything in it. You just pass a reference to the same list and the same items inside it.

    If you change these objects in a method, any other place with a reference to them will see the changes. You’ll need to explicitly make copies of these objects instead.

    (I’m sorry if the answer is too vague and generic, but you haven’t given enough information about your code to make a proper sample.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a property on a domain object that is declared in a many-to-one
I have many Topic objects and each Topic hasMany posts:Post How can I order
I have objects with many variables that I declare and explain in the comments.
In many places in our code we have collections of objects, from which we
I have an application that has many different types of objects that each persist
While there are many guides for Browser Helper Objects, i have a hard time
This Hibernate configuration ostensibly should control how many objects are cached in the first
I have this action method in C#: public ActionResult Index() { ViewBag.Message = Hello;
Let's say I have many objects and they have many string properties. Is there
Assuming I have Customer and Order objects, where one Customer can have many Orders

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.