Sun's code conventions & Eclipse

Has anyone ever found or made XML files I could import in Eclipse in order to comply to Sun's Java coding conventions (code formatter and code/comment templates) ? I could normally look for what I'm going to ask by googling, but we have limited access to the Internet at work so that I can't (stupid but it is so...). What's more, some of you might have made their own, which would not be publicly available on the web...
Thanks in advance !

s/going to ask/asking

Similar Messages

  • Code Conventions

    Hi All,
    being a complete Java(TM) newbie here is a very silly question.
    After reading the "Java Code Conventions" (see http://java.sun.com/docs/codeconv/)
    and studying here and there the Java core library source code (see src.zip
    on your SDK installation) I was wondering what the heck is the characters
    sequence @(#) behind the file class name in the header comment.
    You can see it in all classes' source code and in paragraph 11.1 of the
    aforementioned JCC. For example,
    * @(#)WhatIsIt.java 1.82 04/09/02
    * Copyright [...]
    All the best

    It is some kind of a marker for the source code control system that Sun uses. When you make changes to the file the system knows to update the revision number ("1.82") and the modification date ("04/09/02") automatically thanks to the presence of "@(#)".
    I think Sun uses a system called SCCS; you'd write something else.if you used RCS or CVS for instance.

  • Check code conventions

    Anyone seen or have any ideas about using javadoc to check code for code conventions compliance? I read about use of it to report source where variables are not declareed private (http://www.smotricz.com/kabutz/Issue035.html) - it might be interesting to apply this to other conventions such as variable and method naming.

    No ideas here. We have a DocCheck doclet, but that checks only doc comments, not the
    code itself: http://java.sun.com/javadoc/doccheck
    A doclet based on javadoc 1.3.x could only check the declarations of code and not its
    implementation, because it does not have access to the implementation through the
    Doclet API. With 1.4, the Doclet API gives the source position (file, line number) of the
    code, which a doclet could then access and check the implementation.
    -Doug Kramer
    Javadoc team

  • How to debug Sun's classes using Eclipse

    Sometimes happens to me during the debugging of my application to have the necessity to "step into"
    in some Sun's classes (java.lang.String, or swing classes or something else).
    Even if Sun provide us the sources, I have not found a way to debug Sun classes because the Sun
    classes are shipped in jars without the debug informations.
    Eclipse open correctly the Sun's source but, without the debug informations into Sun's jars, is impossible
    to proceed with debugging.
    Does anyone can help me?
    Thanks.

    I have not used Eclipse but I think this may do it. While u are build' ing ur project can u place the jar files in the source path so that their classes also get compiled! If u can do then u can step into sun's code.
    s

  • Code Convention for Swing

    Can Anyone please point to a document or site which has information
    about Naming or Code Conventions on SWING.
    There are lot of documents for J2EE ,JSP and JMS naming conventions,
    but could not find anything on SWING.
    Any Help would be greatly appriciated.

    "Code Conventions for the Java Programming Language" is found at
    http://java.sun.com/docs/codeconv/index.html. Swing is no exception to these recommendations.

  • Problems while trying to look at the code from Eclipse

    Hello
    I'm having problems trying to look at ABAP code within Eclipse, every time I try to open a program i get this error:
    The editor cannot be shown because the content cannot be synchronized with the back end: Synchronize Content Result for /ABAPsystem/.adt/programs/programs/zprogram/zprogram.approg; System failure: "Exception condition "NOT_POSSIBLE" raised." (For detailed information, check the generated short dump in transaction ST22 of system ABAP).
    The system configuration:
    SAP_BASIS:    731    0004
    SAP Kernel :  721_EXT_REL
    We just upgraded from kernel 720_EXT_REL to 721_EXT_REL to enable debug within Eclipse, however I can't see any code now. Basis has no idea what it could be, they told me they haven't changed anything in the configuration.
    Any help would be appreciated.
    Thanks!
    Daniel H.

    Hi Daniel,
    Some time ago, something similar happened, when ADT was installed in HANA Studio. See note http://service.sap.com/sap/support/notes/1834948. This note does also describe a workaround. Maybe this helps.
    If not, does transaction ST22 show a short dump that might be related to this operation?
    Michael

  • Writing code in eclipse

    Hello everyone!
    I have no expirience programing on ABAP at all. Only in C++, C# and Java. But I'd like to start with making some simple programs. I have a book about APAB language and also I have installed the ABAP development tools into my eclipse. However I found out that if I want to programm something  I have to connect to ABAP back-end systems at first. I am begginer and I can not do that. So can I create  ABAP back-end system on my computer? May be someone can explain how can I write code in eclipse without connecting to  the ABAP back-end system?
    Sorry for my terrible English, hope someone understood me
    Regards

    Dear Dimitry,
    please check out this page: ABAP Platform Developer Center.
    I can recogment to get the Netwever 7.40 trial. The Server runs in the anazopm web services (AWS). Do you already have experience with such virtual appliances?
    Another good way of get you going is to visit an ABAP CodeJam: Upcoming CodeJam Events
    Have Fun,
    Peter

  • How to run TCK using Java Card Sun reference model from eclipse

    Hi all,
    can any one help me by giving an idea about running java card TCK using sun reference model from eclipse IDE.
    Thanks
    Murali

    tck should be able to run as stand-alone (with jcre).

  • How to run the open script code from eclipse?

    Hi,
    How to run the open script code from eclipse.
    Please let me any soulutions on this.

    Hi Konda
    I am not quite sure you can do that and it would even be not supported... Again, what is the purpose? Why do you want to run your openscript code in Eclipse?
    What is the code you try to run?
    As an example, even if you include al the jar files and so on. don't think the function "Launch Browser" could work because it isn't only java code orjar files.....
    If you give us more background. maybe we can guide you to a better solution...
    JB

  • IOP00010202 org.omg.CORBA.UNKNOWN:   vmcid: SUN  minor code: 202

    Hi,
    I try to make a servlet call a method of an EJB that return an object. After the execution of the method (during the object result return I get th exception below.
    Any idea ???
    Thanks
    Didier
    [#|2004-10-28T15:54:09.424+0200|WARNING|sun-appserver-pe8.1|javax.enterprise.resource.corba.S1AS-ORB.rpc.protocol|_ThreadID=11;|"IOP00010202: (UNKNOWN) Unknown user exception thrown by the server - exception: java.lang.ClassCastException; message: null"
    org.omg.CORBA.UNKNOWN: vmcid: SUN minor code: 202 completed: Maybe
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.runtimeexception(ORBUtilSystemException.java:8508)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.convertThrowableToSystemException(CorbaMessageMediatorImpl.java:1921)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1871)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1824)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:261)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1683)
         at com.sun.corba.ee.impl.protocol.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:155)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:132)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:150)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at fr.adp.com.gxp.std.moteur.comm_host.EJB.src._Saisie_DynamicStub.execute(_Saisie_DynamicStub.java)
         at servlet.IP.src.GxpServlet.doGet(Unknown Source)
         at servlet.IP.src.GxpServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:273)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:262)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:618)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:500)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:375)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    Caused by: java.lang.ClassCastException
         at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.write(DynamicMethodMarshallerImpl.java:338)
         at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.writeResult(DynamicMethodMarshallerImpl.java:430)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:127)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:648)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:192)
         ... 40 more
    |#]

    My war archive contains remote and home interface and the return object class.
    The exception is rised between the return of the EJB's result and the reception of the result in my servlet.
    thank you for your help
    didier
    This is my remote interface :
    public interface Saisie extends EJBObject
    public GxpOutput execute(String inputReq)
              throws ResourceException,RemoteException;
    This is my Home interface :
    public interface SaisieHome extends EJBHome
         public Saisie create() throws CreateException,RemoteException;
    This a part of my servlet code :
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////servlet
    InitialContext ic = new InitialContext();
    Object objRef = ic.lookup("ejb/ejbGxp");
    saisieHome = (SaisieHome)PortableRemoteObject.narrow(objRef, SaisieHome.class); //narrow is here
    saisie = saisieHome.create();
    output = (GxpOutput)saisie.execute(inputReq);
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////end

  • Attatching Source Code To Eclipse IDE

    Please please please can someone help me do this? Its driving me nuts
    I am running JDK 5 and have downloaded Java 5 source cide - I have attatched the code to Eclipse and it still does not show it.
    I have tried this on more then one machine with no luck
    Does anyone know what might cause this and how it can be overcome?
    How do you get the JDK source code available within Eclipse?

    Steve_Johnson wrote:
    I am running JDK 5 and have downloaded Java 5 source cideBut is your Eclipse actually using the JDK? Or just the JRE? Eclipse doesn't need a JDK to run, or to compile code, it'll work just fine with a JRE. Have a look at Windows->Preferences->Java->Installed JREs in your Eclipse, and see what it's actually using. If it's not a JDK, chances are it won't pick up the sources

  • Some notes about Java code conventions

    Hello!
    I read the book "Java Code Conventions". It' good conventions but I have some notes Here is my offer
    1.Classes's names start with "C", e.g.
    CMain, CFileTool.
    2.Interfaces's names start with "I", e.g.
    IObserver, IDigitalListener.
    3. Exceptions's names startw with "E", e.g.
    EMyException
    4.Member objects variables start wiht "m_obj". Not member objects variables (local objects variables) start with "obj" respectively, e.g.
    public class CMain {
    private CText m_objText = new CText(); //my class CText
    private void anyMethod() {
    CText objText = new CText();
    5. Vector member variable start with "m_vec" Not member vector variable start with "vec" respectively. Hashtable member variable start with "m_hash".Not member hashtable variable start with "hash" respectively, e.g
    private Vector m_vecElements = new Vector();
    private Hashtable m_hashElements = new Hashtable();
    private void anyMethod() {
    Vector vecElements = new Vector();
    Hashtable hashElements = new Hashtable();
    6. String member variable start with "m_str". Not member string variable start with "str" respectively, e.g.
    private String m_strText = new String();
    private void anyMethod() {
    String strText = new String();
    7. Primitive types starts with "n", "b" and so on. , e.g.
    int nIndex = 4
    boolean bIsCorrect = true
    char cSymbol = 'a'
    float fNumber = 3
    double dNumber = 1.2
    long lNumber=1
    short sNumber=2
    and respectively it's classes start as section 4, e.g
    Integer objIndex = new Integer(nIndex)
    Boolean objIsCorrect = new Boolean(bIsCorrect)
    and so on
    The main idea on my convention is when somebody will look at , e.g. object he at once should understand about what there is this object, and not scrolling java file to understand this.
    It will be pleasant for me to receive your answers.Thank you

    Vector member variable start with "m_vec" Not member vector variable start with "vec" respectively. Hashtable member variable start with "m_hash".Not member hashtable variable start with "hash" respectivelyThere are over 2000 classes in the 1.4 SDK. You need to extend this rule to cover all of them, don't you? For examples, GraphicsConfigTemplate member variables must start with "m_graphicsconfigtemplate"...

  • Sun Studio code hangs at fork, GCC code runs fine

    I am encountering a strange problem where code complied with GCC runs fine, but the same code compiled with Sun Studio 12 compiler hangs at a fork call after an initial set of fork calls.
    I'd appreciate your help in solving this.
    The code was originally written for GCC, I started using the Sun Studio with a view to using Sun's thread analyzer. I made a couple of changes which I think are inoccuous:
    (a) added #ifdef __SUNPRO_CC char * __FUNCTION__ = "name"; #endif
    (b) one more #ifdef around one call to ctime_r because the g++ include expects 2 parameters while Sun Studio 12 expects 3 parameters.
    The g++ is compiled on a Solaris 9 (1 x sparcv9) using GCC 3.3.3
    while the Sun Studio 12 is on a Solaris 10 ( 4 x sparcv9).
    Both runs were on the same Solaris 10 machine which has the compiler.
    The program is a multi instance socket listener, the main program binds to a socket, then forks off a set of processes which accept connections, those children later fork off other client applications based on the connection data; after those clients exit, the children continue accepting etc. The main program only monitors the child processes, records their status and starts if any of those die.
    This is working as expected when compiled with g++.
    The exact same code (note the two sets of #ifdefs above) when compiled with Sun PRO CC alway hangs at the second set of fork. That is, it goes through the first set of forks fine, then when a connection is established, it reads the data but hangs right at the fork call.
    The application code at this point is:
    char * p = pathfind( getenv("PATH"), progname );
    if ( !p ) {  printError(); return false; }
    pid = fork();
    The truss for the Sun Studio code shows
    23914: access("/usr/bin/progname", X_OK) = Err#2 ENOENT
    23914: access("/usr/you/bin/progname", X_OK) = 0
    23914: lwp_park(0x0000000, 0) (sleeping)
    while the truss for the g++ code shows
    23986: access("/usr/bin/progname", X_OK) = Err#2 ENOENT
    23986: access("/usr/you/bin/progname", X_OK) = 0
    23996: fork1() = 24005
    What am I doing wrong?
    Thanks and best regards

    If I understand correctly, you are compiling with gcc on Solaris 9, and with Sun Studio on Solaris 10. Since the OS is different, you might be running into OS issues and not compiler issues. What happens if you build with the same gcc version on the Solaris 10 system where you see the problem?
    By "OS issues", I mean
    1. The program uses unstable or undocumented OS interfaces, or
    2. A bug that is new in Solaris 10.
    A bug was identified in Solaris 10 that could cause forks to hang. It showed up in the libpkcs11 library as used by the JVM. I don't know whether it showed up elsewhere.
    This bug was fixed in Solaris 10u2. If you are using an earlier version of Solaris 10, you could try upgrading.

  • UNKNOWN:   vmcid: SUN  minor code: 202

    The idl of the method is:
    void myMethod(in string param1, in string param2, in long param3, in long long param4) raises (anException);
    The problem occure when the two string parameters are empty (not null, but empty).
    org.omg.CORBA.UNKNOWN: vmcid: SUN minor code: 202 completed: Maybe
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:306)
    at java.lang.Class.newInstance(Class.java:259)
    at com.sun.corba.se.internal.iiop.messages.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:90)
    at com.sun.corba.se.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:105)
    at com.sun.corba.se.internal.POA.GenericPOAClientSC.invoke(GenericPOAClientSC.java:129)
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
    at conferencing._UnitListenerStub.myMethod(_UnitListenerStub.java:61)
    XP Pro, J2SE 1.4.1_01 on the caller side
    XP Pro, J2SE 1.4.1-b21 on the called side
    Both application run on the same machine for the test
    What's wrong with empty String ?

    Empty string is just fine.
    What is probably happening is that server is failing either a) before reaching servant ( server object ) or b) after reaching server object. In this case the exception will be 'unknown' in client side. Try turning on debug for server and checking trace for messages.
    - Jim

  • Where have the code conventions gone?

    The java code conventions used to be reachable from Code Conventions for the Java Programming Language: Contents. It seems that these pages have been moved because all the links now return a 404 page not found error when clicked. Does anybody know the new address of the code conventions?

    jwenting wrote:
    your fallacy is in assuming that "old == bad". If the original was good there's no real need to touch it (and IMO it was good).
    Maybe add a few sections explicitly making statements relating specifically to things like generics and lambdas, but most of that can be derived easily enough from what's in there as is).
    I'm equalling old with "may be outdated" but I leave it to Oracle to decide if so and when to update. But if Oracle has decided now is the time then my guess is that Java 8 has a lot to do with it.
    But maybe I shouldn't have posted an opinion so I withdraw my guess. Happy?

Maybe you are looking for

  • [SOLVED] yaourt -S zoneminder fails

    I previously posted this on the package page, but no return.  So did anyone install zoneminder with success? zm_mpeg.h:63: error: use of enum 'PixelFormat' without previous declaration zm_mpeg.h:64: error: ISO C++ forbids declaration of 'AVOutputForm

  • IPhoto version for OS 10.6.8?

    I upgraded to the latest version of the OS that my Mac mini will run, 10.6.8. For my trouble I seem to have a slower, less stable system although I did gain 10 Gb on the HD. But now cropping won't work in iPhoto - the image window goes black. Is it p

  • Data Load using only 1 data package

    Hi, I am moving data from one cube to another manually using an infopackage. This system has recently been upgraded from 3.0 to 3.5. It is only using 1 datapackage (I am loading 19m records) and have done this successfully before and it used 4 datapa

  • What happened?  Tried to open Elements 8 and error message says "Photoshop has stopped working."

    The Welcome screen somes up but then fades and error message says "Photoshop has stopped working."  Then Windows closes the program. I shut down the computer, waited, then did restart, clicked on PSE, and the same message came up again.  That was las

  • Putting an Image in JPanel

    I am trying to put an image in JPanel. Using something other than ImageIcon. When I run the program only a white screen appears. package game; import gui.FullScreenDisplay; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; impo