Why customize application exception this way?

hi
i found too different ways to customize a same application exception
they actually work the same way but with a little difference that i can not figure out why
the first one is
public class BaseAppException extends Exception {
    static final long serialVersionUID = -5829545098534135052L;
     * the message of the BaseAppException.
    private String exceptionMessage;
     * A public constructor for BaseAppException containing no arguments.
    public BaseAppException() {
     * A public constructor for BaseAppException specifying exception message.
     * <p>
     * @param msg
     *            exception message.
    public BaseAppException(String msg) {
        this.exceptionMessage = msg;
    }it uses a private member "exceptionMessage" to store the exception message
and here is the second piece of code
public class BaseAppException extends Exception {
    static final long serialVersionUID = -5829545098534135052L;
     * A public constructor for BaseAppException containing no arguments.
    public BaseAppException() {
     * A public constructor for BaseAppException specifying exception message.
     * <p>
     * @param msg
     *            exception message.
    public BaseAppException(String msg) {
         super(msg);
//        this.exceptionMessage = msg;
    }this one passes the message to the base throwable
both works but i am wondering why define a private string memeber for message storing and not pass it to the base throwable??

I'm not sure what you're trying to do here, but at
first glance "TestK t = new TestK();" inside the for
loop seemed unusual.
If you place it before the loop it works fine.I guess what he is trying to ask is that why is that if you use the new operator in the code, you donot get the exception while if you dont use it you do get one. While in any case either you use it or not you are supposed to get a new String as per the String API.
Well thats an interesting observation and I have no explanation as to why is this happening. I do remember that thread where somebody pointed this out as a use of the String(String original) construtor. Furtehr adding on to that the API states about this constructor the following
Initializes a newly created String object so that it represents the same sequence of characters as the argument; in other words, the newly created string is a copy of the argument string.
so I donot get why not using it would cause the exception to be thrown. I have tested the code though and it seems to behave as pointed in the original post.
Interesting question though, food for thought.

Similar Messages

  • Combobox in array--why does it work this way?

    I have attached a snippet of a subVI I'm using to initialize the items and set the values of comboboxes in an array. I modified it slightly so the array being referenced is on this block diagram, not a top level diagram. It took me a while to come to this solution; before I had the combobox part in a for loop and was trying to loop through each array element, get a reference to that element, and set the strings[] and value properties but it was acting all wacky. Then I changed it to the way below and it automatically populates all the comboboxes with the correct values, and then sets their values each to be different (which is what I want!) My question is, why does it work this way? I understand all elements in an array need to be the same (although I did find a work around here.), but the part about setting the values to each be different I was trying to do manually with a property node and a value property, when I realized the combobox just handles it all itself. Is this just a feature of a combobox in an array I need to note for future reference? 
    edit: I noticed the testers array reference label changed, so hopefully it's still referencing the same control. You may need to relink it.
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    combobox in array snippet.png ‏29 KB

    nathand wrote:
    Ben wrote:
    nathand wrote:
    You cannot get a reference to an individual element in an array control.  The ArrayElem reference will always refer to the same control regardless of what array index is visible.  This isn't specific to a combo-box, every array works like this.
    I have not tested it lately but as of the time of this Nugget I found that it will point to the top left visable array element.
    The ArrayElem property always returns the same reference no matter which element of the array is in the top-left corner, as demonstrated by the code below (screenshot instead of snippet to avoid mangled references and property nodes).
    Yes that is true but the value returned when using a property node >>> value will return the top left displayed value. In the code included in that Nugget, I set the size of the control such that it only shows a single element then by manipulating the index control I can raed each element in the array.
    At least that is how it behaved back in the day of that nugget.
    Yes, my wife left me home alone with a case of beer and LV to find that tidbit. I suspect that feature will one day disapear without anyone noticing.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • AffineTransform.Concatenate: Anyone got a clue why they do it this way?

    For those who don't know, AffineTransforms need to be built backward. In other words, you start with the last operation, then add the second to last one, etc etc.
    For more information, see AffineTransform.concatenate and preConcatenate.
    Question: Wouldn't it be more intuitive to do it the other way, and use preConcatenate in the rotate/translate etc methods? It looks like you could just switch the order the matrices are multiplied in... Is there any reason that it's been set up this way?
    I think maybe I learned why somewhere, but I've forgotten...

    tjacobs01 wrote:
    For those who don't know, AffineTransforms need to be built backward. In other words, you start with the last operation, then add the second to last one, etc etc.
    For more information, see AffineTransform.concatenate and preConcatenate.
    Question: Wouldn't it be more intuitive to do it the other way, and use preConcatenate in the rotate/translate etc methods? It looks like you could just switch the order the matrices are multiplied in... Is there any reason that it's been set up this way?
    I think maybe I learned why somewhere, but I've forgotten...You can think of the affine transformations as forming a stack. At the bottom is the user space-to-device space transformation. This transformation may be the identity transformation or it may be something else (e.g a translation from the top left corner of the screen to the top left corner of the component that you are paining). What it is depends on the platform (Unix/Linux, Windows, Mac OS X), and an application programmer doesn't need to care what it is, only that it is there and must be kept there. To keep this transformation at the bottom of the stack, you need to add other transformations above it. The transformations are applied in a top-down order, with the transformation at the bottom applied last.
    Now, the stack is not a real stack but a product of transformation matrices. Last transformation applied (i.e., the user space-to-device space transformation) is the leftmost matrix in this product (as defined in linear algebra). Additional transformations are right-multiplied, i.e. concatenated. If they had been pre-concatenated, then the user space-to-device-space transformation would not be the last transformation applied.

  • Edge feather - why is it done this way?

    I wanted to feather the edge of a clip in Motion just like I've done in FCP. I went to the "crop" parameters in Motion expecting to find the edge feather option just like FCP . . .it wasn't there.
    I figured out that I have to apply a mask first and then feather the mask.
    I'm just wondering why it would be done this way in Motion. I can understand that a mask would be more versatile, but why not include a simple "edge feather" option for those frequent times that someone would just want a quick feather?
    Just curious. Any thoughts about that?
    Thanks!

    Jeff Geisel wrote:
    My plan for next time was to feather the edge in FCP then export as Quicktime Movie. Then import the movie into Motion.
    That's just silly, Jeff. You're adding three steps in FCP to avoid ONE step in Motion. On top of that, you're engaging in destructive editing to do so.
    Far be it from me to try to change a person's "workflow", but I suggest again that you'll be happier in the long run learning how to feather in Motion.
    Andy

  • Branching View - Why does it appear this way?

    This is my first large project with Captivate 3 and I am
    trying to create a storyboard. I need to show my manager/client the
    branching view so they can follow along. What I created was a menu
    page that allows the users to go to many different subjects in no
    particular order. At he end of ech subject, I created a button that
    sends the user back to a COPY of the menu so the user doesn't have
    to hear a repeat of the audio every time the go back to the menu
    page and select a new subject. The problem is in the branching
    view....for some reason, the duplicate menu page appears at the end
    of line "A" or after slide 13 instead of following slide 5 (menu
    slide).
    Any thoughts on how to move this? Or, does anyone have a
    better idea than creating this copied slide?
    Thanks.

    nathand wrote:
    Ben wrote:
    nathand wrote:
    You cannot get a reference to an individual element in an array control.  The ArrayElem reference will always refer to the same control regardless of what array index is visible.  This isn't specific to a combo-box, every array works like this.
    I have not tested it lately but as of the time of this Nugget I found that it will point to the top left visable array element.
    The ArrayElem property always returns the same reference no matter which element of the array is in the top-left corner, as demonstrated by the code below (screenshot instead of snippet to avoid mangled references and property nodes).
    Yes that is true but the value returned when using a property node >>> value will return the top left displayed value. In the code included in that Nugget, I set the size of the control such that it only shows a single element then by manipulating the index control I can raed each element in the array.
    At least that is how it behaved back in the day of that nugget.
    Yes, my wife left me home alone with a case of beer and LV to find that tidbit. I suspect that feature will one day disapear without anyone noticing.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Common Language runtime debugging services - Application exception

    I have a add-on application working on 2005A patch 08. One of our client's site I have a strange problem. The addon works on the test server bur on the production server, after install, it gives me the following error:
    Common Language runtime debugging services.
    Application has generated an exception that could not be handled.Process Id 0x98(2328), Thread id 0x3a4(932)
    Can somebody help me?
    I can use test server as client and point the company to the production server and it works fine. What could be missing on production server client? I am using the same ard and exe files for the addon on test server as well as production server.

    Hi Ibai Peña,
    My application goes this way:
    1. Connect to UI api.
    2. Set culture info.
    3. connect to DI api.
    I have placed messageboxes everywhere to b4 and after to see at what point it is failing. but I don't reach there at all.  I get error b4 my first messagebox.
    On test server, the system was on 2004 and now upgraded to 2005. On production server, it is 2005.
    But my application runs on other 2005 clean install machines. We tried uninstalling SAP B1 completely and loading it again but everytime I get the same error.
    Regards.
    Prakash

  • Why do applications have to be packaged for each distribution?

    Hi,
    Sorry this is probably a stupid question, but i don't understand why it's necessary for each application to be packaged (and patched) by each distribution.
    Example: (as i understand it) Mozilla Firefox. Arch has it's own version derived from Mozilla's, and so do the other distributions with their own variations.
    Is anyone able to explain how this works and why it's done this way?
    Bonus points: If anyone has a link to an article explaining in detail, would be very interesting to read

    When packaging software there are a bunch of questions you're facing. Many have been mentioned before.
    This starts with the compile-time configuration regarding which parts of the software should be compiled/used, eg some libraries can use different backends and you can only choose one. Sometimes it's even a matter of licensing. Some distros like to enable experimental features if they don't break the rest of the software, some let you choose (like gentoo's useflags mentioned above).
    Filesystem layouts differ: Some prefer /usr/lib/pkgconfig, some /usr/share/pkgconfig; some like /usr/libexec, some don't, some (eg FreeBSD, which isn't linux but with regard to package management faces the same questions) use /usr/local for packages. Some distinguish between binary-only packages by putting them into /opt, some don't. Some actually have /bin, /usr/bin and /usr/local/bin as separate directories
    Or you might go a completely different way, too, nobody's forcing you to stick to "standards". I'd also like to point to haiku, also not a linux distro, but there too you have most of the same software packages available, which have to follow different directions there, too.
    Default configurations: Some get patched (themed for the distro or for other reasons), some don't.
    Init systems: Gentoo (at least last time I checked) defaults to openrc. Most people do not provide openrc scripts in their source repositories, so the packager is responsible for creating these.
    Gentoo actually brings up another thing: it allows for some packages to have multiple versions installed, and you can use them explicitly and/or switch your default with `eselect`. (It probably does more than that, I haven't used gentoo in years.) For this of course you need to package your software in a certain way. Eg put your binaries and libraries into a separate folder and symlink them to their desired locations, rather than installing them there directly, since they'd be overwritten by the other versions of the package...

  • Why do i get this exception?

    Hi,
    i have a CompanyVO class, wich also has members such AddressVO, UserVO. As you can see, i have some other value objects inside CompanyVO.
    When i do this:
    CompanyVO companyVO = new CompanyVO();
    BeanUtils.copyProperties(companyVO, customCompanyVO);CustomCompanyVO is an object that has only "direct" properties of CompanyVO, stuff like companyName, companyID, companyType (basically all of them are String).
    But when i do this.
    CompanyVO companyVO = new CompanyVO();
    BeanUtils.copyProperties(companyVO, customCompanyVO);
    BeanUtils.copyProperties(companyVO.getAddressVO(), addressVO);I get the following excetion just on the third line (note the addressVO contain the values to be transfered to AddressVO, wich a VO inside the CompanyVO, as i said).
    java.lang.IllegalArgumentException: No destination bean specified
    at org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:220)
    at ltcmelo.session.RegisterCompanyBean.saveCompanyAddressInfo(RegisterCompanyBean.java:157)
    So, if i already initialize the companyVO doesn't the addressVO and the userVO memers have to be initialized too ???
    This way i'm force to do such thing.
    CompanyVO companyVO = new CompanyVO();
    BeanUtils.copyProperties(companyVO, customCompanyVO);
    AddressVO auxAddressVO = new AddressVO();
    BeanUtils.copyProperties(auxAddressVO, addressVO);
    companyVO.setAddressVO(auxAddressVO);Is there a better option????

    No, no, no....
    There's a misunderstanting here! Sorry, it's my fault!
    addressVO is already initialized and populated with data.
    BUT, the addressVO that is a member of companyVO is NOT !!!
    Using BeanUtils, i'm trying to populate what's FROM addressVO (wich contains data) TO companyVO.getAddressVO (wich has not been initializes).
    So, i thought the i could initialize companyVO.getAddressVO in the way, but as i get the exception, it seems that it's not possible.
    My question is WHY is it not possible??? It seems ok to me to copy addressVO to companyVO.getAddressVO in that way.

  • When using office for mac or i studio after inserting several pictures, my computer locks up and the only way I can fix it is to do a force quit.  Why does it do this and how I I get it fixed without a force quit?

    I have a mac book, with office for mac and iStudio installed.  When I try to create a document using either one of these; after inserting several photos, the computer locks up and the only way I can get it to unlock is to do a force quit.  Why does it do this, and how can I get it to unlock without having to do a force quit?

    Are you using versions of the software that are compatible with the version of OS X you have installed? Very often such lockups are caused by application incompatibility.
    The problem may also come from trying to use both sets of applications at the same time while not having enough RAM installed. Adding more RAM may fix the problem.
    The problem can arise from corrupted support files such as preference files or Application Support files or corrupted cache files.
    The image files you are using may also be corrupt thus causing the problem.
    You might start with:
    Kappy's Personal Suggestions for OS X Maintenance
    For disk repairs use Disk Utility.  For situations DU cannot handle the best third-party utilities are: Disk Warrior;  DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible. TechTool Pro provides additional repair options including file repair and recovery, system diagnostics, and disk defragmentation.  TechTool Pro 4.5.1 or higher are Intel Mac compatible;  Drive Genius is similar to TechTool Pro in terms of the various repair services provided.  Versions 1.5.1 or later are Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.  Dependence upon third-party utilities to run the periodic maintenance scripts had been significantly reduced in Tiger and Leopard.  These utilities have limited or no functionality with Snow Leopard or Lion and should not be installed.
    OS X automatically defragments files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems.
    I would also recommend downloading the shareware utility TinkerTool System that you can use for periodic maintenance such as removing old log files and archives, clearing caches, etc.  Other utilities are also available such as Onyx, Lion Cache Cleaner, CockTail, for example.
    For emergency repairs install the freeware utility Applejack.  If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the commandline.  Note that AppleJack 1.5 is required for Leopard. AppleJack 1.6 is compatible with Snow Leopard. There is no confirmation that this version also works with Lion.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand. I also recommend booting into safe mode before doing system software updates.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    Backuplist
    Carbon Copy Cloner
    Data Backup
    Deja Vu
    iBackup
    JaBack
    Silver Keeper
    MimMac
    Retrospect
    Super Flexible File Synchronizer
    SuperDuper!
    Synchronize Pro! X
    SyncTwoFolders
    Synk Pro
    Synk Standard
    Tri-Backup
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac Maintenance Quick Assist.
    Referenced software can be found at CNet Downloads or MacUpdate.

  • When I sync my ipod to add new material, sometimes itunes will automatically rearrange the song order of my pre-existing albums by number of plays. Why does it do this? And is there a way to stop it?

    When I add an album to itunes and subsequently to my ipod, everything is arranged by track number of the album. Sometimes when I sync in order to add new material to my ipod, itunes for some reason automatically rearranges some of my pre-existing material by songs with the greatest number of plays to least (though sometimes it seems to be completely random). When I check itunes on my computer, everything still appears to be in order but the way it appears on the device often is in the previously mentioned disorder. Why does it do this? Is there any setting that I can adjust to make it stop because the only way I've found so far is to delete the rearranged material and re-import the cd and then re-sync. It might sound picky, but I prefer that my music be in order by track number as the artists themselves intended for various reasons the foremost being that I often listen to whole albums from start to finish and this glitch makes such problematic. I have found some settings in preferences that focus on how material is arranged but this seemed to be focused on the actual folders where the music is located on my hard drive and not the way it appears on the ipod. If anyone knows the reason it does this or has suggestions on fixing it, I would be greatly appreciative. Thanks.

    Did the original songs that do not appear on the car player play in the Music app on the iPod? Sometimes glitches happen and they do not. Also, If y ohave a 5G iPod/iOS 7, purchase songs  will show with an cloud icon by them if they are not downloaded if Shall All is turned on in Settings>iTunes and App Store

  • When I import a commercial CD itunes will create 2 identical albums and put all of the songs except one into one album and put the other song into the other album by it self. How can I combine them all into one album and why is itunes doing this?

    When I import a commerical CD Itunes will create 2 identical albums and put all of the songs except one into one album and put the other song into the second album that it created.  Why is itunes doing this and what can I do to combine them into one album?

    I found this to be somewhat helpful: Grouping Tracks into Albums
    What I did was to put in the same name for Album Artist in every track.  That seemed to do the trick (previously all those fields were empty).  It seems like a lot of work for a simple thing.
    iTunes knows (or should know) that these tracks were imported from one CD. So why is it relying on incomplete data from the gracenote database?

  • My cellcom line doesn't work with my iPhone here in Israel, why? Is there any way I can solve this issue?

    My cellcom line doesn't work with my iPhone here in Israel, why? Is there any way I can solve this issue?

    Please explain.
    What does "cellcom line doesn't work with my iPhone" mean?
    What are you trying?  What is happening?
    Where did you buy the iphone?
    Any info abnout your issue at all?

  • I received an error "iTunes requires 64-bit mode" says to go into my iTunes application and 'uncheck' the 'open in 32-bit mode' checkbox - i went into the application and the box was not checked anyway so why am i getting this prompt?  Never happened b4

    i received an error message "iTunes requires 64-bit mode" says to go into my iTunes application and 'uncheck' the 'open in 32-bit mode' checkbox - i went into the application and the box was not checked anyway so why am i getting this prompt?  Never happened before. yesterday did the sofware update for maverick.

    Thank you for your response, Chris. But I'm afraid I have to disagree. There are native 64 bit versions of iTunes available for OSX and Windows.
    In a 64 Bit Windows environment native 64 Bit Applications install the DLL's in a directory called "Program Files" and a directory called "Program Files (x86)" (32 Bit applications only use the ladder).
    iTunes 9 is consistent with this behavior - and it identified itself to the system as a 64 bit application (meaning it's process appears without a "*32" tag on it).

  • I have a problem: every time when i want to download free apple applications in the apple store, apple store asks me which type of credit card i want to use. Why did it ask this question?

    i have a problem: every time when i want to download free apple applications in the apple store, apple store asks me which type of credit card i want to use. Why did it ask this question?

    If you are within 14 days of purchase you can still return the iPhone and get the phone that suits your needs, however, I think you will find that no matter which phone you get the content provider will want to know how you are going to pay for future purchases. For Android phones it is Google, and they will certainly want to know.
    To create an Apple account without a credit card see: http://support.apple.com/kb/HT2534

  • HT201109 Why am I getting this message when I am signed in with the account that I purchased it I don't have another account I'm not sure what's going on here's the message I keep getting my:"To update this application sign into the account you used to pu

    I am trying to update my Final Cut Pro X which I have done many times before.
    Why am I getting this message now?
    --- here's the message I keep getting every time I  try to download the update--
    "To update this application sign into the account you used to purchase it"
    I am signed in with the account that I purchased it I don't have another account I'm not sure what's going on

    Open up iTunes. Go to Store. Go to Account and sign in. Click on Purchase History. Find your purchase record.
    Good luck
    Russ

Maybe you are looking for