Skip to content

Make the project at least compilable on newer JDKs #1350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 of 5 tasks
php-coder opened this issue Apr 17, 2020 · 4 comments
Open
3 of 5 tasks

Make the project at least compilable on newer JDKs #1350

php-coder opened this issue Apr 17, 2020 · 4 comments
Assignees
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Apr 17, 2020

Reported by @milik27:

While we don't support JDK 11 (#1158) and JDK 17 (#1556) yet we should look and try to fix the compilation at least. This should help to new contributors to work with project (even to just compile frontend).

At this moment, compilation fails on JDK14:

image

This thread might be helpful: https://stackoverflow.com/questions/59097317/warning-options-bootstrap-class-path-not-set-in-conjunction-with-source-8


TODO:

  • jdk11 and jdk17: fix Warning: bootstrap class path not set in conjunction with -source 8 (log); solution: pass <source>/<target> parameter to maven-compiler-plugin on JDK8 only and pass <release> on 11 and 17
  • jdk11: fix Error: Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.5:testCompile (default) on project mystamps: Error occurred while calling a method on a Groovy class from classpath. InvocationTargetException: BUG! exception in phase 'class generation' in source unit 'src/test/groovy/ru/mystamps/web/feature/site/CronServiceImplTest.groovy' unsupported Target MODULE (log)
  • jdk17 only: deal with java.lang.IllegalAccessError: class com.google.errorprone.ErrorProneJavacPlugin (in unnamed module @0x510e4d79) cannot access class com.sun.tools.javac.api.BasicJavacTask (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.api to unnamed module @0x510e4d79 (log); solution: pass extra options to maven-compiler-plugin (see http://errorprone.info/docs/installation)
  • jdk17: fix java.lang.NoSuchMethodError: 'java.lang.Iterable com.sun.tools.javac.code.Scope$WriteableScope.getSymbolsByName(com.sun.tools.javac.util.Name, com.sun.tools.javac.util.Filter)' (log); solution: update error-prone to >=2.7.1 (Update error-prone to 2.24.0 #1440)
  • jdk17: fix java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not "opens java.lang" to unnamed module @109a452c during gmavenplus-plugin:1.5:testCompile (log)
@php-coder php-coder added this to the next milestone Apr 17, 2020
@php-coder
Copy link
Owner Author

In order to be able to develop frontend without Maven, this should help:

$ cd src/main/frontend
$ npm ci
$ npm run build

@milik27
Copy link

milik27 commented Apr 17, 2020 via email

@php-coder
Copy link
Owner Author

Я так понимаю ответ на запрос я не смогу получить, и axios как то странно работает

В прототипе axios за-stub-лен, чтобы работать без сервера:

var responseCount = 0;
window.axios = {
post: function(url) {
var possibleOutcomes = [ 'failOnForm', 'failOnField', 'success' ];
var outcome = possibleOutcomes[responseCount % possibleOutcomes.length];
var possibleResponses = {
'/series/similar': {
'failOnField': {
status: 400,
data: {
'fieldErrors': {
'seriesId': [ 'Invalid series id' ]
}
}
},
'success': {
status: 204,
data: {}
}
},
'/series/sales/import': {
'failOnField': {
status: 400,
data: {
'fieldErrors': {
'url': [ 'Invalid value' ]
}
}
},
'success': {
status: 200,
data: {
'sellerId': 3,
'price': 3.5,
'currency' : 'USD',
'altPrice': 100,
'altCurrency' : 'CZK'
}
}
}
};
var stubResponse;
switch (outcome) {
case 'success':
case 'failOnField':
stubResponse = possibleResponses[url][outcome];
break;
case 'failOnForm':
default:
stubResponse = {
status: 500,
statusText: 'Fake Server Error'
};
}
responseCount++;
return new Promise(function delayExecution(resolve) {
setTimeout(resolve, 500 /* 0.5 second */);
}).then(function returnResponse() {
return stubResponse.status == 500 ? Promise.reject(stubResponse) : Promise.resolve(stubResponse);
});
}
};

Посмотри как работают формы для импорта серии и добавления похожей серии на этой странице. Там есть три разных ответа от сервера и при каждом клике возвращается следующий -- таким образом можно проверить и все ошибочные ответы от сервера и основную логику. Надо сделать по аналогии.

Ты можешь просто скопировать код для post и сделать наподобие для get. Справишься или мне сделать?

@php-coder
Copy link
Owner Author

Как вариант -- отладь компонент на любом сервере (хоть своем, хоть онлайн, типа https://my-json-server.typicode.com)

@php-coder php-coder modified the milestones: next, 0.4.8 Jul 27, 2023
@php-coder php-coder self-assigned this Dec 26, 2023
php-coder added a commit that referenced this issue Dec 27, 2023
php-coder added a commit that referenced this issue Dec 27, 2023
Corrections for d1fd249 commit.

Relate to #1350 #1158 #1556
php-coder added a commit that referenced this issue Dec 28, 2023
php-coder added a commit that referenced this issue Jan 2, 2024
php-coder added a commit that referenced this issue Feb 9, 2024
Removal of ErrorProne also fixes compilation on JDK 17 (see #1350 and #1556)

The following issues won't be fixed:
Closes #999
Closes #1069
Closes #1235
Closes #1440

Part of #1669
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants