mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
show warnings if "MockView cannot be casted to ViewGroup" exception occurs
This commit is contained in:
+5
-1
@@ -425,14 +425,18 @@ public class AndroidLayoutPreviewToolWindowManager implements ProjectComponent {
|
||||
catch (RenderingException e) {
|
||||
LOG.debug(e);
|
||||
String message = e.getPresentableMessage();
|
||||
message = message != null ? message : AndroidBundle.message("android.layout.preview.default.error.message");
|
||||
final Throwable[] causes = e.getCauses();
|
||||
message = message != null ? message : AndroidBundle.message("android.layout.preview.default.error.message");
|
||||
errorMessage = causes.length > 0 ? new FixableIssueMessage(message + ' ', "Details", "", new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showStackStace(causes);
|
||||
}
|
||||
}) : new FixableIssueMessage(message);
|
||||
|
||||
if (causes.length == 0) {
|
||||
warnMessages.addAll(e.getWarnMessages());
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.info(e);
|
||||
|
||||
@@ -179,8 +179,7 @@ public class RenderUtil {
|
||||
if (exception != null) {
|
||||
final List<Throwable> exceptionsFromWarnings = getNonNullValues(callback.getBrokenClasses());
|
||||
|
||||
if (exceptionsFromWarnings.size() > 0 &&
|
||||
exception instanceof ClassCastException &&
|
||||
if (exception instanceof ClassCastException &&
|
||||
(SdkConstants.CLASS_MOCK_VIEW + " cannot be cast to " + SdkConstants.CLASS_VIEWGROUP)
|
||||
.equalsIgnoreCase(exception.getMessage())) {
|
||||
throw new RenderingException(exceptionsFromWarnings.toArray(new Throwable[exceptionsFromWarnings.size()]))
|
||||
|
||||
Reference in New Issue
Block a user