title: How to rewrite Java [continue <label> and break <label>] in C#?
body: <p>In Java it's written like this.. when I was porting this code... realizied there is no such thing as
  <code>break &lt;label&gt;</code> and <code>continue &lt;label&gt;</code>.</p>
  
  <p>I know those commands were not included because there HAS to be a cleaner way of doing this when using a goto with a command..</p>
  
  <p>But I ended up using.. the C# code below any way to rewrite it cleaner?</p>
  
  <p><strong>Java Code</strong></p>
  
  <pre><code>for(JClass c : classes) {
      for(JMethod m : c.getMethods()) {
          JCode code = m.getCode();
          if(code == null)
              continue;
          label: for(int index = 0; index &lt; code.getExceptionLookupTable().length; index++) {
              JException e = code.getExceptionTable().get(index);
              for(int index2 = e.getStartIndex(); index2 &lt; e.getEndIndex(); index2++)
                  if(code.getInstruction(index2).getOpcode() == NEW &amp;&amp; ((NEW) code.getInstruction(index2)).getType().equals("java/lang/RuntimeException"))
                      continue label;
                  if(e.getCatchTypeClassName().equals("java/lang/RuntimeException")) {
                      for(int index = e.getHandlerIndex(); index &lt; code.getInstrLength(); index++) {
                          JInstruction instr = code.getInstruction(index);
                          if(instr.getOpcode() == ATHROW)
                              break;
                          else if(instr instanceof ReturnInstruction)
                              break label;
                      }
                      removeStuff(code, ei--);
                  }
              }
      }
  }
  </code></pre>
  
  <p><strong>C# Code.</strong></p>
  
  <pre><code>foreach(JClass c in classes) {
      foreach(JMethod m in c.getMethods()) {
          JCode code = m.getCode();
          if(code == null)
              continue;
  
          for(int index = 0; index &lt; code.getExceptionTable().Length; index++) {
              bool continueELoop = false;
              bool breakELoop = false;
              JException e = code.getExceptionTable().get(index);
              for(int index2 = e.getStartIndex(); index2 &lt; e.getEndIndex(); index2++) {
                  if(code.getInstruction(index2).getOpcode() == JInstructions.NEW &amp;&amp; ((NEW) code.getInstruction(index2)).getType().Equals("java/lang/RuntimeException")) {
                      continueELoop = true;
                      break;
                  }
              }
              if(continueELoop) continue;
  
              if(e.getCatchTypeClassName().Equals("java/lang/RuntimeException")) {
                  for(int index = e.getHandlerIndex(); index &lt; code.getInstrLength(); index++) {
                      JInstruction instr = code.getInstruction(index);
                      if (instr.getOpcode() == JInstructions.ATHROW) {
                          break;
                      } else if (isReturnInstruction(instr)) {
                          breakELoop = true;
                          break;
                      }
                  }
                  removeStuff(code, ei--);
              }
              if (breakELoop) break;
          }
      }
  }
  </code></pre>
  
  <p>You can see when looking at the Java version then looking at the ported C# version.. the clean feeling goes away. Did I make some mistakes that can make the code shorter? or nicer looking? thanks for the help.</p>