Document cast that is a workaround for an Eclipse compiler issue

Issue here: https://github.com/eclipse-jdt/eclipse.jdt.core/issues/99
This commit is contained in:
Lukas Eder 2022-05-24 15:22:45 +02:00
parent 16a4b7ea50
commit e41d0d281c

View File

@ -2309,6 +2309,7 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
if (parseKeywordIf("DUPLICATE KEY UPDATE")) {
parseKeywordIf("SET");
// Cast is necessary, see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/99
InsertOnConflictWhereStep<?> where = parseKeywordIf("ALL TO EXCLUDED")
? onDuplicate.onDuplicateKeyUpdate().setAllToExcluded()
: onDuplicate.onDuplicateKeyUpdate().set((Map<?, ?>) data(DATA_PARSE_ON_CONFLICT, true, c -> c.parseSetClauseList()));
@ -2344,6 +2345,8 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
returning = doUpdate.doNothing();
}
else if (parseKeywordIf("UPDATE SET")) {
// Cast is necessary, see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/99
InsertOnConflictWhereStep<?> where = parseKeywordIf("ALL TO EXCLUDED")
? doUpdate.doUpdate().setAllToExcluded()
: doUpdate.doUpdate().set((Map<?, ?>) data(DATA_PARSE_ON_CONFLICT, true, c -> c.parseSetClauseList()));