JavaDocError: Utility classes should not have a public or default construct

Hello all,
I am trying to comply with some check style errors that i am getting and i cannot seem to figure out what is going on. I have set all non-data members to private, except for call point public static void main(string[] args) and i am still getting this error. "Utility classes should not have a public or default constructor." I cannot figure out what is going on, any help would be greatly welcomed. My code is posted below.
public final class Main
     * Constant Data Member: RECTANGLE
     * Purpose: contains the constant string representing a rectangle.
     * @deprecated RECTANGLE Representitive string value for a rectangle.
    public static final String RECTANGLE = "rectangle";
     * Constant Data Member: TRIANGLE
     * Purpose: contains the constant string representing a triangle.
     * @deprecated TRIANGLE Representitive string value for a triangle.
    public static final String TRIANGLE = "triangle";
     * Constant Data Member: REGEX_NUMBER_TEST
     * Purpose: contains the constant for numerical test within regex method.
     * @deprecated REGEX_NUMBER_TEST regex string for digit comparison.
    public static final String REGEX_NUMBER_TEST = "^[0-9]+$";
     * Constant Data Member: MAX_ARGUMENTS_RECTANGLE
     * Purpose: contains the constant for the maximum number of allowed
     *          arguments coming in from the command line.
     * @deprecated MAX_ARGUMENTS_RECTANGLE constant for rectangle argument.
     *                                      limit.
    public static final int MAX_ARGUMENTS_RECTANGLE = 3;
     * Constant Data Member: MAX_ARGUMENTS_TRIANGLE
     * Purpose: contains the constant for the maximum number of allowed
     *          arguments coming in from the command line, in the case of a
     *          triangle object.
     * @deprecated MAX_ARGUMENTS_TRIANGLE constant for triangle argument limit.
    public static final int MAX_ARGUMENTS_TRIANGLE = 2;
     * Method: main
     * Purpose: Is the execution point for the program. It is in charge of
     *          initiating validation and the creation and application of
     *          objects and their related draw methods.
     * @param args input from the user.
    public static void main(final String[] args)
        String objectType = null;
        int width = 0;
        int height = 0;
        if(args.length > MAX_ARGUMENTS_RECTANGLE || args.length <
            MAX_ARGUMENTS_TRIANGLE || (args.length == MAX_ARGUMENTS_TRIANGLE &&
            !isTriangle(args[0])))
             // fails
            outputErrorMessage();
        else
            if ((isTriangle(args[0]) && args.length > MAX_ARGUMENTS_TRIANGLE) ||
                (!isTriangle(args[0]) && args.length > MAX_ARGUMENTS_RECTANGLE))
                // fails becuase triangle should only have one argument
                outputErrorMessage();
            else
                // passes and proceed
                objectType = args[0];
                if (validNumber(args[1]))
                    width = Integer.parseInt(args[1]);
                    if(width == 0)
                        outputErrorMessage();
                    else
....

