Assigning an object a primative value[ compiler magic | documented] ?

I recently discovered something I was doing in code on J2SE (Mac & Sun) which I never recall knowing you could do. That is assigning an Object a primative an integral datatype, like a short. Example:
public class PrimativeTest {
    public static void main(String[] args) {
        Object sp = getShortPrimative();
        Object so = getShortObject();
        Object da = (short) 34;
        System.out.println("primative version value: " + sp.toString() + " type: " + sp.getClass().toString());
        System.out.println("object  version value: " + so.toString() + " type: " + so.getClass().toString());
        System.out.println("direct assignment version value: " + da.toString() + " type: " + da.getClass().toString());
    static short getShortPrimative() { return (short) 75; }
    static Short getShortObject() { return new Short((short) 25); }   
}Produces:
primative version value: 75 type: class java.lang.Short
object version value: 25 type: class java.lang.Short
direct assignment version value: 34 type: class java.lang.Short
Don't get me wrong, I am using this, like it, and now know I am using it. I, however, cannot find where this is declared as a feature. My concern stems from some of this code is to run on J2ME in the future. How many implementations of that are there?
Can someone please link me up with the on-line doc that say this is legal.
Thank you

Good points about compiler settings. Am using Netbeans with CVS. I literally needed a spreadsheet to plan out which project goes to which platform (servlet, desktop, phone) all in advance.
Figuring out how to compile, assemble (obfuscate/sign), & preverify (for J2ME) common code is one of the reasons I said 'in the future' of my orginal post.
Back in the 'old days', I used Visual Sourcesafe doing VB programming, so I keep trying to figure out a way to make CVS solve my problem. With sourcesafe, one project had the source, but you could put an alias to that file in other projects. I do not want branches that drift apart. If that worked, I could just make three actually distributed projects with all the classes each needed, one of which was compiled using the Mobility pack.
Not really a subject for this forum, but thought I would expand on the issue raised.

Similar Messages

  • Programmatically assigning Authorization Objects to roles

    Hi there,
    I have created an authorisation object with eight fields. The fields control which parts of my application are accessible to the user. (Each field is one category, each category has several subcategories).
    What I want to do is the following:
    There shall be a custom authorization dialog, wherein the system administrator can configure the access of the application for a specific user.
    In plain text: I want to develop an interface which makes it possible to assign authorisation objects with specific values to a user or to an already existing role.
    Is there any functionality, that allows me to perform this assignment and regenerate the users profile?
    I already discovered, that the table UST12 contains the connection between the authorization profile of a role and an authorization object, as well as the assigned values. Anyhow, just to write new values to that table has no affect to the authorization when calling "authority-check object" in an ABAP report.
    Does anyone know, whether there are standard functions in the ERP System, that support the changing of authorization objects and the regeneration of roles?
    Thank you very much,
    Gregor
    Edited by: Gregor Bender on Mar 11, 2008 8:41 AM

    >
    Gregor Bender wrote:
    > I already discovered, that the table UST12 contains the connection between the authorization profile of a role and an authorization object, as well as the assigned values.
    Nope, sorry, it's not the connection but only one of the many.... Roles and profiles are stored in quite a lot of different tables so manipulating one table directly will hardly ever get you the desired situation. It may even lead to problems due to inconsistencies.
    For mass regenerating profiles there's transaction SUPC.
    For manipulating the contents of roles/profiles have a look at scripting with SECATT or LSMW in combination with PFCG.
    If you want to write code to add objects to roles you have to look at least in tables AGR_1250, AG_1251 and AGR_1252. The UST* tables are updated when generating profiles and/or comparing users.

  • Assigning authorization through assigning authorization objects

    hi all,
    can anybody tell me the whole procedure for assigning authorizations by assigning authorization objects from the scratch along with the example with guide for assigned authorizaon using this method.b'coz this is the requirement of our organization.
    I mean to say assign authorization manually without assigning trnsaction codes.
    suggestion are always accepted.
    if you want to send me the documents then my email id is [email protected]
    thanks in advance,
    waiting for reply............
    hardik patel.

    hi kumar,
            thanks for your help.
            ok i got it and i agree that i can find the authorization object by your suggested way.
        now my point is that i find that this perticulat object is corresponding to this particular trnsaction code. now if i want to aloow only four transaction code out of all transaction codes belongs to that authorization objects. so, for this how can i maintain authorization for this authorization objects.
    It means on " Change authorization tab" it shows fields of that added authorization objects. so what values should i give to those fields so that i can allow only particular transaction codes which i want. so, how can i determine these values for allowing particular transaction codes, not all transaction codes. can you guide me regarding this?
    Please help me regarding this?
    thanks for your support,
    waiting for your reply...............
    Regards,
    Hardik Patel.

