Is java supports Copy Constructor ?

Is Java Supports copy constructor ? why?
Thanks

clone is perferable over copy constructors, as
Object.clone() will produce the correct type of
object no matter who called it, wheras you are
responsible for this if you use copy constructors...
unless of course the copy constructor is defined in a
final class, in which case cc's are fine.IMHO, Clone is to be avioded as;
- most classes don't support it.
- class which do support it don't do a deep copy which is that most people expect it to do.
The only really safe way to take a copy of an object is to serialize it and deserialize it.

Similar Messages

  • ABAP+JAVA system copy using 3rd party export/import tools

    Hi all,
    I am trying to do a homogenous system copy.  I am following the syscopy guide for SAP NW 7.0 SR3 ABAP+JAVA systems
    We are running AIX 5.L and Oracle.
    My question is this.  We are using an IBM XiV system for our disk storage, and we are able to restore from "snaps" which is their version of images.  Does anyone know if it is possible to restore or "import" the data in a system copy using an outside tool like this?  If so, do you have any information on how to?
    I know it is possible to restore the database from an offline backup using BRTools rather than r3load and jload, and I just wanted to see if I can restore from a snap as it would save a lot of time in the procedure.
    Any help or ideas would be much appreciated.
    Thanks!

    >My question is this.  We are using an IBM XiV system for our disk storage, and we are able to restore from "snaps" which is their version of images.  Does anyone know if it is possible to restore or "import" the data in a system copy using an outside tool like this?  If so, do you have any information on how to?
    That approach is not supported.
    The reason is: combined instances write the instance name and hostname in various places, on the filesystem in .properties files, in the JDBC configuration, depending on the java applications you run on top in various other places. What you're trying to do is effectively "renaming" an instance.
    Technically it's possible to do it and to get it run, yes, but the supported way is running sapinst and choose ABAP + Java system copy. This will prevent you from lots of (not really documented) manual work after the copy.
    Markus

  • Installation Master DVD Distributed Java System Copy menu missing

    Hello Gurus
    We want to perfom an Java system copy of our EP 6.0 using sapinst
    The source OS is Solaris 8.0 with Oracle 10.2.0.2
    The target OS is Solaris 10.0 with Oracle 10.2.0.2
    Our architecture is Distributed , CI is running on a system and DB server on another system.
    For this operation we use the master DVD 51033746_12 but we have an issue in exporting the DB as the
    Option for exporting the DB on a Distributed system is not displayed on the sapinst Menu .
    We followed the last guide taken from sap 'Homogeneous and Heterogeneous System Copy for SAP Systems Based on SAP Web Application Server Java 6.40 SR 1' and this option should be listed
    Excerpt:
    Choose the installation service SAP NetWeaver u201904 Support Release 1--> Java System --><DB> --> Distributed System --> Migration - Database Export.
    Unfortunately the Distributed system is not displayed and though we are stuck at the export step .
    I could not find any sapinst patches . Is it a known issue for Soalris system and is there a Workaround .
    Thanks for your help
    De Palma Lionel .

    Hello
    Thanks for your answer . Unfortunately this option is not available as we are using a NW04 SR1 system , not a nw'2004's one . With the latest master install (Installation_Master_6.20_6.40_05_08 51033746_5 )we have the choice of
    System copy  Source --> Java system --> oracle --> Migration Data  export 
                                    -->  HA Java system --> oracle --> Migration Data  export
    System copy  Target --> Java system --> oracle --> Central system-> Migration Data  export 
                          Target --> Java system --> oracle --> Distributed system -> Migration Target Central instance / Db instance install
    The Distributed system is available for Import option but no for the export one .
    My questions are :
    - Can we use a master nw2004's master DVD for system copy on a Nw'04s one ?
    - As the central instance is hosted on different system than DB instance , should I use the HA option ?
    Regards

  • How to apply java support packages.

    hi all,
    i applied support packages for 4.7EE but i dont know how to apply java support packages.
    can anyone explain about how to apply  java support package for netweaver s??
    from scratch anyone can explain.
    regards
    vijay

    Hello Vijay ,
    Java Support packs can be installed without using SDM also if you are on NW2004.
    Process:
    Eg SP18
    Download the following DVDs
    1. WebAS 6.40 SP18(Part 1/4): SAP Installer
    2. WebAS 6.40 SP18(Part 2/4): SAPInst Control File for Oracl
    3. WebAS 6.40 SP18(Part 3/4): OS Depend. parts of Java RuntiA
    4. WebAS 6.40 SP18(Part 4/4): OS Indep. Parts of Java Runtime
    Uncar each of them in the sequence
    1,4,3,2
    Once u uncr then u will get some more uncarred files
    eg D:\sapinst\J2EE-RUNT-CD\SCS\NT\I386\SCS.SAR uncar it into run directory : DIR_CT_RUN ( D:\usr\sap\SRX\SYS\exe\runU)
    Note: The value of DIR_CT_RUN can be found In Profile SRX_SCS01_B3BPH1W)
    Run SAPINST
    Note:Give RFC user as 000 DDIC
    Java Support packs can be installed using JSPM  if you are on NW2004s
    1)Download SP Stack or SP
    2)Copy the SCA files to /usr/sap/trans/EPS/in
    3)Execute the JSPM go.bat from \sapmnt\SID\DVEBMGSXX\j2ee\JSPM
    4) Provide SDM Password
    5 ) Select the Traget SP level .
    6 ) Deploy.
    Also, you can find the current SP Level in http://localhost:5<instance numeber>00 and then system information.
    Regards ,
    Santosh Karadkar <a href="https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=3819594">Click here for further info</a>

  • Copy Constructors vs clone()

    In C++, the copy constructor (along with the assignment operator, which doesn't exist in Java) was the standard way of copying an Object. In Java, we have the Clonable interface, but the option of using Copy Constructors remains.
    So, which is preferable? The Clonable interface is clumsy and poorly designed, but many programming language theorists discourage the use of Copy Constructors. Bruce Eckel (of Thinking in Java) seems to use Copy Constructors a lot, but Sun uses the Clonable interface.
    What are the pros and cons of each?

    Hallo,
    in order to use the Copy Constructor, you need to know that you have an instance of class X, eg:
    X a, b;
    a = new X();
    b = new X(a);On the other hand, if you are deep in code somewhere and you need a copy of an Object, then cloning is the only way to make a copy, as you do not know what class you have.
    doSomething (Object obj) {
       if (obj instanceof Cloneable) {
          Object objCopy = obj.clone();
    }So it is a question of horses for courses.

  • Why is it that AS3 does not support private constructors as AS2 does?

    Why is it that AS3 does not support private constructors as
    AS2 does?
    Private constructors are standard in most OOP languages (for
    example
    C++ and Java) and were supported in Actionscript 2. However,
    this is
    not the case in AS3 which only allows its constructors to
    have the
    'public' access modifier.
    I have legacy code that I hope to migrate to the AS3
    platform. Some
    key elements of my code rely on design patterns like the
    Singleton
    pattern which in turn depend on private constructors. I could
    refactor
    my code but, ultimately, I would lose the benefits of the
    pattern
    (ie. one and only one instance of the Singleton class).
    I have also used private constructors to simulate enumerated
    types
    much like the enums you would find in Java 5 and up. But I
    can't
    use the same implementation in AS3 without private
    constructors.
    I do not want to resort to mixing legacy code with new AS3
    code to
    keep functionality intact. Are there any possible
    work-arounds for
    this issue?
    If not, are there any lobbying groups I need to know about so
    that
    we can get this feature back?

    http://www.gskinner.com/blog/archives/2006/07/as3_singletons.html

  • Why no JAVA support ,very disappointed

    It seem to be less Java support on Nokia rather than others languages ???for instance i just looking for last ten years 1992 technology that is SMS and how to send a sms using java ...???the answer is no.
    Is Java that bad ???....
    :<

    Hi everybody ,
    For guy supporting Java ,please reply can i am going to choose Java or Microsoft.
    I developing some Nokia wireless programming using VB and C++ and found very easy to use but in term of stability Microsoft is still not the best .
    Can any one can recomment what platform should i use for building up a wireless transaction .Please give some idea on performance wise ,stability ,scalability and ease of use so on.Currently i am using a Nokia phone connect to a PC but the transaction for these project is high(200 per day) ,so please give recommentation ,say how to do it with a SMS gateway.
    It goes like this .
    First program
    1.Received incoming call and capture the incoming call number using NOKIA phone or better recommentation
    2.Reply an SMS message to the caller
    Second program
    1.Read incoming SMS message ,probably need a listening event on Nokia Phone or better recommentation
    2.Read SMS and reply SMS
    Please reply for all Java supporter ...Please recomment the best plat for should i use and what gateway or phone should i choose.
    TQ,
    Wikey
    SCJP .

  • PI (ABAP+JAVA) system copy

    It's said that PI (ABAP+JAVA) system copy is different from pure JAVA system copy or pur ABAP system copy.
    Could you share your experience?  Thanks!

    Hi Christy,
    For Java there is exe file, so by clicking that the java is installed on the system.
    For PI check the below link
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=870863
    For ABAP
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=784931
    Java tools copy for SAP PI
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=784118
    Regards
    Ramesh

  • Abap+Java System Copy on NW2004

    Hello Gurus:
    I will be performing a system copy of NW2004 (not NW2004s) which is running on ABAPJava stack. How should I perform the system copy? I have gone thru the documents for ABAP system copy and Java System copy. What are steps that I need to follow to do the ABAPJava stack?
    Huge thanks in advance.
    Regards,
    N.S
    Message was edited by:
            Narayanan Swamy

    Hi Swamy,
    Please refer these notes to clarify further.
    Hom./Het.System Copy SAP Web AS 6.40 SR1 Java Note 785848 .
    restrictions which apply to the system copy see SAP Note 711093.
    Cheers,
    Shaym

  • Java system copy problems with the Java Migration Toolkit

    During the JAVA system copy, we have have got the error in second last
    step i.e;Java Migration Toolkit. We tried to do the system copy twice
    but every time we have got the below error.
    Is this a know bug? I have got the OSS note 966752 but the value
    of 'src.ci.host' is already correct. has anybody come across the similar issue. please help.
    " CJSlibModule::writeInfo_impl()
    Output of /usr/java14_64/bin/java -
    classpath /usr/sap/CMT/SYS/global/sltools/sharedlib/launcher.jar:. -Xj9
    com.sap.engine.offline.OfflineToolStart
    com.sap.sdt.jmt.migrationtool.MigrationToolImport /usr/sap/CMT/SYS/global/sltools/jmt:/usr/sap/CMT/SYS/global/sltools/sharedlib import.switch
    resume downtime mti.properties is written to the
    logfile /home/cmtadm/CI_Import_08312009/runJmt.log.
    WARNING 2009-09-01 20:49:43.473
    CJSlibModule::writeWarning_impl()
    Execution of the command "/usr/java14_64/bin/java -
    classpath /usr/sap/CMT/SYS/global/sltools/sharedlib/launcher.jar:. -Xj9
    com.sap.engine.offline.OfflineToolStart
    com.sap.sdt.jmt.migrationtool.MigrationToolImport /usr/sap/CMT/SYS/global/sltools/jmt:/usr/sap/CMT/SYS/global/sltools/sharedlib import.switch
    resume downtime mti.properties" finished with return code 27. Output:
    ERROR 2009-09-01 20:49:43.477
    CJSlibModule::writeError_impl()
    CJS-20068 Error when running the J2EE Migration Toolkit.<br>SOLUTION:
    See output of logfile /home/cmtadm/CI_Import_08312009/runJmt.log: ''.
    ERROR 2009-09-01 20:49:43.479
    CJSlibModule::writeError_impl()
    CJS-20068 Error when running the J2EE Migration Toolkit.<br>SOLUTION:
    See output of logfile /home/cmtadm/CI_Import_08312009/runJmt.log: ''.
    ERROR 2009-09-01 20:49:43.480 [iaxxgenimp.cpp:731]
    showDialog()
    FCO-00011 The step RunMigrationController with step key
    |NW_Doublestack_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CI_Instance|ind|ind|ind|ind|11|0|NW_CI_Instance_Configure_Java|ind|ind|ind|ind|4|0|NW_RUN_MIGRATION_CONTROLLER|ind|ind|ind|ind|2|0|RunMigrationController was executed with status ERROR ."
    There is no log file by the name runJmt.log.
    Regards,
    Sagar

    This issue was resolved by OSS note 966752 itself. Below is the important line in the OSS note.
    Note: The default value is crucial! If a custom value other than the default value was applied, we highly recommend that you restore the default value.
    Thanks,
    Sagar

  • I tried to paste text from another site into my Firebox document, but it says "Firefox does not support Copy & Paste". How do I enable clipboard? I never had problems like this on Firefox before...why?

    I tried to paste text I copied from another site into my Notepad++ (as I've always done in the past with no problem).
    But today for the 1st time, I got a message when I tried to paste the text "Firefox does not support Copy & Paste". What?
    What happened to the clipboard?

    That's a security feature in Firefox.
    Use this extension to add the necessary permissions to Firefox - Allow Clipboard Helper: <br />
    https://addons.mozilla.org/en-US/firefox/addon/852

  • RSPOR_SETUP  = Different ABAP and Java support packages.

    Hi all,
    We have an ECC 6.0 system with abap+java stacks. When we run the RSPOR_SETUP report we get this error:
    Different ABAP and Java support packages. Combination of support packages invalid
    And with some more clicking we find this:
    6. Compare version information of Java support package (com.sap.ip.bi classes) with ABAP support package (SAP BI)
       ABAP Support Package:                  13
       Java Support Package:                   0
    On the Java stack we see (among others) these components:
    sap.com        BI-IBC        7.00 SP12 (1000.7.00.12.0.20070509050058)
    sap.com        BI_MMR        7.00 SP12 (1000.7.00.12.0.20070507084106)
    sap.com        BI_UDI        7.00 SP12 (1000.7.00.12.0.20070507084125)
    sap.com        BI-BASE-S        7.00 SP12 (1000.7.00.12.11.20080324092518)
    sap.com        BI-WDALV        7.00 SP12 (1000.7.00.12.1.20071105133039)
    sap.com        BI-REPPLAN        7.00 SP12 (1000.7.00.12.3.20080104101916)
    So I believe all components are correctly installed.
    What are we doing wrong?

    Hello.
    Please be aware, that report RSPOR_SETUP should NOT be used with a Netweaver 04s system. This report has been replaced by the support desk tool. I request you to run the support desk tool as per note 937697 to check if there are any configuration issues in your system.You can resolve any red traffic lights that might be reported by the tool by following the corresponding actions suggested.
    I hope I can be helpful.
    Thanks,
    Walter Oliveira.

  • ABAP + Java Support Pack installation

    When updating support packs in an ABAP+Java environment (ECC 6.0), is there any reason why one could not do the Java Support Packs first, followed by the ABAP support packs?  We are trying to update our support packs as efficiently as possible, and would like to update our java support packs first, followed by the ABAP stack a few days later.
    In regards,
    Michael

    Hi!
    There can probably not be a general answer to that question. There are some functionality where ABAP and JAVA are closely linked and where you'll most likely run into problems if the levels do not match.
    Technically there is no problem as applying the SP-Stack for Java and applying SPs for ABAP are independent (technical) tasks, but you will have to VERY carefully check the dependencies and carefully test this in a QA-environment.
    If you want my advice: Try to find a 'big shot' solution where you do all in one move.
    Regards,
    Jörg

  • 12.4 beta: private copy constructor in base class required to be called from temporary reference when -g option used

    Hi,
    We've got an abstract base class (StringBase) which various types of strings inherit from. The copy constructor for this base class is private, since we don't want to allow copying when this class shouldn't be directly instantiated. A number of our methods take specify the base class as a reference, but take a derived class temporary as a default argument (see code appended).
    This worked fine in 12.3, but in 12.4 beta, this now says:
       Error: StringBase::StringBase(const StringBase&) is not accessible from __dflt_argA().
    This works fine in clang and gcc, and indeed, this GNU document says it was a bug which was fixed in gcc 4.3.0:
        Copy constructor access check while initializing a reference
    which references http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#391
    It only appears to error when the "-g" option is used, however, which doesn't seem right, and compiles fine if the "-g" option is removed, which makes me think it's a bug. Presumably the optimizer is eliding the copy when not using -g, but it's left in for debug mode, causing the compile error?
    Many thanks,
    Jonathan.
    $ clang++ -std=c++11 defaultarg.cpp
    $ g++ -std=c++11 defaultarg.cpp
    $ /opt/SolarisStudio12.4-beta_mar14-solaris-x86/bin/CC -c defaultarg.cpp
    $ /opt/SolarisStudio12.4-beta_mar14-solaris-x86/bin/CC -g -c defaultarg.cpp
    "defaultarg.cpp", line 6: Error: StringBase::StringBase(const StringBase&) is not accessible from __dflt_argA().
    1 Error(s) detected.
    $ cat defaultarg.cpp
    #include "stringbase.h"
    #include "conststring.h"
    static const ConstString S_DEFAULT("default value");
    void SomeMethod( const StringBase& str = S_DEFAULT )
       (void) str;
    int main( void )
       SomeMethod();
    $ cat stringbase.h
    #ifndef STRINGBASE_H
    #define STRINGBASE_H
    class StringBase
    protected:
       StringBase() {}
    private:
       StringBase( const StringBase& );
    #endif
    $ cat conststring.h
    #ifndef CONSTSTRING_H
    #define CONSTSTRING_H
    #include "stringbase.h"
    class ConstString : public StringBase
    public:
       ConstString() {}
       ConstString( const char* ) {}
       ConstString( const ConstString& );
    #endif

    Thanks for reporting the problem!
    This looks like a compiler bug, I think an artifact of creating a helper function for the debugger for the default argument.
    I have filed bug 18505648 for you.

  • How to deploy EAR on CE server using Java Support Package Manager

    Hello,
    I am using CE server where I want to deploy EAR file by using JSPM. I run this program in Drive:\usr\sap\CE1\J00\j2ee\JSPM\go.bat
    I have also put the EAR file into the inbox folder Drive:\usr\sap\CE1\SYS\EPS\in but still It does not show me any file to proceed further for deployment.
    Does any one has idea?
    Regards,
    NK

    Hi,
    The Java Support Package Manager is not able to deploy a single .ear file.
    If the *.EAR file is placed inside an SCA (Software Component Archive) then JSPM is able to deploy it.
    You have to create a .SCA from an .EAR file
    SAP note 1223957 contains an attachment (nwpacktool.zip) which can be used to create a .SCA file from the .EAR file.
    Gerd

Maybe you are looking for