473,769 Members | 7,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 3675

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

Similar topics

2
3802
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
47613
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
3109
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
5448
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
6956
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
13740
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
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10048
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
9996
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
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6674
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();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
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
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.