eclipse - Error compiling a java into ,class (goto) -


this first time editing program made in java, know how program in php, problem i'm editing program done in java, done dedicated myself add few lines of code extend capabilities (copy , paste ) have webscraper.class file , decompile , convert java edit ,when compile following error:

i tested eclipse , when give run nothing , tried changing version of jdk , nothing tried on computer , still nothing , i've been reading on previous responses due "goto " have not managed fix , since not know how part must programmed compiled. appreciate help, or tell me how use eclipse or put fix mistakes have.

c:\users\tecnicom\downloads\prog>javac webscraper.java webscraper.java:99: error: illegal start of expression         if (i >= 3) goto _l2; else goto _l1                     ^ webscraper.java:99: error: not statement         if (i >= 3) goto _l2; else goto _l1                          ^ webscraper.java:99: error: 'else' without 'if'         if (i >= 3) goto _l2; else goto _l1                               ^ webscraper.java:99: error: illegal start of expression         if (i >= 3) goto _l2; else goto _l1                                    ^ webscraper.java:99: error: ';' expected         if (i >= 3) goto _l2; else goto _l1                                            ^ webscraper.java:143: error: illegal start of expression           goto _l3           ^ webscraper.java:144: error: ';' expected _l2:    ^ 7 errors 

i'll show part of code show error:

  static hashtable parsefirmwarepage(string s)     {         matcher matcher = pattern.matcher(s);         hashtable hashtable = new hashtable();                 {             if(!matcher.find())                 break;             string s1 = matcher.group(1);             if(s1 != null && s1.trim().length() != 0 && displayfields.contains(s1))             {                 string s3 = matcher.group(2);                 if(s3 != null && s3.trim().length() != 0 && !s3.tolowercase().contains("todo"))                     hashtable.put(matcher.group(1), s3);             }         } while(true);         string s2 = string.format("%s_%s", new object[] {             hashtable.get("device"), hashtable.get("build")         });         if(s2.equalsignorecase("ipod11_7e18"))             hashtable.put("downloadurl", "ipod1,1_3.1.3_7e18_restore.ipsw");         return hashtable;     }      static string wikimarkupforpage(string s)     {         int = 0; _l3:         if(i >= 3) goto _l2; else goto _l1 _l1:         if(i != 0)         {             gui.error("the iphone wiki seems bit down; retrying in %d sec..", new object[] {                 integer.valueof(30)             });             try             {                 thread.sleep(30000l);             }             catch(interruptedexception interruptedexception)             {                 gui.exc(interruptedexception);             }         } 

goto keyword has no use. has use in other language such c or c++, not java.

the keywords const , goto reserved, though not used. may allow java compiler produce better error messages if these c++ keywords incorrectly appear in programs.

given it's tough should since don't know code structure, consider this:

  • goto in general used jump specific identifier. may want replace method call instead.
  • think natural flow of program, if not in oo fashion, @ least through procedural fashion. oo can come on second revision of code.

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -