Method chaining and casting

I was wondering if anyone knows whether it is possible to somehow apply method chaining on an object that requires a cast.
For example:
ArrayList ar = new ArrayList();
ar.add(new Integer(3));
int i = ar.get(0).intValue();The third line obviously produces a compile error to the effect that you can't call method intValue() on object Object.
To get the int value from the ArrayList above I have to do the following:
ArrayList ar = new ArrayList();
ar.add(new Integer(3));
Integer intObject = (Integer)ar.get(0);
int i = intObject.intValue();Is it at all possible to get the int value somehow without explicitly creating an Integer object? Is there a possible way to combine method chaining and casting in this case?

You may combine the two lines by casting at the same time:
int i = ((Integer)ar.get(0)).intValue();
Notice the additional brackets to help the compiler understand the precedence of your intentions. It makes no sense if the compile tries to call intValue THEN cast to Integer.
When you call:
Integer intObject = (Integer)ar.get(0);
No Integer object is created, only a reference to the object is created. I'm not sure if an implicit reference is created in the previous example, but I see no substantial benefit using the first method. In fact I won't use it as its not very readable (to me).

Similar Messages

  • Difference between narrow() method usage and simple class cast for EJB

    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?
    P.S. I'm working with WL 6.1 sp2
    Any help would be appreciated.
    Thanks in advance,
    Orly

    [email protected] (Orly) writes:
    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?(1) is mandated by the spec. It is required because CORBA systems may
    not have sufficient type information available to do a simple case.
    P.S. I'm working with WL 6.1 sp2 You should always use PRO.narrow()
    andy

  • Get values from a node and Cast it back to a table

    Hi guys!
    Anyway know if it is possible to get the values from a table(That was binded previously) and cast it back to a table structure so i can manupilate the fields inside...
    My scenario here is to get an input and mass update tis input into the corresponding field in the table...
    Any suggestions are welcome and points will be awarded generously! ")

    Hi Ravikiran,
    In your example you update node node_list with the content of internal table tab_list..
    The content of the node can be retrieved as an itab using:
      tab_list = node_list->get_static_attributes_table( ).
    This method only returns the values static attributes of the node. Dynamic attributes added at runtime using dynamic programming are not returned, since they are managed in a different inside of the context node.
    Best regards,
    Thomas

  • ABAP OO: methods as method params, method chains

    Hello all,
    I am currently developing quite much ABAP OO and wonder if this is possible, because I got compilation errors.
    a) Methods as method params w/o temp vars:
    I have a method whose parameter shall be the return value (let s say a string) shall be the parameter:
    document->set_owner( owner = person->get_name( ) ).
    This throws an error and I have to code this instead
    data: owner type String.
    ownerString = person->get_owner( ).
    document->set_owner( owner = ownerString ).
    ... so I have always a temp variable which is getting MUCH overhead when having such stuff often...
    Am I doing wrong or is this impossible in ABAP OO? ...am used to do such things in all other languages I know... mean, that methods can be params of other methods.
    b) "chaining of methods"
    Is this possible somehow?:
    data: tmp type String.
    tmp = employee->get_orgUnit( )->get_name( ).
    Calling one level (the get_OrgUnit() method) works fine, but an immediate call to the second level ( get_name() method) fails and I have to code this:
    data: tmp     type String,
          orgUnit type ZOrgUnit.
    orgUnit = employee->get_orgUnit( ).
    tmp = orgUnit->get_name( ).
    This also very annoying to have so much temporary help variables on the way.
    Is there any help for me?
    Thank you for any hints and reagrds,
    Timo

    Hi Timo,
    as Richard's reply says it's impossible in ABAP-OO. The nature of this language is ABAP not OO
    Only helpful for you, could be the returning parameter. It's very useful in conditional expressions like
    if m1->a() = '2'.
    A preferred parameter to avoid writing parameter names like
    m1->b( '2' ).
    All other useful stuff of method or parameter chaining, and so on is NOT possible. Sorry.

  • Get runtime class and cast object to it?

    Hi,
    public interface Msg
    Msg msg=msgLib.get(msgType);
    Msg msg2=msg.clone(); //problem! cannot find clone in  x.y.Msg!
    ...Shouldn't msg be resolved to the implementing class (MsgReply for example) and use the "clone()" method, that i have declared in that class -which overrides the one of Object class?
    If no, is there a way to find the runtime class -probably use "getClass"- and cast to it? How?
    Thanks

    There are many implementing classes; i want to get the runtime class. Something like:
    (msg.getClass())msg.clone();
    Message was edited by:
    uig

  • *TRANSPORTING CHAIN AND INFOPACKAGE*

    Dear experts,
    I've transported, from development to test, a chain and an InfoPackage  which is included in this chain.
    The problem is the InfoPackage  doesn't appear into the chain transported, although it was already into the modeling, because this InfoPackage  had been previously transported with other order. Besides, the transport's method execution ended with warning (4).
    The warning is the follow:
    Post-import methods for change/transport request: 902761
    Follow-up action RS_AFTER_IMPORT for ISIP L started at 20090306143729
    Start of the after-import method for object type R3TR ISIP (Mode d'activació)
    InfoPackage ZPAK_01GSDO6PG4H6P29K8KDWORJG6, source system integra changed by source system gaudi_pre in import
    Start of the after-import method for object type R3TR RSPC (Mode d'activació)
    Version 'M' of chain ZG_CAD_ATR_11_TEMP was saved without checking
    Chain ZG_CAD_ATR_11_TEMP Was Activated And Scheduled
    Start of the after-import method for object type R3TR RSPC (Mode de supressió)
    Start of the after-import method for object type R3TR ISIP (Mode de supressió)
    Follow-up action RS_AFTER_IMPORT for ISIP L ended at 20090306143753
    Post-import methods of change/transport request 902761 completed
    Start of subsequent processing ... 20090306143729
    End of subsequent processing... 20090306143753
    I don't know hot to discover the problem. Please could anyone give a hand.
    Than you very much in advance
    Jorge

    Hi,
    When u transport a chain it always appear at the target system deactivated, just create an order, modify the chain, activate, it will ask for an order, select the order previously created and now see if the infopackage appears.
    If the chain was already at the target system and you don't active it, you will see the chain in the last active valid option.
    You can delete the order of the target system if the chain appears ok.
    Hope it helps.
    Maybe you speak this language too:
    Bones,
    Quan transportes una cadena sempre apareix al sistema destí com a desactivada, per arreglar-ho crea una ordre al sistema destí, modificar la cadena, activala, et demanarà una ordre, hi poses la ordre creada anteriorment. I comprovar si la cadena apareix amb el paquet correcte.
    Si la cadena esta en el sistema destí i no la actives al transportarla de nou, el que es veu es la ultima versió activa, o sigui com estava originalment.
    Un cop fet, pots borrar la ordre del sistema destí.
    Espero que t'ajudi.

  • Process chains and event collectors

    Hi All,
    I need help in Process chains and event collectors.I joined in new project and this client using process chains and event collectors and they ask me to work on these areas.I didnt work on this as of now So please send any docs on this area and explain the procedure and technology methods behind this concept.I would really appreciate If someone can send me the full documentation on this concept as I couldnt find any  any docs on this.
    Thanks,
    Ras

    Hi Ras,
    Process chains are a sequence of processes to be performed. The are put together in a chain with the necessary dependancies (process A needs to finish before B can start) and conditions (if A and B are successful then C else send an email), and then scheduled. They usually revolve around processes related to data loading: Load, activate, roll up, compress etc.
    Please take a look at this links/threads for more info:
    http://help.sap.com/saphelp_nw04/helpdata/en/8f/c08b3baaa59649e10000000a11402f/content.htm
    process chains
    process chains
    Process chains
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9936e790-0201-0010-f185-89d0377639db
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/263de690-0201-0010-bc9f-b65b3e7ba11c
    Process Chains
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9936e790-0201-0010-f185-89d0377639db
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/263de690-0201-0010-bc9f-b65b3e7ba11c
    Re: Ho to make a variable mandatory or optional?
    There are lot of threads available in the SDN....go through them.....hope it really helps you in getting understand what are process chains and Events included in that.
    Assign points if it helps you.
    Regards,
    Sreedhar

  • Method Chaining

    Hi all,
    I have these method chaining:
    boolean b = Services.getInstance().getEntitleReferenceService().getUser(username) != null;
    As I understood, I have to follow the method chain from right to left, right?
    Services.getInstance()> returns an object of type: Services
    On the Services object, I call the method: getEntitleReferenceService()
    this method returns an object of type: EntitlementsReferenceService which is object of type interface: EntitlementsReferenceService
    The only class that implements that interface is: RemoteEntitleReferenceService.java
    In RemoteEntitleReferenceService.java, I have the method: getUser(String userID)
    The point is that the method: getUser() does NOT return boolean as expected!
    This is the method signature:
    public User getUser(final String userId){}
    I have this part of code in Intellij and it does not show an error as it usually does when these kind of error happens.
    Does anybody has any idea that where am I making a mistake? Any help is greatly appreciated.

    The point is that the method: getUser() does NOT return boolean as expected! Nobody expects it to. It'll return a reference, which will be evaluated against null, and the reult of that gets assigned to the boolean.

  • Method Chaining - Benefit?

    Hiii...
    I have read about Method Chaining like
    obj.method1().method2().method3();
    Its easy for development like you are concatinating 3 calls into 1, but I want to know whether its improving perfromance something or not?
    Thanks..

    endasil wrote:
    georgemc wrote:
    String url = new StringBuilder("file://")
    .append(baseUrl).append(File.separator)
    .append(resourceDir).append(File.separator)
    .append(resourceName)
    .append(extension).toString();Now you can just read down the "right-hand column" and see what the url string is composed of.Forgive my ignorance, but how is that example better than
    String url = "file://" +
    baseURL + File.separator +
    resourceDir + File.separator +
    resourceName +
    extension;I don't mean to attack an example whose purpose was something different (it correctly showed why chain methods), but I just thought I'd ask. It seems to me like using a StringBuilder really only has benefit if you're going to be building the string dynamically/not all in one statement. Otherwise just using String concatenation seems cleaner.:sigh: I'm not being side-tracked here. By your own admission, the example was to demonstrate method chaining.

  • Problem with porcess chain and request

    Hi experts, I need help!!
    Description of the problem:
    There are three ODS that load daily information through process chain to a Infocubo. The information is loaded to BW from View generated for a data base of Oracle.
    Process chain for the three ODS is equal, I explain the one procedure to them:
    1- It initiates the chain .
    2- Blocks the View.
    3- Load of data through of infoPackage.
    4- If the load finishes well, then the data is delete of the View, the data is activte in the ODS and it arises to InfoCube, and if it finishes bad so unblocks the View and finishes process chain.
    5- Then, reconstruct the Index.
    Happens that in the three ODS when we loaded the information erase request loaded previously, then the historical one of the loads in the ODS does not stay. The three infopakages used to load the information to the ODS does not have labeled the option to erase the destiny of data, and it does not have it marked. The ODS do not have marked that option.
    When I do it manually east problem does not happen. I erased process chain and I returned to create the chain porcess but it did not solve the problem.
    Thank you

    I just checked the documentation and found that your code is incorrect. IAlternativeName::StrValue contains value for an email address, a Domain Name System (DNS) name, a URL, a registered object identifier (OID), or a user principal name (UPN). It doesn't
    contain string value for directory name (and other non-mentioned types). Instead, you need to instantiate an IX500DistinguishedName interface and initialize it from an alternative name value:
    class Program {
    static void Main(string[] args) {
    String RequestString = "Base64-encoded request");
    CX509CertificateRequestPkcs10 request = new CX509CertificateRequestPkcs10();
    request.InitializeDecode(RequestString, EncodingType.XCN_CRYPT_STRING_BASE64_ANY);
    Console.WriteLine("Subject: {0}", request.Subject.Name);
    foreach (IX509Extension ext in request.X509Extensions) {
    if (ext.ObjectId.Name == CERTENROLL_OBJECTID.XCN_OID_SUBJECT_ALT_NAME2) {
    CX509ExtensionAlternativeNames extensionAlternativeNames = new CX509ExtensionAlternativeNames();
    string rawData = ext.RawData[EncodingType.XCN_CRYPT_STRING_BASE64];
    extensionAlternativeNames.InitializeDecode(EncodingType.XCN_CRYPT_STRING_BASE64, rawData);
    foreach (CAlternativeName alternativeName in extensionAlternativeNames.AlternativeNames) {
    switch (alternativeName.Type) {
    case AlternativeNameType.XCN_CERT_ALT_NAME_DIRECTORY_NAME:
    IX500DistinguishedName DN = new CX500DistinguishedName();
    DN.Decode(alternativeName.RawData[EncodingType.XCN_CRYPT_STRING_BASE64]);
    Console.WriteLine("SAN: {0}", DN.Name);
    break;
    default:
    Console.WriteLine("SAN: {0}", alternativeName.strValue);
    break;
    My weblog: en-us.sysadmins.lv
    PowerShell PKI Module: pspki.codeplex.com
    PowerShell Cmdlet Help Editor pscmdlethelpeditor.codeplex.com
    Check out new: SSL Certificate Verifier
    Check out new:
    PowerShell FCIV tool.

  • Process Chain and CPS

    Hello all,
    We are currently having a problem with submitting process chains. When the chain runs it does not display any of steps in the process chain and where they are running from the job we submit (RSI_START_BW_CHAIN) So what we see is that the PC has been submited and completes in say 17seconds...however everything is still running on the system...for example our CIF PC runs for 3hrs but alls we are able to see is that the job executed from CPS with no problem. I've been digging around trying to find clear documenation about PC and CPS with little luck. Am I approaching the job submission incorrectly? We are on 7.0.3.

    Hello,
    You should be using the RSI_RUN_BW_CHAIN job to start process chains. Maybe you can try that first. For the rest things should be straight forward. Depending on the BW backend systems you might encounter some issues, with BW 7 the synchronization has changed and you would be better of using one of the latest 7.0.4 versions (SP6 has just been released).
    Regards Gerben

  • Process chain and Control M

    Hi Gurus
    We are designing process chain for our BW solution.
    We have identified the dependancies of various loads which includes flat file loads and loads from R/3.
    Now we would like to control ERP and BW jobs by Control M .
    I have the following questions:
    1. Which portion of BW process chain do we need to plug in to Control M. ? Do we need to connect the Meta chain to control M or different process chains to Control M?
    2.When we create Process chain for BW, what is the best practice? Is it good to create small chains and connect them via Meta chain? or we have to create small chains only?
    3. Can we include R/3 extraction Jobs and V3 Jobs in our BW process chain? so that they will trigger when we run the process chain?
    4. If we decide to run V 3 jobs after every half an hour on R3 side then how often we have to extract data to BW? and how to catch correct delta without missing single record?
    I would appreciate if you can help me with your knowledge.
    Thanks
    Kris

    Hi Kris,
    Control M is a third party scheduling tool provided by BMC software.
    1) You have option to either include a meta chain or individual chains in Control  M .
    2) It depends on how your data is extracted. If you have any dependecy jobs on sourcre system, then it is better to create small process chians and include them along with your dependecy jobs in Control M
    3)you can include R/3 dependency jobs and V3 jobs in Control M. Once those jobs are finished you can run BW process chains via Control M.
    4)You have several scheduling options availalbe in control M to take care of your BW and R/3 jobs.
    V3 jobs collect data from R/3 application tables and fill R/3 delta queue(RSA7). when you run BW process chain it will collect all the data available from R/3 delta queue.
    If both jobs are running at same time, then it is better to apply some wait time on BW jobs(in process chians).
    hope this helps

  • Process Chain and Info Package Transportation?

    Hello All
    Case 1
    How to transport a Process chain and a Info Package Individually?(<b>first time from DEV to QA</b>)
    Case 2
    I have 9(<b>IP1 to IP9</b>)infopackages and 3(<b>P1 to P3</b>) Process chains and in each Process chain I have 3 Info packages like IP1,IP2,IP3 in P1 and so on.,
    Now is it necessary to transport Infopackages and Process chains individually or is it enough to transport Process chains only(If v transport Process chains will the Infopackages will also transport)then how to assign a request to each one?
    What I mean is,all <b>Infopackages are in $TMP(Package</b>),and Process chain is also <b>$TMP</b>,Now is it necessary to change the package for Infopackages as well as Process chain and Tranport only PC,Iam confused here,can anyone help me out?
    Many thanks
    balaji

    Hi Balaji,
    If you have created new infopackages then you have to transport them. It is not necssary to transport the info-packages if you have them in the process chain but have not changed them.
    Also you cannot transport any BW object with $ tmp package. Assign a package and then transport the objects.
    The best way to transport the process chain is from the RSPC screen. Click the transport button there and collect all the objects and transport them.
    Bye
    Dinesh

  • Job Chaining and Quickcluster

    I always get
    Status: Failed - HOST [Macintosh.local] QuickTime file not found.
    after the first part of the job is successful.
    If I just submit with "This Computer" it works fine. Original file is ProRes 422, first job uses ProRes 422 to scale it down to 480x270. Second job compresses to h.264. I found some info on this board from 2008 saying that job chaining and quickclusters don't work together. Is that still how it is? that's really useless..
    I also found this from Jan 2009
    David M Brewer said:
    The reason the second rendering is failing is.......this has happen to me a few times until I figured it out.....make sure you set the dimension to the video in the h.264 settings, set to the same size as the Pro Rez dimensions.
    For the most part the dimensions are left blank for the second link, h.264. And don't use 100% of source. Put the physical numbers into the spaces. When you link one video to another, the second codec doesn't know the specs settings you made for the first video settings.
    Also make sure you (at least check) set the audio for the second video. I usually have the Pro Res do the audio conversion and just past-through to the second video settings. Again it can happen the the audio is disable in the h.264 settings. This has happen a few time for me........... Check and double check your settings!
    He doesn't mention anything about with or w/o Quickclusters, but I tried what he said and could not get it to work with quickclusters...
    Anyone got any new info on this?

    Studio X,
    Thanks for taking the time to run some tests and post your results.
    I'm finding the same results with converting ProRes422 to mp4, But...
    Other codecs are giving me very different results.
    I've run some random tests to try to get a grip on whats happening.
    First I was playing around with the # of instances. I've read here and on Barefeats that (at least for my model MacPro) the instances should be set to (# of processors/2), so I've been using 4 for quite a while now and thought I'd test it for myself.
    A single 5min ProRes422 1920x1080 29.97 file to h.264
    This Computer- 15:28
    2 Instances- 14:56
    3 Instances- 13:52
    4 Instances- 14:48
    5 Instances- 13:43
    6 Instances- 13:48
    7 Instances- 13:58
    In this case 5i was the fastest but not using a Quickcluster wasn't far off
    A single 2m30s ProRes422 1920x1080 29.97 file to h.264
    This Computer- 3:19
    2 Instances- 3:45
    3 Instances- 3:45
    4 Instances- 3:45
    5 Instances- 3:50
    6 Instances- 4:00
    7 Instances- 4:00
    Interesting...not using a Quickcluster is fastest
    A single 2m30s ProRes422 1920x1080 29.97 file Scaled down using original codec
    This Computer- 5:20
    4 Instances- 4:10
    5 Instances- 4:10
    7 Instances- 4:11
    A single 1m30s ProRes422 1920x1080 29.97 file to mpeg-2
    This Computer- 2:12
    5 Instances- 2:10
    When Quickclusters are faster, 4-5 instances does seem to be the sweet spot(again for my setup).
    In the mpeg-2 test, I should have used a longer clip to get a better test but it was getting late and I was just tring to get an idea of the codecs usage of my resources. I was also monitoring CPU usage with Activity Monitor in all tests.
    Now multiclip batches:
    I forgot to write down the length of the clips in this first test but it consisted of 8 ProRes 422 clips. 3 about 1m long and the rest between 13s and 30s
    8 ProRes 422 clips to mp4
    This Computer- 11:25
    4 Instances- 5:16
    Same results as Studio X
    Next tests with 5 clips(total 1m51s)
    5 ProRes 422 clips to h.264
    This Computer- 5:00
    4 Instances- 4:52
    5 ProRes 422 clips to mpeg-2
    This Computer- 2:55
    4 Instances- 3:01
    5 ProRes 422 clips to DV NTSC
    This Computer- 6:40
    4 Instances- 5:12
    5 ProRes 422 clips to Photo Jpeg
    This Computer- 2:44
    4 Instances- 2:46
    I re-ran the last test with 7 clips because of the time it took reassemble the segmented clips
    7 ProRes 422 clips to Photo Jpeg(total 3m14s)
    This Computer- 4:43
    4 Instances- 3:41
    One last test,
    A single ProRes 422 clip to Photo Jpeg(4:05;23)
    This Computer- 5:52
    4 Instances- 4:10
    Let me start off by saying it is clear that there are many factors that effect compression times such as # of clips, length of clips, and codecs, but here are some of the things I noted:
    1)Some codecs themselves seem to be "more aware" of the computers resources than others.
    When I compress to h.264 w/o a cluster it will use about 80-85% of all resources
    When I compress to h.264 with a cluster it will use about 90-95% of all resources
    When I compress to PhotoJpeg w/o a cluster it will use about 20-25% of all resources
    When I compress to PhotoJpeg with a cluster it will use about 80-85% of all resources
    2)The time it takes to reassemble clips can be quite long and could effect overall speed
    In the very last test, compressing a single file to photoJpeg using 4 instances took 4m10s. Watching Batch Monitor I noted that it took 2m0s to compress and 2m10s to reassemble.Wow...
    It would be interesting to see how the disassemble/reassemble of bigger and larger batches using clusters effect overall time. But that would take some time.
    I think the thing I will be taking with me from all of this is your workflow is your own. If you want to optimize it, you should inspect it, test it and adjust it where it needs adjusting. Now if anyone has the time and was to run similar tests with very different results I'd love to know about it...

  • How do i Call an a method on and object that is a parameter

    I have thee code as below.
    I want to call the method setValue and set the value and pass it a String. i want it called on the jobject param1.
    What do i need to call todo that given the below code.
    JNIEXPORT jobject JNICALL
    Java_PassObjectAndDoSomething_nativeMethod(JNIEnv *env, jobject obj, jobject param1) {
        jstring jstr;
        jclass cls2 = (*env)->GetObjectClass(env, param1);
        jmethodID mid3 = (*env)->GetMethodID(env, cls2, "setValue", "(Ljava/lang/String;)V");
        if (mid3 == NULL) {
            return NULL;
        jstr = (*env)->NewStringUTF(env, "My brand new JString");
        if (jstr == NULL) {
             return NULL;
        /*This causes errors when called*/
        (*env)->CallObjectMethod(*env, param1, mid3, jstr);
        return param1;
    }

    daniel_p wrote:
    /*This causes errors when called*/Presumably you mean a system exception and not java exception of some sort.
    (*env)->CallObjectMethod(*env, param1, mid3, jstr);Why is the asterisk in front of the env parameter in CallObjectMethod()?
    return param1;Since you passed that in it is obviously pointless to return it. But that has nothing to do with your problem.

Maybe you are looking for

  • How to filter group using in function

    Hey i am trying to do a group filter in the data model using IN function g.segment3 in ('401000', '401010', '401020', '409100') how can i configure the filter is in one of these values ? i tried the g.segment3 in ('401000', '401010', '401020', '40910

  • Delete Operation Not work

    Hi, i have created a form with reprt and at the fprm a have created Report for delete Record If Any record i9s not correct and i am on the same page when i create new Record.Page does not back to report page. i have add a column in report for delete

  • Transferring 3GS from PC to MBP

    Hi all My mother has a 3GS which she has synced to her Windows 7 PC via iTunes for Windows. She has recently got a 13" MBP with Snow Leopard (upgrading to Lion soon though!) and wants to sync her iPhone to that. Her contacts are on the PC's own Addre

  • How to disable the onscreen notifications that comes for ios update

    We are using the new ipad 2s at kiosk system, while the new ipads that we got are coming with the latest ios but the one we installed earlier are ios 5.0 we do not want any notifications of any sorts that allows the user to get out of the app that we

  • Error When Downloading Config via TFTP

    I have 2 different 4400 series controllers running vastly different version of code (7.0.98.0 & 4.1.185.0) that both give me this error when attempting to download the config via TFTP: "TFTP Code File type not supported!" I have successfully download