Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6856711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:55:14+00:00 2026-05-27T01:55:14+00:00

using jdk 1.7 (so i can use String switches and the multicatch) when running

  • 0

using jdk 1.7 (so i can use String switches and the multicatch)

when running my code through sonar i got the following message:

switch (extension) {  

Switch statement found where default case is missing

i understand what its saying but it is not right see my code below:
Why am i getting this error.

private void handlefileformats(String location) {
    try {
        String extension = location.substring(location.length() - 4);
        switch (extension) {
        case ".xml":
                      logger.info(LoggerMessages.getLoadxml());
                      break;
        case ".txt":
        case ".csv":
                      logger.info(LoggerMessages.getLoadcsv());
                      break;
        default:
            throw new IncorrectFileException(location, sets);
        }
    } catch (IOException || IncorrectFileExceptione) {
        logger.fatal(LoggerMessages.getException(), e);
        return null;
    }
}

p.s. the code above is a simplified version of the original thats why i do not use the else if.

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:55:15+00:00Added an answer on May 27, 2026 at 1:55 am

    Indeed Java7 will be supported in Sonar 2.12.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First a little background, I'm using jdk 1.6. I've got a 2 column table
Using PyObjC , you can use Python to write Cocoa applications for OS X.
I'm using Jackson 1.6.4 and Java JDK 6. I don't want to use Jackson
I am using JDK 1.6.0.18 for my Swing application. I am experiencing very different
This is using the Backberry JDK (5.0 if needed). I have a custom Manager
I'm writing a Java application that runs on Linux (using Sun's JDK). It keeps
Using IE 7, JDK 1.6 and Sun Web server 7. Inside the jsp form,
I am using JAXB 2.0 JDK 6 in order to unmarshall an XML instance
I'm using intelliJ IDEA version 9.0.1 build #IU 93.94 with JDK 1.6.0_17. This error
I’m not sure how to use Java/JDBC to insert a very long string into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.