machaval / mule-intellij-plugins

Mule Intellij Plugin
Apache License 2.0
44 stars 24 forks source link

SYStringNode cannot be cast to ArrayNode #120

Open longtimeago opened 6 years ago

longtimeago commented 6 years ago

Good day!

Faced with this exception

annotator: org.mule.tooling.lang.raml.annotator.RamlAnnotator@4e6421a2 (class org.mule.tooling.lang.raml.annotator.RamlAnnotator)

java.lang.ClassCastException: org.raml.yagi.framework.nodes.snakeyaml.SYStringNode cannot be cast to org.raml.yagi.framework.nodes.ArrayNode
    at org.raml.v2.internal.impl.v10.grammar.AuthorizationUriRequiredField.isRequiredField(AuthorizationUriRequiredField.java:31)
    at org.raml.yagi.framework.grammar.rule.KeyValueRule.isRequired(KeyValueRule.java:197)
    at org.raml.yagi.framework.grammar.rule.ObjectRule.apply(ObjectRule.java:256)
    at org.raml.yagi.framework.grammar.rule.KeyValueRule.apply(KeyValueRule.java:171)
    at org.raml.yagi.framework.grammar.rule.ObjectRule.apply(ObjectRule.java:234)
    at org.raml.yagi.framework.grammar.rule.AnyOfRule.apply(AnyOfRule.java:110)
    at org.raml.yagi.framework.grammar.rule.KeyValueRule.apply(KeyValueRule.java:171)
    at org.raml.yagi.framework.grammar.rule.ObjectRule.apply(ObjectRule.java:234)
    at org.raml.yagi.framework.grammar.rule.AnyOfRule.apply(AnyOfRule.java:110)
    at org.raml.yagi.framework.grammar.rule.KeyValueRule.apply(KeyValueRule.java:171)
    at org.raml.yagi.framework.grammar.rule.ObjectRule.apply(ObjectRule.java:234)
    at org.raml.yagi.framework.phase.GrammarPhase.apply(GrammarPhase.java:38)
    at org.raml.v2.internal.impl.v10.Raml10Builder.runPhases(Raml10Builder.java:114)
    at org.raml.v2.internal.impl.v10.Raml10Builder.build(Raml10Builder.java:93)
    at org.raml.v2.internal.impl.RamlBuilder.build(RamlBuilder.java:117)
    at org.raml.v2.internal.impl.RamlBuilder.build(RamlBuilder.java:99)
    at org.raml.v2.internal.impl.RamlBuilder.build(RamlBuilder.java:94)
    at org.mule.tooling.lang.raml.annotator.RamlAnnotator.doAnnotate(RamlAnnotator.java:37)
    at org.mule.tooling.lang.raml.annotator.RamlAnnotator.doAnnotate(RamlAnnotator.java:18)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:179)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.access$500(ExternalToolPass.java:38)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:155)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
    at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:277)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:291)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:232)
    at com.intellij.util.Alarm$Request.runSafely(Alarm.java:405)
    at com.intellij.util.Alarm$Request.access$700(Alarm.java:330)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:371)
    at com.intellij.util.Alarm$Request.run(Alarm.java:382)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:228)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:226)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$100(BoundedTaskExecutor.java:26)
    at com.intellij.util.concurrency.BoundedTaskExecutor$2$1.run(BoundedTaskExecutor.java:199)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:229)
    at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:193)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

when opening following raml file

#%RAML 1.0
title: Some
version: "1.0"
baseUri: https://some.com
protocols: [ HTTPS ]
IntelliJ IDEA 2018.2.4 (Ultimate Edition)
Build #IU-182.4505.22, built on September 18, 2018
JRE: 1.8.0_152-release-1248-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-36-generic

I suspect something is wrong with array of protocols :)