Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 386408

Summary: support Trac IDs that are not numeric
Product: z_Archived Reporter: Randall Becker <rsbecker>
Component: MylynAssignee: Project Inbox <mylyn-triaged>
Status: CLOSED MOVED QA Contact:
Severity: enhancement    
Priority: P5 Keywords: helpwanted
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Randall Becker CLA 2012-08-01 12:11:01 EDT
What steps will reproduce the problem?
1. This requires setting up Trac so that IDs can have non-numeric data (e.g., #ABC0003)
2. Create a Trac task as above.
3. Create a query that returns a non-empty result.
4. Hit Finish.

This appears to be possible in Trac 0.12rc1. The problem also applies to Mylyn 3.8.

TracXmlRpcClient.java:701: TracTicket ticket = new TracTicket((Integer) ticketResult[0]); appears to make an assumption that is not correct, specifically that ticketResult[0] is an integer. Unfortunately, TracTicket also makes an assuption that the id is an int. The impact to changing id is obviously getId(), setId(int), INVALID_ID, and anything downstream of those.

-- Error Details --
Date: Wed Aug 01 11:12:36 EDT 2012
Message: Unexpected server response: java.lang.String cannot be cast to java.lang.Integer
Severity: Error
Product: Eclipse SDK 3.7.2.v201202080800 (org.eclipse.sdk.ide)
Plugin: org.eclipse.mylyn.trac.core
Session Data:
eclipse.buildId=M20120208-0800
java.version=1.6.0_33
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_CA
Command-line arguments:  -os win32 -ws win32 -arch x86

Exception Stack Trace:
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
	at org.eclipse.mylyn.internal.trac.core.client.TracXmlRpcClient.parseTicket(TracXmlRpcClient.java:701)
	at org.eclipse.mylyn.internal.trac.core.client.TracXmlRpcClient.search(TracXmlRpcClient.java:688)
	at org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector.performQuery(TracRepositoryConnector.java:487)
	at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.synchronizeQuery(SynchronizeQueriesJob.java:311)
	at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.synchronizeQueries(SynchronizeQueriesJob.java:268)
	at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.run(SynchronizeQueriesJob.java:201)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Steffen Pingel CLA 2012-08-01 12:46:22 EDT
The assumption that IDs are numeric is made in a number of places in the code base. I was not aware that non numeric IDs are also supported. Do you have a pointer to the Trac documentation how to enable that?
Comment 2 Randall Becker CLA 2012-08-04 22:40:58 EDT
The environment where I encountered this had a modified version of Jira that changed the database schema. I think the basic assumption of numeric IDs is possibly unavoidable. The underlying Jira python code (from a cursory scan) does not appear to care much whether the ID field is an auto-increment or any other type as long as the create function works and returns a unique identifier, so this may be a "nice to have". In any event, Steffen's assumption is quite correct and I'm not sure this request needs to go any further.
Comment 3 Steffen Pingel CLA 2012-08-06 09:32:05 EDT
Thanks for the background information. I'll mark this as P5 to indicate that we would only be able to consider this enhancement with significant help from the community. Someone from the community would need to provide a patch to implement the code changes and possibly a customized test environment that we could deploy on mylyn.org.
Comment 4 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn