Home | History | Annotate | Download | only in smali
      1 # /*
      2 #  * Copyright (C) 2015 The Android Open Source Project
      3 #  *
      4 #  * Licensed under the Apache License, Version 2.0 (the "License");
      5 #  * you may not use this file except in compliance with the License.
      6 #  * You may obtain a copy of the License at
      7 #  *
      8 #  *      http://www.apache.org/licenses/LICENSE-2.0
      9 #  *
     10 #  * Unless required by applicable law or agreed to in writing, software
     11 #  * distributed under the License is distributed on an "AS IS" BASIS,
     12 #  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 #  * See the License for the specific language governing permissions and
     14 #  * limitations under the License.
     15 #  */
     16 #
     17 # public class Main {
     18 #   public static void main(String[] s) {
     19 #     Subtype s = new Subtype();
     20 #     try {
     21 #       s.callPackage();
     22 #       System.out.println("No error thrown!");
     23 #     } catch (IncompatibleClassChangeError e) {
     24 #       System.out.println("Recieved expected ICCE error!");
     25 #     }
     26 #   }
     27 # }
     28 
     29 .class public LMain;
     30 
     31 .super Ljava/lang/Object;
     32 
     33 .method public static main([Ljava/lang/String;)V
     34     .locals 3
     35 
     36     new-instance v0, LSubtype;
     37     invoke-direct {v0}, LSubtype;-><init>()V
     38     sget-object v2, Ljava/lang/System;->out:Ljava/io/PrintStream;
     39     :try_start
     40         invoke-virtual {v0}, LSubtype;->callPackage()V
     41         const-string v1, "No error thrown!"
     42         invoke-virtual {v2, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
     43         return-void
     44     :try_end
     45     .catch Ljava/lang/IncompatibleClassChangeError; {:try_start .. :try_end} :error_start
     46     :error_start
     47         const-string v1, "Recieved expected ICCE error!"
     48         invoke-virtual {v2, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
     49         return-void
     50 .end method
     51