The final variable compiler optimization

Hello
Can someone explain to me what optimizations respectively presumption the compiler makes the following code?

public class AsmMain
{
Public Shared Sub main (final String [] args)
{
Var = 'Bar ';
String b = "";
String c = "Foo";
String d = a + b + c;
System.out.println (d);
}
}

When I dismantling this code, it is obviously that the compiler translates the string concatenation of StringBuilder.append () (Yes, I know that strings are immutable)

Compiled from "AsmMain.java."
SerializableAttribute public class AsmMain extends java.lang.Object {}
Public AsmMain();
Code:
0: aload_0
1: invokespecial #1; Java/lang/object method. "" < init > ': (V)
4: return

public static main (java.lang.String []) Sub;
Code:
0: ldc #2; Chain Bar
2: astore_1
3: ldc #3; String
5: astore_2
6: loc #4; String Foo
8: astore_3
9: new #5; java/lang/StringBuilder class
12: dup
13: invokespecial #6; Method java/lang/StringBuilder. "" < init > ': (V)
16: aload_1
17: invokevirtual #7; Method java/lang/StringBuilder.append: (Ljava/lang/String ;) Ljava/lang/StringBuilder;
20: aload_2
21: invokevirtual #7; Method java/lang/StringBuilder.append: (Ljava/lang/String ;) Ljava/lang/StringBuilder;
24: aload_3
25: invokevirtual #7; Method java/lang/StringBuilder.append: (Ljava/lang/String ;) Ljava/lang/StringBuilder;
28: invokevirtual #8; Java/lang/StringBuilder.toString method: () Ljava/lang/String;
31: astore 4
33: getstatic #9; Field java/lang/System.out:Ljava/io/PrintStream;
36: aload 4
38: invokevirtual #10; Method java/io/PrintStream.println: (Ljava/lang/String ;) V
41: back

}

Now if I change the AsmMain class so that all variables are final:

public class AsmMain
{
Public Shared Sub main (final String [] args)
{
final String a = "Bar";
final String b = "";
final String c = "Foo";
final String d = a + b + c;
System.out.println (d);
}
}

... the disassembled output looks like this:

Compiled from "AsmMain.java."
SerializableAttribute public class AsmMain extends java.lang.Object {}
Public AsmMain();
Code:
0: aload_0
1: invokespecial #1; Java/lang/object method. "" < init > ': (V)
4: return

public static main (java.lang.String []) Sub;
Code:
0: ldc #2; Chain Bar
2: astore_1
3: ldc #3; String
5: astore_2
6: loc #4; String Foo
8: astore_3
9: ldc #5; Foo String Bar
11: astore 4
13: getstatic #6; Field java/lang/System.out:Ljava/io/PrintStream;
16: loc #5; Foo String Bar
18: invokevirtual #7; Method java/io/PrintStream.println: (Ljava/lang/String ;) V
21: return

}

What is the explanation for this optimizations?
Thanks in advance.

The Sun compiler does little or no optimizations. The Sun implementation is based on the virtual machine for optimizations.

What is the explanation for this optimizations?

I suspect that this is not an optimization but rather required by the specification of language Java (JLS).

By DG JLS, a string literal is defined as 'the strings that are the values of constant expressions' (3.10.5).

Since your second example falls definition the compiler is responsible for creating a literal at the time of the compilation that represents the final value.

Tags: Java

