FAQ on VB & C# to Java Converter





























FAQ for VB & C# to Java Converter:

Q:    Is the original VB.NET or C# project altered in any way?
A:    Your existing code is left completely intact.  The new Java files are written to the new location that you specify.
Q:    What is the conversion accuracy?
A:    Our accuracy is the highest in the industry, but there will be significant adjustments required for all but the most trivial conversions.  There are no direct equivalents for some aspects of VB and C#.  Read the rest of the FAQ to get an idea of a few things that are not converted.  VB & C# to Java Converter is intended to reduce the amount of work you'll have to do to convert VB or C# code to Java, but it is just the first step.
 
Q:    Does VB & C# to Java Converter convert VB6 projects to Java?
A:    No.  The most effective and safest way to get from VB6 to Java is to use the upgrade wizard included with Visual Studio on your VB6 code, and then use VB & C# to Java Converter on the resulting VB.NET code.
 
Q:    How are VB methods with optional parameters converted?
A:    Overloaded methods are created and the 'Optional' keywords are removed.  Missing arguments are replaced by the defaults specified by the original VB.NET parameter list.
Q:    Are VB case statements with range expressions handled?
A:    Yes, VB 'Select Case' blocks containing non-ordinal or range expressions are converted to Java 'if-else' blocks.  Other 'Select Case' blocks are either converted to Java 'switch' statements if the expressions are constant (a requirement in Java) or to Java if-else blocks otherwise.
 
Q:    Are VB ByRef and C# ref parameters converted?
A:    Yes - try out our demo to see the conversion details.  We substitute a wrapper type (using Java generics) for the parameter type and adjust all references to the parameter in the defining method and all calls to the method.
 
Q:    What are the most common adjustments necessary after conversion?
A:
●  Most .NET Framework calls are not converted.  However, many references to the .NET String, Char, Hashtable, Dictionary, ArrayList, List, Stack, Queue, StrringBuilder, Array, Math, Convert, Console, and MessageBox classes are converted to Java.
 
●  There are no simple equivalents to VB & C# delegates and events in Java, so these must be refactored.

●  Operator overloading is not available in Java. These methods are marked with a comment.

●  Since Java lacks a preprocessor, all code dependent on conditional compilation needs to be refactored so that the functionality can be achieved in other ways.  If your target environment is NetBeans, then no adjustments are required since VB & C# to Java Converter converts preprocessor directives to NetBeans format by default (using //#if, //#else, //#elif, //#endif, //#define, and //#undefine).

●  VB9 and C#3 LINQ queries are not converted since this feature is not available in Java.

●  VB 'Structure' and C# 'struct' is converted to Java 'class', since Java does not include value types.  The Java class does not reproduce the same behavior as .NET value types, so adjustments may be required.

●  If the VB.NET project did not have 'Option Strict On' set, then you'll likely have a number of cases where different types are compared with each other - these may need adjustment.

●  Although most On Error GoTo statements are converted, some elements of classic VB unstructured error handling (On Error Resume Next, On Error GoTo -1, etc.) are not converted.  These statements are marked as a 'ToDo' task. Also, all references to the VB Err object are not converted and marked as a 'ToDo' task.

●  ‘When’ statements in ‘Catch’ blocks (which have no equivalent in Java) must be manually adjusted.  These are commented out and combined with a warning comment.

●  C# 'unsafe’ blocks cannot be fully converted since Java has no corresponding concept.  These are marked with 'ToDo' comments.

Email your questions and comments to:  info@tangiblesoftwaresolutions.com

[Site Map]        [Home]


Copyright © 1997 - 2009 Tangible Software Solutions Inc.