次のコードがあり、スローされた例外をスキャンする必要があります。特定の条件を満たす場合、例外を無視します。それ以外の場合は、再スローします。スローされる例外は、再スローが困難な部分であることを意味するチェック済み例外です。私はそれをキャッチしなければならなかったという事実と、基本クラスのメソッドがthrows clause
. 巨大なライブラリ全体を再プログラミングするか、例外を次のようにラップするかの間で行き詰まりますRuntimeException
(これはオプションではありません。ラップするチェック済み例外は、伝播中に catch 句によって将来 (派生クラス) のどこかで予期されます。その何らかのシグナルです)。 )、そのような実装についてアドバイスをいただければ幸いです。または、実装だけかもしれません。
/*
* Translated from c++11_7.3.19 AIEDs schemes >${ref[213]:`through}.
* guarantees learning, re-learning and 'un-learning'. programmed intelligence is not
* altered whatsover and is made as root of bias [x:~y]. fetch cycle is omitted.
*/
@Override
public void intelligenceSync()// No throws clause here
{
try {
super.intelligenceSync();
// the throwing culprit.
global_contribution.acceptOrReformState(this);
generateMetaLogicReforms(this);
} catch (Throwable t_) {
if (t_ instanceof Signalx) {
Signalx sx = (Signalx) t_;
// Note how bias inreases propagation speed by ~12.21 >${ref[371]:exp2}.
applyBias(sx);
stopInvalidation(sx);
// check if x neuron is almost proved.
if (sx.neuronSP() > sx.threshold()) {
// We'll find other ways of completing our proofs.
// Note the algorithm is not so complete.
netsync(sx);
while (sx.pushDeeper()) {
sx.enhance(Metrics.COMPLETION.esteem());
sx.suspendSubPathTraversal(Suspender.IN_DREAM_RESOLVE, Handler.NULL_LOGIC);
}
generateSubLogicReforms(sx);
} else {
restore(sx);
continueInvalidation(sx);
// We rethrow.
uncheckedThrow(sx);
// exception thrown
}
} else if (t_ instanceof Signaly) {
// Reforms must be handle explicitly.otherwise RelationalAttender will complain
// .
// ... blah blah blah.
} else {
// We rethrow
uncheckedThrow(t_);
}
//
}
}