W1512 Code Labels Inside Method Are Not Unique
[Previous]  [Next] 
|
User Manual [Previous]  [Next] W1512 Code Labels Inside Method Are Not UniqueWarning reporting that code labels inside methods should have unique names.Code Labels allow aspects to inject code in specific locations inside method bodies. However, the code injection is only applied to the first encountered label. Therefore, a code label should not be reused multiple times (inside a method). If you encounter this warning, you can easily rename code labels with unique names for each label inside the method body. Exampleclass CodeLabelExample { void methodToDoSomething() { //code Label1: ; int x=0; //code Label1: ; x++; } // aspect injection in a code label. after Label1:methodToDoSomething { int y =0; } } // @@@skipcompile - injects code in impossible place Load the above code into UmpleOnline |