Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Alternative of com.atlassian.jira.util.map.EasyMap in Jira 5.1.7

satya L November 19, 2012

Hi,

we are using "com.atlassian.jira.util.map.EasyMap" in our plugins developed for Jira 4.4.5 for the purpose like to get ChangeItems etc .. see below code ,..

We are planning to upgrade our Jira to 5.1.7 and I did not find "com.atlassian.jira.util.map.EasyMap" in jira 5.1.7.

So Can any one please suggest the alternative class to this in Jira 5.1.7, (Or) please share if any alternative ways to achive the same in Jira 5.1.7.

Map params = EasyMap.build("issue", issue.getLong("id"));
		
		List<GenericValue> changeGroups = delegator.findByAnd("ChangeGroup", params);

Map paramsItem = EasyMap.build("group", changeGroup.getLong("id"),"field", "status","fieldtype", "jira");
			
List<GenericValue> changeItems = delegator.findByAnd("ChangeItem", paramsItem);






3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2012

Use MapBuilder. EasyMap is deprecated.

satya L November 21, 2012

Thnx Jobin ..

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2012

I'd agree using deprecated stuff should be avoided, however, I think you may be mistaken this time:

EasyMap was deprecated in its original 3.13 - 4.0 package, it has since been moved to a different package in JIRA 5 and is no longer deprecated.

Sometimes, retaining them allows wider version compatibility. That it is deprecated is an indicator it will go away in future, testing will of course pick that up rather quickly. Finding alternatives can be a challenge, something the existing Javadoc does not do nothing more than @deprecated

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2012

I see. However, using core package itself is not recommended ;) I still recommend to use MapBuilder.

yunfeng guo April 15, 2014

Hi Jobin, but when i use MapBuilder, i found there is no Map build(Object... objects) as EasyMap, it's not convenient for me to use that when i have many key-value parameter.

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2019

Hello! 

Just interesting why time to time in the some place (in the source of product) we meet with easyMap, when can be used guava? 

Also, this one shows refactoring

https://jira.atlassian.com/browse/CWD-3098

 

Cheers,

Gonchik Tsymzhitov

0 votes
Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2012

EasyMap is still there,

com/atlassian/core/util/map/EasyMap.java

Try importing jira-core, I can't quite see where the dependency comes in but I have jira-api and jira-core, EasyMap is visible to me?

<dependency>

<groupId>com.atlassian.jira</groupId>

<artifactId>jira-core</artifactId>

<version>${jira.version}</version>

<scope>provided</scope>

</dependency>

satya L November 21, 2012

Thnx Andy for your reply ..

which version of Jira you were using.. because in 5.1.7 I could not able to find EasyMap

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2012

atlassian-jira/WEB-INF/lib/atlassian-core-4.6.2.jar ?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events