Add a private constructor.
private Main() {  }
...This way it will be not possible to create an instance because it is not needed to use its static members or methods.
ref : [http://www.javapractices.com/topic/TopicAction.do?Id=40]
Bye.

Similar Messages

  • Wscompile + xmlbeans: class does not have a public accessible empty constru

    Hi
    I have some schema files from 3gpp.org and created java files with xmlbeans.
    Now I try to use them but wscompile complains:
    error: class provider.VersionType$Enum does not have a public accessible empty constructor
    that class is generated by xmlbeans and I can't modify it...
    The class is an innner class of an interface, and looks like this:
    * Enumeration value class for provider.VersionType.
    * These enum values can be used as follows:
    * <pre>
    * enum.toString(); // returns the string value of the enum
    * enum.intValue(); // returns an int value, useful for switches
    * // e.g., case Enum.INT_X_5_3_0
    * Enum.forString(s); // returns the enum value for a string
    * Enum.forInt(i); // returns the enum value for an int
    * </pre>
    * Enumeration objects are immutable singleton objects that
    * can be compared using == object equality. They have no
    * public constructor. See the constants defined within this
    * class for all the valid values.
    static final class Enum extends org.apache.xmlbeans.StringEnumAbstractBase
    * Returns the enum value for a string, or null if none.
    public static Enum forString(java.lang.String s)
    { return (Enum)table.forString(s); }
    * Returns the enum value corresponding to an int, or null if none.
    public static Enum forInt(int i)
    { return (Enum)table.forInt(i); }
    private Enum(java.lang.String s, int i)
    { super(s, i); }
    static final int INT_X_5_3_0 = 1;
    public static final org.apache.xmlbeans.StringEnumAbstractBase.Table table =
    new org.apache.xmlbeans.StringEnumAbstractBase.Table
    new Enum[]
    new Enum("5.3.0", INT_X_5_3_0),
    private static final long serialVersionUID = 1L;
    private java.lang.Object readResolve() { return forInt(intValue()); }
    Can anyybody help me ?
    thanks
    Gabor

    Sorry, I think you are out-of-luck on this one. The JAXRPC spec mandates that an acceptable value type have a public empty constructor. The only work-around I can suggest is to write a wrapper bean around this one that has such a constructor and use that in you interface instead.

  • ERR_WIS_30253 and user should not have 'save' rights to public folder

    Hello
    Environment - BO XI 3.2 SP2, FP 3.6
    Source is SAP - BI 7
    I am trying to implement the security in the project for the very first time from scratch , and requirement is -
    there should be 3 type of user Groups - Super, Power and End users
    All the users have their own specifications, along with that, one common requirement is, in-spite of the group user belong to, should not have the rights to save the BO reports in the public folder but may save it to its Favorites.
    I have created one super users group and also assigned some rights to Reporting folder.
    But
    1. I am not getting any option to achieve the above mentioned requirement.
    2. I am getting Error ERR_WIS_30253 while trying to refresh the reports.
    Looking forward to have a quick reply from experts.
    Thanks in advance.
    Zeenat
    Edited by: Zeenat on Nov 14, 2011 7:20 PM

    Hi Zeenat,
    If you have observed in BO right collections are categorized as:
       General
       Content
       Application
       system
    For Err_WIS_30253:
    We generally follow the practice of creating custom access levels as per the business requirement and apply them on the folder level. If you're one of us, to resolve this issue for WEBI reports you would have to edit the custom access level applied on the folder by providing "Refresh report's data" privilege for 'Web Intelligence Report' in 'CONTENT' rights collection.
    The key is 'CONTENT' right collection. Its similar in BIP 4.x Platform with 'owner' privilege.
    Issue is resolved.:)
    If above practice is not followed in your org you could also provide above stated privilege on the folder containing the WEBI report.
    Hope this gives you some idea.
    Kind regards,
    Sandeep Rana

  • ERROR:The applet Tennisball does not have a public constructor Tennisball()

    hi all...sorry...i encountered this java error msg with the following code.....n the error msg tat was generated is that i do not have a public constructor which i already have...can some1 please enlighten me..??
    import java.applet.*;
    import java.awt.*;
    public class Tennisball
         double x, y, oldx, oldy, xinc, yinc, v=2.0;
         int i,e,west,north,east,south,ry,rs,score,rx;
         int choice, zone;
         AudioClip ballout;
         boolean running,toggle,enough;
            Color ballcolor;
         Tennis t;
         Color bgColor = Color.black;
         public Tennisball(int w, int n, int e, int s, AudioClip bo)
                    west=w;
              east=e;
              south=s;
              north=n;
              ballout = bo;
              //this.t = t;
              xinc=1.7*v;
              yinc=0.7*v;
         public void getRacketPosition(int racket_y)
              ry=racket_y;
              rs=ry;
         public void newBall()
              ballcolor=Color.yellow;
              x=20;
              y=(int)(Math.random()*100+50);
              int angle=(int)(Math.random()*8+1);
              if(angle==1)yinc=-0.7*v;
              if(angle==2)yinc=-0.5*v;
              if(angle==3)yinc=-0.4*v;
              if(angle==4)yinc=-0.3*v;
              if(angle==5)yinc=0.3*v;
              if(angle==6)yinc=0.4*v;
              if(angle==7)yinc=0.5*v;
              if(angle==8)yinc=0.7*v;
              toggle=false;
              running=true;
              enough=false;
              e=0;
         public void move()
              if(running)
                   if(!toggle)
                        oldx=x;
                        oldy=y;
                        x+=xinc*v;
                        y+=yinc*v;
                   if(x<west && xinc<0)
                        int angle=(int)(Math.random()*8+1);
                        if(angle==1)yinc=-0.7*v;
                        if(angle==2)yinc=-0.5*v;
                        if(angle==3)yinc=-0.4*v;
                        if(angle==4)yinc=-0.3*v;
                        if(angle==5)yinc=0.3*v;
                        if(angle==6)yinc=0.4*v;
                        if(angle==7)yinc=0.5*v;
                        if(angle==8)yinc=0.7*v;
                       xinc=-xinc;
                        t.playClick();
                   else if(x>east-10)
                        x=east-10;
                        toggle=true;
                        running=false;
                        score++;
                        t.playBallout();
                   else if(y<north || y>south)
                       if(y<north&&yinc<0)
                             yinc=-yinc;
                        if(y>south&&yinc>0)
                             yinc=-yinc;
                        t.playClick();
                   else if(x>425 && xinc>0 && y>ry && y<rs+25)
                        if(y<ry+3)zone=1;
                        else if(y>=ry+3&&y<ry+6)zone=2;
                        else if(y>=ry+6&&y<ry+9)zone=3;
                        else if(y>=ry+9&&y<ry+12)zone=4;
                        else if(y>=ry+12&&y<ry+15)zone=5;
                        else if(y>=ry+15&&y<ry+18)zone=6;
                        else if(y>=ry+18&&y<ry+21)zone=7;
                        else if(y>=ry+21)zone=8;
                        if(zone==1)yinc=-0.7*v;
                        if(zone==2)yinc=-0.5*v;
                        if(zone==3)yinc=-0.4*v;
                        if(zone==4)yinc=-0.3*v;
                        if(zone==5)yinc=0.3*v;
                        if(zone==6)yinc=0.4*v;
                        if(zone==7)yinc=0.5*v;
                        if(zone==8)yinc=0.7*v;
                        xinc=-xinc;
                        t.playClick();
         public void toggle()
                        int i=t.j;
                        if(!enough)
                             if(i>-1&&i<11)ballcolor=Color.yellow;
                             if(i>10&&i<20){ballcolor=bgColor;e++;}
                        if (e>35){ballcolor=bgColor;enough=true;}
         public void paint(Graphics g)
              if(toggle)toggle();
              g.setColor(ballcolor);
              g.fillOval((int)x,(int)y,10,10);
    }

    I thought I should point out a few things
    The rule is that every class should have a no
    argument constructor that you need to specify
    explicitly if you have overloaded the default one.
    One of the reaons for that is the following:This is not true, there are many classes that do not have a no argument constructor (For example Integer). Integer is a perfect example of why you would not want a no argument constructor, having an Integer with no value is pointless (theres nothing you can do with it).
    public class A {
    private final int a ;
    public A(int b) {
    this.a = b ;
    }Now you realize that the variable
    n
    is getting initialized in the constructor. I see no variable n in the constructor but I take it you mean a
    Now if you
    refer to
    n
    somewhere else in you code you get a compile error because
    n
    might not have been initialized.This is not true, only local variables can cause a
    variable (a variable) might not have been initialized
    this is because all member fields are initialised with their default valuse. For example all pointers are intitialised to null, ints are intitialised to 0, booleans to false and so on.
    >
    So you need this:
    public class A {
    private final int a ;
    public A(int b) {
    this.a = b ;
    public A() {
    this(0) ; /* Calls the above constructor with some
    default parameter. */
    /* You can add some more code below but not above
    this(0) */
    Of course you know you are never calling the default
    constructor but it's still there so you need to
    ensure that the variables get initialized if some one
    calls it!
    As above classes can have no argument constructors
    Just add this to your code for example:
    public Tennisball() {
    this(0, 0, 0, 0, null) ;
    } Hope that helped you out!
    Thanks,
    Nikolas.
    PS any duke dollars would be much appreciated as i'm
    very poor at the moment :-)I dont mean to be offensive just thought I should clarify these points
    Michael

  • Newbie: Method should or should not have side effects

    Hi experts,
    What does it really mean when I read for the InputVerifier class that the method 'shouldYieldFocus' can have side effects but the method 'verify' should not have side effects.
    Thanks for you comments.
    tuckie

    I am but a newbie only asked to learn and maintain. The reason I ask about side effects is that the shouldYieldFocus() method is invoked twice for the same tab key event. When the tab key (or mouse click) wants to move focus to another input the current input's shouldYieldFocus() is invoked, it in turn invokes verify() which validates data returning true or false and checks to see if a warning should be issued that the data is legal but high. If the data is not high it also returns true and the focus is yielded. Also shouldYieldFocus() is only invoked once. It is when the data is high and the showConfirmDialog() is put up that I get the second shouldYieldFocus() invocation. The previous coder put in a de-bouncing mechanism and I think this is where/how the problems with the next field are created. Sometimes the next field's focusLost() is invoked without the operator making any input. The focusLost() does some fill in the blank things that are reasonable only if the operator really wanted not to fill in any data in the field.
    Back to my original point, I was wondering if the fact that the verify() method may have a dialog box put up before it returns to shouldYieldFocus() is the kind of thing that shouldn't be done - no side effects. If so then it could be the likely cause of the problem with the next field sometimes being automatically filled in as if it had received a focusLost() event.
    tuckie

  • Why Math class does not have any constructor.

    Math class does not have any constructor.
    But all the classes have a default constructor. Then why the math class is not having any constructor. Is math class having some other constructor or is the default constructor concept applicable only for user defined classes.

    Math class does not have any constructor.
    But all the classes have a default constructor. Then
    why the math class is not having any constructor. Is
    math class having some other constructor or is the
    default constructor concept applicable only for user
    defined classes.You cannot instantiate a new Math object, nor can you extend the Math class. All you can do is use Math's static methods and variables. Its a utility class, thats what its susposed to do.
    JJ

  • Applet - JavaPurse does not have a public constructor

    Hello,
    I'm starting playing with Javacard and I tried to compile a demo of Java purse Applet.
    I can compile it withou problem but once I try to start it with JBuilder 2006 I get the following error :
    The applet com.sun.javacard.samples.JavaPurse.JavaPurse does not have a public constructor com.sun.javacard.samples.JavaPurse.JavaPurse()
    Here is a part of my code
    public class JavaPurse extends javacard.framework.Applet {
    protected JavaPurse(byte[] bArray, short bOffset, byte bLength) {
    public static void install(byte[] bArray, short bOffset, byte bLength) {
    new JavaPurse(bArray, bOffset, bLength);
    Does anyone of you know why JBuilder is displaying this error message?
    Thanks in advance fo you reply.
    Alain.

    I don't think that's the error message; there is no class "java.awt.Applet". Are you sure it doesn't say "java.applet.Applet"?
    In any event, I don't know about javacard, but I suspect that javacard applets are not interchangeable with browser applets. My guess is that when JBuilder tries to build an applet, it's thinking about browser applets. Therefore it expects your applet to be a subclass of java.applet.Applet.
    I don't know how JBuilder works, but perhaps you can try using normal compilation instead of whatever JBuilder provides for applets.

  • GetCodeBase() generates "does not have a public constructor"

    I've been searching the net for days, and I seem to be the only guy with this problem. Here's the simple code:
    public class testapplet extends JApplet {
    public testapplet() {
    URL url = getCodeBase();
    I get the error message:
    The applet testapplet does not have a public constructor testapplet()
    I once had the same error message, but it was an entirely different problem. At that time, I made an JMenu[2] and somewhere in the code addressed JMenu[3];
    As I said, this has nothing to do with my current problem, but I get VERY frustrated when I get such an error.
    I'm running JBuilder6 on Win XP. Please help! desperate cry

    Damn, it helped. O_O Thanks a lot! As you can tell, I'm new to this. I was surprised since in my other program, I wrote a lot of stuff without that init procedure and it worked...
    Thanks again!

  • [svn] 1931: the ja_JP swc' s should not have been removed from the locales package, I' m adding them back in

    Revision: 1931
    Author: [email protected]
    Date: 2008-06-03 13:30:46 -0700 (Tue, 03 Jun 2008)
    Log Message:
    the ja_JP swc's should not have been removed from the locales package, I'm adding them back in
    Modified Paths:
    flex/sdk/trunk/build.xml

    Hi Manny1/mreider,
    First, I’m sorry to hear that you two may be having issues utilizing a recently purchased Gamers Club Unlocked (GCU) Gifting Card.
    In all reality, our stores don’t even need to exchange the Gifting Card for the standard GCU card, although that option should be available to you if absolutely needed. The GCU Gifting Card can be applied to your My Best Buy membership by simply following the directions on the back of the card.
    Thanks for sharing your feedback and I hope for a much better experience when you return to your local Best Buy to get this taken care of! If needed, please don't hesitate to ask for a manager or supervisor.
    Brian|Senior Social Media Specialist | Best Buy® Corporate
     Private Message

  • Warning: language 'class' does not have locator

    Hi,
    While deploying an application on WLS8.1 SP2 we get the following error/warning -
    Warning: language 'class' does not have locator
    <Jan 20, 2004 12:52:00 PM GMT+05:30> <Warning> <WLW> <000000> <Warning: language 'class' does not have locator>
    Can somebody please tell me why is this and how to get rid of it.
    Thanks,
    Maheep S. Bhalla
    [att1.html]

    Hello,
    This could be a bug, I would recommend contacting our marvelous support
    team [1] and reference CR117072. They will be able to sort out this
    issue.
    Regards,
    Bruce
    [1]
    http://support.bea.com
    [email protected]
    "Maheep S. Bhalla" wrote:
    Hi,
    While deploying an application on WLS8.1 SP2 we get the following
    error/warning -
    Warning: language 'class' does not have locator
    <Jan 20, 2004 12:52:00 PM GMT+05:30> <Warning> <WLW> <000000>
    <Warning: language 'class' does not have locator>
    Can somebody please tell me why is this and how to get rid of it.
    Thanks,
    Maheep S. Bhalla

  • 1st - itunes downloaded to my ipod albums that are all fractured, compilation albums are seperated.This should not have happened but itunes felt it knew better. I do not like it.

    1st - itunes downloaded to my ipod albums that are all fractured, compilation albums are seperated.This should not have happened but itunes felt it knew better. I do not like it.
    2nd - While trying to fix it, itunes made all albums and artists unknown
    3rd - While trying to get an answer I am unable to contact anyone or even send an email requesting an answer.
    4th - While trying to use the "fast lane" i ran into trying to find the product S/N, I went to my account and it was not there. I tried to see it on the back of the Ipod but had to find a magnifying glass to even read it.
    5th  -- The we will get back to you really ****** me off
    6th  -- I have wasted 2 hours to fix something that should not have happened and the situation is worse than when i started
    7Th  --- Itunes management of songs is terrible and there are NO instructions and even worse no support
    8th  ----  Apple is going down the toilet because the products are good, not great, and the itunes instructions are non existent
    9th  --- to even suggest i pay for product support is insulting and a sign that apple is desperate
    10th -The suggestion for online feedback is this; BE ON-LINE SUPPORT, NOT WHATEVER YOU CONSIDER IT TO BE NOW.

    I agree with stevejobsfan - (0123).
    However, if what you actually want to do is to fix/sort out your problem, why no try posting a question on that subject?
    For starters - you can re-name the tracks in your iTunes library, so it is possible to correct the changes that you must have made that mean that songs are now "unknown artists and albums."

  • I have two macs in my house.  One is newer and came with the os x mountain lion software and the other one needs to be upgraded.  I was wondering if there is a way to take upgrade from one to the other?  Should not have to buy this software again.

    I have two macs in my house.  One is newer and came with the os x mountain lion software and the other one needs to be upgraded.  I was wondering if there is a way to take upgrade from one to the other?  Should not have to buy this software again.

    Welcome to Apple Support Communities
    Buy it for the other computer. Mountain Lion is preinstalled on the new Mac, but you can only use it in the new one

  • I guess I should not have messed with my file sharing pref...now I'm toast

    I use my Airport to connect to my DSL.
    I was "messing around" with my SHARING configuration (Apple...System Pref....Sharing...) and did something awful. I no longer have wireless connection to my Verizon router. I can hook up and get online (as I'm doing now) with Ethernet , but not Airport.
    The Airport ICON is now GREY and has an ARROW (pointing UP) though it. Never seen that before.
    And when I click on the icon I can't find my net work. The other Macs in the house work fine with airport.
    Verizon tech support could not help.
    How can get my Sharing preference back to normal (I was trying and guessing how to connect my other imacs around my home , without really knowing what I was doing. And I did something in there to screw this up).
    Help please
    JON

    Sys Prefs Sharing should not have messed up your ability to connect wirelessly to your router.
    Click on the  on your menubar, click on "About This Mac" then click on "More Info..." Find "Airport Card" under "Network" and click on it. Does it say something like "No information found" or is your Airport card being recognized? If Airport is recognized as existing, I would next look in Sys Prefs Network, authenticate on the padlock in the lower lefthand corner, click on AIrport then click on Advanced, then check stuff in there, like on the Airport tab, is your home network listed there anymore? Try deleting it and readding it. Under TCP/IP, are you using DHCP (or whatever you use)? Or might it have gotten changed to a setting that is incompatible with your router's settings?
    To get the Sharing Prefs "back to normal," just uncheck all of the checkboxes in Sharing and it will be back in its OEM state.

  • I would like to reload the recent software update for iPad.  When bringing it back up I skipped the Apple ID step and should not have.

    I would like to reload the recent software update for iPad.  When bringing it back up I skipped the Apple ID step and should not have.

    You can sign in at the iTune and App Store.
    Settings>iTunes and App Store>Apple ID

  • I have a Power Book OS 10.4.11 and cant access my radio library.  I believe I deleted something I should not have. How do I reload Itunes and will I loose my music I loaded?

    I have a Power Book OS 10.4.11 and cant access my radio library.  I believe I deleted something I should not have. How do I reload Itunes and will I loose my music I loaded?  I do not have the original software.  I was trying to free up some memory and removed the wrong thing.

    If you mean the listing of internet streams that seems to have disappeared for many users of older iTunes versions over week ago. Probably some update at Apple broke older versions.  No idea if it will ever come back but you can open stream URLs you find on the web and save them in playlists.

Maybe you are looking for

  • Moving a folder, Linking between content areas

    I have 2 problems: 1) So far we developed all our content in a single content area. We would now like to split the information into multiple content areas. The MOVE or COPY command on the folder only allows me to copy within a content area. I have hu

  • Downloaded files from Firefox, opens temporary file instead of the new downloaded file?

    I have downloaded the same (but updated over time) file from dropbox many time. But when i try to download the updated version, Ecxel opens a temporary file. I know this, because i'm sure the file has been updated since last download, and when i down

  • MathML vs CS2, CS3

    Hi scripters Anyone give me an idea about MathML into Indesign process. Originally I am trying to create equations when I am importing XML+MathML into Indesign. Is this possible? Your comments are most welcome Thanks in advance regards a r u l

  • I need help please. Raw photo's.

    Ok. I took some sunset photo's in Raw.  I downloaded them on my computer. I couldn't view them on my PC. It wouldn't let me. A friend recommended lightroom 5 to view Raw photo's.  I purchased and installed and it own't import my raw photo's. It said

  • When will Apple update Safari to work with Yahoo! business mail?

    This doesn't seem right to have this issue with so many users and not have a fix.