草庐IT

local-class

全部标签

class - Kotlin 中另一个类中的密封类无法编译 : cannot access '<init>' it is private

如果我使用docs中的示例,classSomeActivity:AppCompatActivity(){sealedclassExprdataclassConst(valnumber:Double):Expr()dataclassSum(vale1:Expr,vale2:Expr):Expr()objectNotANumber:Expr()}无法编译,报错:Cannotaccess'',itisprivatein'Expr'.但是,将其移到封闭类之外使其可以编译:sealedclassExprdataclassConst(valnumber:Double):Expr()dataclas

git 恢复本地未提交的文件 local history

事情的原因是这样:我在A分支上建了A1我在A1上写了很多代码,未commit,但是代码有问题,我需要调试,我又在A1上建了A2,Pycharm没有保存A1,直接跳到A2,我在A2上操作,删除了我A1上写的大多数代码。我切回A1,发现我的a1和我修改后的A2代码一样,导致我一周工作量的代码都丢失了。解决方案:Pycharm上有个localhistory按时间点恢复的Pycharm项目右键点击localhistory–>showhistory然后根据时间,恢复到自己想要的我同时用了Pycharm和vscode打开的文件,vscode没有localhistory功能,需要装插件,真的好危险谢谢wec

gradle - Kotlin 插件错误 : Could not generate a proxy class for class org. jetbrains.kotlin.gradle.tasks.KotlinCompile

尝试运行gradle任务时出错。无法弄清楚还需要什么或错误是什么。我正在做的项目有几个子项目,所以我有一个主要的build.gradle。错误是针对我想尝试Kotlin的子项目。*Where:Buildfile'/home/oracle/bnc/KotlinHandler/build.gradle'line:13*Whatwentwrong:Aproblemoccurredevaluatingrootproject'KotlinHandler'.>Failedtoapplyplugin[id'kotlin']>Couldnotgenerateaproxyclassforclassorg

gradle - Kotlin 插件错误 : Could not generate a proxy class for class org. jetbrains.kotlin.gradle.tasks.KotlinCompile

尝试运行gradle任务时出错。无法弄清楚还需要什么或错误是什么。我正在做的项目有几个子项目,所以我有一个主要的build.gradle。错误是针对我想尝试Kotlin的子项目。*Where:Buildfile'/home/oracle/bnc/KotlinHandler/build.gradle'line:13*Whatwentwrong:Aproblemoccurredevaluatingrootproject'KotlinHandler'.>Failedtoapplyplugin[id'kotlin']>Couldnotgenerateaproxyclassforclassorg

ruby-on-rails - Rails 5.2 和 Sidekiq : Can't find Worker Class

我有一个名为release_monitor_worker.rb的工作程序保存在app/workers/下。看起来像这样:classReleaseMonitorAddWorkerincludeSidekiq::Workersidekiq_optionsretry:falserequire'watir'require'nokogiri'require'open-uri'defparse_url(url)puts"Beginningnavigationto#{url}"browser=Watir::Browser.new:chrome,headless:truebrowser.gotourl

php - 拉维尔 5.1 : Class cache does not exist

您好,许多问题的许多答案的亲爱的提供者!我现在使用SO已有一段时间(5年以上),尽管主要是被动使用。这次我遇到了一个让我整夜无法解决的问题。这就是它的全部内容。我将Laravel5.1与Redis(缓存和session)结合使用。可悲的是,当我切换到nginx并升级了一些软件包(Composer)时,一切都停止了。Laravel打印出以下异常:ReflectionExceptioninContainer.phpline737:ClasscachedoesnotexistinContainer.phpline737atReflectionClass->__construct('cache

java - mongo-operations spring mongo批量操作执行异常(CodecConfigurationException : Can't find a codec for class)

我尝试使用springmongo操作类在mongodb中执行批量操作。这些是我的POJO类:@Document(collection="location_settings_mst")publicclassLocationSettingsEntity{@IdprivateStringid;@Field("userId")privateStringuserId;@Field("location")privateListlocationSettings=newLinkedList();//GettersandSetters}publicclassLocationSettingEntity{@

mongodb - 错误 : exec: "/usr/local/bin/docker-entrypoint.sh": stat/usr/local/bin/docker-entrypoint. sh:权限被拒绝

当我运行时:dockerrun--namemongodb-p27107:27107mongo--noauth--bind_ip=0.0.0.0我总是得到这个错误:error:exec:"/usr/local/bin/docker-entrypoint.sh":stat/usr/local/bin/docker-entrypoint.sh:permissiondenied容器退出(1)我需要它来运行以便我可以将我的其他docker图像链接到它我已经在多个网站上搜索过这个问题的解决方案,但我没有找到任何东西。感谢您的帮助! 最佳答案 尝

java - Kotlin kotlinClass.class.getName() 不能返回包名,只能返回简单的类名

AClass.class.getName();如果AClass是一个java类,这个方法会返回包名和类名。但是当我将AClassjava文件转换为Kotlin文件时,它只会返回一个类名。所以系统找不到这个类路径上面的代码 最佳答案 有很多方法可以在kotlin中获取javaClass的完整限定名:通过属性KClass.qualifiedName获取名称:valname=AClass::class.qualifiedName;OR通过Class.name属性获取名称:valname=AClass::class.java.name;OR

java - Kotlin kotlinClass.class.getName() 不能返回包名,只能返回简单的类名

AClass.class.getName();如果AClass是一个java类,这个方法会返回包名和类名。但是当我将AClassjava文件转换为Kotlin文件时,它只会返回一个类名。所以系统找不到这个类路径上面的代码 最佳答案 有很多方法可以在kotlin中获取javaClass的完整限定名:通过属性KClass.qualifiedName获取名称:valname=AClass::class.qualifiedName;OR通过Class.name属性获取名称:valname=AClass::class.java.name;OR