Illegal access of Private Members

Hi friends,
Can you belive that Java has a Bug see it I can access private member ;-) of one class in other inherited class
first make a class and complie it:
class Hi
public void show()
System.out.println("BUGSSS");
After that make another class in same package as
class Hello extends Hi
public static void main(String[] args)
Hi h=new Hello();
h.show();
This will show us result BUGSS that is OKAY but now hold ur breath :=((
make the following changes in Hi.java file
1. set accessibility of show() to private
2. Change BUGSSS to "New BUG"
Now compile Hi.java and Run Hello.java(Without recompiling) see what happens?
Regards,
Amit Ruwali

This is a certainly a bug.
You can access any private method of any class that you know the signature of the method.
The way to do it is quite simple,
1)rename the .class of the class you want to break,
2)create a dummy class in the same package and with the same name;
3)in the dummy class create all the methods with the same signature that you want access to.
4)compile the dummy.
5)Now compile the program in which you will use the broken class.
6)Erase or rename the dummy.java and the dummy.class
7)Remember to rename the original class.
NOW YOU CAN ACCESS THE METHODS.
this is certainly a compile time check, and is ignore during runtime. This only works with private, package(default) access, also works for complete classes within the same package.

Similar Messages

  • Bug or feature? Direct access to private property in other instance.

    This is example code:
    public class SomeClass {
        private String property;
        public String getProperty() {
            return property;
        public void setProperty(String property) {
            this.property = property;
        @Override
        public boolean equals(Object o){
            if (null == o) return false;
            if (!(o instanceof SomeClass)) return false;
            SomeClass someClass = (SomeClass)o;
            if (null != property && !property.equals(someClass.property) ||
                null == property && null != someClass.property) return false;
            return true;
        @Override
        public int hashCode(){
            int hash = 0;
            if (null != property) hash = property.hashCode();
            return hash;
    }In equals method you can clearly see "someClass.property" which means accessing private property in someClass, which is other instance than that one, where is equals invoked.
    This code is compilable, runable (1.5), but obviously didn't do right job.
    To do right job, you must use "someClass.getProperty()".
    How can this be compilable and runable?

    endasil wrote:
    georgemc wrote:
    I'd say one could argue this violates encapsulation if you really wanted to, but it's certainly not a bug, it's well-known and documented. At the very worst, it's a compromise. Probably something to do with the fact that Java objects do not have their own copy of the bytecode of the class they're an instance of.I don't really think you could argue that. From class A, being able to access members of an instance of class A isn't against encapsulation since, being class A, you already know all of the intimate details! It's not seeing inside the black box, it's being inside the black box. Or rather, it's being the box!You already know all the intimate details, because each instance of a class in Java shares the class bytes with other instances of that class. That's because of the design of the language. Encapsulation (really, we're talking about data-hiding here, not encapsulation) is about hiding an objects data from other objects. The fact that all instances of a class can see each other's fields just makes things convenient for language and runtime designers. The original spec for object-oriented programming talked about objects communicating with each other by message-passing, which we see as method invocations. Accessing data directly is just a relaxation of that stricture, for convenience.
    Accessing the private members is a completely fine and actually very normal case, especially in equals() methods. I still favour accessors in that instanceWhy? Seems like pointless overhead. And due to symmetry, you would probably want to use accessors for this's members as well. Otherwise, changing an accessor will break your equals implementation.It's no overhead at all. The method will probably be inlined. Suppose you subclass. Your member variables now have to be protected, not private. But what if your subclass changes how one of those fields is returned by the accessor?
    Look, I'm not saying "Java should not allow instances of the same class to access each others' private members (oo-er)" but I can certainly understand why someone might be surprised that it does.

  • Accessing Enclosing Class Members From Inner Class Subclass

    I have the following scenario that I cannot get to work. Notice the comments in B.doWork() for the problem code. In B.doWork(), how do I access m_strA?
    * A.java
    * Created on July 5, 2002, 2:20 PM
    package Projects.InnerTrouble.Files;
    public class A {
         public abstract class InnerA {
              public abstract void doWork ();
         public String m_strA;
         /** Creates new A */
         public A ()
                   new InnerA() {
                             public void doWork ()
                                       System.out.println("A$InnerA$1's doWork() called!");
                                       m_strA = "Annonymous subclass of InnerA's doWork did this";
                        }.doWork();
         * @param args the command line arguments
         public static void main (String args[])
                   A oTemp = new A();
                   System.out.println(oTemp.m_strA);
                   B.getB(oTemp).doWork();
                   System.out.println(oTemp.m_strA);
    class B extends A.InnerA {
         public B (A a)
                   a.super();
         public void doWork ()
                   System.out.println("B's doWork() called!");
                   // How do I access m_strA within B's doWork() method?  The following is what I would expect to be the answer, but it does not compile
                   // A.this.m_strA = "B's doWork did this";
         private static A.InnerA sm_oInnerA;
         public static A.InnerA getB (A a)
                   if (sm_oInnerA == null)
                        sm_oInnerA = new B(a);
                   return (sm_oInnerA);

    The whole point is that B is not an inner class of A
    so it does not have access to A's member variables.
    Eventhough B extends an inner class of A, that does
    not make B an inner class of A. That is in the JLS,
    but not so elegantly as I have put it, hehe.
    If B were an innerclass of InnerA, then it would
    qualify to access A's member variables.OK, I think that you are finally getting through to my thick skull on this one. Let me restate and get your check-off on my understanding of the situation.
    The only classes with access to A's this reference are A and inner classes of A that are found within the definition of A. So, despite the fact that A and B are in the same package (and B should have access to A's non-private members because B and A are in the same package), and despite the fact that we would normally state that B "is a" InnerA (which is an inner class of A and would have access to a reference to the A.this reference), B is not allowed access to A.this (because B "is not really a" InnerA in the same way that the anonymous implementation of InnerA "is a" InnerA). However, nothing would prevent me from giving B access to a reference of the enclosing A as long as it was done via a method of InnerA, and as long as the implementation of that method is contained in A's implementation.
    Does this "access" rule realy make sense? Are you aware of the justification for this rule? Or is the justification stated in the JLS? I would think that the compiler ought to be able to figure this kind of thing out and allow it. It seems to me the fact that I defined B in the way that I did, and the fact that B "is a" InnerA, implies that I desired a fairly tight relationship to A. In fact, I desired the exact relationship that exists for the anonymous implementation of InnerA.
    The following is a modified version of my original example that runs as I originally wanted it to, but works around the access rules discussed on this forum thread:
    * A.java
    * Created on July 5, 2002, 2:20 PM
    package Projects.InnerTrouble.Files;
    public class A {
         public abstract class InnerA {
              public abstract void doWork ();
              /** added to allow implementors of InnerA that are not enclosed in A's class definition to have access to the enclosing class */
              public A myEnclosingInstance ()
                        return (A.this);
         public String m_strA;
         /** Creates new A */
         public A ()
                   new InnerA() {
                             public void doWork ()
                                       System.out.println("A$InnerA$1's doWork() called!");
                                       m_strA = "Annonymous subclass of InnerA's doWork did this";
                        }.doWork();
         * @param args the command line arguments
         public static void main (String args[])
                   A oTemp = new A();
                   System.out.println(oTemp.m_strA);
                   B.getB(oTemp).doWork();
                   System.out.println(oTemp.m_strA);
    class B extends A.InnerA {
         public B (A a)
                   a.super();
         public void doWork ()
                   System.out.println("B's doWork() called!");
                   // The following is what I would expect to be the answer, but it does not compile
                   // A.this.m_strA = "B's doWork did this";
                   // added myEnclosingInstance() to get functionality desired above
                   myEnclosingInstance().m_strA = "B's doWork did this";
         private static A.InnerA sm_oInnerA;
         public static A.InnerA getB (A a)
                   if (sm_oInnerA == null)
                        sm_oInnerA = new B(a);
                   return (sm_oInnerA);
    }

  • Inheritance and access control - "private protected"

    I'm reopening an old topic, seems to have been last discussed here 2-3 years ago.
    It concerns the concept of restricting access to class members to itself, and its subclasses. This is what "protected" does in C++ and "private protected" did in early versions of the Java language. This feature was removed from Java with a motivation along the lines of not being "simple", and "linear" (in line with the other access modes, each being a true subset of the next). Unfortunately, the article which explained Sun's position on this keyword combination seems to have been removed from the site, so I haven't been able to read its original text.
    But regardless of simplicity of implementation or explaining Java's access modifiers to newbies, I believe it is a fundamental part of OO programming for such an access mode to exist. The arguments for having the standard "private" mode in fact also apply for having a C++-style "protected" mode. (Arguing that classes within a package are related and it therefore doesn't hurt to also give them access to Java's "protected" members, is equally arguing that "private" is unneccessary, which noone of course believes.)
    The whole concept of inheritance and polymorphism and encapsulation builds on the access modes private, protected, and public (in the C++ senses). In Java the "package" concept was added - a nice feature! But I see no justification for it to negate the proper encapsulation of a class and its specializations.

    What effect upon inheritance other than hiding members
    from subclasses is there?
    None. And I cant think of another declaration that prevents members from being inherited but private.
    Of course the onus comes on the programmer with Java's
    definition of "protected" - but
    1) there is rarely a single programmer working within
    a package
    The point was the package is a unit which does not hide from itself. Just like all methods within a class can see each other, all classes within a package can, and all packages within a program can.
    2) it muddies the encapsulation in the design - when
    you see a "protected" method someone else, or yourself
    some time ago - wrote, how do you know if the design
    intention is to have it accessed solely by the class
    and its subclasses, or if it is indeed intended to be
    shared with the whole package? The only way to do
    this today is to always explicitly specify this in the
    comments, which may be lacking, inconsistent, and
    abused (since it isn't enforced).Encapsulation would be implementation hiding. Not method hiding. The only thing you should probably allow out of your package is an interface and a factory anyway.
    I understand where you are coming from, but I really have not had occasion to take issue with it. I can't think of a real codeing situation where this is required. OTOH, I can't think of a coding situation where I need to access a protected method from another class either.

  • Are private members inherit or not??

    Hi, I read the Sun Java tutorial twice times in this year about this topic.
    March 2006, it says:
    "A subclass inherits all the members variables and methods from its superclass. However the
    subclass might not have access to an inherited member variable or method. For example a
    subclass cannot access a private member inherited from its superclass. One might think ,then ,
    that the item was not inherited at all. But the item is inherited."
    September 2006, it says:
    "A subclass does not inherit the private members of its parent class. However, if the superclass
    has public or protected methods for accessing its private fields, these can also be used by the subclass.
    A nested class has access to all the private members of its enclosing class�both fields
    and methods. Therefore, a public or protected nested class inherited by a subclass has indirect access
    to all of the private members of the superclass".
    Which is wrong? Are private members inherit or not??

    I teach Java 101 now and then. When I describes classes, sub-classes and access modifyers I use this metaphor:
    Look at a class as a cardboard box. On the left outside of the box, you can write the names of the methods and attributes that you want others to see. These are the ones marked with public.
    On the bottom outside of the box, you write all the names of attributes and methods that can be seen by classes that extends your class, sub-classes. These are the ones marked with protected.
    Somehow, you are able to read the text on the outside when standing inside the box... has something to do with the pen that you use... ;-)
    On the inside of the box you can write whatever you want that you do not want anyone else to see. These are marked private.
    When creating a sub-class the sub-class-boxes are designed in such a way that it has a glass shelf halfway up on the right wall where you place your super-class-cardboard-box and a small window that allows users on the outside to look at the left side of the super-class-box. That is the only difference between a sub-class and a super-class-box.
    Standing outside of the sub-class-box, you can read the left side of the sub-box and the left side of super-box through the window.
    Standing inside the box, you can also read the bottom of the super-box through the glass-shelf.

  • Public settings with selected private members

    Is it possible to run Javadoc with the default settings ie. no -private option but in some way select specific private members in a class to be documented. I have a set of classes that I only wish to generate docs for the public attributes & methods, all private methods AND private attributes that have been tagged at the top of the class as /** PRIVATE ATTRIBUTE DESCRIPTION */. I guess not but worth a shot.
    Thanks in advance,
    Iain

    While this is possible, we have decided not to include such
    a facility in javadoc. A third party has implemented
    the ability to exclude members, but apparently not
    the ability to force their inclusion.
    http://java.sun.com/j2se/javadoc/faq/index.html#ydoc
    The serialized form page is the only page that documents
    private members while using the default access (-protected),
    so javadoc has the capacity to do what you're asking.
    You would need to modify the standard doclet. With the new
    doclet toolkit in Tiger (1.5.0), this might be somewhat
    easier.
    -Doug Kramer
    Javadoc team

  • How can I manage access to dimension members in a layout?

    Hello,
    I have a dimension member list of materials (400) on a "material" dimension. But some people have access to one portion of the whole group and others may have access to other groups. But the materials can be shared between groups so I cannot group them in differents hierarchies.
    The problem is in the layout you need to select a hierachy to show various rows (the whole group of materiales). The layout shows all the list of materials. Even if the user only have access to 10 of them. I don't know how is the best way for presenting this to the user? It should presents only the 10 rows corresponding to his materials.
    One way that I found (but I don't find it acceptable because of the hard effort that represents the maintenance) is to create differents member access profiles and denied the access to each material (dimension member - 390) that the user cannot modified. Then in excel I have to run a macro that hides all the rows that have an empty description in the cell of the material name.
    How can I achive this?
    Is there a function in BPC to see if a user have access or not to a dimension member?
    The only way to show in a layout various rows is to set in the view a hierarchy?
    Thanks & Regards
    SU

    hi
    pl. verify whether this will suit your requirements:
    Material           UG1           UG2
    MAT1               Y
    MAT2                                 Y
    MAT3               Y
    MAT4                                 Y
    MAT5               Y               Y
    Now UG1,UG2 diff user groups and property in Material. Assignment of Y is one time job.
    At the time of accessing the dimension members can restrict on the basis of UG1="Y" or UG2="Y" property
    Here MAT5 is common in both UG1 and UG2
    (Hardly may have 3-4 set of users: Accordingly can have UG1,UG2,UG3,UG4 etc.)
    sri

  • Security.Cryptography - The specified path is invalid. while accessing the private key stored in LocalMachine store

    Hello,
    I have C# dll which is invoked through a C++ cgi executable which is deployed on apache 2.2. I am getting the following error when I am trying to access the private key of a certificate which is stored in the Localmachine store. It works fine while
    debugging in visual studio.
    It also works fine when I try to access the same certificate from the current user store through apache.
    I have tried running apache as "SYSTEM", even then I get the same error.
    I have followed the right process to import the certificate into the localmachine store through mmc. 
    Error Message:
    The specified path is invalid.
     caused by mscorlib
       at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
       at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
       at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
       at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
       at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()
       at SamlImplLib.SamlImpl.GetSamlResponse(String sInParamXml, String sInAttrXml)
    The above error is not really helpful as it doesnt tell me which path is invalid as I am not passing any path in my code. I am just accessing the certificate through the X509Certificate2 store
    Thanks in advance

    Hi,
    This is probably because the worker process identity does not have read permission to the machine key store.
    And I agree with you. "The specified path is invalid" is a typical misleading message.
    You may need to clarify the difference between "SYSTEM- User" and "Current-user "through apache. Good Luck!
    Best regards,
    Kristin
    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.
    Click
    HERE to participate the survey.

  • Illegal access error at runtime

    Hi,
    I am getting an illegal access error while trying to call a method.
    - Class1 tries to call method on Class2.
    - Method has package visibility
    - Both classes are in same package.
    - Class1 is being invoked by a class in a Web Application which is
    in a completely different package. Class1 gets invoked properly
    and then instantiates Class2. It then tries to call the method on
    Class2.
    - Compiler is compiling successfully i.e. no compile time errors
    Any clues?
    Env:
    JDK 1.4.2_01
    App Server Tomcat 4.0.6
    Thanks
    Reg
    Aashish

    Hi,
    I am getting an illegal access error while trying to
    call a method.
    - Class1 tries to call method on Class2.
    - Method has package visibility
    - Both classes are in same package.
    - Class1 is being invoked by a class in a Web
    Application which is
    in a completely different package. Class1 gets
    s invoked properly
    and then instantiates Class2. It then tries to call
    l the method on
    Class2.
    - Compiler is compiling successfully i.e. no compile
    time errors
    Any clues?
    Env:
    JDK 1.4.2_01
    App Server Tomcat 4.0.6
    Thanks
    Reg
    AashishThe problem is the Class1 and Class2 are being loaded by different classloaders. Because of this, they are considered to be in different packages by the VM, and hence the IllegalAccessError.
    To correct this, make sure both classes are only available in a single classloader context. So if these classes are only used by the WebApp, include them in a jar in WEB-INF/lib or WEB-INF/classes..
    If yyou need access to these across multiple webapps, or by some other non-webapp classes, place them in the /common/lib directory for Tomcat.
    Whatever you do, MAKE SURE THEY AREN'T avaialble in BOTH! Which is what appears to be the problem now.

  • Accessing a private variable from a public method of the same class

    can anyone please tell me how to access a private variable, declared in a private method from a public method of the same class?
    here is the code, i'm trying to get the variable int[][][] grids.
    public static int[][] generateS(boolean[][] constraints)
      private static int[][][] sudokuGrids()
        int[][][] grids; // array of arrays!
        grids = new int[][][]
        {

    Are you sure that you want to have everything static here? You're possibly throwing away all the object-oriented goodness that java has to offer.
    Anyway, it seems to me that you can't get to that variable because it is buried within a method -- think scoping rules. I think that if you want to get at that variable your program design may be under the weather and may benefit from a significant refactoring in an OOP-manner.
    If you need more specific help, then ask away, but give us more information please about what you are trying to accomplish here and how you want to do this. Good luck.
    Pete
    Edited by: petes1234 on Nov 16, 2007 7:51 PM

  • Certificate [Thumbprint SOME THUMBPRINT] issued to 'CLientMachineName' doesn't have private key or caller doesn't have access to private key.

    Hi,    We are trying to get a client to communicate with the primary Config Manager Site System(MP/DP).
    We have a Config Manager Client Template that was setup using this guide. 
    http://technet.microsoft.com/en-us/library/gg682023.aspx
    We have a Client Cert on the primary site system server (primary config manager server)  based on this template and it meets the requirements specified in this document
    http://technet.microsoft.com/en-us/library/gg699362.aspx
             Enhanced Key Usage value must contain
    Client Authentication (1.3.6.1.5.5.7.3.2).   
             Client computers must have a unique value in the Subject Name field or in the Subject Alternative Name field.
             SHA-1and SHA-2 hash algorithms are supported.
             Maximum supported key length is 2048 bits.
    The Cert that we generated for the client meets the same requirements and shows the exact same template id but has a different subject name and alternate name (which is the clients machine name).
    With this setup, we still get the following error
    Certificate [Thumbprint  SOME THUMBPRINT] issued to 'CLientMachineName' doesn't have private key or caller doesn't have access to private key.
    Both the site system and client have the same trusted root cert installed.
    What are we missing or what can we check?    Does the cert check process only need the client certs on both the site system and the client to be from the same template?
    Here is a snippet of the clientidmanagerstartup.log
    <![LOG[HTTPS is enforced for Client. The current state is 63.]LOG]!><time="15:02:32.057+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716" file="ccmutillib.cpp:395">
    <![LOG[Begin searching client certificates based on Certificate Issuers]LOG]!><time="15:02:32.058+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716"
    file="ccmcert.cpp:3833">
    <![LOG[Certificate Issuer 1 [CN=THE_NAME_OFTHE_CA; DC=DOMAIN; DC=LOCAL]]LOG]!><time="15:02:32.058+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716"
    file="ccmcert.cpp:3849">
    <![LOG[Based on Certificate Issuer 'THE_NAME_OFTHE_CA' found Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.082+300" date="03-12-2014" component="ClientIDManagerStartup"
    context="" type="1" thread="716" file="ccmcert.cpp:3931">
    <![LOG[Begin validation of Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.082+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1"
    thread="716" file="ccmcert.cpp:1245">
    <![LOG[Completed validation of Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.085+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1"
    thread="716" file="ccmcert.cpp:1386">
    <![LOG[Completed searching client certificates based on Certificate Issuers]LOG]!><time="15:02:32.085+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716"
    file="ccmcert.cpp:3992">
    <![LOG[Begin to select client certificate]LOG]!><time="15:02:32.085+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716" file="ccmcert.cpp:4073">
    <![LOG[Begin validation of Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.085+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1"
    thread="716" file="ccmcert.cpp:1245">
    <![LOG[Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME' doesn't have private key or caller doesn't have access to private key.]LOG]!><time="15:02:32.086+300" date="03-12-2014" component="ClientIDManagerStartup"
    context="" type="2" thread="716" file="ccmcert.cpp:1372">
    <![LOG[Completed validation of Certificate [Thumbprint SOMETHUMBPRINT_1] issued to 'CLIENTMACHINENAME']LOG]!><time="15:02:32.086+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1"
    thread="716" file="ccmcert.cpp:1386">
    <![LOG[Raising event:
    instance of CCM_ServiceHost_CertRetrieval_Status
        ClientID = "GUID:GUID";
        DateTime = "20140312200232.090000+000";
        HRESULT = "0x87d00283";
        ProcessID = 6380;
        ThreadID = 716;
    ]LOG]!><time="15:02:32.090+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716" file="event.cpp:706">
    <![LOG[Failed to submit event to the Status Agent. Attempting to create pending event.]LOG]!><time="15:02:32.092+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="2" thread="716"
    file="event.cpp:728">
    <![LOG[Raising pending event:
    instance of CCM_ServiceHost_CertRetrieval_Status
        ClientID = "GUID:GUID";
        DateTime = "20140312200232.090000+000";
        HRESULT = "0x87d00283";
        ProcessID = 6380;
        ThreadID = 716;
    ]LOG]!><time="15:02:32.092+300" date="03-12-2014" component="ClientIDManagerStartup" context="" type="1" thread="716" file="event.cpp:761">
    <![LOG[Unable to find PKI Certificate matching SCCM certificate selection criteria. 0x87d00283]
    Thanks Lance

    Hi,
    It seems that there are something wrong with you PKI system.
    Here are some steps for your reference.
    SCCM 2012: Part II – Certificate Configuration
    http://gabrielbeaver.me/2012/08/sccm-2012-part-ii-certificate-configuration/
    Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
    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.

  • Class VIs for access to private Data: reentrant or not?

    I just created in a class some VIs for access to private data (my German translation). I'm talking about these VIs, which enable you to connect your class object to a property node to read or write private class data. These VIs are by default non-reentrant. My question is: what happens, if I try to access two objects of the same class with these property nodes? Does the second object have to wait for the first one to be read? If yes, can I circumvent this by making these VIs reentrant?
    Regards,
    Marc
    CLD
    Solved!
    Go to Solution.

    In theory yes. In pratice it will depend on what you are doing in the private method and the methods it calls.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to access the private constructor??

    i have a one private constructor in which i define some important variables then how should i access that private constructor?(Is this related to singleton class? if possible give me some example )

    Hi
    you can access to your private constructor through static methods of that class.
    you can create objects of that class using these static method.
    example code
    public class rrr
         public static void main(String[] args)
              a ao=a.getobj(30);
              System.out.println(a.geti(ao));
    class a
         private int i;
         private a(int x)
              i=x;
         static a getobj(int y)
              return new a(y);
         static int geti(a temp)
              return temp.i;
    enjoy .........
    This is my first reply to forum .
    If you found any problem free feel to tell
    Thank you

  • [svn:bz-trunk] 21286: Also need to change 2 more private members to protected in order to make the first call after login

    Revision: 21286
    Revision: 21286
    Author:   [email protected]
    Date:     2011-05-20 11:43:00 -0700 (Fri, 20 May 2011)
    Log Message:
    Also need to change 2 more private members to protected in order to make the first call after login
    Modified Paths:
        blazeds/trunk/apps/ds-console/console/ConsoleManager.as

    Revision: 21286
    Revision: 21286
    Author:   [email protected]
    Date:     2011-05-20 11:43:00 -0700 (Fri, 20 May 2011)
    Log Message:
    Also need to change 2 more private members to protected in order to make the first call after login
    Modified Paths:
        blazeds/trunk/apps/ds-console/console/ConsoleManager.as

  • C7 how to access the PRIVATE folder in phone memor...

    C7-00 how to access the PRIVATE folder in phone memory?
    Meaning the folder C:\private
    With X-plore you can see the folder but it is marked as 0 kb.
    Edit: reason for this is that I had Angry Birds installed on memory C:
    Then I had changed my phones default game install memory to E: at the OVI store setup in the phone. On Monday OVI suggested that I should update the AB and so I did.
    Now it installed the new version to memory E: and all my game progress was gone.
    Just need to see if the save game still lays on C:\private\20030e51.
    Solved!
    Go to Solution.

    Ah, I'm sorry - I thought it was the private folder in C drive that I had managed to get into the previous week but it was the private folder in mass storage ...
    If you want to thank someone, just click on the blue star at the bottom of their post

Maybe you are looking for

  • What's wrong with my "Contact Me" page?

    My website has a way to go before it's "done", but I've uploaded it to see what works and what doesn't. On the Contact Us page http://www.dohaexpatmumsandkids.com/Contact.html , I want an e-mail to be sent to me when the user completes the box; howev

  • Using an iPad2 as a remote device for a PC

    The office I work at is currently going paperless and we are trying to use an iPad2 as a remote device four our PC's, I have everything all hooked up except the laptop has a widescreen and it doesnt show everything on the iPad, any advice on how to c

  • I want to delete the version I am running and then upgrade

    I am using a MacBook pro and having some issues with the touch pad (background info). I want to delete the current version of Firefox and up grade to FF 4.0.1 I can only find FF listed under 'Drives' in finder and am unable to delete it. I have downl

  • Why doesn't iPhone have the options to import photos directly in Windows 8 like in Windows 7?

    It used to be able to import photos directly into the same folder as the photos are synced under "Last Import" back in Windows 7. But now in windows 8, I have to use Dropbox to import photos, yet Dropbox doesn't have the options to erase photos alrea

  • Returning a BLOB via BPM.

    I have a situation where using an attachment will not work - because of the sensitivity of the item being stored. It has to be made available to a subset of participants within the process instance. I can use ScreenFlow mapped to a JSP to upload the