[prev in list] [next in list] [prev in thread] [next in thread]
List: velocity-user
Subject: Re: Create an empty java.util.Set in VTL
From: Sergiu Dumitriu <sdumitriu () apache ! org>
Date: 2018-01-25 16:57:56
Message-ID: 93464c4a-e07c-561e-fba3-e0f3db51a84d () apache ! org
[Download RAW message or body]
Not if you're using the secure uberspector, which everyone should be doing.
On 01/25/2018 11:44 AM, Alex Fedotov wrote:
> You can probably use a hack with classloader. Along the lines of:
>
> #set($x =
> "1".getClass().getClassloader().findClass("java.uti.HashSet").newInstance())
>
> Alex
>
>
> On Thu, Jan 25, 2018 at 11:30 AM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
> All,
>
> If I want to create a new empty array/collection, I can do something
> like this:
>
> #set($array = [])
>
> If I want to create a new Map, I can do this:
>
> #set($map = {})
>
> Is there a way to create a new Set?
>
> I'd like to use a set because:
>
> 1. I want to use this object as a sort of scratch-area to know what
> work I've done before
>
> and
>
> 2. I'm going to be consulting it a lot using Set.contains(object) so
> something other than ArrayList/LinkedList will be much faster
>
> Thanks,
> -chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>
--
Sergiu Dumitriu
http://purl.org/net/sergiu
--
Sergiu Dumitriu
http://purl.org/net/sergiu
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic