4
我有一個問題,因爲文件名的長度,因此編譯器給我的Scala的類中倒閉的一個,使用Scala的2.9.2斯卡拉閉包文件名
CurrencyInitializer $$ anonfun $ COM $ gottex $ gottware $服務器$啓動$初始化$ impl $貨幣$ CurrencyInitializer $$ updateDepositEquivalentBonds $ 1.class
我有這個文件名的問題是,我上傳一個文件夾包含所有我編譯的類通過SSH服務器通過SSH gui和這失敗。
private def updateDepositEquivalentBonds(currency: Currency) {
val depositEquivalentBonds = gottwareDataSource.space.readAllWithCurrency(classOf[DepositEquivalentBondImpl], currency)
for (depositEquivalentBond <- depositEquivalentBonds) depositEquivalentBond.updateFromDeposit(gottwareDataSource.space)
if (depositEquivalentBonds.length > 0) {
gottwareDataSource.space.writeMultiple(depositEquivalentBonds, Lease.FOREVER,
UpdateModifiers.UPDATE_OR_WRITE | UpdateModifiers.NO_RETURN_VALUE)
gottwareDataSource.space.writeMultiple(AskBidSpread.newInstances(depositEquivalentBonds.toArray[SecurityImpl]), Lease.FOREVER, UpdateModifiers.UPDATE_OR_WRITE | UpdateModifiers
.NO_RETURN_VALUE)
}
}
令人驚訝的是,這是產生長文件名的代碼。有什麼我可以做的編譯器,以防止這種情況發生?
你真的需要上傳一個.class文件? .jar文件不會嗎? – jpalecek 2013-03-20 13:10:31
無法控制編譯器如何爲函數文字等內容生成內部類名稱。 (請記住,所有閉包都是函數文字,但並非所有函數文字都是閉包,術語很重要......雖然不是針對這個特殊問題......) – 2013-03-20 15:14:33