Similar Questions

  • Behavior of the instance variable private &amp; Final while working with reflection

    Using reflection, I am able to successfully access the private members of the class A suite help extract:
    package com.test;
    
    public class A {
    
         
         private int _count = 0;
         public A() {
              
         }
         
         public void setCount(int count) {
              if ( count < 0){
                   System.err.println("Value must be positive.");
                   return;
              }
              _count = count;
         }
         
         public int getCount() {
              return _count;
         }
         
    }
    package com.test;
    
    import java.lang.reflect.Field;
    
    public class MainClass {
    
         private static Field f = null;
         A a  = null;
         static {
              try {
                   
                   f = A.class.getDeclaredField("_count");
                   if ( f != null)
                        f.setAccessible(true);
                   
              } catch (NoSuchFieldException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (SecurityException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              }
              
         }
         
         
         public MainClass() {
              
              a = new A();
              
              if ( f != null ) {
                   try {
                        f.set(a, -99);
                   } catch (IllegalArgumentException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                   } catch (IllegalAccessException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                   }
              }
              
         }
         
         public void printCount() {
              
              System.out.println("Total Count : " + a.getCount());
              
         }
         
         public static void main(String[] args) {
              
         
              MainClass cls = new MainClass();
              cls.printCount();
              
              
         }
         
    }
    The above code works fine, but when I tried the same thing with the class provided as java.lang.String and tried access private member of this one, he threw an exception to access. If access can be restricted by setting SecurityManager I've tried in my case also and worked, but also in java.lang.String, I was unable to find any implementation for the SecurityManager who refused access to private members, then how is it that I'm not able to access by using reflection?

    Also in the same example above, when I did a final variable _count, and tried changing the value by using reflection, that he did not throw any exception when running, but don't not change either value.

    Appreciate any help on the improvement of the understanding on this.

    Thanks in advance.

    I gave it a try with Java 1.7.0_21 - b11.

    import java.lang.reflect.*;
    
    class Y {
         public static void main(String[] args) throws Exception {
              String s = "123";
              System.out.println(s);
              Field stringValue = String.class.getDeclaredField("value");
              stringValue.setAccessible(true);
                    //stringValue.set(s, "321");
              stringValue.set(s, new char[]{'3', '2', '1'});
              System.out.println(s);
         }
    }
    

    Output:

    123
    321
    

    Jtahlborn is right and your code may not agree. You may have seen:

    Exception in thread "main" java.lang.IllegalArgumentException: Can not set final [C field java.lang.String.value to java.lang.String
            at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
            at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
            at sun.reflect.UnsafeQualifiedObjectFieldAccessorImpl.set(Unknown Source)
            at java.lang.reflect.Field.set(Unknown Source)
            at Y.main(Y.java:8)
    

    What is happening with the commented line.

    Published by: baftos on May 16, 2013 15:07

  • The final value of a variable declaration

    Hi all

    I work through a project that has many different results based on what options the user click.

    Basically, I set up a variable called "totalclicks" and set a tip action to assign the value 1 to this variable whenever a user clicks on the selected items.

    I was wondering is there an easy way to get the final value of the "totalclicks" to display in a report? We currently use an internal server and Adobe Quiz results Analyzer. Ideally, I would have just the user 'show results' as normal and the value of this variable is displayed somewhere.

    Any ideas?

    Thank you

    It would be easier if you posted a screenshot of the slide: are all those click boxes on a slide, or you want to go to the next slide, click on another box click here? I ask this because of your sentence «Continues the slide...» » ?

    No need to create another user variable. Perhaps you understand very well what it means to be a variable: it is just a container, and you can change its value as many times as you want.

    So, if you want the click to increment and move to the next slide, the advanced standard action would be:

    Expression totalclicks = totalclicks + 1

    Go to the next slide

    With the first click var will increase to 1, with the 01:58, etc. In the statement list progress of actions, in opposition to the drop-down list of simple actions (accordion) you do not Increment (ask the devs since many versions to add it, but they can't hear me). This is the reason why you need to the statement Expression.

    Take a look on: http://blog.lilybiri.com/statements-advanced-actions-in-captivate-6-li

    Lilybiri

  • Is there a way to SHORTEN the time of compilation

    Hey guys,.

    It is extremely laborious when you book only little change in the labview project and the overall program needs to be recompiled all over again!

    Need me often 30 minutes or more. He lead me almost crazy...

    Is there anyone who have samilar experence and find a way to solve it, or even just shorten this boring waiting?

    Thank you very much!

    Nick

    You can't really affect time itself, but you can affect how much/often it RECOMPILES.

    For example this type of variable, is it used in a lot of vi? If this is some common AE, perhaps it can be divided in a couple different ones?

    You can write to protect a folder which shouldn't really change and adjust the LV of "Treat read only VI as locked"

    There is also a framework of LV in the .ini file that can facilitate the optimization that will reduce the time of compile/save.

    /Y

  • Passing parameter (s) to the fLex SWF compiled object

    Recently, I found that by copying sources HTML generated by Flex in my own CFM page, I could add some process on the server side.

    Now, I wonder if it is possible to change a parameter - or more than one - to the SWF object generated and compiled with Flex?

    In the example; Let's say that I work in ColdFusion with a range of Session variable to store the current wording of the navigation of the user. I want to transmit this information in the SWF (Flex) in order to use this information through the different components of Flex that I use in the same SWF.

    I found some little help on the NET talking flashvars. I don't really understand how to use what he has a name for the parameter variable.

    I also found another link which talked about the addition of parameter at the end of the file name of the SWF file:

    < object classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    ID = "home" width = "100%" height = "100%".
    codebase =" http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" > "
    < param name = "movie" value = "accueil.swf? "SessionLang = #session.lang #" / >
    < param name = "quality" value = "high" / >
    < param name = "bgcolor" value = "#869ca 7" / >
    < param name = "allowScriptAccess" value = "sameDomain" / >
    < embed src = "accueil.swf? ' Quality SessionLang = #session.lang # "="high"bgcolor =" # ca 869, 7.
    Width = "100%" height = "100%" name = "home" align = "middle".
    play = "true".
    Loop = "false".
    allowScriptAccess = "sameDomain".
    Type = "application/x-shockwave-flash".
    pluginspage =" http://www.adobe.com/go/getflashplayer_fr" > "
    < / embed >
    < / object >

    That's what I tried, but by forcing another value for Session.Lang, nothing happens. I'm suspicious that this is really working this way!

    If anyone has any information on the passage of a SWF Flex object setting, let me know.

    You should be able to use the flashvars to do this. This means that you need to change the code page of the flashplayer hosting html javascript.

    There is a JavaScript method called AC_FL_RunContent script that must be modified as follows:

    NOTE: This is not an example of ColdFusion, so please make changes accordingly.

    AC_FL_RunContent)
    'src', "Flex/CorporationContactDataEntry,"
    "width", "100%."
    "height", "100%."
    "align", "middle",
    'id', 'CorporationContactDataEntry ',.
    'quality', 'high ',.
    "bgcolor", "#869ca 7."
    'name', 'CorporationContactDataEntry ',.
    "flashvars", " < %="" #="" flashvars="" %=""> ,"
    "allowScriptAccess", "sameDomain",.
    'type', "application/x-shockwave-flash"
    "pluginspage", "" http://www.adobe.com/go/getflashplayer_fr " "
    );

    the tag < %#flashvars="" %=""> finally is resolved to a string of name/value pairs as follows:

    name1 = value1 & name2 = value2 & name3 = value3

    In your Flex Application, you then have access to these settings as follows:

    Application.application.Parameters.name1

    and so on.

    Shiv.

  • View of the complex Variable

    I appreciate that CVI2013 with its new clang compiler now supports data _Complex type - unfortunately the view Variable does only partially: it recognizes the type (Interestingly, it is displayed in the form of complex while bool appears as _Bool) but does not display don't not values...

    Thank you for pointing out this oversight. I filed the bug report 426270 to the complex issue. Including watch expressions and debug tips.

    I also filed bug report 426273 for number _Bool.

  • Support of the shared Variables in the third part XP embedded based of PTC?

    I sent a request in an embedded XP touch function (third party). The application works very well, but hosted on a RT (sbRIO Board) shared variables are not getting updated in the app on PTC

    1. the PTC is part of the project as a Windows XP Embedded Touch Panel

    2 NI TPC Service has been installed on the PTC and the application can be deployed remotely from the PC development via ethernet. (Where network connections and communications are OK)

    3. using distributed in the development computer systems manager, I can see that the shared variables are getting updates on the network

    I think that the problem can be solved if the following programs are installed on the TPC

    A. Support for variables that are shared for XPembedded

    B. shared Variable engine

    I tried to install the support of variables shared Program Files > National Instruments > Labview 8.6 > PDA > utilities > Variables > x 86 - but I get an installation error "cannot find the application for the Pocket PC applications Manager.

    Shared variable engine was installed from the ve220 folder. The program is installing. But the engine Variable is not start Control Panel > administrative tools > Services, Xpe, the service is stopped and cannot be started. When I try to start the service, I get the following error on PTC

    "Cannot start Service engine of National Instruments Variable on the local computer."

    Error 1053. Service has failed to demand launch or timely control.

    Please suggest solutions to the addresses above or another of the following:

    1. support of variables shared for XP built-in PTC

    2 Installer engine Variable shared.

    Thank you

    Krish

    Problem solved!

    Update for interested people working on XP Embedded PTC

    Just to ensure that shared Variables were indeed accessible to the TPC, I wanted to install Distributed Systems Manager 8.6 on the TPC. However given that the TPC was only 1 GB of DOM (disk on memory) and with all the software that I had tried, there remained only a few megabytes on the system. I had to add an another DOM of 2 GB.

    All products in the Installation went well, with the exception of the Logos NOR (Version 5.0). Logos OR installation has failed repeatedly.  I tried to install NI Logos separately, with the same results. Then I had this intuition that NI Logos had anything to do with the question.

    Then, I downloaded the new version of NI DSM 2009 SP1. Even if it were to settle on any fresh system without Labview, the installation would not proceed beyond the stage of configuration. I tried to install NI Logos of the folder on the download of new products separately and it worked magically!

    Once the new Logos (Ver 5.5) installed, the Shared Variable engine starts automatically and the shared Variables are finally unleashed - free stand up and shine! I thank Almighty God!

    On the lighter side, come to think of it - to run an application about 400 KB, we need NEITHER of Run Time, XP embedded, DSM, Logos...  (around 900 MB). Can make us everything simpler?  Invite your comments...

    Thank you

    Krish

  • Windows server x 64 r2 disk extensions are missing the final figure very and replaced by '_', why?

    Hello

    In collaboration with the team of active directory on a system dual processor pentium 4 two internal drives and a USB key.

    The system was primarily used to support customers who had taken similar systems for their businesses and also used sql 2005 for a knowledge base.

    An update of security at the end of November had touched the directory active directory at the point no user could identify or change anything, we cut it down so that it wouldn't harm to all customers, the day after the workstation which ran xp pro started having problems COM + and MSDTC so in fact it crashed, in the crash, we restarted since a complete system upward, and it ran for a week and then crashed again. This time did us not back up on top of the system, and it's very buggy but clean. Microsoft Security Essentials has been loaded on the system and said that's fine.

    The server has boggled the very nice people at Microsoft, mistakes he sewing equipment was bad as a first step, we took it a part and ran some diagnostics intel and found a bank card that spontaneous USB to work, but that's all. We have disconnected them.

    The server was constantly being developed and will start normally and knitting, then he would start the same set of problems.

    Finally, the system and the active directory would not start or respond, so we put the OS on drive D, and started the system.

    Although we have the C drive copied to a drive F: area and we have the hive, and other backups Microsft expressed the view that it was better to operate just with the own training version.

    This weekend, I watched the system run from the building with his hair on fire. Literally started with simple set of values of an unknown ethernet, video, drivers etc. until it stopped because the RPCSS would not, or not could not authenticate.

    From there, we took the outer disc and decided to clean the D drive and put everything on the C drive. Because there were documents and articles referring to the fact that, since the D drive, was not a clean place, meaning THAT NTFS formatting install and it can make the WAUS and other components such as IIS and DCOM update think that it was not legitimate.

    Using the disc, we have tried to address the problem of the recovery console. We were surprised to find that the BOOT record for drive D came from the copy of drive C on the F drive.

    This weekend, the system failed to load the operating system, whenever we tried, more files would not copy.

    I found a copy of Windows 2003 Web x 86 and told them to format the C drive and see if it would install.

    It and done. Today, I want to format the C drive again and this time, put the WINDOWS Server 2003 x 64 or Windows Server x 86 on drive C. restore the information and the hive of the back upward, and then move data from the d drive format and put the applications she had on her, then take the f drive, format and put the applications and save copies to this topic.

    Saying all this, the biggest problem and the ultimate question is are the discs toast? IF they are what to do, and finally what is the windows server 2003 web,

    We have also a copy of windows Server 2008 longhorn, or something, we didn't put it on the ram on the system being only 8 GB.

    Part of the problem I think, there are too many x 86 and so, right now, we have think it is only 2 GB.

    Hello

    Thank you for your response. I think that I was a bit of a troublemaker yesterday.  I was looking for a work-around and nice CSR suggested putting the issue here.

    I'm not bad today, so I'll answer the question for your readers, without references to the kb articles and white papers.

    The answer is simple. The CDs are compilations of different files and batch processes and applications. They have 'by default'. If criteria is not met, the reaction is errors. How errors are showing is not always encountered a ready error message.

    Yes, although Windows Server 2003 can support multiple operating systems.

    FF this is your intention in Windows Server 2003, have the default value of the BOOT file on the C drive. This robust environment, you can connect to the other OS as needed.

    When faced with a failure Active Directory of such magnitude nit files are corrupt, you will need to do a full format to NTFS on drive C and redo your configuration of good backups or from scratch.

    Best regards

    Steven

  • change the settings of the view variable value

    Hello

    I want to know if it is possible to change the settings for the debugger, including the display of the "view variable values" settings in labwindows cvi 9.0.

    My problem is that in my project, it is essential to be able to debug and I came across some difficulities with the array of structs containing pointers to structures. So, I did a demonstration to show project:

    typedef struct {}
    short sVar1;
    short sVar2;
    char cVar1 [512];
    } MyStruct2;

    typedef struct {}
    MyStruct2 ReadMyS2;
    MyStruct2 WriteMyS2;
    MyStruct2 * pReadMyS2;
    MyStruct2 * pWriteMyS2;
    } MyStruct1;

    int main()

    {

    MyStruct1 MyS1_Phis [3] = {0};
    int i = 0;

    init
     
    for (i = 0; i<>
    {

    MyS1_Phis [i] .pReadMyS2 = & MyS1_Phis [i]. ReadMyS2;

    MyS1_Phis [i] .pWriteMyS2 = & MyS1_Phis [i]. WriteMyS2;
    }

    }

    Unfortunately, the debugger handles .pReadMyS2 pointer [0] MyS1_Phis as if that it points to an array of 10 elements of type MyStruct2.

    Anyone know the reason for this?

    Thanks in advance,

    Laszlo Nagy

    Hi Laszlo,

    Yes, it is a known problem in CVI. This can happen because of the way the CVI user protection is implemented. It is certainly not desirable, but we probably won't be able to change it at least still a year or two.

    A solution you have is to disable the protection of the user and then rebuild your program (Options > Compiler Options > level debugging: no execution check)

    Luis

  • by the way the Session variable of type DATE for opaque filter data view

    Hello world

    You guys can help me please by passing the session variable of DATE in physical layer 'view opaque' data type filter RPD to Oracle database

    I tried following syntax, syntax wise, I didn't get any error, but at the same time this opaque view is not fetch all the records as well. my session variable is 'End_date' and its value is 1998/12 / 31:00:00:00(as_shown_in_RPD_session_windows,_datatype_is_DATETIME)

    SELECT AMOUNT_SOLD, CHANNEL_ID, CUST_ID, PROD_ID, PROMO_ID, QUANTITY_SOLD, SH. SALES TIME_ID

    WHERE TIME_ID = TO_DATE (' VALUEOF (NQ_SESSION.) END_DATE) ", ' MM/DD/YYYY')"

    SELECT AMOUNT_SOLD, CHANNEL_ID, CUST_ID, PROD_ID, PROMO_ID, QUANTITY_SOLD, SH. SALES TIME_ID

    WHERE TIME_ID = TO_DATE (' VALUEOF (NQ_SESSION.) ("' END_DATE ')", ' MM/DD/YYYY') "

    SELECT AMOUNT_SOLD, CHANNEL_ID, CUST_ID, PROD_ID, PROMO_ID, QUANTITY_SOLD, SH. SALES TIME_ID

    WHEN TRUNC (TIME_ID) = TO_DATE (' VALUEOF (NQ_SESSION.) ("' END_DATE ')", ' MM/DD/YYYY') "

    In the past, I could spend a session variable in an opaque display by using the DATE filter, but which was in DB2.

    I appreciate your time and help

    Finally, I had good format. It's here

    TO_DATE (substr ("valueof (NQ_SESSION. End_date)', 1, 10), "yyyy-mm-dd")

    and here is the source where I got this information

    Using Variables in Session OBIEE in some tables of the physical layer

  • The local variable cannot be declared outside a function.

    I was getting an ORA-936 on an application that I support (Oracle 11 g, CF 11, Windows Server 2012).  The database went down yesterday, for some reason unknown to me, and when he came, I'm now getting this error message.  The only pointer to the .cfm file is the sponsor.  I don't see how to fix it.  Can what information I include that will help you help me?  It seems that the more I learn, something new always comes along.   Here is the error page that is displayed.  I have not changed all the statements, I know.   Thank you.

     The local variable application cannot be declared outside of a function.
    All variables defined with the var keyword must be declared inside a function.
    
    Resources:
    
        Check the ColdFusion documentation to verify that you are using the correct syntax.
        Search the Knowledge Base to find a solution to your problem.
    
    Browser       Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:46.0) Gecko/20100101 Firefox/46.0
    Remote Address       108.44.188.221
    Referrer       https://TestServer/secure/Requirement/requirementsum.cfm?frompage=orig&CFID=58847&CFTOKEN=1c45276fd65debf-7F25B5E6-AA99-1268-0B24AB3E54D73594
    Date/Time       27-May-16 01:25 PM
    Stack Trace
    
    
    coldfusion.compiler.ASTvariableDefinition$InvalidVarDefinition: The local variable application cannot be declared outside of a function.
        at coldfusion.compiler.ASTvariableDefinition.register(ASTvariableDefinition.java:98)
        at coldfusion.compiler.SemanticAnalyzer.transform(SemanticAnalyzer.java:340)
        at coldfusion.compiler.Treewalker.postorder(Treewalker.java:100)
        at coldfusion.compiler.Treewalker.postorder(Treewalker.java:27)
        at coldfusion.compiler.Treewalker.postorder(Treewalker.java:27)
        at coldfusion.compiler.NeoTranslator.parseAndTransform(NeoTranslator.java:443)
        at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:370)
        at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:147)
        at coldfusion.runtime.TemplateClassLoader$TemplateCache$1.fetch(TemplateClassLoader.java:436)
        at coldfusion.util.LruCache.get(LruCache.java:180)
        at coldfusion.runtime.TemplateClassLoader$TemplateCache.fetchSerial(TemplateClassLoader.java:362)
        at coldfusion.util.AbstractCache.fetch(AbstractCache.java:58)
        at coldfusion.util.SoftCache.get_statsOff(SoftCache.java:133)
        at coldfusion.util.SoftCache.get(SoftCache.java:81)
        at coldfusion.runtime.TemplateClassLoader.findClass(TemplateClassLoader.java:609)
        at coldfusion.filter.PathFilter.invoke(PathFilter.java:101)
        at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
        at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
        at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
        at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
        at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
        at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
        at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
        at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
        at coldfusion.CfmServlet.service(CfmServlet.java:219)
        at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
        at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:437)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:197)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:722)
    

    I had added end brand to all the and it has cleared up.  Weird.

    Which brings me to another question.  When you do make the end like this tag or use the tag?

  • Procedure with an unknown name or the amounts of the bind variable.

    Hey gurus,

    I hope someone out there can point me in the right direction.

    I write a PL/SQL function that receives an unknown number of bind variables in the client.
    I use Apex 1.1 earpiece to set up a model of RESTful resource for a x-www-formulaires-urlencoded body POSITION.

    If the client publishes the following body: * "title = M. & fname = John & lname = Smith" * "

    My PL/SQL procedure automatically receives the bind variables which is placed by the following:
    : title: = "M";
    : fname: = "John";
    : lname: = 'Smith ';.

    Now my limit is that the required design uses the metadata to define the structure of data of the end-user.
    So in reality the body of MESSAGE I get more like this: * "M. = 120 & 121 = John & 122 = Smith" * "

    So my PL/SQL procedure receives:
    : 120: = "M";
    : 121: = "John";
    : 122: = 'Smith ';.

    I can query the metadata tables to anticipate what bind variables can be present at the execution,
    but this can change depending on the resource ID with the body of the MESSAGE at the time of the request.

    My first attempt was to be a loop expected elements and run an EXECUTE IMMEDIATE likes:

    for c_record_items in
    (select field_id in the tfields where record_id =: id) loop
    EXECUTE IMMEDIATE ' begin update_item ('|: field_id |', :'|| field_id |'); end;';
    end loop;

    But unfortunately the EXECUTE IMMEDIATE fails because the binding variable is not declared; It requires the USING clause.
    Which I can't think I can code the amount or value in...

    I started dabbling in the DBMS_SQL package but I still have to think of a way I can fix this problem.

    There are experts out there who can direct me in the right direction?
    Very much appreciated.

    Published by: Codes on March 5, 2013 17:11

    Published by: Codes on March 5, 2013 17:13

    I have a lot of procedures where I accumulate the number of bind variables.

    My approach has been to load each variable binding in an associative array and maintain a counter of the number of bind variables.

    Finally, there is a great if then elsif endif block which is actually

    if v_binds = 0
    then
         execute immediate ;
    elsif v_binds = 1
    then
         execute immediate  using bind_array(1);
    elsif v_binds = 2
         execute immediate  using bind_array(1), bind_array(2);
    elsif ...
    end if;
    

    Here is a link:
    Re: USING Dynamic Clause?

    Later, I discovered that you could do something like the following:
    (Asktom)
    http://www.Oracle.com/technetwork/issue-archive/2009/09-Jul/o49asktom-090487.html

    Either of these approaches to solve your problem.

    Added link: Keith Jamieson on 6 March 2013 09:26

  • Pass the .swc variable to main application...

    Hello

    I'm trying to retrieve data from a compiled .swc that is loaded into the main application. I have a generic function as follows:

    public void onSubFormFinishClick(event:MouseEvent):void

    {

    var applicationCompletedVar:int = 1;

    trace ("Full Application =" + applicationCompletedVar);

    }

    ... which is executed when the user clicks on the button in the custom .swc. I want to be able to pass this parameter to the main application. Can someone provide examples of how to achieve this? Using external swf loading in a swf Flash, I have just shipped a new event and listen for this event and take action after hearing the past event. being new Flex, I don't know how to proceed.

    Thx for any help,

    ~ Chipleh

    Set the public variable in the main application for example,

    public var Valeurdonnees: String = "Hello";

    Assign the value to the dataValue component SWC file using FlexGlobals as:

    FlexGlobals.topLevelApplication.dataValue = 'Hello friend ';

    Now draw the value in the handler in the main application that handle the event dispatched from CFC. Gets the update of dataValue.

  • By passing the package variables to the package...

    Hello world

    I have the following problem:

    Package A compiled in scenario A - not referencing not date of process.
    Package B compiled in scenario B with declare the flow variable called ProcessDate.
    Package MAIN calling declare variable ProcessDate, then calling scenario A, then B Scenario and then ENDS.

    MAIN scenario created with the ProcessDate startup parameter.

    So I want to start the MAIN scenario, with a parameter to ProcessDate. He asks me for the setting, but then scenario B fails as if he did not get the parameter. However, when I run the only TI, scenario B works very well after asking for the value of the parameter.

    any help appreciated.
    Thank you!
    Nick

    Hi Nick,

    When you drop scenario B in the main package, please do not forget to pass the variable processdate to scenario B. This can be done by using the additional Variables tab in the scenario using the menu drop down.

    Thank you
    Ritika

  • inside the text variable page numbers?

    Using ID3.  Variables of text for the current titles work well by themselves.  Insert page numbers also works well by itself.  However, I expect that management of the page numbers would be via an additional variable inside the head of the race variable.  Apparently, this is not correct?   I was thinking that something like this would be the best, regarding the layout more tight on my page and a more consistent presentation throughout the final book:

    (Sharp hooks attach together variable.)

    < [page number variable] EM [title of Book] space > for back

    < [chapter number variable] space em space [variable chapter title] [page number variable] em > for front

    The only thing I can get to watch right up to now is:

    < chapter title variable then em space > < page number variable >

    Thanks in advance-

    YC

    What do you use for your page number variable? You should use a "marker of current Page" fom the Insert menu, so your first string would look like:

    [Course marker in page] BookTitle em space (the title is not a variable, is it?). No running head variable at all, unless it is used for the title.

    Your second string should look like:

    [Chapter number variable] space em space [chapter title varies] em [marker in page courses]

    You shouldn't try to embed a variable, or spaces, inside another variable. Maybe I am misinterpreting your sharp hooks?

    Peter

Maybe you are looking for