  • How to assign authorisation object to  user

    hi,i have created authorisation object now i want to assign it to role and
    then to user
    how to get this.
    i went into pfcg transaction but i didnt know how to assign authorisation object to
    role and then to user
    can any one tell me how to procedd further?
    Message was edited by:
            venkat s

    Hi Venkat,
    When you create authorization object in RSSM you only assign info object.
    How did you assign respective values?
    once your authorization object is saved you should find it in PFCG. even if you go to expert mode for profile generation
    Check tecnical name.
    Alternatively instead of inserting manually go to selection criteria  and the system will display all active authorization objects  and you can choose your object.
    Jaya

  • Target of assignment must be a reference value. Issue

    So I have this issue I have never seen before and am unsure how to solve. I might be dumb but Im pretty sure I can do this. any ways can some one tell me why the following throws a Target of Assignment must be a refrene value?
    public class test
         private var t:Test = new Test();
         private var fName:String;
         private var xml:XML;
         //For this example assumewe set a value of apples.XML to fName
         public function get fileName():String
              return fName;
         public function loadFile(fileToLoad:String):Boolean
              //open the file and return true or false if it exists and
              //can be opened.
         public funtion returnObject():XML
              if(loadFile(t.fileName) = true) // Target of assignment must be a reference value.
                   //load objects into xml
                   retun xml
    There is a reason I am doing it this way. How ever I am not here to disuss that I am here to discuss why I am getting this error. loadFile(fileToLoad:String) takes a string, I am essentially giving it a string...So whats it's issue?

    that's not a valid as3 class.  you need a package designation and a constructor.
    package{
    public class test
         private var t:Test = new Test();
         private var fName:String;
         private var xml:XML;
         //For this example assumewe set a value of apples.XML to fName
    public function test(){
          public function get fileName():String
              return fName;
         public function loadFile(fileToLoad:String):Boolean
              //open the file and return true or false if it exists and
              //can be opened.
         public funtion returnObject():XML
              if(loadFile(t.fileName) = true) // Target of assignment must be a reference value.
                   //load objects into xml
                   retun xml

  • How to assign a JSP variabl's value to a JavaScript variable?

    Hello,
    I want to assign a JSP variable's value to JAVASCRIPT variable.
    or how to assign JavaScript variable's value to JSP varialbe
    HOw do i do it ?
    can anyone please help?
    Regards and thanks for your time.
    Ashvini

    I want to assign a JSP variable's value to
    JAVASCRIPT variable.
    var jsVariable = <%=someVariable%>;
    or how to assign JavaScript variable's value to JSP
    varialbeYou can't. JSP is server-side and JavaScript is client-side. The JSP variables are never available on the client side for any sort of assignment.

  • How to get the object class field value in CDHDR table for vendor

    hi
    how to get the object class field value in CDHDR table for vendor

    Try KRED/KRED_N as object class in CDHDR for Vendor.

  • Document type ZD does not allow you to assign to object MARA

    hi ppl,
             I have created a Z document type.but its not allowing me to assign in mm02.what might be the problem..? its throwing an error message Document type ZD does not allow you to assign to object MARA.

    You need to enable object linking to mara on your new document type. Go to Tcode DC10, select the document type and then go to the object links area. Create a new object link for your document type.

  • Error occured in number assignment for object RESB

    Hello all,
    While creating the production order, I am getting error as "Error occured in number assignment for object RESB" ,
    How to solve this error?
    Regards,
    Sagar

    In SNRO for Object RESB, check the definition i.e. the intervals, number ranges assigned, the buffer setup. If you're not familiar with this, seek help from your basis personnel.

  • Internal number assignment for object AUFTRAG

    Hello,
    Previously with SAP PM module we had configured the maintenance work order number range for internal assignment to a narrow range of numbers i.e. 12000000 to 12999999.
    Following rolling out the functionality to other sites, we required to extend the internal number range (to accomodate the volume to be produced) and have updated this in configuration i.e. 300,000,000,000 to 399,999,999,999.
    We are now experiencing an information message each time we Save a new maintenance work order;
    Internal number assignment for object AUFTRAG (numbers are in critical area)
    Message no.  RU 153
    When the user clicks Enter to continue a warning message is also displayed on the status bar;
    Number XXXXXX for order type XXX within critical area
    Message no. CO 395
    However, we have investigated this and the work orders are creating normally after this. We have created in the system, the work orders with the prevous number range and also hunders of work orders with the new number range, we do not appear to be experiencing our buffer.
    I have check the settings in SNRO config setting. The settings appear as standard with a warning buffer of 5% and the No. of numbers in buffer = 20.
    Please can anyone advise how to remove this information message or how to update the system to resolve.
    Regards,
    Hayley

    The message is given by the number range function, according to the configuration of field percentage. You have entered 5% - which means when you reach within 5% of the end of the numbers, you should get the warning. Your range is 300,000,000,000 to 399,999,999,999 My calculation that you should get the warning around 395,000,000,000
    I suspect that the issue is linked to buffering of the numbers. Is it resolved??

  • Internal number assignment for object

    Hi Experts,
    While creating PM order the error comes"Internal number assignment for object AUFTRAG"(numbers are in critical area).
    I am not able to create order.
    Please help.
    Regards
    Vishal

    Hi Vishal
    Your number range might have exhausted, you need to extend it through T-code SNRO. number range object (AUFTRAG). click numbr range button then change interval & extend the to number
    shakti

  • Message : Document type doesnot allow you to assign  to object VBAP

    Hi All,
    I am attaching a document that is been created through CV01N to transaction VA02 at item level.when i am trying to put that document no. at item level on the Extras-Documents- system is giving me a message as "Document type doesnot allow you to assign  to object VBAP".
    similarly if i take this document no from F4 screen,it comes but when i check the same after saving the document gets disappeared.
    while the same document is getting attached at material master easily.
    I think some customization is missing for the same..plz let me what i need to do to resolve the same.
    Thanks & Regards,
    Sandeep Sharma

    Hi Sandeep,
    The mentioned error message indicates to me that you do not have maintained the object VBAP in transaction DC10 to your relevant document type.
    Please see the WIKI page https://www.sdn.sap.com/irj/sdn/wiki?path=/display/plm/ca-dms-Object+link for all necessary customizing settings to achieve a proper object link behavior.
    Further please check if note 1034682 could be also relevant for you, because I do not know your current release.
    After all the settings in DC10 and TDWOD are maintained the document should be linked to the VBAP objects.
    Best regards,
    Christoph
    P.S.: Please reward points for useful information.

  • Assigning authorization objects to transaction

    Hi All,
    While creating a new role using transaction PFCG, If i enter transaction SE38, i will get lot of authorization objects, fields where i can decide whether i should allow only display or change or create etc. But if i create my own transaction, then i will not get these authorization objects. Where should i assign there objects for my transactions.
    I tried to assign this in transaction se93, but that did not work.
    Thanks in advance.
    Best Regards,
    Surendra<b></b><b></b>

    TRY with SE97.
    and check the check box change mode and try running there you can change the authorizations..
    vijay

  • Internal Number Assignment for Object QMERKRUECK

    Hi Gurus,
    When I clicked on SMPL( sample calculation) in the Sample tab of the Inspection plan (QA02) I got the below Information error " Internal Number Assignment for Object QMERKRUECK (Numbers are in critical area).
    Though we have enough number range why this Information error is coming? Couold you please explain the cause and how to avoid it?
    Thanks in advance,
    Shashidhar

    Hi Shashidar,
    Actually its gap
    Reason: some times number ranges overlap or missing from the buffer data base system will happen very rarely.
    in our QM module, below objects error chances may happen
    - QLOSE      (Inspection lots in QM)
    - QMEL_NR    (Number range - message)
    - QMERK      (Confirmation number)
    - QMERKMALE  (Master inspection characteristics in QSS)
    - QMERKRUECK (Confirmation number of an inspection characteristic in QM results processing)
    - QMETHODEN  (Inspection methods in QM)
    - ROUTING_Q  (Number ranges for inspection plans)
    - QCONTROLCH (Quality control chart)
    Read Notes 504875 and 678501.
    Thanks
    Shiva

  • J1I5 - 'Error occured in number assignment for object J_1IRG1'

    Dear Friends,
    Please help me.I got the following error while clicking on Register entry button.
    "Error occured in number assignment for object J_1IRG1".
    How can I correct it.
    Regards,
    Rubin

    maintain numer ranges for  this object.
    or check in SNUM.
    Regards
    Peram

Maybe you are looking for