Skip to content

Commit

Permalink
Fix Java 9 issues (#109)
Browse files Browse the repository at this point in the history
Avoid forbidden import
Bump GWT version
  • Loading branch information
tsuoanttila authored and Legioth committed Oct 25, 2017
1 parent 66e0fdc commit 2a12d09
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 75 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<!-- TODO this would also be used in an archetype, currently broken -->
<!-- This property is used in a filtered resources to check the version compatibility -->
<vaadin.version>${project.version}</vaadin.version>
<gwt.version>2.8.0</gwt.version>
<gwt.version>2.8.2</gwt.version>
<!-- apt filtering doesn't support dot -->
<vaadinVersion>${vaadin.version}</vaadinVersion>
<gwtVersion>${gwt.version}</gwtVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

import com.vaadin.integration.maven.wscdn.CvalChecker.UnreachableCvalServerException;

import sun.net.www.protocol.file.FileURLConnection;

/**
* Utility class to collect widgetset related information from classpath.
* Utility will seek all directories from classpaths, and jar files having
Expand Down Expand Up @@ -238,86 +236,84 @@ private static void searchForWidgetSetsAndAddonStyles(
// and files in jar

URLConnection openConnection = location.openConnection();
if (openConnection instanceof JarURLConnection || openConnection instanceof FileURLConnection) {

JarFile jarFile;
if (openConnection instanceof JarURLConnection) {
JarURLConnection conn = (JarURLConnection) openConnection;
jarFile = conn.getJarFile();
} else {
jarFile = new JarFile(location.getFile());
}

Manifest manifest = jarFile.getManifest();
if (manifest == null) {
// No manifest so this is not a Vaadin Add-on
return;
}
JarFile jarFile;
if (openConnection instanceof JarURLConnection) {
JarURLConnection conn = (JarURLConnection) openConnection;
jarFile = conn.getJarFile();
} else {
jarFile = new JarFile(location.getFile());
}

// Check for widgetset attribute
String value = manifest.getMainAttributes().getValue(
"Vaadin-Widgetsets");
if (value != null) {
String[] widgetsetNames = value.split(",");
for (int i = 0; i < widgetsetNames.length; i++) {
String widgetsetname = widgetsetNames[i].trim();
if (!widgetsetname.equals("")) {
widgetsets.put(widgetsetname, location);
}
Manifest manifest = jarFile.getManifest();
if (manifest == null) {
// No manifest so this is not a Vaadin Add-on
return;
}

// Check for widgetset attribute
String value = manifest.getMainAttributes().getValue(
"Vaadin-Widgetsets");
if (value != null) {
String[] widgetsetNames = value.split(",");
for (int i = 0; i < widgetsetNames.length; i++) {
String widgetsetname = widgetsetNames[i].trim();
if (!widgetsetname.equals("")) {
widgetsets.put(widgetsetname, location);
}
}

Attributes attribs = manifest.getMainAttributes();
String license = attribs.getValue(VAADIN_ADDON_LICENSE);
String name = attribs.getValue(VAADIN_ADDON_NAME);
String vers = attribs.getValue(VAADIN_ADDON_VERSION) == null ? ""
: attribs.getValue(VAADIN_ADDON_VERSION);
String title = attribs.getValue(VAADIN_ADDON_TITLE) == null ? name
: attribs.getValue(VAADIN_ADDON_TITLE);

String awidgetsets = attribs
.getValue(VAADIN_ADDON_WIDGETSET) == null ? name
: attribs.getValue(
VAADIN_ADDON_WIDGETSET);

if (name != null && license != null) {
if (VAADIN_AGPL.equals(license)) {
// For agpl version, we don't care
} else if (VAADIN_CVAL.equals(license)) {
// We only check cval licensed products
CvalInfo info;

try {
info = cvalChecker.validateProduct(name,
vers,
title);
printValidLicense(info, title, vers);
} catch (UnreachableCvalServerException e) {
info = new CvalInfo();
final Product product = new Product();
product.setName(name);
info.setProduct(product);
printServerUnreachable(title, vers);
}
// for (String w : awidgetsets.split("[, ]+")) {
// ret.add(new CValUiInfo(title, String
// .valueOf(computeMajorVersion(vers)),
// w,
// info.getType()));
// }
Attributes attribs = manifest.getMainAttributes();
String license = attribs.getValue(VAADIN_ADDON_LICENSE);
String name = attribs.getValue(VAADIN_ADDON_NAME);
String vers = attribs.getValue(VAADIN_ADDON_VERSION) == null ? ""
: attribs.getValue(VAADIN_ADDON_VERSION);
String title = attribs.getValue(VAADIN_ADDON_TITLE) == null ? name
: attribs.getValue(VAADIN_ADDON_TITLE);

String awidgetsets = attribs
.getValue(VAADIN_ADDON_WIDGETSET) == null ? name
: attribs.getValue(
VAADIN_ADDON_WIDGETSET);

if (name != null && license != null) {
if (VAADIN_AGPL.equals(license)) {
// For agpl version, we don't care
} else if (VAADIN_CVAL.equals(license)) {
// We only check cval licensed products
CvalInfo info;

try {
info = cvalChecker.validateProduct(name,
vers,
title);
printValidLicense(info, title, vers);
} catch (UnreachableCvalServerException e) {
info = new CvalInfo();
final Product product = new Product();
product.setName(name);
info.setProduct(product);
printServerUnreachable(title, vers);
}
// for (String w : awidgetsets.split("[, ]+")) {
// ret.add(new CValUiInfo(title, String
// .valueOf(computeMajorVersion(vers)),
// w,
// info.getType()));
// }
}
}
}

// Check for theme attribute
value = manifest.getMainAttributes().getValue(
"Vaadin-Stylesheets");
if (value != null) {
String[] stylesheets = value.split(",");
for (int i = 0; i < stylesheets.length; i++) {
String stylesheet = stylesheets[i].trim();
if (!stylesheet.equals("")) {
addonStyles.put(stylesheet, location);
}
// Check for theme attribute
value = manifest.getMainAttributes().getValue(
"Vaadin-Stylesheets");
if (value != null) {
String[] stylesheets = value.split(",");
for (int i = 0; i < stylesheets.length; i++) {
String stylesheet = stylesheets[i].trim();
if (!stylesheet.equals("")) {
addonStyles.put(stylesheet, location);
}
}
}
Expand Down

0 comments on commit 2a12d09

Please # to comment.