473,756 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SupportClass.Co llectionSupport = java.util.Colle ction

I got another convert issue. This is the same project as I posted
yesterday, and received a perfect response.
The conversion threw a SupportClass for me and one of the data type is
CollectionSuppo rt, this is to my understanding to replace
Java.Util.Colle ction. In my code:
public EcomWeb.rx_tran sactions.order. GroverOrder[]
getGroverOrders (EcomWeb.domain .WebOrder webOrder)
{
System.Console. Out.WriteLine(" OrderFactory.
getGroverOrders ( ) started");
EcomWeb.rx_tran sactions.order. GroverOrder[]
arrayOfGroverOr ders = new
EcomWeb.rx_tran sactions.order. GroverOrder[0];
//UPGRADE_TODO: Class 'java.util.Hash Map' was
//converted into'System.Col lections.Hashta ble'
// which has a different behavior. 'ms- help:
//MS.VSCC.2003 /commoner/redir/redirect.htm?
//keyword="jlca10 73_javautilHash Map"'
System.Collecti ons.IDictionary groverOrdersMap =
new System.Collecti ons.Hashtable() ;
//UPGRADE_ISSUE: Class hierarchy differences
//between ''java.util.Lis t''
//and ''SupportClass. ListCollectionS upport'' may cause
// compilation errors. 'ms-
// help://MS.VSCC.2003/commoner/redir/redirect.htm?
// keyword="jlca11 86"'
//UPGRADE_ISSUE: Class hierarchy differences
// between 'java.util.Arra yList'
// and 'System.Collect ions.ArrayList' may cause
// compilation errors. 'ms-
//help://MS.VSCC.2003/commoner/redir/redirect.htm?
//keyword="jlca11 86"'
SupportClass.Li stCollectionSup port otcOrderItems = new
SupportClass.Li stCollectionSup port( new
System.Collecti ons.ArrayList() );

// Iterate through all the OrderItems, building a map
// of GroverOrder
// objects for each pharmacy_id. Hold onto the
// OTCOrderItems until
// all the GroverOrder objects are created.
EcomWeb.domain. OrderItem[] orderItems =
webOrder.OrderI tems;
for (int i = 0; i < orderItems.Leng th; i++)
{
if (orderItems[i] is EcomWeb.domain. RxOrderItem)
{
EcomWeb.rx_tran sactions.order. GroverOrder order;
EcomWeb.domain. RxOrderItem item =
(EcomWeb.domain .RxOrderItem) orderItems[i];
System.Int32 pharmacyId = item.PharmacyId ;
// Is this pharmacy id already mapped?
//UPGRADE_ISSUE: Method 'java.util.Map. containsKey' was
// not converted. 'ms-
//help://MS.VSCC.2003/commoner/redir/redirect.htm?
//keyword="jlca10 00"'
//if (groverOrdersMa p.containsKey(p harmacyId))
if (groverOrdersMa p.Contains(phar macyId))
{
// GroverOrder is cached.
//UPGRADE_TODO: Method 'java.util.Map. get' was
//converted to 'System.Collect ions.IDictionar y.Item'
// which has a different behavior. 'ms-
//help://MS.VSCC.2003/commoner/redir/redirect.htm?
//keyword="jlca10 73_javautilMapg et_javalangObje ct"'
order =
(EcomWeb.rx_tra nsactions.order .GroverOrder)
groverOrdersMap[pharmacyId];
order.add(item) ;
}
else
{
// Create a new GroverOrder
order = constructGrover Order(webOrder,
pharmacyId);
order.add(item) ;
object tempObject;
tempObject = order;
groverOrdersMap[pharmacyId] = tempObject;
System.Object generatedAux2 = tempObject;
} // END-IF-ELSE
}
else
{
// This is an OTC order item.Save it for later use.
//UPGRADE_TODO: The equivalent in .NET for
// method 'java.util.List .add' may return a
//different value. 'ms-
//help://MS.VSCC.2003/commoner/redir/redirect.htm?
//keyword="jlca10 43"'
otcOrderItems.A dd(orderItems[i]);
} // END-IF-ELSE
} // END-FOR
// Add the collected OTC order items to an appropriate
// GroverOrder.
addOTCOrderItem s(groverOrdersM ap, otcOrderItems,
webOrder);
// Transfer collection of GroverOrder objects to array
// structure.
//UPGRADE_ISSUE: Class hierarchy differences
//between ''java.util.Col lection''
// and ''SupportClass. CollectionSuppo rt'' may cause
//compilation errors. 'ms-
//help://MS.VSCC.2003/commoner/redir/redirect.htm?
//keyword="jlca11 86"'
SupportClass.Co llectionSupport groverOrdersCol lection=
(SupportClass.C ollectionSuppor t)
groverOrdersMap .Values;
arrayOfGroverOr ders =
(EcomWeb.rx_tra nsactions.order .GroverOrder[])
groverOrdersCol lection.ToArray (new
EcomWeb.rx_tran sactions.order. GroverOrder[0]);
System.Console. Out.WriteLine
("OrderFactory. getGroverOrders ( ) end");
return arrayOfGroverOr ders;
} // END-METHO

Again, my issue is the runtime error rather than compilation. It threw
invalid cast exception right on
SupportClass.Co llectionSupport groverOrdersCol lection=
(SupportClass.C ollectionSuppor t)
groverOrdersMap .Values;
SupportClass.Co llectionSupport is Collection in Java,
System.Collecti ons.IDictionary groverOrdersMap = new
System.Collecti ons.Hashtable() ; in java is Java.Util.Map.
I thought this is the same issue as I posted last time, but I do not
know how to handle it.
Thank you again for help.
Daniel


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
0 3673

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3801
by: Steven | last post by:
Hello, I'm a student at the university of Antwerp Belgium and I'm writing a program for java web start that has to support plugins. Now my question is why does java web start download 3 versions of the resources specified in the jnlp file: RC*.jar, RM*.jar and RT*.jar and is there any way in which I can acces the jar files in the following way:
1
6918
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
1
47612
by: greg.knaddison | last post by:
Hi, I'm trying to use the httpclient within Jython (see http://jakarta.apache.org/commons/httpclient/ for more information on the httpclient). My Jython version is: Jython 2.1 on java1.4.2_04 (JIT: null) My Java version is:
4
3427
by: angel | last post by:
A java runtime environment includes jvm and java class (for example classes.zip in sun jre). Of course jython need jvm,but does it need java class. Thanx
1
2469
by: Christian W. Guenther | last post by:
Hallo, please excuse if I violate any group etiquette etc. but I am not very experienced both regarding the usenet and your group. I have installed Xindice, integrated into Tomcat, and can use it via the command line tools provided without problems. Yet when I try to access the database within a Java program I get the following error: trying to register database
1
3108
by: Jens Mueller | last post by:
Hi there, this is a Java-XML Question, so I am not sure whether this is the right place, haven't found anything better .... I try to convert a Java object to XML via SAX and let the FOP Transformer convert that via XSLT to valid XSL-FO. So I define a SAXReader which fires the SAX Events for the Java Object. This works fine and the Transformation to PDF is ok. However, I have one object which contains an XHTML String and the tags
4
5446
by: puntino | last post by:
Hi I have created my Alarm, at compile time I don't have any problem, but at run time I receive the follo wing messages: Exception in thread "main" java.lang.NullPointerException at java.util.Timer.sched(Unknown Source) at java.util.Timer.scheduleAtFixedRate(Unknown Source) at Alarm.AlarmExecute(Alarm.java:20) at Test.main(Test.java:11) (With <- I have pointed out the line 11 of test.java and line 20 of alarm.java)
6
6955
oll3i
by: oll3i | last post by:
when i run my jsp file i get an error SEVERE: Servlet.service() for servlet jsp threw exception java.util.MissingResourceException: Can't find bundle for base name MessagesBundle, locale pl_PL at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1508) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1262) at java.util.ResourceBundle.getBundle(ResourceBundle.java:789) at...
1
13736
by: jimgym1989 | last post by:
I dont get it..why is the error: Exception in thread "main" java.util.InputMismatchException this is my code /** * @(#)textFileRead.java * * * @author * @version 1.00 2008/10/17 */
0
10046
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9886
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7259
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6542
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.