mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
android layout preview without custom components should work with JDK7
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
package org.jetbrains.android.uipreview;
|
||||
|
||||
/**
|
||||
* @author Eugene.Kudelevsky
|
||||
*/
|
||||
public class IncompatibleClassFileFormatException extends Exception {
|
||||
}
|
||||
@@ -181,6 +181,11 @@ class ProjectCallback extends LegacyCallback implements IProjectCallback {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
catch (UnsupportedClassVersionError e) {
|
||||
LOG.info(e);
|
||||
myBrokenClasses.put(className, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Object createMockView(String className, Class[] constructorSignature, Object[] constructorArgs)
|
||||
@@ -331,7 +336,7 @@ class ProjectCallback extends LegacyCallback implements IProjectCallback {
|
||||
return myBrokenClasses;
|
||||
}
|
||||
|
||||
public void loadAndParseRClass() throws ClassNotFoundException {
|
||||
public void loadAndParseRClass() throws ClassNotFoundException, IncompatibleClassFileFormatException {
|
||||
final String className = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
|
||||
@Nullable
|
||||
@Override
|
||||
@@ -347,7 +352,12 @@ class ProjectCallback extends LegacyCallback implements IProjectCallback {
|
||||
Class<?> aClass = myLoadedClasses.get(className);
|
||||
if (aClass == null) {
|
||||
ProjectClassLoader loader = new ProjectClassLoader(null, myModule);
|
||||
aClass = loader.loadClass(className);
|
||||
try {
|
||||
aClass = loader.loadClass(className);
|
||||
}
|
||||
catch (UnsupportedClassVersionError e) {
|
||||
throw new IncompatibleClassFileFormatException();
|
||||
}
|
||||
if (aClass != null) {
|
||||
myLoadedClasses.put(className, aClass);
|
||||
}
|
||||
|
||||
@@ -93,6 +93,9 @@ public class RenderUtil {
|
||||
catch (ClassNotFoundException e) {
|
||||
LOG.debug(e);
|
||||
}
|
||||
catch (IncompatibleClassFileFormatException e) {
|
||||
LOG.debug(e);
|
||||
}
|
||||
|
||||
final RenderResources resolver =
|
||||
factory.createResourceResolver(facet, config, projectResources, theme.getName(), theme.isProjectTheme());
|
||||
@@ -159,6 +162,11 @@ public class RenderUtil {
|
||||
missingRClassMessage = e.getMessage();
|
||||
missingRClass = true;
|
||||
}
|
||||
catch (IncompatibleClassFileFormatException e) {
|
||||
LOG.debug(e);
|
||||
missingRClassMessage = "Incompatible R.class file format";
|
||||
missingRClass = true;
|
||||
}
|
||||
|
||||
final RenderResources resolver =
|
||||
factory.createResourceResolver(facet, config, projectResources, theme.getName(), theme.isProjectTheme());
|
||||
|
||||
Reference in New Issue
Block a user