title: Braces missing return statements?
body: <p>I'm currently writing a program where I have a string of methods all set up basically identical. If they're given i = 1, they'll return the price of the product times the quantity ordered. Otherwise, they simply returned the quantity ordered. Whenever I attempt to compile it, however, the compiler says that the brackets are missing return statements. I've gone through the code several times and I don't see anything overtly wrong in the syntax. Any guesses as to why this is happening?</p>
  
  <p>Thank you for any help.</p>
  
  <p>Relevant Source:    </p>
  
  <pre><code>private class ButtonListener implements ActionListener {
          public void actionPerformed(ActionEvent e)
          {
              if (e.getSource() == switchCard)
              {
                  cl.show(infoPanel, (String)candyList.getSelectedValue());
              }
  
          if (e.getSource() == checkoutButton)
          {
              double acidPops = acidPopsTotal(1);
              double bertieBotts = bertieBottsTotal(1);
              double bloodPops = bloodPopsTotal(1);
              double cauldronCakes = cauldronCakesTotal(1);
              double charmChoc = charmChocTotal(1);
              double chocoballs = chocoballsTotal(1);
              double chocCauldrons = chocCauldronsTotal(1);
              double chocFrogs = chocFrogsTotal(1);
              double chocWands = chocWandsTotal(1);
              double roachClusters = roachClustersTotal(1);
              double crystalPineapple = crystalPineappleTotal(1);
              double droobleGum = droobleGumTotal(1);
              double explodeBonbons = explodeBonbonsTotal(1);
              double fizzWhiz = fizzWhizTotal(1);
              double iceMice = iceMiceTotal(1);
              double jellySlugs = jellySlugsTotal(1);
              double liquorWands = liquorWandsTotal(1);
              double pepImpts = pepImpsTotal(1);
              double pinkIce = pinkIceTotal(1);
              double shockChoc = shockChocTotal(1);
              double spindleSpiders = spindleSpidersTotal(1);
              double quills = quillsTotal(1);
              double wizochoc = wizochocTotal(1);
          }
      }
  
      double acidPopsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (5.95* (Integer.parseInt(acidPopsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(acidPopsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double bertieBottsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (16.95 * (Integer.parseInt(bertieBottsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(bertieBottsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double bloodPopsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (5.95 * (Integer.parseInt(bloodPopsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(bloodPopsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double cauldronCakesTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (14.95 * (Integer.parseInt(cauldronCakesTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(cauldronCakesTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double charmChocTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (5.95 * (Integer.parseInt(charmChocTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(charmChocTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double chocoballsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (9.95 * (Integer.parseInt(chocoballsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(chocoballsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double chocCauldronsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (14.95 * (Integer.parseInt(chocCauldronsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(chocCauldronsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double chocFrogsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (14.95 * (Integer.parseInt(chocFrogsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(chocFrogsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double chocWandsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (9.95 * (Integer.parseInt(chocWandsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(chocWandsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double roachClustersTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (5.95 * (Integer.parseInt(roachClustersTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(roachClustersTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double crystalPineappleTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (9.95 * (Integer.parseInt(crystalPineappleTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(crystalPineappleTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double droobleGumTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (2.95 * (Integer.parseInt(droobleGumTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(droobleGumTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double explodeBonbonsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (9.95 * (Integer.parseInt(explodeBonbonsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(explodeBonbonsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double fizzWhizTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (9.95 * (Integer.parseInt(fizzWhizTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(fizzWhizTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double iceMiceTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (5.95 * (Integer.parseInt(iceMiceTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(iceMiceTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double jellySlugsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (2.95 * (Integer.parseInt(jellySlugsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(jellySlugsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double liquorWandsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (9.95 * (Integer.parseInt(liquorWandsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(liquorWandsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double pepImpsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (4.95 * (Integer.parseInt(pepImpsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(pepImpsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double pinkIceTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (4.95 * (Integer.parseInt(pinkCocoIceTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(pinkCocoIceTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double shockChocTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (4.95 * (Integer.parseInt(shockChocTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(shockChocTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double spindleSpidersTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (4.95 * (Integer.parseInt(spindleSpidersTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(spindleSpidersTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double quillsTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (1.95 * (Integer.parseInt(sugarQuillsTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(sugarQuillsTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  
      double wizochocTotal(int i)
      {
          if (i == 1)
          {
              try
              {
                  return (5.95 * (Integer.parseInt(wizochocTF.getText())));
              }
              catch (NumberFormatException e) {}
          }
          else
          {
              try
              {
                  return Integer.parseInt(wizochocTF.getText());
              }
              catch (NumberFormatException e) {}
          }
      }
  }
  </code></pre>
  
  <p>Errors:</p>
  
  <pre><code>C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:490: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:510: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:530: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:550: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:570: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:590: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:610: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:630: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:650: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:670: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:690: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:710: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:730: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:750: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:770: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:790: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:810: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:830: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:850: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:870: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:890: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:910: error: missing return statement
          }
          ^
  C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java:930: error: missing return statement
          }
          ^
  Note: C:\Users\Sam\Desktop\Java\4H 2012\ClientApp.java uses unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.
  23 errors
  </code></pre>