java.lang.AssertionError 断言错误。

java.lang.AssertionError
	at com.android.tools.idea.gradle.projectView.ModuleNodeIconDecorator.decorate(ModuleNodeIconDecorator.java:50)
	at com.intellij.ide.projectView.impl.CompoundProjectViewNodeDecorator.lambda$decorate$0(CompoundProjectViewNodeDecorator.java:49)
	at com.intellij.ide.projectView.impl.CompoundProjectViewNodeDecorator.forEach(CompoundProjectViewNodeDecorator.java:60)
	at com.intellij.ide.projectView.impl.CompoundProjectViewNodeDecorator.decorate(CompoundProjectViewNodeDecorator.java:49)
	at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.lambda$doUpdate$1(AbstractPsiBasedNode.java:165)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:940)
	at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.doUpdate(AbstractPsiBasedNode.java:138)
	at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.lambda$update$0(AbstractPsiBasedNode.java:134)
	at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:169)
	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:127)
	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:116)
	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:111)
	at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.update(AbstractPsiBasedNode.java:134)
	at com.intellij.ide.util.treeView.PresentableNodeDescriptor.getUpdatedPresentation(PresentableNodeDescriptor.java:89)
	at com.intellij.ide.util.treeView.PresentableNodeDescriptor.update(PresentableNodeDescriptor.java:41)
	at com.intellij.ui.tree.StructureTreeModel$Node.update(StructureTreeModel.java:451)
	at com.intellij.ui.tree.StructureTreeModel$Node.(StructureTreeModel.java:433)
	at com.intellij.ui.tree.StructureTreeModel$Node.(StructureTreeModel.java:425)
	at com.intellij.ui.tree.StructureTreeModel$Node.(StructureTreeModel.java:419)
	at com.intellij.ui.tree.StructureTreeModel.getValidChildren(StructureTreeModel.java:389)
	at com.intellij.ui.tree.StructureTreeModel.validateChildren(StructureTreeModel.java:297)
	at com.intellij.ui.tree.StructureTreeModel$Node.isLeaf(StructureTreeModel.java:554)
	at com.intellij.ui.tree.StructureTreeModel$Node.access$400(StructureTreeModel.java:419)
	at com.intellij.ui.tree.StructureTreeModel.isLeaf(StructureTreeModel.java:333)
	at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.load(AsyncTreeModel.java:597)
	at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.getNode(AsyncTreeModel.java:571)
	at com.intellij.ui.tree.AsyncTreeModel$ObsolescentCommand.get(AsyncTreeModel.java:463)
	at com.intellij.ui.tree.AsyncTreeModel$ObsolescentCommand.get(AsyncTreeModel.java:429)
	at com.intellij.util.concurrency.Command$Processor.lambda$process$1(Command.java:48)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:68)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:121)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:110)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:68)
	at com.intellij.util.concurrency.Invoker.invokeSafely(Invoker.java:153)
	at com.intellij.util.concurrency.Invoker.lambda$invokeLater$0(Invoker.java:91)
	at com.intellij.util.concurrency.Invoker$BackgroundThread.lambda$offer$0(Invoker.java:320)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:220)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$100(BoundedTaskExecutor.java:26)
	at com.intellij.util.concurrency.BoundedTaskExecutor$2.lambda$run$0(BoundedTaskExecutor.java:198)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:224)
	at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:194)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

java.lang.AssertionError 断言错误。_第1张图片
嗯 点击这个 不知道怎么引入了android support 了 去掉。。。然后重启。。。嗯 好了

额 这个断言错误。。。

额外。。。的
断言语句不是永远会执行,可以屏蔽也可以启用
因此:
1.不要使用断言作为公共方法的参数检查,公共方法的参数永远都要执行
2.断言语句不可以有任何边界效应,不要使用断言语句去修改变量和改变方法的返回值
断言 相关:
断言:也就是所谓的assertion,是jdk1.4后加入的新功能。
它主要使用在代码开发和测试时期,用于对某些关键数据的判断,如果这个关键数据不是你程序所预期的数据,程序就提出警告或退出。

当软件正式发布后,可以取消断言部分的代码。java中使用assert作为断言的一个关键字,这就可以看出java对断言还是很重视的,因为如果不是很重要的话,直接开发个类就可以了,没必要新定义一个关键字。

语法1:assert expression; //expression代表一个布尔类型的表达式,如果为真,就继续正常运行,如果为假,程序退出

语法2:assert expression1 : expression2; //expression1是一个布尔表达式,expression2是一个基本类型或者Object类型,如果expression1为真,则程序忽略expression2继续运行;如果expression1为假,则运行expression2,然后退出程序。

注意:断言功能是用于软件的开发和测试的,也就是说,删去断言的那部分语句后,你程序的结构和运行不应该有任何改变,千万不要把断言当成程序中的一个功能来使用

你可能感兴趣的:(java,idea)