8 Replies Latest reply: Apr 7, 2013 4:37 AM by TPD-Opitz RSS

    Syntax error, insert "AssignmentOperator Expression" to complete Expression

    user122479
      Hi experts,
      I am very new in Java. Currently, I get stuck in the exception of program. Please help me figure out what is the issue. The eclipse raises the error "Syntax error, insert "AssignmentOperator Expression" to complete Expression" at the command "exception;" as below code.

      Thanks,
      Hieu

      Edited by: user122479 on Apr 5, 2013 4:23 PM
        • 1. Re: Syntax error, insert "AssignmentOperator Expression" to complete Expression
          TPD-Opitz
          please add
          -tags around your code and the complete Stacktrace.
          
          bye
          TPD                                                                                                                                                                                
          • 2. Re: Syntax error, insert "AssignmentOperator Expression" to complete Expression
            rp0428
            Sorry - this forum doesn't provide help if it appears that the code being posted may not belong to the person posting.

            >
            break MISSING_BLOCK_LABEL_221;
            >
            That's the type of code you get when you try to decompile a class file and the decompiler you are using doesn't understand the code.

            If this is YOUR code you would already have the source file and wouldn't need to decompile it.
            • 3. Re: Syntax error, insert "AssignmentOperator Expression" to complete Expression
              user122479
              Hi TPD,
              I put
               as your advice, but it is still error. Can you please show me where is the issue? I am really new in Java, this code was developed by my colleague.
              
              Thanks,
              Hieu
              
              Edited by: user122479 on Apr 5, 2013 4:23 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
              • 4. Re: Syntax error, insert "AssignmentOperator Expression" to complete Expression
                rp0428
                >
                Can you please show me where is the issue? I am really new in Java, this code was developed by my colleague
                >
                No - it wasn't. That code was decompiled from a class file. No one puts statements like this in a source file
                break MISSING_BLOCK_LABEL_221; 
                I told you where the 'issue' is. That code is not Java, is invalid and indicates that the source was produced by decompiling a class file.

                If that code was really developed by your 'colleague' then you could get the real source code and it would not have those lines in it.
                • 5. Re: Syntax error, insert "AssignmentOperator Expression" to complete Expression
                  user122479
                  Hi,
                  My colleague sent me the WAR file, and open it with Eclipse using import functionality. Because I am new in Java, I do not know the importing functionality is call 'decompiling'. Anyway, I will remove all code.

                  Thanks,
                  • 6. Re: Syntax error, insert "AssignmentOperator Expression" to complete Expression
                    TPD-Opitz
                    user122479 wrote:
                    I put { code } as your advice, but it is still error.
                    You put the
                     tage in your *.java file?
                    
                    Oh dear!
                    
                    I think you should  take a few days to go trough the Java tutorials
                    http://docs.oracle.com/javase/tutorial/ starting at "Trails Covering the Basics"
                    
                    Then you should find a tutorial on your IDE to learn how to import a project.
                    
                    Programming is a craft.
                    And as with any craft you need some knowledge on your matter and training on your tools.
                    
                    A forum is not the right place to gather either one.
                    
                    bye
                    TPD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                    • 7. Re: Syntax error, insert "AssignmentOperator Expression" to complete Expression
                      gimbal2
                      TPD Opitz-Consulting com wrote:
                      Programming is a craft.
                      And as with any craft you need some knowledge on your matter and training on your tools.
                      Nice!
                      A forum is not the right place to gather either one.
                      Be gentle, it hurts when you are made to realize that you can't program by copy/pasting code together.
                      • 8. Re: Syntax error, insert "AssignmentOperator Expression" to complete Expression
                        TPD-Opitz
                        gimbal2 wrote:
                        TPD Opitz-Consulting com wrote:
                        Programming is a craft.
                        And as with any craft you need some knowledge on your matter and training on your tools.
                        Nice!
                        I only quoted uncle Bob: http://www.amazon.de/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

                        bye
                        TPD