Hope the system can exit the void function HandlePostwhen condition 1 is encountered, so I add returnafter DoSomething1().
But Android Studio will tell me that the "return" information is redundant as the last statement in the "void" method!
private void HandlePost(IHTTPSession session){
try {
Map<String, String> files = new HashMap<String, String>();
session.parseBody(files);
String deleteValue=session.getParms().get("ActionDelete");
if (deleteValue!=null){
DoSomething1();
return;
}
String copyValue=session.getParms().get("ActionCopy");
if (copyValue!=null){
DoSomething2();
return;
}
} catch (Exception e) {
Utility.LogError("This is an error "+e.getMessage() );
}
}
source
share