redhat-developer / redhat-developer/vscode-java

Wrong reported errors by compiler

Aperta
#730 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug diagnostics
Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

I have some pieces of code that compiles fine in IntelliJ and Gradle but VSCode reports them as errors.
Examples:

  1. Error in import

    import sun.security.ssl.ProtocolVersion;

screenshot 2018-11-30 at 11 46 27

I have to point that I'm not using the JVM in the error description. Here's my workspace's settings:

{
   "java.home": "/Users/augusto.dias/.sdkman/candidates/java/8.0.181-oracle",
   "java.jdt.ls.vmargs": "-javaagent:/Users/augusto.dias/my-project/.vscode/lombok.jar -Xbootclasspath/a:/Users/augusto.dias/my-project/.vscode/lombok.jar"
}
  1. Wrong exception handling

I have a RetryTemplate class from spring and I'm calling execute as the following example:

retryTemplate.execute(getCallback(),getRecovery());

private RetryCallback<Void, IOException> getCallback() {
    return context -> {
        if (context.getLastThrowable() instanceof IOException) {
                    IOException e = (IOException) context.getLastThrowable();
    // do some other things
                    throw e;
        }
        return null;
    };
}

private RecoveryCallback getRecovery() {
    return context -> {
        Throwable lastThrowable = context.getLastThrowable();
    // do some other things
        throw lastThrowable instanceof Exception ? (Exception) lastThrowable : new Exception(lastThrowable);
    }
}

screenshot 2018-11-30 at 13 54 27

  1. And finally: false error in method signature
    assertThat((List) ((Envelope) responseEntity.getBody()).getData(), hasItems(siteDTO));
    assertThat((List) ((Envelope) responseEntity.getBody()).getData(), hasSize(1));

screenshot 2018-11-30 at 13 57 43

Environment
  • Operating System: macOS Mojave
  • JDK version: 1.8
  • Visual Studio Code version: 1.29.1
  • Java extension version: 0.34.0

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo le tre diagnosi segnalate nei frammenti Java forniti usando le impostazioni dell'area di lavoro, JDK 1.8, VS Code 1.29.1 e Java extension 0.34.0. Confronta i risultati del language server con IntelliJ e Gradle, quindi determina se ogni errore falso ha la stessa causa. Il lavoro è completato quando gli esempi interessati non producono più diagnosi errate e sono presenti test di regressione per i casi segnalati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, vscode
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.