Difference of using reflection on AIX and XP

Hi,
I'm using java reflection to get the fields of a class. I'm having one issue related to the order of fileds (using getDeclaredFields()) when I run the program on AIX.
Say i have field1,field2,...field10 in a class A.
If i try to print the Fields[] array on console, the elements are in different order when I run on Windows XP and AIX.
In windows XP (Solaris and HP-UX) the order as i defined in the source (field1 to field10).
But in AIX i'm getting in exactly reverse order. i.e. field10 to field1.
Any idea how to solve this problem?
I tried one simple way. It goes like this...
Find the os type programatically and if it is AIX.. just reverse the contents of Field[] that's returned by the getDeclaredFields() method.
Not sure if that is the correct approach.
Thanks
Jag

Well, the API does, if you read it, say this for java.lang.Class.getFields():
"The elements in the array returned are not sorted and are not in any particular order."
So you shouldn't be assuming any order. If you want them sorted a particular way (which would pretty much have to be alphabetical by name, since there is nothing in the Field class that tells what "order" it was defined in), you'd have to write a Comparator and sort them.

Similar Messages

  • Difference between use of decision table and if/then in business rules

    Hello ,
    Could some one please explain me difference between use of decision table and if/then in business rules in short.
    - Shirish

    Hi,
    They are equivalent, pretty much what you can do with a decision table you can also do with if/then...
    However, decision tables provide automated features that can reduce the number of required rules, as compared to the if/then rules (this is called rule coalescing).
    Have a look on this document... Search for 5.1.1 What is a Decision Table?
    http://docs.oracle.com/cd/E23943_01/user.1111/e10228/decision.htm#CJHFIAHG
    Cheers,
    Vlad

  • What's the difference between using a connection pool and a datasource

    Howdy. I figure this is a newbie question, but I can't seem to find an
    answer.
    In the docs at bea, the datasource docs say
    "DataSource objects provide a way for JDBC clients to obtain a DBMS
    connection. A DataSource is an interface between the client program and the
    connection pool. Each data source requires a separate DataSource object,
    which may be implemented as a DataSource class that supports either
    connection pooling or distributed transactions."
    In there it says the datasource uses the connection pool, but other than
    that, what is the difference between a connection pool and a datasource?

    Thanks for the info. I think it makes some sense. But it's a bit greek.
    I'm sure it'll make more sense the more I work with it. Thanks.
    "Chuck Nelson" <[email protected]> wrote in message
    news:3dcac1f5$[email protected]..
    >
    Peter,
    Here is a more formal definition of a DataSource from the Sun site
    "A factory for connections to the physical data source that thisDataSource object
    represents. An alternative to the DriverManager facility, a DataSourceobject
    is the preferred means of getting a connection. An object that implementsthe
    DataSource interface will typically be registered with a naming servicebased
    on the JavaTM Naming and Directory (JNDI) API.
    The DataSource interface is implemented by a driver vendor. There arethree types
    of implementations:
    Basic implementation -- produces a standard Connection object
    Connection pooling implementation -- produces a Connection object thatwill automatically
    participate in connection pooling. This implementation works with amiddle-tier
    connection pooling manager.
    Distributed transaction implementation -- produces a Connection objectthat may
    be used for distributed transactions and almost always participates inconnection
    pooling. This implementation works with a middle-tier transaction managerand
    almost always with a connection pooling manager.
    Does that help clarify the distinction?
    Chuck Nelson
    DRE
    BEA Technical Support

  • Difference in using BI 7.0 and BW 3x  in SCM 5.0

    Hi,
             SCM 5.0 comes with BI 7.0 (SP9). I heard the BI system is unstable until SP 14. The question is does it make any difference using BI 7.0 and using BW3x, which is also option BI 7.0 gives with the transaction RSA1OLD.
    Thank you.

    Hi, you are right, BI 7.0 is unstable in SCM 5.0.
    We are using BI7.0 SP12 and SCM SP9. It gives bit stability now.
    Looking at the path ahead BI7.0 transaction using is better than RSA1old.
    If you are upgrading the system then you can use <b>RSA1OLD</b> transaction to check old functionality is working fine or not.
    If you are doing fresh implementation project then use <b>RSA1</b> to map your business process
    Loading data from file (.csv) has been changed. If you load the data from infppack it store into the PSA to load it from PSA to Cube you require Data transfer process.
    You can not shedule Data transfer process in the background, To schedule it you require to map process chain.
    You can load the full update data with out Infopack, directly with the help of Data transfer process you can load the data into the cube.
    You can map the data flow process as below
    Data source --> Infosource --> Data trasfer process --> infocube --> data transfer process for infocube.
    Message was edited by:
            Anjali Butley

  • What is difference between using interface as source and table as source?

    I am working on a batch flow which need several steps to populate data from source to target. For example, I need 5 interfaces to finish final data loading. I can either use interface or use temporary table as source and target for the interface 2, 3, and 4. It looks like both case will use tables no matter use interface or use temporary table. So my question is if there is any difference between these two (using interface as source or use temporary table as source)?
    Thanks

    if you use a Table as source for the intermediate process, it will create a physical temporary table i your work rep(depends on you choice) and populate the data into the table. if you use a interface as a source, just it will create a sub query instead of temporary table.
    Thanks
    nidhi

  • What is the difference between using the command "dsmgmt" and the "Managed By" tab when adding users to the local administrators Account on a Read-Only Domain Controller?

    When I use the
    "dsmgmt" command to add a user to the local administrators account of a RODC I can actually see the user when I use the "Show Role Administrators" parameter. However, I can't see the members of the
    group added to the "Managed By" tab of the RODC object in AD. Even though, the users added using
    "dsmgmt" and by the "Managed By" tab can all log in locally and have admin rights to the RODC. Are there any differences between these two ways of adding users to the local administrators account? 

    Hi,
    For groups, managedBy is an administrative convenience to designate “group admins”. Whatever principal listed in
    managedBy gets permission to update a group’s membership (the actual security is updated on the group’s AD object to allow this).
    In Win2008 and later managedBy also became the way you delegated local administration on an RODC, allowing branch admins to install patches, manage shares, etc. (http://technet.microsoft.com/en-us/library/cc755310(WS.10).aspx). 
    On the RODC, this is updating the RepairAdmin registry value within RODCRoles.
    So the difference between them should be only the way they do the same thing.
    For more details, please refer to the below article:
    http://blogs.technet.com/b/askds/archive/2011/06/24/friday-mail-sack-wahoo-edition.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • No difference between using a local variable and a notifier in timed parallel loops?

    The example code "Pass Data With Notifiers.vi" that came with LV 7.1 illustrates using notifiers with parallel loops.  Just looking at two of the loops, the one that generates the sine wave and the one for "User 1", you can change the timing of the two loops and you can change the condition of the "Ignore Previous" status on the "Wait on Notification".  I have a special case of this to consider, where I'm wondering if there's any reason not to use a local variable instead of the notifier:
    Set the delay on the generator portion (which contains the Send Notification) to something very short, say 5 ms.  Set the delay on the User 1 (which contains the Wait on Notification) to something relatively longer, say 200 ms.  Set the Wait on Notification to False.  Now you have a situation where the User 1 loop action is contingent only upon the loop delay time, since each time the loop timer runs the loop there will always be a value in the notifier.  In this case it seems to behave just like the case where you update a local variable in the fast loop and read it in the slow one.
    Is my understanding correct?  Would there be a performance difference between the two methods?  What do you prefer in this situation and why?
    Thanks,
    Hosehead

    Hi H.,
    I think your idea is to write to a Global Variable in the data-producer VI, and read it in the data-consumer VI(?)
    One reason this might be less efficient than using Notifiers is if you want to graph every new value in the "consumer" - or make sure the value read in the consumer has changed at least once since the last loop.
    > since each time the [consumer] loop timer runs the loop there will always be a value in the notifier...
    > Would there be a performance difference between the two methods? 
    If you don't use the Notification "event" to synchronize the producer and consumer, then to be sure the consumer gets a new vaue, you've made the producer loop faster - every 5 ms - a waste of cpu-cycles.  More often the situation is reversed, that is, there's a consumer that needs to see every single new value, and (without events) the consumer must loop faster than the producer (to catch every new value) - this is called polling and it wastes cpu-cycles.
    Just about anytime one's tempted to make a loop execute "fast" to check on some value (or to make sure there's a fresh value,) there's an opportunity to improve performance through synchronization with events (including notifiers, queues, occurrances, semaphores, and rendezvous')
    tbd
    Message Edited by tbd on 07-09-2006 03:51 AM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Difference between using the Enterprise Portal and SAP GUI

    Hi Gurus,
    Could one of you please send me a document that lists the differences between the Enterprise Portal and SAP GUI?
    thanks in advance

    Hi,
    For groups, managedBy is an administrative convenience to designate “group admins”. Whatever principal listed in
    managedBy gets permission to update a group’s membership (the actual security is updated on the group’s AD object to allow this).
    In Win2008 and later managedBy also became the way you delegated local administration on an RODC, allowing branch admins to install patches, manage shares, etc. (http://technet.microsoft.com/en-us/library/cc755310(WS.10).aspx). 
    On the RODC, this is updating the RepairAdmin registry value within RODCRoles.
    So the difference between them should be only the way they do the same thing.
    For more details, please refer to the below article:
    http://blogs.technet.com/b/askds/archive/2011/06/24/friday-mail-sack-wahoo-edition.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Differences between using a Object Reference and the Object itself

    Example:
    public class Myclass
    //difference between
    Myclass myobj;
    //and
    Myclass myobj = new Myclass();
    can anyone help me?

    Both lines you showed declare an object reference.
    The first one is not explictely assigned a value and
    is thus implicetly assigned the null reference (= a
    reference pointing to no object). The latter is
    initialized with an reference to the newly created
    Object (new Myclass()).
    They're both given a value of null first.
    The second one is then given a value that points to that object that was created.
    If they were inside a method, then the first one's value would be undefined.

  • What is difference between using VIrtual USB port and standard TCP/IP port

    Have a dv6t 2000 laptop and connecting to a photosmart 6150
    Trying to figure out why I have two printer devices installed for the same printer, actually three, one says 6100 series (have to connect to laptop docking station), one says 6100 series 1 (this one i can print to wirelessly) and the last one says 6100 series fax.
    Both the 6100 series and 6100 series 1 only allow me to scan when it is docked but i can print wirelessly to series 1.
    is there a way to scan wirelessly as well.  Allprinters are shared home network.

    Let's handle the easy one first.  The 6100 series fax icon was installed by the HP software as a printer so that you can select that printer from a program.  When you select the 6100 series fax to print to, it sends out that document as a fax skipping the hard copy step of faxing.
    When you look at the icons in the printers folder keep in mind that those are for printing not scanning.  Those icons do not represent a scanner being installed.  It would appear that you have setup the HP software once when docked.  I am assuming that the printer is attached USB to the laptop dock.
    To clear this up, delete the series 1.  That is your network print icon.  Once it is deleted, undock the laptop and then rerun the HP software.  It should come up to a menu where you can select Add a Device.  Go through the network install and it should put a series 1 icon back into the printers folder but also enable scanning over wireless.
    I was an HP employee.
    Please mark the post that solves your problem as "Accepted Solution"

  • Whats the difference between using a .mac account and an AIM account?

    hi, i'm trying to set up ichat to videochat with home when i'm abroad. Will two AIM accounts satisfy or do i have to have a family .mac account? i really dont see the point in paying 200 bucks for the .mac account if you can do the same thing with a free AIM account.
    thanks
    Tom

    Hi
    Either will do for free.
    Free 60day trial(click on free trial on the top) here http://www.apple.com/dotmac/ keep your .mac name after the 60days.
    or free AIM name here http://www.aim.com/ click on "get a screen name"
    Tony

  • Calling a pkg from managed code and then using reflection to call a method from a script task

    Hi we run 2012 std.  I have some pretty good evidence that when I call my pkg from a .net service, a script component in that pkg fails when trying 2 use reflection to load and invoke our .net message history method.  The exception is either on
    the invoke or in the message history method.  I suspect its in the method but will take additional steps 2 verify.
    But when I run the pkg stand alone, it has no problem and the method does what it is supposed 2 do.
    There r no vars passed from the service to the pkg.  I wonder if its a managed to unmanaged to managed issue that the community is already aware of.  If not, my apologies 4 posting this quickly.
    I'll post more info here as I collect it. 

    we have 2 theories after showing the exception trace to folks who r more adept at managed code.
    the first is related to the fact that our 3rd party dlls (I think entity framework is included in these) r older versions.  I don't want to discount this theory but we have some evidence already that this might not be true.
    I hope I can do justice to the 2nd theory but will make it clearer and clearer as I get a better understanding.  I believe this is what Arthur was saying and I applaud his instincts.  They explained that .net is so "smart" that it detected
    a change in namespace  (ie context as Arthur said) and purposely threw an exception 2 save us from ourselves.  The workarounds discussed were a bit over my head but I will continue trying to better understand it.  The fact that many of the methods
    we call after reflection r now merged into one assembly seemed relevant to the discussion and possible workarounds.   
    this link came up in their discussion and I believe the bottom line here is that by qualifying assembly names further (in config?)r, a workaround is possible. 
    http://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx  .
    This link came up as well and has something to do with ILMerge and workarounds to ILMerge. 
    http://elegantcode.com/2011/04/02/dynamically-load-embedded-assemblies-because-ilmerge-appeared-to-be-out/  .
    Finally, this link came up and seems to have something to do with embedding your dlls in one assembly without them losing their identity.
    http://blogs.msdn.com/b/microsoft_press/archive/2010/02/03/jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx
    I'll post more here as we muddle thru this.

  • Difference between invoking a method using reflect.proxy and reflect.Method

    Could any one tell me the difference between invoking a method using reflection java.lang.reflect.Method and java.lang.reflect.Proxy
    using both the class, we can invoke a method at runtime
    1)
    Method mthd=cl.getMethod("methodName",parameterName);
    Integer output=(Integer)mthd.invoke(new RunMthdRef(),input);
    2)
    Proxy.newProxyInstance(super.getClass().getClassLoader(), new Class[] { adapter }, new SomeClass(this));
    Does anybody have any idea?

    The two idioms are fundamentally different. Using java.lang.reflect.Method is how we call a method on a class, using Proxy is how we intercept that method call. An exercise for you, to illustrate that they do not do the same thing: write a simple class with one method, then use java.lang.reflect.Method to invoke that method, and then use a Proxy to invoke that method

  • Differences between AIX and Windows for SAP

    Dear All,
    I have a problem regarding SAP Software.We want to change our company software .First we order SAP On Windows with Oracle10g But Now We want SAP on AIX with Oracle10g.
    SAP delivered us software on Windows platform.
    Please Suggest me for this as what are the differences between the above two platforms and what are the differences between the above 2 platforms.
    Regards,
    Pankaj Kalsayan

    hi Pankaj,
    well, this is a very general question. perhaps you could specify a little more.
    in general i would see no difference regarding the end user sitting in front of his pc using sapgui.
    as far as i know all server side sap software is available for aix and windows (and many more).
    for administration on the other hand there is of course lots of difference. AIX is a UNIX operating system running on special hardware with power processors. it offers quit extensive virtualisation abilities using so called LPARs and supports real big number of CPUs and large RAM. Windows is a completly differnet operating system running mostly on x86/amd64 hardware.
    therefore you should also consider what know-how is available in your system administration.
    not shure if that is partly answering your question ...
    btw. if you are going forward with AIX you should perhaps consider switching oracle with db2. so you have a consistent IBM based landscape. also to me, sap and db2 seem to "like" each other more than sap and oracle
    regards,
    martin

  • What the difference and use between   of  TABLES and SY-REPID?

    Hi,
    Experts,
    I have came accross 2 cases that i can't able understand
    EX1:
    TABLES: VBAP   -
    >( Here also Appplication Server(AS) creates Wrokarea of Structure VBAP but, by 
    data: v_vbeln like vbap-vbeln.    double clicking on variable v_vbeln AS taking me to DDIC VBAP table VBELN field then what the using declaring tables. )
    ( and ) 
    DATA: VBAP TYPE VBAP -->( Here also Appplication Server(AS) creates Wrokarea of Structure VBAP data: v_vbeln like vbap-vbeln.    but,double clicking on variable v_vbeln AS taking me to user declared VBAP
                                                  i.e., above DATA declaration statement )
    Then Which one is better in Functionality wise as well as Performance wise or when we have to go for TABLES and when we have to go for DATA declaration of DDIC objects.
    EX2:
    what the difference between
    I know that SY_REPID is not a system variable. And also that
    Data: vrepid type SY_REPID.--> Predefined data type in ABAP
    and
    Data: vrepid like SY_REPID.-> Predefined Constatnt in ABAP( it is a constant it allowing with out VALUE                                                                               
    attribute)
    what difference between them and when we have to go Data: vrepid type SY_REPID and when we have to go Data: vrepid like SY_REPID.
    Thank U,
    Shabeer Ahmed.

    Hi Ahmed,
    TABLES:
      VBAP.   " DDIC
    DATA:
      v_vbeln like vbap-vbeln.
    *Here you are using the DDIC VBAP
    DATA:
      VBAP TYPE VBAP.
    DATA:
      vbeln like vbap-vbeln.
    *Here you are using the local data object as your data type so it will always
    * take you to user declared VBAP which is declared by you.
    DATA:
      T_VBAP TYPE VBAP.
    DATA:
      vbeln like vbap-vbeln.
    * here its using T_VBAP not DDIC VBAP
    And for performance always the second option is better, use Data instead of tables, declare your own local structure.
    Data:
      vrepid type SY_REPID.  thereis nop redefined data type in ABAP as SY_REPID
    * its SY-REPID which is a system variable.
    Data:
      vrepid type SY-REPID.
    Also refer to the links:
    Difference between tables statement and by using type statement
    for type and like:
    Re: LIKE and Type in abap statements
    With luck,
    Pritam.

Maybe you are looking for

  • IMovie video project I made has no audio working after power failure

    I have spent about a week stitching together family movies by ripping them to Apple tv format, then use a software program called MPEG streamclip to create a DV version which take about 24 gb a piece, I put 12 hours worth into iMovie which has taken

  • IPod touch 4th gen (restore problem, unknown error 9)

    So I was using an app on my iPod touch, but then suddenly the screen froze and turned white. Then it would shut off and get to the apple logo, then slowly fade out to all white and restart. This happened continuously and I couldn't get it to stop whe

  • Recurring appointment not updating correctly with caldav calendar

    I use iCal for my family's calendar. I sync this calendar to my online caldav calendar at godaddy.com. I have a 9-month weekly recurring teaching appointment in my calendar. In each month, there is at least one date that I do not need to teach, so I

  • MD61 -Authorization control for Version , requirements type -reg

    Hi, We have an issue in providing MD61 -Create Planned Independent Requirements to the users By standard authorization objects available , Plant level authorization control only is there if we have to give authorization for many users in the same pla

  • Recovering iphoto library: rebuilding database doesn't work

    My iphoto-library runs on an external HDD (using a MBP 256 SSD). It contains 38.000 photos, lots of albums and projects (photo albums) and a week ago it crashed. I accidentally removed the hdd while using iphoto. This happened to me before and with a