├── .github └── workflows │ └── simple_build.yml ├── .gitignore ├── LICENSE-2.0.txt ├── README.md ├── bin ├── javajpf ├── jpf ├── jpf.bat ├── print_class ├── print_class.bat ├── print_events ├── test └── test.bat ├── build.gradle ├── docs └── graphics │ ├── DFSListener.svg │ ├── app-types.svg │ ├── attributes.svg │ ├── bc-factory.svg │ ├── cg-impl.svg │ ├── cg-motivation.svg │ ├── cg-ontology.svg │ ├── cg-sequence.svg │ ├── choicegen-example.svg │ ├── genpeer.svg │ ├── interleavings.svg │ ├── jpf-abstractions.svg │ ├── jpf-basic.svg │ ├── jpf-intro-new.svg │ ├── jpf-layers.svg │ ├── jpf-project.svg │ ├── listener-overview.svg │ ├── listeners.svg │ ├── mji-call.svg │ ├── mji-functions.svg │ ├── mji-mangling.svg │ ├── new-testing.svg │ ├── por-mark.svg │ ├── por-scheduling-relevance.svg │ ├── properties.svg │ ├── report.svg │ ├── states-mc.svg │ ├── states-testing.svg │ ├── sw-model-checking-2.svg │ └── sw-model-checking.svg ├── gradle ├── build-resources.gradle ├── distribution.gradle ├── ide-support.gradle ├── source-sets.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jpf.properties ├── output.txt ├── settings.gradle └── src ├── annotations └── gov │ └── nasa │ └── jpf │ └── annotation │ ├── BitFlip.java │ ├── FilterField.java │ ├── FilterFrame.java │ ├── JPFAttribute.java │ ├── JPFConfig.java │ ├── JPFOption.java │ ├── JPFOptions.java │ ├── MJI.java │ ├── NeverBreak.java │ ├── NoJPFExecution.java │ └── NonShared.java ├── classes ├── gov │ └── nasa │ │ └── jpf │ │ ├── AnnotationProxyBase.java │ │ ├── BoxObjectCaches.java │ │ ├── CachedROHttpConnection.java │ │ ├── ConsoleOutputStream.java │ │ ├── EventProducer.java │ │ ├── FinalizerThread.java │ │ └── SerializationConstructor.java ├── modules │ ├── java.base │ │ ├── java │ │ │ ├── io │ │ │ │ ├── File.java │ │ │ │ ├── FileDescriptor.java │ │ │ │ ├── FileInputStream.java │ │ │ │ ├── FileOutputStream.java │ │ │ │ ├── InputStreamReader.java │ │ │ │ ├── OutputStreamWriter.java │ │ │ │ └── RandomAccessFile.java │ │ │ ├── lang │ │ │ │ ├── Class.java │ │ │ │ ├── ClassLoader.java │ │ │ │ ├── InheritableThreadLocal.java │ │ │ │ ├── Object.java │ │ │ │ ├── StackFrameInfo.java │ │ │ │ ├── StackTraceElement.java │ │ │ │ ├── String.java │ │ │ │ ├── System.java │ │ │ │ ├── Thread.java │ │ │ │ ├── ThreadGroup.java │ │ │ │ ├── ThreadLocal.java │ │ │ │ ├── Throwable.java │ │ │ │ ├── annotation │ │ │ │ │ ├── Inherited.java │ │ │ │ │ └── Retention.java │ │ │ │ ├── invoke │ │ │ │ │ └── JPFFieldVarHandle.java │ │ │ │ ├── ref │ │ │ │ │ ├── Reference.java │ │ │ │ │ ├── ReferenceQueue.java │ │ │ │ │ └── WeakReference.java │ │ │ │ └── reflect │ │ │ │ │ ├── AccessibleObject.java │ │ │ │ │ ├── Constructor.java │ │ │ │ │ ├── Field.java │ │ │ │ │ ├── InvocationTargetException.java │ │ │ │ │ ├── Method.java │ │ │ │ │ └── Proxy.java │ │ │ ├── net │ │ │ │ └── URLClassLoader.java │ │ │ ├── nio │ │ │ │ ├── Buffer.java │ │ │ │ ├── BufferUnderflowException.java │ │ │ │ ├── ByteBuffer.java │ │ │ │ ├── ByteOrder.java │ │ │ │ ├── CharBuffer.java │ │ │ │ ├── channels │ │ │ │ │ └── FileChannel.java │ │ │ │ ├── files │ │ │ │ │ ├── FileSystem.java │ │ │ │ │ ├── FileSystems.java │ │ │ │ │ ├── Path.java │ │ │ │ │ └── spi │ │ │ │ │ │ └── FileSystemProvider.java │ │ │ │ └── package-info.java │ │ │ ├── security │ │ │ │ ├── AccessController.java │ │ │ │ ├── MessageDigest.java │ │ │ │ └── SecureClassLoader.java │ │ │ ├── text │ │ │ │ ├── DateFormat.java │ │ │ │ ├── DecimalFormat.java │ │ │ │ ├── Format.java │ │ │ │ ├── NumberFormat.java │ │ │ │ └── SimpleDateFormat.java │ │ │ └── util │ │ │ │ ├── Random.java │ │ │ │ ├── ServiceLoader.java │ │ │ │ ├── TimeZone.java │ │ │ │ ├── concurrent │ │ │ │ ├── BrokenBarrierException.java │ │ │ │ ├── CyclicBarrier.java │ │ │ │ ├── Exchanger.java │ │ │ │ ├── ThreadLocalRandom.java │ │ │ │ └── atomic │ │ │ │ │ ├── AtomicIntegerArray.java │ │ │ │ │ ├── AtomicIntegerFieldUpdater.java │ │ │ │ │ ├── AtomicLong.java │ │ │ │ │ ├── AtomicLongArray.java │ │ │ │ │ ├── AtomicLongFieldUpdater.java │ │ │ │ │ ├── AtomicReferenceArray.java │ │ │ │ │ └── AtomicReferenceFieldUpdater.java │ │ │ │ ├── function │ │ │ │ └── Supplier.java │ │ │ │ ├── regex │ │ │ │ ├── Matcher.java │ │ │ │ └── Pattern.java │ │ │ │ └── zip │ │ │ │ └── ZipFile.java │ │ ├── jdk │ │ │ └── internal │ │ │ │ ├── misc │ │ │ │ ├── JavaAWTAccess.java │ │ │ │ ├── JavaIOAccess.java │ │ │ │ ├── JavaIODeleteOnExitAccess.java │ │ │ │ ├── JavaIOFileDescriptorAccess.java │ │ │ │ ├── JavaLangAccess.java │ │ │ │ ├── JavaNetAccess.java │ │ │ │ ├── JavaNetUriAccess.java │ │ │ │ ├── JavaNioAccess.java │ │ │ │ ├── SharedSecrets.java │ │ │ │ └── Unsafe.java │ │ │ │ └── reflect │ │ │ │ └── ConstantPool.java │ │ └── sun │ │ │ ├── net │ │ │ └── www │ │ │ │ └── protocol │ │ │ │ └── http │ │ │ │ └── Handler.java │ │ │ ├── nio │ │ │ └── ch │ │ │ │ └── Interruptible.java │ │ │ └── reflect │ │ │ └── annotation │ │ │ └── AnnotationType.java │ └── java.logging │ │ └── java │ │ └── util │ │ └── logging │ │ └── FileHandler.java └── org │ └── junit │ ├── After.java │ ├── AfterClass.java │ ├── Before.java │ ├── BeforeClass.java │ ├── Ignore.java │ └── Test.java ├── examples ├── BoundedBuffer.java ├── BoundedBuffer.jpf ├── Crossing.java ├── Crossing.jpf ├── DiningPhil.java ├── DiningPhil.jpf ├── HelloWorld.java ├── HelloWorld.jpf ├── NumericValueCheck.java ├── NumericValueCheck.jpf ├── Racer.java ├── Racer.jpf ├── Rand.java ├── Rand.jpf ├── RobotManager-replay-nt.jpf ├── RobotManager-replay-ot.jpf ├── RobotManager.java ├── RobotManager.jpf ├── StopWatch.java ├── StopWatch.jpf ├── TestExample-coverage.jpf ├── TestExample.java ├── oldclassic-da.jpf ├── oldclassic.java └── oldclassic.jpf ├── main ├── fault │ └── injection │ │ └── examples │ │ ├── APISimpleExample.java │ │ ├── AnnotationSimpleExample.java │ │ ├── BCDEncodedISBN.java │ │ ├── CRC.java │ │ ├── CheckISBN.java │ │ └── LongEncodedCRC.java └── gov │ └── nasa │ └── jpf │ ├── $coreTag.java │ ├── Config.java │ ├── ConfigChangeListener.java │ ├── Error.java │ ├── GenericProperty.java │ ├── JPF.java │ ├── JPFClassLoader.java │ ├── JPFConfigException.java │ ├── JPFErrorException.java │ ├── JPFException.java │ ├── JPFListener.java │ ├── JPFListenerException.java │ ├── JPFNativePeerException.java │ ├── JPFShell.java │ ├── ListenerAdapter.java │ ├── Property.java │ ├── PropertyListenerAdapter.java │ ├── State.java │ ├── StateExtension.java │ ├── SystemAttribute.java │ ├── jvm │ ├── ClassFile.java │ ├── ClassFilePrinter.java │ ├── ClassFileReader.java │ ├── ClassFileReaderAdapter.java │ ├── ClassNames.java │ ├── DirClassFileContainer.java │ ├── JRTClassFileContainer.java │ ├── JVMAnnotationParser.java │ ├── JVMByteCodePrinter.java │ ├── JVMByteCodeReader.java │ ├── JVMByteCodeReaderAdapter.java │ ├── JVMClassFileContainer.java │ ├── JVMClassInfo.java │ ├── JVMCodeBuilder.java │ ├── JVMDirectCallStackFrame.java │ ├── JVMInstructionFactory.java │ ├── JVMNativeStackFrame.java │ ├── JVMStackFrame.java │ ├── JVMSystemClassLoaderInfo.java │ ├── JarClassFileContainer.java │ ├── SkipAnnotation.java │ └── bytecode │ │ ├── AALOAD.java │ │ ├── AASTORE.java │ │ ├── ACONST_NULL.java │ │ ├── ALOAD.java │ │ ├── ANEWARRAY.java │ │ ├── ARETURN.java │ │ ├── ARRAYLENGTH.java │ │ ├── ASTORE.java │ │ ├── ATHROW.java │ │ ├── ArrayLoadInstruction.java │ │ ├── ArrayStoreInstruction.java │ │ ├── BALOAD.java │ │ ├── BASTORE.java │ │ ├── BIPUSH.java │ │ ├── CALOAD.java │ │ ├── CASTORE.java │ │ ├── CHECKCAST.java │ │ ├── D2F.java │ │ ├── D2I.java │ │ ├── D2L.java │ │ ├── DADD.java │ │ ├── DALOAD.java │ │ ├── DASTORE.java │ │ ├── DCMPG.java │ │ ├── DCMPL.java │ │ ├── DCONST.java │ │ ├── DDIV.java │ │ ├── DIRECTCALLRETURN.java │ │ ├── DLOAD.java │ │ ├── DMUL.java │ │ ├── DNEG.java │ │ ├── DREM.java │ │ ├── DRETURN.java │ │ ├── DSTORE.java │ │ ├── DSUB.java │ │ ├── DUP.java │ │ ├── DUP2.java │ │ ├── DUP2_X1.java │ │ ├── DUP2_X2.java │ │ ├── DUP_X1.java │ │ ├── DUP_X2.java │ │ ├── DoubleCompareInstruction.java │ │ ├── EXECUTENATIVE.java │ │ ├── F2D.java │ │ ├── F2I.java │ │ ├── F2L.java │ │ ├── FADD.java │ │ ├── FALOAD.java │ │ ├── FASTORE.java │ │ ├── FCMPG.java │ │ ├── FCMPL.java │ │ ├── FCONST.java │ │ ├── FDIV.java │ │ ├── FINISHCLINIT.java │ │ ├── FLOAD.java │ │ ├── FMUL.java │ │ ├── FNEG.java │ │ ├── FREM.java │ │ ├── FRETURN.java │ │ ├── FSTORE.java │ │ ├── FSUB.java │ │ ├── GETFIELD.java │ │ ├── GETSTATIC.java │ │ ├── GOTO.java │ │ ├── GOTO_W.java │ │ ├── GetHelper.java │ │ ├── I2B.java │ │ ├── I2C.java │ │ ├── I2D.java │ │ ├── I2F.java │ │ ├── I2L.java │ │ ├── I2S.java │ │ ├── IADD.java │ │ ├── IALOAD.java │ │ ├── IAND.java │ │ ├── IASTORE.java │ │ ├── ICONST.java │ │ ├── IDIV.java │ │ ├── IFEQ.java │ │ ├── IFGE.java │ │ ├── IFGT.java │ │ ├── IFLE.java │ │ ├── IFLT.java │ │ ├── IFNE.java │ │ ├── IFNONNULL.java │ │ ├── IFNULL.java │ │ ├── IF_ACMPEQ.java │ │ ├── IF_ACMPNE.java │ │ ├── IF_ICMPEQ.java │ │ ├── IF_ICMPGE.java │ │ ├── IF_ICMPGT.java │ │ ├── IF_ICMPLE.java │ │ ├── IF_ICMPLT.java │ │ ├── IF_ICMPNE.java │ │ ├── IINC.java │ │ ├── ILOAD.java │ │ ├── IMUL.java │ │ ├── INEG.java │ │ ├── INSTANCEOF.java │ │ ├── INVOKECG.java │ │ ├── INVOKECLINIT.java │ │ ├── INVOKEDYNAMIC.java │ │ ├── INVOKEINTERFACE.java │ │ ├── INVOKESPECIAL.java │ │ ├── INVOKESTATIC.java │ │ ├── INVOKEVIRTUAL.java │ │ ├── IOR.java │ │ ├── IREM.java │ │ ├── IRETURN.java │ │ ├── ISHL.java │ │ ├── ISHR.java │ │ ├── ISTORE.java │ │ ├── ISUB.java │ │ ├── IUSHR.java │ │ ├── IXOR.java │ │ ├── IfInstruction.java │ │ ├── InstanceInvocation.java │ │ ├── InstructionFactory.java │ │ ├── JSR.java │ │ ├── JSR_W.java │ │ ├── JVMArrayElementInstruction.java │ │ ├── JVMFieldInstruction.java │ │ ├── JVMInstanceFieldInstruction.java │ │ ├── JVMInstruction.java │ │ ├── JVMInstructionVisitor.java │ │ ├── JVMInstructionVisitorAdapter.java │ │ ├── JVMInvokeInstruction.java │ │ ├── JVMLocalVariableInstruction.java │ │ ├── JVMReturnInstruction.java │ │ ├── JVMStaticFieldInstruction.java │ │ ├── L2D.java │ │ ├── L2F.java │ │ ├── L2I.java │ │ ├── LADD.java │ │ ├── LALOAD.java │ │ ├── LAND.java │ │ ├── LASTORE.java │ │ ├── LCMP.java │ │ ├── LCONST.java │ │ ├── LDC.java │ │ ├── LDC2_W.java │ │ ├── LDC_W.java │ │ ├── LDIV.java │ │ ├── LLOAD.java │ │ ├── LMUL.java │ │ ├── LNEG.java │ │ ├── LOOKUPSWITCH.java │ │ ├── LOR.java │ │ ├── LREM.java │ │ ├── LRETURN.java │ │ ├── LSHL.java │ │ ├── LSHR.java │ │ ├── LSTORE.java │ │ ├── LSUB.java │ │ ├── LUSHR.java │ │ ├── LXOR.java │ │ ├── LockInstruction.java │ │ ├── LongArrayLoadInstruction.java │ │ ├── LongArrayStoreInstruction.java │ │ ├── LongReturn.java │ │ ├── MONITORENTER.java │ │ ├── MONITOREXIT.java │ │ ├── MULTIANEWARRAY.java │ │ ├── NATIVERETURN.java │ │ ├── NEW.java │ │ ├── NEWARRAY.java │ │ ├── NOP.java │ │ ├── NewArrayInstruction.java │ │ ├── POP.java │ │ ├── POP2.java │ │ ├── PUTFIELD.java │ │ ├── PUTSTATIC.java │ │ ├── PutHelper.java │ │ ├── RET.java │ │ ├── RETURN.java │ │ ├── RUNSTART.java │ │ ├── SALOAD.java │ │ ├── SASTORE.java │ │ ├── SIPUSH.java │ │ ├── SWAP.java │ │ ├── StaticFieldInstruction.java │ │ ├── SwitchInstruction.java │ │ ├── TABLESWITCH.java │ │ ├── VirtualInvocation.java │ │ └── WIDE.java │ ├── listener │ ├── AssertionProperty.java │ ├── BitFlipListener.java │ ├── BudgetChecker.java │ ├── CGMonitor.java │ ├── CGRemover.java │ ├── CallMonitor.java │ ├── ChoiceSelector.java │ ├── ChoiceTracker.java │ ├── CoverageAnalyzer.java │ ├── DeadlockAnalyzer.java │ ├── DistributedSimpleDot.java │ ├── EndlessLoopDetector.java │ ├── ErrorTraceGenerator.java │ ├── ExceptionInjector.java │ ├── ExecTracker.java │ ├── HeapTracker.java │ ├── IdleFilter.java │ ├── InsnCounter.java │ ├── LockedStackDepth.java │ ├── LogConsole.java │ ├── MethodAnalyzer.java │ ├── MethodTracker.java │ ├── NoStateCycles.java │ ├── NonSharedChecker.java │ ├── NullTracker.java │ ├── NumericValueChecker.java │ ├── OOMEInjector.java │ ├── ObjectTracker.java │ ├── OverlappingMethodAnalyzer.java │ ├── PathOutputMonitor.java │ ├── Perturbator.java │ ├── PreciseRaceDetector.java │ ├── ReferenceLocator.java │ ├── SearchStats.java │ ├── SimpleDot.java │ ├── SimpleIdleFilter.java │ ├── StackDepthChecker.java │ ├── StackTracker.java │ ├── StateCountEstimator.java │ ├── StateSpaceAnalyzer.java │ ├── StateSpaceDot.java │ ├── StateTracker.java │ ├── StopWatchFuzzer.java │ ├── TraceStorer.java │ ├── VarRecorder.java │ └── VarTracker.java │ ├── perturb │ ├── GenericDataAbstractor.java │ ├── IntOverUnder.java │ └── OperandPerturbator.java │ ├── report │ ├── ConsolePublisher.java │ ├── Publisher.java │ ├── PublisherExtension.java │ ├── PublisherExtensionAdapter.java │ ├── Reporter.java │ ├── Statistics.java │ └── XMLPublisher.java │ ├── search │ ├── DFSearch.java │ ├── PathSearch.java │ ├── RandomSearch.java │ ├── Search.java │ ├── SearchListener.java │ ├── SearchListenerAdapter.java │ ├── SearchState.java │ ├── Simulation.java │ └── heuristic │ │ ├── BFSHeuristic.java │ │ ├── DFSHeuristic.java │ │ ├── GlobalSwitchThread.java │ │ ├── HeuristicSearch.java │ │ ├── HeuristicState.java │ │ ├── Interleaving.java │ │ ├── MinimizePreemption.java │ │ ├── MostBlocked.java │ │ ├── PreferThreads.java │ │ ├── PrioritizedState.java │ │ ├── RandomHeuristic.java │ │ ├── SimplePriorityHeuristic.java │ │ ├── StaticPriorityQueue.java │ │ └── UserHeuristic.java │ ├── tool │ ├── GenPeer.java │ ├── LogConsole.java │ ├── PrintEvents.java │ ├── Run.java │ ├── RunJPF.java │ └── RunTest.java │ ├── util │ ├── ArrayByteQueue.java │ ├── ArrayIntSet.java │ ├── ArrayObjectQueue.java │ ├── Attributable.java │ ├── AvailableBufferedInputStream.java │ ├── BailOut.java │ ├── BinaryClassSource.java │ ├── BitArray.java │ ├── BitSet1024.java │ ├── BitSet256.java │ ├── BitSet64.java │ ├── BitSetN.java │ ├── ClassInfoFilter.java │ ├── CloneableObject.java │ ├── Cloner.java │ ├── CommitOutputStream.java │ ├── ConsoleStream.java │ ├── ConstGrowth.java │ ├── CountDown.java │ ├── DevNullPrintStream.java │ ├── DynamicIntArray.java │ ├── DynamicObjectArray.java │ ├── ElementCreator.java │ ├── ExpGrowth.java │ ├── FeatureSpec.java │ ├── FieldSpec.java │ ├── FieldSpecMatcher.java │ ├── FileUtils.java │ ├── FinalBitSet.java │ ├── FixedBitSet.java │ ├── Growth.java │ ├── HashData.java │ ├── HashPool.java │ ├── IdentityArrayObjectSet.java │ ├── IdentityObjectSet.java │ ├── ImmutableList.java │ ├── IndexIterator.java │ ├── InstructionState.java │ ├── IntArray.java │ ├── IntIterator.java │ ├── IntSet.java │ ├── IntTable.java │ ├── IntVector.java │ ├── Invocation.java │ ├── JPFLogger.java │ ├── JPFSiteUtils.java │ ├── Left.java │ ├── LimitedInputStream.java │ ├── LinkedObjectQueue.java │ ├── LocationSpec.java │ ├── LogHandler.java │ ├── LogManager.java │ ├── Loggable.java │ ├── LongVector.java │ ├── MethodInfoRegistry.java │ ├── MethodSpec.java │ ├── MethodSpecMatcher.java │ ├── Misc.java │ ├── MutableInteger.java │ ├── MutableIntegerRestorer.java │ ├── OATHash.java │ ├── ObjArray.java │ ├── ObjVector.java │ ├── ObjectConverter.java │ ├── ObjectList.java │ ├── ObjectQueue.java │ ├── ObjectSet.java │ ├── PSIntMap.java │ ├── Pair.java │ ├── PairPermutationGenerator.java │ ├── PathnameExpander.java │ ├── PermutationGenerator.java │ ├── Predicate.java │ ├── PrintStreamable.java │ ├── PrintUtils.java │ ├── Printable.java │ ├── Processor.java │ ├── RandomPermutationGenerator.java │ ├── ReadOnlyObjList.java │ ├── Reflection.java │ ├── RepositoryEntry.java │ ├── Result.java │ ├── Right.java │ ├── RunListener.java │ ├── RunRegistry.java │ ├── SimplePool.java │ ├── SingleElementList.java │ ├── SortedArrayIntSet.java │ ├── SortedArrayObjectSet.java │ ├── Source.java │ ├── SourceRef.java │ ├── SparseClusterArray.java │ ├── SparseIntVector.java │ ├── SparseObjVector.java │ ├── SplitInputStream.java │ ├── SplitOutputStream.java │ ├── StateExtensionClient.java │ ├── StateExtensionListener.java │ ├── StringExpander.java │ ├── StringMatcher.java │ ├── StringSetMatcher.java │ ├── StructuredPrinter.java │ ├── TotalPermutationGenerator.java │ ├── Trace.java │ ├── TraceElement.java │ ├── Transformer.java │ ├── TwoTypeComparator.java │ ├── TypeRef.java │ ├── TypeSpec.java │ ├── TypeSpecMatcher.java │ ├── UniqueRandomPermGenerator.java │ ├── UnsortedArrayIntSet.java │ ├── VarSpec.java │ ├── WeakPool.java │ ├── automaton │ │ ├── Automaton.java │ │ ├── State.java │ │ └── Transition.java │ ├── event │ │ ├── CheckEvent.java │ │ ├── ControlEvent.java │ │ ├── Event.java │ │ ├── EventChoiceGenerator.java │ │ ├── EventConstructor.java │ │ ├── EventContext.java │ │ ├── EventForest.java │ │ ├── EventTree.java │ │ ├── NoEvent.java │ │ ├── PropagatingEventContext.java │ │ ├── SystemEvent.java │ │ └── TestEventTree.java │ ├── json │ │ ├── AbstractValue.java │ │ ├── ArrayValue.java │ │ ├── BooleanValue.java │ │ ├── CGCall.java │ │ ├── CGCreator.java │ │ ├── CGCreatorFactory.java │ │ ├── Creator.java │ │ ├── CreatorsFactory.java │ │ ├── DoubleValue.java │ │ ├── JSONLexer.java │ │ ├── JSONObject.java │ │ ├── JSONObjectValue.java │ │ ├── JSONParser.java │ │ ├── NullValue.java │ │ ├── StringValue.java │ │ ├── Token.java │ │ └── Value.java │ ├── script │ │ ├── Alternative.java │ │ ├── ESParser.java │ │ ├── ElementProcessor.java │ │ ├── Event.java │ │ ├── EventFactory.java │ │ ├── EventGenerator.java │ │ ├── EventGeneratorFactory.java │ │ ├── Repetition.java │ │ ├── Script.java │ │ ├── ScriptElement.java │ │ ├── ScriptElementContainer.java │ │ ├── ScriptEnvironment.java │ │ ├── Section.java │ │ ├── SequenceInterpreter.java │ │ └── StringSetGenerator.java │ └── test │ │ ├── JPF_gov_nasa_jpf_util_test_TestJPF.java │ │ ├── JPF_gov_nasa_jpf_util_test_TestMultiProcessJPF.java │ │ ├── TestJPF.java │ │ └── TestMultiProcessJPF.java │ └── vm │ ├── AbstractRestorer.java │ ├── AbstractSerializer.java │ ├── AbstractTypeAnnotationInfo.java │ ├── AllRunnablesSyncPolicy.java │ ├── Allocation.java │ ├── AllocationContext.java │ ├── AnnotationInfo.java │ ├── AnnotationParser.java │ ├── ApplicationContext.java │ ├── ArrayAccess.java │ ├── ArrayFields.java │ ├── ArrayIndexOutOfBoundsExecutiveException.java │ ├── ArrayOffset.java │ ├── AtomicData.java │ ├── Attributor.java │ ├── Backtracker.java │ ├── BooleanArrayFields.java │ ├── BooleanChoiceGenerator.java │ ├── BooleanFieldInfo.java │ ├── BootstrapMethodInfo.java │ ├── BoxObjectCacheManager.java │ ├── ByteArrayFields.java │ ├── ByteFieldInfo.java │ ├── BytecodeAnnotationInfo.java │ ├── BytecodeTypeParameterAnnotationInfo.java │ ├── CharArrayFields.java │ ├── CharFieldInfo.java │ ├── CheckExtendTransition.java │ ├── ChoiceGenerator.java │ ├── ChoiceGeneratorBase.java │ ├── ChoicePoint.java │ ├── ClassChangeException.java │ ├── ClassFileContainer.java │ ├── ClassFileMatch.java │ ├── ClassInfo.java │ ├── ClassInfoException.java │ ├── ClassLoaderInfo.java │ ├── ClassLoaderList.java │ ├── ClassParseException.java │ ├── ClassPath.java │ ├── ClinitRequired.java │ ├── ClosedMemento.java │ ├── CollapsePools.java │ ├── ConstInsnPathTime.java │ ├── DebugJenkinsStateSet.java │ ├── DebugStateSerializer.java │ ├── DefaultBacktracker.java │ ├── DefaultFieldsFactory.java │ ├── DefaultMementoRestorer.java │ ├── DelegatingScheduler.java │ ├── DirectCallStackFrame.java │ ├── DoubleArrayFields.java │ ├── DoubleChoiceGenerator.java │ ├── DoubleFieldInfo.java │ ├── DoubleSlotFieldInfo.java │ ├── DynamicElementInfo.java │ ├── ElementInfo.java │ ├── ExceptionHandler.java │ ├── ExceptionInfo.java │ ├── ExceptionParameterAnnotationInfo.java │ ├── FieldInfo.java │ ├── FieldLockInfo.java │ ├── FieldLockInfoFactory.java │ ├── Fields.java │ ├── FieldsFactory.java │ ├── FinalizerThreadInfo.java │ ├── FloatArrayFields.java │ ├── FloatChoiceGenerator.java │ ├── FloatFieldInfo.java │ ├── FormalParameterAnnotationInfo.java │ ├── FullStateSet.java │ ├── FunctionObjectFactory.java │ ├── GenericHeap.java │ ├── GenericSGOIDHeap.java │ ├── GenericSharednessPolicy.java │ ├── GenericSignatureHolder.java │ ├── GlobalSchedulingPoint.java │ ├── GlobalSharednessPolicy.java │ ├── HandlerContext.java │ ├── HashedAllocationContext.java │ ├── Heap.java │ ├── IncrementalChangeTracker.java │ ├── InfoObject.java │ ├── Instruction.java │ ├── IntArrayFields.java │ ├── IntChoiceGenerator.java │ ├── IntegerFieldInfo.java │ ├── IsEndStateProperty.java │ ├── JPFOutputStream.java │ ├── JPF_gov_nasa_jpf_vm_Verify.java │ ├── JenkinsStateSet.java │ ├── KernelState.java │ ├── LoadOnJPFRequired.java │ ├── LocalVarInfo.java │ ├── LockSetThresholdFli.java │ ├── LongArrayFields.java │ ├── LongChoiceGenerator.java │ ├── LongFieldInfo.java │ ├── MJIEnv.java │ ├── Memento.java │ ├── MementoFactory.java │ ├── MementoRestorer.java │ ├── MethodInfo.java │ ├── MethodLocator.java │ ├── Monitor.java │ ├── MultiProcessVM.java │ ├── NamedFields.java │ ├── NativeMethodInfo.java │ ├── NativePeer.java │ ├── NativeStackFrame.java │ ├── NativeStateHolder.java │ ├── NoJPFExec.java │ ├── NoOutOfMemoryErrorProperty.java │ ├── NoUncaughtExceptionsProperty.java │ ├── NotDeadlockedProperty.java │ ├── OVHeap.java │ ├── OVStatics.java │ ├── ObjRef.java │ ├── PSIMHeap.java │ ├── Path.java │ ├── PathSharednessPolicy.java │ ├── PersistentLockSetThresholdFli.java │ ├── PersistentSingleLockThresholdFli.java │ ├── PersistentTidSet.java │ ├── PreciseAllocationContext.java │ ├── PredicateMap.java │ ├── PriorityRunnablesSyncPolicy.java │ ├── ReferenceArrayFields.java │ ├── ReferenceChoiceGenerator.java │ ├── ReferenceFieldInfo.java │ ├── ReferenceProcessor.java │ ├── ReleaseAction.java │ ├── Restorable.java │ ├── RestorableVMState.java │ ├── Scheduler.java │ ├── SerializingStateSet.java │ ├── SharednessPolicy.java │ ├── ShortArrayFields.java │ ├── ShortFieldInfo.java │ ├── SingleLockThresholdFli.java │ ├── SingleProcessVM.java │ ├── SingleSlotFieldInfo.java │ ├── StackFrame.java │ ├── StateRestorer.java │ ├── StateSerializer.java │ ├── StateSet.java │ ├── StaticElementInfo.java │ ├── Statics.java │ ├── StatisticFieldLockInfoFactory.java │ ├── Step.java │ ├── Storable.java │ ├── SuperTypeAnnotationInfo.java │ ├── SyncPolicy.java │ ├── SystemClassLoaderInfo.java │ ├── SystemState.java │ ├── SystemTime.java │ ├── ThreadChoiceGenerator.java │ ├── ThreadData.java │ ├── ThreadInfo.java │ ├── ThreadInfoSet.java │ ├── ThreadList.java │ ├── ThresholdFieldLockInfo.java │ ├── ThrowsAnnotationInfo.java │ ├── TidSet.java │ ├── TimeModel.java │ ├── Transition.java │ ├── TypeAnnotationInfo.java │ ├── TypeParameterAnnotationInfo.java │ ├── TypeParameterBoundAnnotationInfo.java │ ├── Types.java │ ├── UncaughtException.java │ ├── VM.java │ ├── VMListener.java │ ├── VariableAnnotationInfo.java │ ├── Verify.java │ ├── bytecode │ ├── ArrayElementInstruction.java │ ├── FieldInstruction.java │ ├── InstanceFieldInstruction.java │ ├── InstanceInvokeInstruction.java │ ├── InstructionInterface.java │ ├── InvokeInstruction.java │ ├── LocalVariableInstruction.java │ ├── LookupSwitchInstruction.java │ ├── NewInstruction.java │ ├── ReadInstruction.java │ ├── ReadOrWriteInstruction.java │ ├── ReturnInstruction.java │ ├── ReturnValueInstruction.java │ ├── StaticFieldInstruction.java │ ├── StoreInstruction.java │ ├── TableSwitchInstruction.java │ └── WriteInstruction.java │ ├── choice │ ├── BreakGenerator.java │ ├── CompoundChoiceGenerator.java │ ├── DoubleChoiceFromList.java │ ├── DoubleChoiceFromSet.java │ ├── DoubleSpec.java │ ├── DoubleThresholdGenerator.java │ ├── ExceptionThreadChoiceFromSet.java │ ├── ExposureCG.java │ ├── FloatChoiceFromList.java │ ├── IntChoiceFromList.java │ ├── IntChoiceFromSet.java │ ├── IntIntervalGenerator.java │ ├── InvocationCG.java │ ├── LongChoiceFromList.java │ ├── NumberChoiceFromList.java │ ├── PermutationCG.java │ ├── RandomIntIntervalGenerator.java │ ├── RandomOrderIntCG.java │ ├── RandomOrderLongCG.java │ ├── ThreadChoiceFromSet.java │ └── TypedObjectChoice.java │ └── serialize │ ├── Abstraction.java │ ├── AbstractionAdapter.java │ ├── AdaptiveSerializer.java │ ├── AmmendableFilterConfiguration.java │ ├── CFSerializer.java │ ├── DebugCFSerializer.java │ ├── DebugFilteringSerializer.java │ ├── DefaultFilterConfiguration.java │ ├── DynamicAbstractionSerializer.java │ ├── FieldAmmendmentByName.java │ ├── FilterConfiguration.java │ ├── FilterFrame.java │ ├── FilteringSerializer.java │ ├── FramePolicy.java │ ├── IgnoreConstants.java │ ├── IgnoreReflectiveNames.java │ ├── IgnoreThreadNastiness.java │ ├── IgnoreUtilSilliness.java │ ├── Ignored.java │ ├── IgnoresFromAnnotations.java │ ├── IncludesFromAnnotations.java │ ├── PolDetSerializer.java │ ├── TopFrameSerializer.java │ ├── UnfilterField.java │ └── UnknownJPFClass.java ├── peers ├── JPF_PolDetListener.java └── gov │ └── nasa │ └── jpf │ └── vm │ ├── AtomicFieldUpdater.java │ ├── JPF_gov_nasa_jpf_AnnotationProxyBase.java │ ├── JPF_gov_nasa_jpf_CachedROHttpConnection.java │ ├── JPF_gov_nasa_jpf_ConsoleOutputStream.java │ ├── JPF_gov_nasa_jpf_DelegatingTimeZone.java │ ├── JPF_gov_nasa_jpf_EventProducer.java │ ├── JPF_gov_nasa_jpf_FinalizerThread.java │ ├── JPF_gov_nasa_jpf_SerializationConstructor.java │ ├── JPF_gov_nasa_jpf_test_MemoryGoal.java │ ├── JPF_gov_nasa_jpf_tools_MethodTester.java │ ├── JPF_java_io_File.java │ ├── JPF_java_io_FileDescriptor.java │ ├── JPF_java_io_InputStreamReader.java │ ├── JPF_java_io_ObjectInputStream.java │ ├── JPF_java_io_ObjectOutputStream.java │ ├── JPF_java_io_ObjectStreamClass.java │ ├── JPF_java_io_OutputStreamWriter.java │ ├── JPF_java_io_RandomAccessFile.java │ ├── JPF_java_lang_Boolean.java │ ├── JPF_java_lang_Byte.java │ ├── JPF_java_lang_Character.java │ ├── JPF_java_lang_Class.java │ ├── JPF_java_lang_ClassLoader.java │ ├── JPF_java_lang_Double.java │ ├── JPF_java_lang_Float.java │ ├── JPF_java_lang_Integer.java │ ├── JPF_java_lang_Long.java │ ├── JPF_java_lang_Math.java │ ├── JPF_java_lang_Object.java │ ├── JPF_java_lang_Runtime.java │ ├── JPF_java_lang_Short.java │ ├── JPF_java_lang_StackStreamFactory.java │ ├── JPF_java_lang_String.java │ ├── JPF_java_lang_StringCoding.java │ ├── JPF_java_lang_StringUTF16.java │ ├── JPF_java_lang_System.java │ ├── JPF_java_lang_Thread.java │ ├── JPF_java_lang_ThreadLocal.java │ ├── JPF_java_lang_Throwable.java │ ├── JPF_java_lang_invoke_JPFFieldVarHandle.java │ ├── JPF_java_lang_invoke_MethodHandles.java │ ├── JPF_java_lang_reflect_Array.java │ ├── JPF_java_lang_reflect_Constructor.java │ ├── JPF_java_lang_reflect_Field.java │ ├── JPF_java_lang_reflect_Method.java │ ├── JPF_java_lang_reflect_Proxy.java │ ├── JPF_java_net_URLClassLoader.java │ ├── JPF_java_net_URLDecoder.java │ ├── JPF_java_net_URLEncoder.java │ ├── JPF_java_security_MessageDigest.java │ ├── JPF_java_text_Bidi.java │ ├── JPF_java_text_DateFormat.java │ ├── JPF_java_text_DateFormatSymbols.java │ ├── JPF_java_text_DecimalFormat.java │ ├── JPF_java_text_DecimalFormatSymbols.java │ ├── JPF_java_text_Format.java │ ├── JPF_java_text_SimpleDateFormat.java │ ├── JPF_java_util_Calendar.java │ ├── JPF_java_util_Date.java │ ├── JPF_java_util_Locale.java │ ├── JPF_java_util_Random.java │ ├── JPF_java_util_ResourceBundle.java │ ├── JPF_java_util_TimeZone.java │ ├── JPF_java_util_concurrent_Exchanger.java │ ├── JPF_java_util_concurrent_atomic_AtomicInteger.java │ ├── JPF_java_util_concurrent_atomic_AtomicIntegerArray.java │ ├── JPF_java_util_concurrent_atomic_AtomicIntegerFieldUpdater.java │ ├── JPF_java_util_concurrent_atomic_AtomicLong.java │ ├── JPF_java_util_concurrent_atomic_AtomicLongArray.java │ ├── JPF_java_util_concurrent_atomic_AtomicLongFieldUpdater.java │ ├── JPF_java_util_concurrent_atomic_AtomicReference.java │ ├── JPF_java_util_concurrent_atomic_AtomicReferenceArray.java │ ├── JPF_java_util_concurrent_atomic_AtomicReferenceFieldUpdater.java │ ├── JPF_java_util_logging_Level.java │ ├── JPF_java_util_regex_Matcher.java │ ├── JPF_java_util_regex_Pattern.java │ ├── JPF_java_util_zip_ZipFile.java │ ├── JPF_jdk_internal_misc_Unsafe.java │ ├── JPF_jdk_internal_misc_VM.java │ ├── JPF_jdk_internal_reflect_Reflection.java │ ├── JPF_jdk_internal_reflect_ReflectionFactory.java │ ├── JPF_sun_net_www_protocol_http_Handler.java │ ├── JPF_sun_reflect_ReflectionFactory.java │ └── LoggablePeer.java └── tests ├── CharBufferTest.java ├── NullCharsetTest.java ├── PolDet ├── PolDetExamples.java └── PolDetMain.java ├── ReporterResourcesTest.java ├── SingleThreadTest.java ├── TypeNameTest.java ├── classloader_specific_tests ├── Class1.java ├── Class2.java ├── Class3.java ├── Interface1.java └── Interface2.java ├── fault └── injection │ └── examples │ ├── BCDEncodedISBNTest.java │ ├── CRCTest.java │ ├── CheckISBNTest.java │ └── LongEncodedCRCTest.java ├── gov └── nasa │ └── jpf │ ├── ConfigTest.java │ ├── configTestApp.jpf │ ├── configTestCommon.jpf │ ├── configTestIncludes.jpf │ ├── configTestRequires.jpf │ ├── configTestRequiresFail.jpf │ ├── configTestSite.properties │ ├── jvm │ ├── ClassInfoTest.java │ ├── FileVersionTest.java │ ├── JVMStackFrameTest.java │ ├── MethodInfoTest.java │ └── NonResolvedClassInfo.java │ ├── listener │ └── VerTrackerTest.java │ ├── test │ ├── basic │ │ ├── ConsolePublisherTest.java │ │ ├── HarnessTest.java │ │ ├── InstructionFactoryTest.java │ │ ├── JPF_gov_nasa_jpf_test_basic_MJITest.java │ │ ├── ListenerTest.java │ │ ├── MJITest.java │ │ ├── TestJPFMainTest.java │ │ └── TestJPFNoMainTest.java │ ├── java │ │ ├── concurrent │ │ │ ├── AtomicIntegerFieldUpdaterTest.java │ │ │ ├── AtomicLongFieldUpdaterTest.java │ │ │ ├── AtomicReferenceFieldUpdaterTest.java │ │ │ ├── AtomicReferenceTest.java │ │ │ ├── ConcurrentSkipListMapTest.java │ │ │ ├── CountDownLatchTest.java │ │ │ ├── ExchangerTest.java │ │ │ ├── ExecutorServiceTest.java │ │ │ ├── SemaphoreTest.java │ │ │ └── ThreadExceptionTest.java │ │ ├── io │ │ │ ├── BufferedInputStreamTest.java │ │ │ ├── FileIOStreamTest.java │ │ │ ├── FileIOTest.java │ │ │ ├── FileTest.java │ │ │ ├── ObjectStreamTest.java │ │ │ └── PrintStreamTest.java │ │ ├── lang │ │ │ ├── BoxObjectCacheTest.java │ │ │ ├── ClassLoaderTest.java │ │ │ ├── ClassTest.java │ │ │ ├── CloneTest.java │ │ │ ├── DoubleTest.java │ │ │ ├── FloatTest.java │ │ │ ├── RuntimeTest.java │ │ │ ├── StackWalkerTest.java │ │ │ ├── StringTest.java │ │ │ ├── SystemTest.java │ │ │ ├── ThreadLocalTest.java │ │ │ ├── ThrowableTest.java │ │ │ ├── ref │ │ │ │ └── WeakReferenceTest.java │ │ │ └── reflect │ │ │ │ ├── ConstructorTest.java │ │ │ │ ├── FieldTest.java │ │ │ │ ├── MethodTest.java │ │ │ │ └── other_package │ │ │ │ ├── OtherPackageParent.java │ │ │ │ └── OtherPackagePublicClass.java │ │ ├── math │ │ │ └── BigIntegerTest.java │ │ ├── misc │ │ │ └── UnsafeTest.java │ │ ├── net │ │ │ ├── LoadUtility.java │ │ │ ├── URLClassLoaderTest.java │ │ │ └── URLEncoderTest.java │ │ ├── nio │ │ │ └── BufferTest.java │ │ ├── text │ │ │ ├── DateFormatTest.java │ │ │ ├── DecimalFormatTest.java │ │ │ └── SimpleDateFormatTest.java │ │ └── util │ │ │ ├── ArraysTest.java │ │ │ ├── CalendarTest.java │ │ │ ├── FunctionsTest.java │ │ │ ├── StreamTest.java │ │ │ ├── ZipFileTest.java │ │ │ └── java.timeTest │ │ │ ├── ClockTest.java │ │ │ └── LocalDateTest.java │ ├── mc │ │ ├── basic │ │ │ ├── AttrsTest.java │ │ │ ├── BreakTest.java │ │ │ ├── CGNotificationTest.java │ │ │ ├── CGRemoverTest.java │ │ │ ├── CGReorderTest.java │ │ │ ├── CascadedCGTest.java │ │ │ ├── ExceptionInjectorTest.java │ │ │ ├── ExtendTransitionTest.java │ │ │ ├── FinalBreakTest.java │ │ │ ├── FinalFieldChoiceTest.java │ │ │ ├── IdleLoopTest.java │ │ │ ├── InvokeListenerTest.java │ │ │ ├── JPF_gov_nasa_jpf_test_mc_basic_AttrsTest.java │ │ │ ├── JPF_gov_nasa_jpf_test_mc_basic_InvokeListenerTest.java │ │ │ ├── JPF_gov_nasa_jpf_test_mc_basic_NoJPFExecTest.java │ │ │ ├── JPF_gov_nasa_jpf_test_mc_basic_RestorerTest$X.java │ │ │ ├── LocalVarInfoTest.java │ │ │ ├── MethodListenerTest.java │ │ │ ├── NoJPFExecTest.java │ │ │ ├── NullTrackerTest.java │ │ │ ├── OOMEInjectorTest.java │ │ │ ├── OVHeapTest.java │ │ │ ├── RecursiveLockTest.java │ │ │ ├── RestorerTest.java │ │ │ ├── SearchMultipleTest.java │ │ │ ├── SharedPropagationTest.java │ │ │ ├── SharedRefTest.java │ │ │ ├── SkipInstructionTest.java │ │ │ ├── StackDepthCheckerTest.java │ │ │ ├── StatelessTest.java │ │ │ ├── TraceTest.java │ │ │ ├── TransitionLengthTest.java │ │ │ ├── UnlockNonSharedTest.java │ │ │ └── VerifyTest.java │ │ ├── data │ │ │ ├── BitFlipTest.java │ │ │ ├── CGCreatorFactoryTest.java │ │ │ ├── CrossingTest.java │ │ │ ├── DataChoiceTest.java │ │ │ ├── DynamicAbstractionTest.java │ │ │ ├── EventGeneratorTest.java │ │ │ ├── JSONTest.java │ │ │ ├── NativeStateHolderTest.java │ │ │ ├── NumericValueCheckerTest.java │ │ │ ├── ObjectStreamTest.java │ │ │ ├── PerturbatorTest.java │ │ │ ├── RandomTest.java │ │ │ ├── StopWatchFuzzerTest.java │ │ │ ├── TimeModelTest.java │ │ │ └── TypedObjectChoiceTest.java │ │ └── threads │ │ │ ├── AtomicTest.java │ │ │ ├── ClinitTest.java │ │ │ ├── DaemonTest.java │ │ │ ├── DeadlockTest.java │ │ │ ├── ExceptionalThreadChoiceTest.java │ │ │ ├── FinalizerThreadTest.java │ │ │ ├── HORaceTest.java │ │ │ ├── JPF_gov_nasa_jpf_test_mc_threads_ExceptionalThreadChoiceTest.java │ │ │ ├── MinimizePreemptionTest.java │ │ │ ├── MissedPathTest.java │ │ │ ├── NestedInitTest.java │ │ │ ├── OldClassicTest.java │ │ │ ├── RaceTest.java │ │ │ ├── SchedulesTest-output │ │ │ └── SchedulesTest.java │ ├── test_classes │ │ └── class_test │ │ │ ├── DiffPkgProtectedClass.java │ │ │ └── DiffPkgProtectedSubClass.java │ ├── vm │ │ ├── basic │ │ │ ├── AnnotationDefaultValueReflectionTest.java │ │ │ ├── AnnotationHashCodeEqualsTest.java │ │ │ ├── AnnotationTest.java │ │ │ ├── AnnotationToStringTest.java │ │ │ ├── ArrayTest.java │ │ │ ├── AssertTest.java │ │ │ ├── CastTest.java │ │ │ ├── ClassInitTest.java │ │ │ ├── EndStateListener.java │ │ │ ├── EndStateTest.java │ │ │ ├── EnumTest.java │ │ │ ├── ExceptionHandlingTest.java │ │ │ ├── FieldTest.java │ │ │ ├── InitializeInterfaceClassObjectRefTest.java │ │ │ ├── JPFAttrAnnotationTest.java │ │ │ ├── LargeCodeTest.java │ │ │ ├── MethodTest.java │ │ │ ├── MissingAnnotationClassTest.java │ │ │ ├── OutOfMemoryErrorTest.java │ │ │ └── RecursiveClinitTest.java │ │ ├── reflection │ │ │ ├── ArrayTest.java │ │ │ ├── ConstructorTest.java │ │ │ ├── FieldTest.java │ │ │ ├── FieldVisibilityTest.java │ │ │ ├── MethodTest.java │ │ │ └── ProxyTest.java │ │ └── threads │ │ │ ├── InterruptTest.java │ │ │ ├── JoinTest.java │ │ │ ├── LockedStackDepthTest.java │ │ │ ├── SuspendResumeTest.java │ │ │ ├── ThreadExceptionHandlerTest.java │ │ │ ├── ThreadStopTest.java │ │ │ ├── ThreadTest.java │ │ │ └── WaitTest.java │ └── xerces │ │ ├── SAXParserTest.java │ │ ├── http%^^www.puppycrawl.com^dtds^configuration_1_3.dtd │ │ └── sun_checks.xml │ ├── util │ ├── ArrayIntSetTestBase.java │ ├── ArrayObjectQueueTest.java │ ├── AvailableBufferedInputStreamTest.java │ ├── BitSet1024Test.java │ ├── BitSet256Test.java │ ├── BitSet64Test.java │ ├── CommitOutputStreamTest.java │ ├── IdentityArrayObjectSetTest.java │ ├── IntTableTest.java │ ├── IntVectorTest.java │ ├── LimitedInputStreamTest.java │ ├── LocationSpecTest.java │ ├── MethodSpecTest.java │ ├── OATHashTest.java │ ├── ObjVectorTest.java │ ├── ObjectListTest.java │ ├── PSIntMapTest.java │ ├── PermutationGeneratorTest.java │ ├── SortedArrayIntSetTest.java │ ├── SortedArrayObjectSetTest.java │ ├── SparseClusterArrayTest.java │ ├── SparseIntVectorTest.java │ ├── SplitInputStreamTest.java │ ├── SplitOutputStreamTest.java │ ├── StringSetMatcherTest.java │ ├── UnsortedArrayIntSetTest.java │ ├── event │ │ └── EventTreeTest.java │ └── json │ │ ├── JSONLexerTest.java │ │ └── JSONParserTest.java │ └── vm │ ├── AllocationTest.java │ ├── AnnotationInfoTest.java │ ├── ClassLoaderInfoTest.java │ ├── ElementInfoTest.java │ ├── StackFrameTest.java │ ├── SystemStateTest.java │ ├── TypesTest.java │ ├── choice │ ├── IntChoiceFromListTest.java │ └── IntChoiceFromSetTest.java │ └── multiProcess │ ├── FinalizerThreadTest.java │ ├── JPF_gov_nasa_jpf_vm_multiProcess_MethodTest.java │ ├── JPF_gov_nasa_jpf_vm_multiProcess_NativePeerTest.java │ ├── JPF_gov_nasa_jpf_vm_multiProcess_ThreadTest.java │ ├── JPF_gov_nasa_jpf_vm_multiProcess_TypeSeparationTest.java │ ├── MethodTest.java │ ├── NativePeerTest.java │ ├── StringTest.java │ ├── ThreadTest.java │ └── TypeSeparationTest.java ├── java11 ├── MatcherTest.java ├── StringConcatenationTest.java └── StringEqualsTest.java ├── java8 ├── DefaultMethodTest.java ├── JPF_java8_DefaultMethodTest$G1.java ├── LambdaTest.java └── TypeAnnotationTest.java ├── resources ├── TestClassJava11.class └── TestClassJava17.class └── test.zip /.github/workflows/simple_build.yml: -------------------------------------------------------------------------------- 1 | name: baseline build 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: ${{ matrix.os }} 13 | strategy: 14 | matrix: 15 | os: [ubuntu-latest, macos-latest] #, windows-latest] 16 | steps: 17 | - name: Checkout repository 18 | uses: actions/checkout@v2 19 | with: 20 | fetch-depth: 0 21 | - name: Set up JDK 11 22 | uses: actions/setup-java@v2 23 | with: 24 | java-version: 11 25 | distribution: 'adopt' 26 | - name: Build with Gradle 27 | run: ./gradlew check 28 | - name: Run PolDet test 29 | run: ./gradlew testPolDet 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java PathFinder 2 | 3 | An extensible software model checking framework for Java bytecode programs 4 | 5 | ## General Information about JPF 6 | 7 | All the latest developments, changes, documentation can be found on our 8 | [wiki](https://github.com/javapathfinder/jpf-core/wiki) page. 9 | 10 | ## Building and Installing 11 | 12 | If you are having problems installing and running JPF, please look at the [How 13 | to install 14 | JPF](https://github.com/javapathfinder/jpf-core/wiki/How-to-install-JPF) guide. 15 | 16 | Note that we have transitioned to OpenJDK with the new version of JPF (for Java 11), so unlike branch `java-8`, the new default version for Java 11 no longer compiles using Oracle's JDK. 17 | 18 | We have documented on the wiki a lot of common problems during the install and 19 | build processes reported by users. If you are facing any issue, please, make 20 | sure that we have not addressed it in documentation. Otherwise, feel free to 21 | contact us at java-pathfinder@googlegroups.com or open an issue on the Issue 22 | Tracker. 23 | 24 | ## Documentation 25 | 26 | There is a constant effort to update and add JPF documentation on the wiki. 27 | If you would like to contribute in that, please, contact us at 28 | java-pathfinder@googlegroups.com. 29 | 30 | Contributions are welcomed and we encourage you to get involved with the 31 | community. 32 | 33 | Happy Verification 34 | *-- the Java PathFinder team* 35 | -------------------------------------------------------------------------------- /bin/javajpf: -------------------------------------------------------------------------------- 1 | # shell script to start arbitrary classes through a JPFClassLoader 2 | 3 | JPF_HOME=`dirname "$0"`/.. 4 | 5 | if test -z "$JVM_FLAGS"; then 6 | JVM_FLAGS="-Xmx1024m -ea" 7 | fi 8 | 9 | 10 | java -ea -cp "$JPF_HOME/build/main:$JPF_HOME/build/peers:$JPF_HOME/build/annotations:$JPF_HOME/build/tests:$JPF_HOME/lib/bcel.jar:$JPF_HOME/lib/junit-4.10.jar" gov.nasa.jpf.Main -a "$@" 11 | -------------------------------------------------------------------------------- /bin/jpf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # unix shell script to run jpf 4 | # 5 | 6 | JPF_HOME=`dirname "$0"`/.. 7 | 8 | if test -z "$JVM_FLAGS"; then 9 | JVM_FLAGS="-Xmx1024m -ea" 10 | fi 11 | 12 | java $JVM_FLAGS -jar "$JPF_HOME/build/RunJPF.jar" "$@" 13 | 14 | -------------------------------------------------------------------------------- /bin/jpf.bat: -------------------------------------------------------------------------------- 1 | REM 2 | REM overly simplified batch file to start JPF from a command prompt 3 | REM 4 | 5 | @echo off 6 | 7 | REM Set the JPF_HOME directory 8 | set JPF_HOME=%~dp0.. 9 | 10 | set JVM_FLAGS=-Xmx1024m -ea 11 | 12 | java %JVM_FLAGS% -jar "%JPF_HOME%\build\RunJPF.jar" %* 13 | 14 | -------------------------------------------------------------------------------- /bin/print_class: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | JPF_HOME=`dirname "$0"`/.. 4 | 5 | java -classpath "$JPF_HOME/build/jpf.jar" gov.nasa.jpf.jvm.ClassFilePrinter "$@" 6 | -------------------------------------------------------------------------------- /bin/print_class.bat: -------------------------------------------------------------------------------- 1 | 2 | @echo off 3 | 4 | REM Set the JPF_HOME directory 5 | set JPF_HOME=%~dp0.. 6 | 7 | java -classpath "%JPF_HOME%\build\jpf.jar" gov.nasa.jpf.classfile.ClassFilePrinter %* 8 | 9 | -------------------------------------------------------------------------------- /bin/print_events: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | JPF_HOME=`dirname "$0"`/.. 4 | 5 | java -classpath "$JPF_HOME/build/jpf.jar" gov.nasa.jpf.tool.PrintEvents "$@" 6 | -------------------------------------------------------------------------------- /bin/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # unix shell script to run jpf 4 | # 5 | 6 | JPF_HOME=`dirname "$0"`/.. 7 | 8 | if test -z "$JVM_FLAGS"; then 9 | JVM_FLAGS="-Xmx1024m -ea" 10 | fi 11 | 12 | java $JVM_FLAGS -jar "$JPF_HOME/build/RunTest.jar" "$@" 13 | 14 | -------------------------------------------------------------------------------- /bin/test.bat: -------------------------------------------------------------------------------- 1 | REM 2 | REM overly simplified batch file to start JPF tests from a command prompt 3 | REM 4 | 5 | @echo off 6 | 7 | REM Set the JPF_HOME directory 8 | set JPF_HOME=%~dp0.. 9 | 10 | set JVM_FLAGS=-Xmx1024m -ea 11 | 12 | java %JVM_FLAGS% -jar "%JPF_HOME%\build\RunTest.jar" %* 13 | 14 | -------------------------------------------------------------------------------- /gradle/distribution.gradle: -------------------------------------------------------------------------------- 1 | tasks.register('srcDist', Zip) { 2 | group = "JPF Distribution" 3 | description = "Builds the source distribution." 4 | 5 | archiveBaseName = project.name 6 | archiveVersion = project.version 7 | archiveClassifier = "src" 8 | archiveExtension = "zip" 9 | 10 | destinationDirectory = buildDir 11 | includeEmptyDirs = false 12 | 13 | from projectDir 14 | include "build.gradle" 15 | include "settings.gradle" 16 | include "gradlew" 17 | include "gradlew.bat" 18 | include "gradle/**/*" 19 | include "src/**/*" 20 | include "bin/**/*" 21 | include "jpf.properties" 22 | include "build.properties" 23 | include "LICENSE-2.0.txt" 24 | include "README.md" 25 | } 26 | 27 | tasks.register('dist', Zip) { 28 | group = "JPF Distribution" 29 | description = "Builds binary distribution." 30 | 31 | archiveBaseName = project.name 32 | archiveVersion = project.version 33 | archiveExtension = "zip" 34 | 35 | destinationDirectory = buildDir 36 | includeEmptyDirs = false 37 | 38 | from projectDir 39 | include "jpf.properties" 40 | include "build.properties" 41 | include "bin/**/*" 42 | include "lib/**/*" 43 | include "${buildDir.name}/**/*.jar" 44 | } 45 | 46 | -------------------------------------------------------------------------------- /gradle/ide-support.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "eclipse" 2 | 3 | eclipse { 4 | group = "JPF IDE Support" 5 | 6 | project { 7 | natures = ["org.eclipse.buildship.core.gradleprojectnature"] 8 | } 9 | classpath { 10 | defaultOutputDir = buildDir 11 | file { 12 | whenMerged { classpath -> 13 | classpath.entries.findAll{ entry -> entry.kind == "src" }*.every { srcNode -> 14 | srcNode.output = srcNode.output.replace("bin", "${buildDir.name}") 15 | } 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javapathfinder/jpf-core/70c3013c60d627bc8158316abcf82fe503f5ae15/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /output.txt: -------------------------------------------------------------------------------- 1 | After. 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.gradle.enterprise' version '3.13.4' 3 | } 4 | 5 | rootProject.name = 'jpf-core' 6 | -------------------------------------------------------------------------------- /src/annotations/gov/nasa/jpf/annotation/BitFlip.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * @author Pu Yi 10 | * 11 | * An annotation used to specify fields/parameters to perform bit flipping exploration 12 | */ 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Target({ ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE }) 15 | public @interface BitFlip { 16 | int value() default 1; 17 | } 18 | -------------------------------------------------------------------------------- /src/annotations/gov/nasa/jpf/annotation/JPFAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.annotation; 19 | 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | /** 24 | * a model annotation that causes JPF to automatically set a corresponding 25 | * attribute for the target construct upon class loading 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | public @interface JPFAttribute { 29 | String[] value(); 30 | } 31 | -------------------------------------------------------------------------------- /src/annotations/gov/nasa/jpf/annotation/JPFConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.annotation; 20 | 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | 24 | /** 25 | * annotation that can be used to change JPF config properties 26 | * from within the SuT 27 | * using such annotations should NOT make the SuT JPF dependent 28 | */ 29 | @Retention(RetentionPolicy.CLASS) 30 | public @interface JPFConfig { 31 | String[] value(); // each element is a "key[+]=val" pair 32 | } 33 | -------------------------------------------------------------------------------- /src/annotations/gov/nasa/jpf/annotation/JPFOption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.annotation; 19 | 20 | public @interface JPFOption { 21 | String type(); 22 | String key(); 23 | String defaultValue(); 24 | String comment(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/annotations/gov/nasa/jpf/annotation/JPFOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.annotation; 19 | 20 | public @interface JPFOptions { 21 | 22 | JPFOption[] value(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/annotations/gov/nasa/jpf/annotation/MJI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.annotation; 19 | 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | /** 24 | * @author Nastaran Shafiei 25 | * 26 | * An annotation used to specify native peer methods 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | public @interface MJI { 30 | boolean noOrphanWarning() default false; 31 | } -------------------------------------------------------------------------------- /src/annotations/gov/nasa/jpf/annotation/NeverBreak.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.annotation; 20 | 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | 24 | /** 25 | * annotation that is used to mark fields or types which should not 26 | * have shared field access CGs 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | public @interface NeverBreak { 30 | } 31 | -------------------------------------------------------------------------------- /src/annotations/gov/nasa/jpf/annotation/NonShared.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.annotation; 19 | 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | /** 24 | * instances of @NonShared classes are not allowed to be referenced from 25 | * more than one thread (but do allow hand-over) 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | public @interface NonShared { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/lang/InheritableThreadLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package java.lang; 20 | 21 | /** 22 | * model of java.lang.InheritableThreadLocal 23 | * 24 | * since we model ThreadLocal, we also need to model this one 25 | */ 26 | public class InheritableThreadLocal extends ThreadLocal { 27 | 28 | public InheritableThreadLocal (){ 29 | // nothing here 30 | } 31 | 32 | // watch out - this can be overridden 33 | protected T childValue (T parentVal){ 34 | return parentVal; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/lang/annotation/Inherited.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package java.lang.annotation; 20 | 21 | @Retention(RetentionPolicy.RUNTIME) 22 | @Target(ElementType.ANNOTATION_TYPE) 23 | public @interface Inherited { 24 | } 25 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/lang/annotation/Retention.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package java.lang.annotation; 20 | 21 | @Retention(RetentionPolicy.RUNTIME) 22 | @Target(ElementType.ANNOTATION_TYPE) 23 | public @interface Retention { 24 | RetentionPolicy value(); 25 | } 26 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/lang/ref/WeakReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package java.lang.ref; 19 | 20 | /** 21 | * MJI model class for java.lang.ref.WeakReference library abstraction 22 | */ 23 | public class WeakReference extends Reference { 24 | public WeakReference (T ref) { 25 | super( ref); 26 | } 27 | 28 | public WeakReference (T ref, ReferenceQueue queue) { 29 | super( ref, queue); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/nio/BufferUnderflowException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package java.nio; 19 | 20 | public class BufferUnderflowException extends RuntimeException { 21 | public BufferUnderflowException() { } 22 | } 23 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/nio/ByteOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package java.nio; 19 | 20 | public final class ByteOrder { 21 | private String name; 22 | 23 | private ByteOrder(String name) { 24 | this.name = name; 25 | } 26 | 27 | public static final ByteOrder BIG_ENDIAN = new ByteOrder("BIG_ENDIAN"); 28 | public static final ByteOrder LITTLE_ENDIAN = new ByteOrder("LITTLE_ENDIAN"); 29 | 30 | @Override 31 | public String toString() { 32 | return name; 33 | } 34 | 35 | public static ByteOrder nativeOrder() { return null; } // stub for Eclipse 36 | } 37 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/nio/files/FileSystem.java: -------------------------------------------------------------------------------- 1 | package java.nio.file; 2 | 3 | import java.nio.file.spi.FileSystemProvider; 4 | 5 | public abstract class FileSystem { 6 | protected FileSystem() {} 7 | 8 | public abstract Path getPath(String first, String... more); 9 | 10 | public abstract FileSystemProvider provider(); 11 | } -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/nio/files/Path.java: -------------------------------------------------------------------------------- 1 | package java.nio.file; 2 | import java.net.URI; 3 | 4 | public interface Path extends Comparable { 5 | FileSystem getFileSystem(); 6 | boolean isAbsolute(); 7 | Path getRoot(); 8 | Path getFileName(); 9 | Path getParent(); 10 | int getNameCount(); 11 | Path getName(int index); 12 | Path subpath(int beginIndex, int endIndex); 13 | boolean startsWith(Path other); 14 | boolean endsWith(Path other); 15 | Path normalize(); 16 | Path resolve(Path other); 17 | Path relativize(Path other); 18 | URI toUri(); 19 | Path toAbsolutePath(); 20 | Path toRealPath(LinkOption... options); 21 | 22 | static Path of(String first, String... more) { 23 | return FileSystems.getDefault().getPath(first, more); 24 | } 25 | } -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/nio/files/spi/FileSystemProvider.java: -------------------------------------------------------------------------------- 1 | package java.nio.file.spi; 2 | 3 | import java.io.IOException; 4 | import java.nio.file.FileSystem; 5 | import java.nio.file.AccessMode; 6 | import java.nio.file.Path; 7 | import java.net.URI; 8 | import java.util.Map; 9 | 10 | 11 | public abstract class FileSystemProvider { 12 | protected FileSystemProvider() {} 13 | 14 | public abstract FileSystem newFileSystem(URI uri, Map env); 15 | 16 | public abstract String getScheme(); 17 | 18 | public abstract FileSystem getFileSystem(); 19 | } -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/nio/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | /** 19 | * This package contains Byte* classes and exceptions. 20 | * 21 | * All of them are implemented straightforwardly but 22 | * only few methods are tested. 23 | */ 24 | package java.nio; 25 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/security/SecureClassLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package java.security; 20 | 21 | /** 22 | * This is just a dummy implementation of java.security.SecureClassLoader 23 | * 24 | * @author Nastaran Shafiei 25 | */ 26 | public class SecureClassLoader extends ClassLoader { 27 | 28 | protected SecureClassLoader(String name, ClassLoader parent) { 29 | super(parent); 30 | } 31 | 32 | protected SecureClassLoader(ClassLoader parent) { 33 | super(parent); 34 | } 35 | 36 | protected SecureClassLoader() { 37 | super(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/util/concurrent/BrokenBarrierException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package java.util.concurrent; 19 | 20 | @SuppressWarnings("serial") 21 | public class BrokenBarrierException extends Exception { 22 | 23 | public BrokenBarrierException () { 24 | } 25 | 26 | public BrokenBarrierException (String details) { 27 | super(details); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/util/concurrent/ThreadLocalRandom.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package java.util.concurrent; 19 | 20 | import java.util.Random; 21 | 22 | public class ThreadLocalRandom { 23 | 24 | static Random rand = new Random(); 25 | 26 | static final ThreadLocalRandom instance = new ThreadLocalRandom(); 27 | 28 | public static final ThreadLocalRandom current() { 29 | return instance; 30 | } 31 | 32 | static final int nextSecondarySeed() { 33 | return rand.nextInt(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/java/util/function/Supplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package java.util.function; 19 | 20 | /** 21 | * Java7 doesn't have it, but we need it to model ThreadLocal 22 | */ 23 | public interface Supplier { 24 | T get(); 25 | } 26 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/jdk/internal/misc/JavaAWTAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package jdk.internal.misc; 20 | 21 | /** 22 | * same as the others - we need to model it in case somebody uses Java 5, 23 | * or an earlier Java 6 version on OS X 24 | */ 25 | public interface JavaAWTAccess { 26 | 27 | // don't know about these yet 28 | public Object get(); 29 | public void put(Object k, Object v); 30 | public void remove(Object k); 31 | 32 | public boolean isDisposed(); 33 | public boolean isMainAppContext(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/jdk/internal/misc/JavaIODeleteOnExitAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package jdk.internal.misc; 20 | 21 | /** 22 | * this is a placeholder for a Java 6 class, which we only have here to 23 | * support both Java 1.5 and 6 with the same set of env/ classes 24 | * 25 | * see sun.msic.SharedSecrets for details 26 | * 27 | * <2do> THIS IS GOING AWAY AS SOON AS WE OFFICIALLY SWITCH TO JAVA 6 28 | */ 29 | public interface JavaIODeleteOnExitAccess extends Runnable { 30 | @Override 31 | public void run(); 32 | } 33 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/jdk/internal/misc/JavaNetAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package jdk.internal.misc; 20 | 21 | import java.net.URLClassLoader; 22 | import jdk.internal.loader.URLClassPath; 23 | 24 | /** 25 | * this is a placeholder for a Java 6 class, which we only have here to 26 | * support both Java 1.5 and 6 with the same set of env/ classes 27 | * 28 | * see sun.msic.SharedSecrets for details 29 | * 30 | * <2do> THIS IS GOING AWAY AS SOON AS WE OFFICIALLY SWITCH TO JAVA 6 31 | */ 32 | public interface JavaNetAccess { 33 | URLClassPath getURLClassPath (URLClassLoader ucl); 34 | } 35 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/jdk/internal/misc/JavaNetUriAccess.java: -------------------------------------------------------------------------------- 1 | package jdk.internal.misc; 2 | 3 | public interface JavaNetUriAccess { 4 | // We can add more necessary methods here 5 | } 6 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/jdk/internal/misc/JavaNioAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package jdk.internal.misc; 19 | 20 | /** 21 | * <2do> this is not supported yet 22 | */ 23 | public interface JavaNioAccess { 24 | 25 | interface BufferPool { 26 | String getName(); 27 | long getCount(); 28 | long getTotalCapacity(); 29 | long getMemoryUsed(); 30 | } 31 | 32 | BufferPool getDirectBufferPool(); 33 | } 34 | -------------------------------------------------------------------------------- /src/classes/modules/java.base/sun/nio/ch/Interruptible.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package sun.nio.ch; 20 | 21 | /** 22 | * this is a placeholder for a Java 6 class, which we only have here to 23 | * support both Java 1.5 and 6 with the same set of env/ classes 24 | * 25 | * see sun.msic.SharedSecrets for details 26 | * 27 | * <2do> THIS IS GOING AWAY AS SOON AS WE OFFICIALLY SWITCH TO JAVA 6 28 | */ 29 | 30 | public interface Interruptible { 31 | public void interrupt(); 32 | } 33 | -------------------------------------------------------------------------------- /src/classes/modules/java.logging/java/util/logging/FileHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package java.util.logging; 20 | 21 | import java.io.FileOutputStream; 22 | import java.io.IOException; 23 | 24 | /** 25 | * simple stub to avoid execptions when using basic logging 26 | */ 27 | public class FileHandler extends StreamHandler { 28 | public FileHandler() throws IOException { 29 | this("log.log"); 30 | } 31 | 32 | public FileHandler(String pattern) throws IOException { 33 | super(); 34 | setOutputStream(new FileOutputStream(pattern)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/classes/org/junit/After.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.junit; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * same as org.junit.Test - we don't want to pull the whole of JUnit 28 | * into our JPF classpath just because we run TestJPF derived classes 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target(ElementType.METHOD) 32 | public @interface After { 33 | // nothing in here 34 | } 35 | -------------------------------------------------------------------------------- /src/classes/org/junit/AfterClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.junit; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * same as org.junit.Test - we don't want to pull the whole of JUnit 28 | * into our JPF classpath just because we run TestJPF derived classes 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target(ElementType.METHOD) 32 | public @interface AfterClass { 33 | // nothing in here 34 | } 35 | -------------------------------------------------------------------------------- /src/classes/org/junit/Before.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.junit; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * same as org.junit.Test - we don't want to pull the whole of JUnit 28 | * into our JPF classpath just because we run TestJPF derived classes 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target(ElementType.METHOD) 32 | public @interface Before { 33 | // nothing in here 34 | } 35 | -------------------------------------------------------------------------------- /src/classes/org/junit/BeforeClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.junit; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * same as org.junit.Test - we don't want to pull the whole of JUnit 28 | * into our JPF classpath just because we run TestJPF derived classes 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target(ElementType.METHOD) 32 | public @interface BeforeClass { 33 | // nothing in here 34 | } -------------------------------------------------------------------------------- /src/classes/org/junit/Ignore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.junit; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * same as org.junit.Test - we don't want to pull the whole of JUnit 28 | * into our JPF classpath just because we run TestJPF derived classes 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target(ElementType.METHOD) 32 | public @interface Ignore { 33 | String value() default ""; 34 | } 35 | -------------------------------------------------------------------------------- /src/examples/BoundedBuffer.jpf: -------------------------------------------------------------------------------- 1 | target = BoundedBuffer 2 | 3 | # this should produce a deadlock 4 | target.args = 2,4,1 -------------------------------------------------------------------------------- /src/examples/Crossing.jpf: -------------------------------------------------------------------------------- 1 | target = Crossing 2 | 3 | vm.tree_output = false 4 | vm.path_output = true 5 | search.class = .search.heuristic.BFSHeuristic 6 | -------------------------------------------------------------------------------- /src/examples/DiningPhil.jpf: -------------------------------------------------------------------------------- 1 | target = DiningPhil 2 | 3 | search.class = .search.heuristic.BFSHeuristic 4 | -------------------------------------------------------------------------------- /src/examples/HelloWorld.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * you guess what that one does - just like a normal VM 21 | */ 22 | public class HelloWorld { 23 | public static void main(String[] args){ 24 | System.out.println("I won't say it!"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/examples/HelloWorld.jpf: -------------------------------------------------------------------------------- 1 | target=HelloWorld -------------------------------------------------------------------------------- /src/examples/NumericValueCheck.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * example to catch numeric value rnge violations with the NumericValueChecker listener 21 | */ 22 | public class NumericValueCheck { 23 | 24 | public static void main (String[] args){ 25 | double someVariable; 26 | 27 | someVariable = 42; // what else 28 | 29 | someVariable = 12345; // ..That's the number only an idiot would have on his luggage 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/examples/NumericValueCheck.jpf: -------------------------------------------------------------------------------- 1 | target = NumericValueCheck 2 | 3 | listener = .listener.NumericValueChecker 4 | 5 | # NumericValueChecker configuration 6 | range.vars = 1 7 | range.1.var = NumericValueCheck.main(java.lang.String[]):someVariable 8 | range.1.min = 0 9 | range.1.max = 42 10 | 11 | -------------------------------------------------------------------------------- /src/examples/Racer.jpf: -------------------------------------------------------------------------------- 1 | target = Racer 2 | 3 | listener=gov.nasa.jpf.listener.PreciseRaceDetector 4 | 5 | report.console.property_violation=error,trace 6 | -------------------------------------------------------------------------------- /src/examples/Rand.jpf: -------------------------------------------------------------------------------- 1 | target = Rand 2 | 3 | cg.enumerate_random = true 4 | report.console.property_violation=error,trace -------------------------------------------------------------------------------- /src/examples/RobotManager-replay-nt.jpf: -------------------------------------------------------------------------------- 1 | target = RobotManager 2 | 3 | listener=.listener.ChoiceSelector,.listener.NullTracker 4 | 5 | choice.use_trace=trace 6 | 7 | cg.enumerate_random=true 8 | -------------------------------------------------------------------------------- /src/examples/RobotManager-replay-ot.jpf: -------------------------------------------------------------------------------- 1 | target = RobotManager 2 | 3 | listener=.listener.ChoiceSelector,.listener.ObjectTracker 4 | 5 | choice.use_trace=trace 6 | 7 | ot.refs = 0x160,0x185 8 | ot.log_fields = false 9 | 10 | cg.enumerate_random=true 11 | -------------------------------------------------------------------------------- /src/examples/RobotManager.jpf: -------------------------------------------------------------------------------- 1 | target = RobotManager 2 | 3 | listener=.listener.TraceStorer 4 | 5 | cg.enumerate_random=true 6 | -------------------------------------------------------------------------------- /src/examples/StopWatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * example to show how to explore off-nominal paths 21 | */ 22 | public class StopWatch { 23 | 24 | public static void main(String[] args){ 25 | long tStart = System.currentTimeMillis(); 26 | System.out.println("some lengthy computation.."); 27 | long tEnd = System.currentTimeMillis(); 28 | 29 | if (tEnd - tStart > 1000){ 30 | throw new RuntimeException("it took too long.."); 31 | } 32 | 33 | System.out.println("all fine, finished in time"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/examples/StopWatch.jpf: -------------------------------------------------------------------------------- 1 | target = StopWatch 2 | 3 | listener = .listener.StopWatchFuzzer 4 | -------------------------------------------------------------------------------- /src/examples/TestExample-coverage.jpf: -------------------------------------------------------------------------------- 1 | target = TestExample 2 | 3 | listener=.listener.CoverageAnalyzer 4 | 5 | coverage.include = T1,T2 6 | coverage.show_methods = true 7 | #coverage.show_bodies = true -------------------------------------------------------------------------------- /src/examples/oldclassic-da.jpf: -------------------------------------------------------------------------------- 1 | # JPF properties to run the oldclassic example with DeadlockAnalyzer report 2 | 3 | target=oldclassic 4 | 5 | # turn off instruction trace 6 | report.console.property_violation=error,snapshot 7 | 8 | # deadlock analyzer is a property-specific trace report generator 9 | listener=.listener.DeadlockAnalyzer 10 | deadlock.format=essential -------------------------------------------------------------------------------- /src/examples/oldclassic.jpf: -------------------------------------------------------------------------------- 1 | # JPF properties to run the oldclassic example with DeadlockAnalyzer report 2 | 3 | target=oldclassic 4 | 5 | report.console.property_violation=error,snapshot,trace 6 | -------------------------------------------------------------------------------- /src/main/fault/injection/examples/APISimpleExample.java: -------------------------------------------------------------------------------- 1 | package fault.injection.examples; 2 | 3 | import gov.nasa.jpf.vm.Verify; 4 | 5 | /* 6 | * Use getBitFlip API to inject a bit flip to a variable 7 | */ 8 | public class APISimpleExample { 9 | public static void main(String[] args) { 10 | System.out.println(Verify.getBitFlip((byte)0, 2)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/fault/injection/examples/AnnotationSimpleExample.java: -------------------------------------------------------------------------------- 1 | package fault.injection.examples; 2 | 3 | import gov.nasa.jpf.vm.Verify; 4 | import gov.nasa.jpf.annotation.BitFlip; 5 | 6 | /* 7 | * Use @BitFlip annotation to inject a bit flip to an argument 8 | */ 9 | public class AnnotationSimpleExample { 10 | public static void foo(@BitFlip byte bar) { 11 | System.out.println(bar); 12 | } 13 | public static void main(String[] args) { 14 | foo((byte)0); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/JPFErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf; 19 | 20 | /** 21 | * internal JPF error 22 | */ 23 | @SuppressWarnings("serial") 24 | public class JPFErrorException extends JPFException { 25 | public JPFErrorException (String s) { 26 | super(s); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/JPFListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf; 19 | 20 | /** 21 | * this is just a common root type for VMListeners and SearchListeners. No 22 | * own interface, just a type tag. It's main purpose is to provide some 23 | * typechecks during config-based reflection instantiation 24 | */ 25 | public interface JPFListener { 26 | // see VMListener, SearchListener 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/JPFListenerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf; 19 | 20 | /** 21 | * JPFException that wraps whatever can go wrong in a listener during notification 22 | */ 23 | public class JPFListenerException extends JPFException { 24 | 25 | public JPFListenerException(String details, Throwable cause) { 26 | super(details, cause); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/JPFNativePeerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf; 19 | 20 | /** 21 | * JPFException that wraps whatever can go wrong in a native method 22 | */ 23 | public class JPFNativePeerException extends JPFException { 24 | 25 | public JPFNativePeerException(String details, Throwable cause) { 26 | super(details, cause); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/StateExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf; 20 | 21 | public interface StateExtension { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/SystemAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf; 20 | 21 | /** 22 | * a type tag for attributes used by JPF 23 | * SystemAttributes are protected by the .util.ObjectList API against accidental 24 | * set(..) overwrite, they have to be removed by forceSet(..) 25 | */ 26 | public interface SystemAttribute { 27 | // nothing in here 28 | } 29 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/jvm/ClassNames.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.jvm; 2 | 3 | import java.util.*; 4 | public class ClassNames { 5 | public static ArrayList classNames = new ArrayList(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/jvm/JRTClassFileContainer.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.jvm; 2 | 3 | import gov.nasa.jpf.vm.ClassFileMatch; 4 | 5 | import java.io.IOException; 6 | import java.net.URI; 7 | import java.nio.file.FileSystem; 8 | import java.nio.file.FileSystems; 9 | import java.nio.file.Files; 10 | 11 | /** 12 | * ClassFileContainer to hold classes from the run-time image 13 | * Uses the new URL scheme, jrt, to references the classes stored in the run-time image 14 | * jrt:/ refers to the root path of the container where all class and resource files are stored 15 | */ 16 | public class JRTClassFileContainer extends JVMClassFileContainer { 17 | 18 | public JRTClassFileContainer() { 19 | super("jrt", "jrt:/"); 20 | } 21 | 22 | @Override 23 | public ClassFileMatch getMatch(String clsName) { 24 | FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/")); 25 | byte[] data; 26 | try { 27 | data = Files.readAllBytes(fs.getPath("modules", getClassEntryURL(clsName))); 28 | return new JVMClassFileMatch(clsName, getClassURL(clsName), data); 29 | } catch (IOException e) { 30 | return null; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/jvm/SkipAnnotation.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.jvm; 2 | 3 | public class SkipAnnotation extends RuntimeException { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/jvm/bytecode/GOTO_W.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.jvm.bytecode; 19 | 20 | 21 | public class GOTO_W extends GOTO { 22 | 23 | public GOTO_W(int targetPos){ 24 | super(targetPos); 25 | } 26 | 27 | @Override 28 | public int getLength() { 29 | return 5; // opcode, bb1, bb2, bb3, bb4 30 | } 31 | 32 | @Override 33 | public int getByteCode() { 34 | return 0xc8; 35 | } 36 | 37 | @Override 38 | public void accept(JVMInstructionVisitor insVisitor) { 39 | insVisitor.visit(this); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/jvm/bytecode/JVMFieldInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.jvm.bytecode; 19 | 20 | import gov.nasa.jpf.vm.FieldInfo; 21 | import gov.nasa.jpf.vm.ThreadInfo; 22 | import gov.nasa.jpf.vm.ElementInfo; 23 | 24 | /** 25 | * common type for all GET/PUT insns 26 | */ 27 | public interface JVMFieldInstruction extends JVMInstruction { 28 | 29 | FieldInfo getFieldInfo(); 30 | 31 | long getLastValue(); 32 | 33 | String getFieldName(); 34 | 35 | boolean isReferenceField(); 36 | 37 | ElementInfo peekElementInfo (ThreadInfo ti); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/jvm/bytecode/JVMInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.jvm.bytecode; 19 | 20 | import gov.nasa.jpf.vm.bytecode.InstructionInterface; 21 | 22 | /** 23 | * common type for all JVM instructions 24 | * 25 | * this can't be a abstract class since this would not allow us to 26 | * have machine independent instruction types 27 | */ 28 | public interface JVMInstruction extends InstructionInterface { 29 | 30 | public void accept(JVMInstructionVisitor insVisitor); 31 | } -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/report/PublisherExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.report; 20 | 21 | /** 22 | * used to add sections to publishers 23 | */ 24 | public interface PublisherExtension { 25 | 26 | void publishStart (Publisher publisher); 27 | void publishTransition (Publisher publisher); 28 | void publishPropertyViolation (Publisher publisher); 29 | void publishConstraintHit (Publisher publisher); 30 | void publishFinished (Publisher publisher); 31 | void publishProbe (Publisher publisher); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/search/SearchState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.search; 19 | 20 | public class SearchState { 21 | 22 | Search search; 23 | int depth; 24 | 25 | SearchState (Search search) { 26 | this.search = search; 27 | depth = search.depth; 28 | } 29 | 30 | public int getSearchDepth () { 31 | return depth; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/search/heuristic/DFSHeuristic.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.search.heuristic; 19 | 20 | import gov.nasa.jpf.Config; 21 | import gov.nasa.jpf.vm.VM; 22 | 23 | 24 | /** 25 | * heuristic state prioritizer that favors search depth 26 | */ 27 | public class DFSHeuristic extends SimplePriorityHeuristic { 28 | 29 | public DFSHeuristic (Config conf, VM vm) { 30 | super(conf, vm); 31 | } 32 | 33 | @Override 34 | protected int computeHeuristicValue () { 35 | return Integer.MAX_VALUE - vm.getPathLength(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/BailOut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | /** 22 | * this is just an evil control flow exception for non-local gotos 23 | * Useful in a context where you have to terminate execution from different (recursive) levels 24 | */ 25 | public class BailOut extends RuntimeException { 26 | 27 | public BailOut(){ 28 | // nothing here 29 | } 30 | 31 | public BailOut (String details){ 32 | super(details); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/CloneableObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | /** 21 | * the standard java.lang.Cloneable is just a type tag without methods, so 22 | * we can't use it to enforce public access of clone() 23 | */ 24 | public interface CloneableObject { 25 | Object clone(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/Cloner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | /** 21 | * this is a helper to enable deep copy of generic containers, where the 22 | * element types are generic type parameters and therefore can't be 23 | * created via ctor or clone. In this case, we have to pass in a cloner 24 | * object that knows about the concrete element types 25 | */ 26 | public interface Cloner { 27 | E clone (E other); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/ConstGrowth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | /** 19 | * 20 | */ 21 | package gov.nasa.jpf.util; 22 | 23 | public class ConstGrowth implements Growth { 24 | final int v; 25 | public ConstGrowth(int v) { 26 | if (v < 1 || v > 1000000000) { 27 | throw new IllegalArgumentException(); 28 | } 29 | this.v = v; 30 | } 31 | 32 | @Override 33 | public int grow(int oldSize, int minNewSize) { 34 | int newSize = oldSize + v; 35 | if (newSize < minNewSize) { 36 | newSize = minNewSize + (v >> 1); 37 | } 38 | return newSize; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/CountDown.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | final class CountDown extends RuntimeException { 22 | private int remaining; 23 | 24 | CountDown (int remaining){ 25 | this.remaining = remaining; 26 | } 27 | 28 | public final int dec(){ 29 | if (remaining <= 0){ 30 | throw this; 31 | } 32 | remaining--; 33 | return remaining; 34 | } 35 | 36 | public final void expire (){ 37 | remaining = 0; 38 | } 39 | 40 | public final void set(int remaining){ 41 | this.remaining = remaining; 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/ElementCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | /** 21 | * create an instance of type E out of a T instance 22 | */ 23 | public interface ElementCreator { 24 | E create (T o); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/Growth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | public interface Growth { 21 | int grow(int oldSize, int minNewSize); 22 | 23 | public static final Growth defaultGrowth = new ExpGrowth(1.7f); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/IdentityObjectSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | /** 22 | * an ObjectSet that uses reference comparison (identity) for inclusion checks 23 | */ 24 | public interface IdentityObjectSet extends ObjectSet, Iterable { 25 | // no new methods, just different inclusion checks 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/IndexIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | /** 21 | * specialized iterator class for index values [0..N] 22 | */ 23 | public interface IndexIterator { 24 | 25 | /** 26 | * answer next index value in iteration 27 | * @returns -1 if no next index 28 | */ 29 | int next(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/InstructionState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | import gov.nasa.jpf.SystemAttribute; 22 | 23 | /** 24 | * a abstract SystemAttribute that can be used to store instruction 25 | * execution state between top and bottom halves of respective instruction.execute() methods 26 | */ 27 | public abstract class InstructionState implements SystemAttribute { 28 | static class Processed extends InstructionState {} 29 | public static final Processed processed = new Processed(); // no need to burn lots of objects if we don't have state 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/IntIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | /** 22 | * just a little helper to iterate over collections of ints without doing 23 | * a lot of boxing/unboxing 24 | */ 25 | public interface IntIterator { 26 | void remove(); 27 | boolean hasNext(); 28 | int next(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/IntSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | public interface IntSet extends Cloneable { 22 | 23 | boolean add (int i); 24 | boolean remove (int i); 25 | boolean contains (int i); 26 | 27 | boolean isEmpty(); 28 | int size(); 29 | 30 | void clear(); 31 | 32 | IntIterator intIterator(); 33 | 34 | IntSet clone(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/ObjectQueue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | import java.util.NoSuchElementException; 22 | 23 | /** 24 | * generic interface for object queues 25 | */ 26 | public interface ObjectQueue extends Iterable { 27 | 28 | boolean isEmpty(); 29 | 30 | void clear(); 31 | 32 | int size(); 33 | 34 | boolean offer (E e); 35 | boolean add (E e); 36 | 37 | E peek(); 38 | 39 | E poll(); 40 | E remove() throws NoSuchElementException; 41 | 42 | void process (Processor processor); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/ObjectSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | /** 22 | * generic interface for object sets 23 | * this one makes no guarantees about identity or value comparison 24 | */ 25 | public interface ObjectSet extends Cloneable { 26 | 27 | boolean add (E e); 28 | boolean contains (E e); 29 | boolean remove (E e); 30 | 31 | int size(); 32 | 33 | ObjectSet clone(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/Predicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | public interface Predicate { 22 | 23 | boolean isTrue (T subject); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/Printable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | import java.io.PrintWriter; 21 | 22 | 23 | /** 24 | * Printable is mainly used to avoid having to create potentially huge 25 | * String(via StringBuilders or Writers) which are just used to be 26 | * written to std streams 27 | */ 28 | public interface Printable { 29 | void printOn (PrintWriter ps); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/Processor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | public interface Processor { 22 | void process(T obj); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/ReadOnlyObjList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util; 20 | 21 | public interface ReadOnlyObjList extends Iterable { 22 | E get(int idx); 23 | int length(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/RunListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | /** 21 | * little helper interface to facilitate resetting classes and objects 22 | * between JPF runs, mostly to avoid memory leaks 23 | */ 24 | public interface RunListener { 25 | 26 | void reset (RunRegistry reg); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/StateExtensionClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | import gov.nasa.jpf.JPF; 21 | 22 | /** 23 | * generic interface for state extensions that have to be backtracked/restored 24 | */ 25 | public interface StateExtensionClient { 26 | 27 | // these are the automatic SearchListener callbacks from the corresponding StateExtensionListener 28 | T getStateExtension(); 29 | void restore (T stateExtension); 30 | 31 | // this needs to be called somewhere from the app 32 | void registerListener (JPF jpf); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/Transformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | /** 21 | * transforms between two types 22 | * 23 | * a utility interface that esp. can be used for generic containers 24 | */ 25 | public interface Transformer { 26 | T2 transform (T1 e); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/TwoTypeComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | /** 21 | * like a normal comparator, but comparing heterogenous objects 22 | */ 23 | public interface TwoTypeComparator { 24 | int compare (T1 o1, T2 o2); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/event/ControlEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util.event; 19 | 20 | import gov.nasa.jpf.vm.MJIEnv; 21 | 22 | /** 23 | * pseudo event that is used to control the system under test execution 24 | */ 25 | public abstract class ControlEvent extends SystemEvent { 26 | 27 | protected ControlEvent (String name, Object... arguments){ 28 | super(name, arguments); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/event/EventContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util.event; 20 | 21 | /** 22 | * functional interface that is used to expand events from execution context 23 | */ 24 | public interface EventContext { 25 | Event map (Event original); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/event/NoEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util.event; 20 | 21 | /** 22 | * a null event, which is usually ignored by EventProducers 23 | */ 24 | public class NoEvent extends Event { 25 | 26 | // we don't have a singleton since we couldn't detect at compile time if 27 | // links are going to be modified 28 | 29 | public NoEvent (){ 30 | super(""); 31 | } 32 | 33 | @Override 34 | public boolean isNoEvent(){ 35 | return true; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/event/PropagatingEventContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util.event; 20 | 21 | /** 22 | * an EventContext that is invariant and hence can be automatically 23 | * propagated along the path 24 | */ 25 | public interface PropagatingEventContext extends EventContext { 26 | // no additional methods, just a type 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/event/SystemEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util.event; 19 | 20 | import gov.nasa.jpf.vm.MJIEnv; 21 | 22 | /** 23 | * event type that is not supposed to be handled by the SUT 24 | */ 25 | public abstract class SystemEvent extends Event { 26 | 27 | protected SystemEvent (String name, Object... arguments){ 28 | super(name, arguments); 29 | } 30 | 31 | @Override 32 | public boolean isSystemEvent(){ 33 | return true; 34 | } 35 | 36 | public void process (MJIEnv env, int objRef){ 37 | // nothing, optionally overridden by subclass 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/json/BooleanValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util.json; 19 | 20 | /** 21 | * Boolean value from JSON document 22 | * @author Ivan Mushketik 23 | */ 24 | class BooleanValue extends AbstractValue { 25 | 26 | Boolean value; 27 | 28 | public BooleanValue(boolean b, String read) { 29 | super(read); 30 | value = b; 31 | } 32 | 33 | @Override 34 | public Boolean getBoolean() { 35 | return value; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/json/Creator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util.json; 20 | 21 | import gov.nasa.jpf.vm.MJIEnv; 22 | 23 | /** 24 | * Creates new JPF from JSON value. 25 | * @author Ivan Mushketik 26 | */ 27 | interface Creator { 28 | /** 29 | * Create new object, according to read value. 30 | * @param env - MJI environment 31 | * @param typeName - name of the new object's type 32 | * @param value - value read from JSON document 33 | * @return reference to the new object 34 | */ 35 | public int create(MJIEnv env, String typeName, Value value); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/json/DoubleValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util.json; 19 | 20 | /** 21 | * Double value from JSON document 22 | * @author Ivan Mushketik 23 | */ 24 | public class DoubleValue extends AbstractValue { 25 | 26 | Double value; 27 | 28 | public DoubleValue(String strValue) { 29 | super(strValue); 30 | value = Double.parseDouble(strValue); 31 | } 32 | 33 | @Override 34 | public Double getDouble() { 35 | return value; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/json/StringValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util.json; 19 | 20 | /** 21 | * String value from JSON document 22 | * @author Ivan Mushketik 23 | */ 24 | public class StringValue extends AbstractValue { 25 | 26 | String value; 27 | 28 | public StringValue(String str) { 29 | super(str); 30 | value = str; 31 | } 32 | 33 | @Override 34 | public String getString() { 35 | return value; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/script/ElementProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util.script; 20 | 21 | public interface ElementProcessor { 22 | void process (Section s); 23 | void process (Event e); 24 | void process (Alternative a); 25 | void process (Repetition r); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/script/EventFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util.script; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * factory class used to create concrete Event instances 25 | */ 26 | public interface EventFactory { 27 | 28 | Event createEvent(ScriptElement parent, String id, List args, int line); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/script/EventGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util.script; 20 | 21 | import gov.nasa.jpf.vm.ChoiceGeneratorBase; 22 | 23 | /** 24 | * abstract ChoiceGenerator root for Event based generators 25 | */ 26 | public abstract class EventGenerator extends ChoiceGeneratorBase { 27 | 28 | protected EventGenerator (String id){ 29 | super(id); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/util/script/Script.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.util.script; 20 | 21 | public class Script extends ScriptElementContainer { 22 | 23 | /***** the stuff we need for traversal *****/ 24 | 25 | public Script() { 26 | super(null, 0); 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return toString("Script"); 32 | } 33 | 34 | @Override 35 | public void process (ElementProcessor p) { 36 | processChildren(p); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/AllocationContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | /** 21 | * abstract type that captures the context (class, thread id and callstack) 22 | * of an allocation 23 | * 24 | * Used for SGOID computation 25 | */ 26 | public interface AllocationContext { 27 | 28 | AllocationContext extend (ClassInfo ci, int anchor); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/AnnotationParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * a parser for annotation class files 23 | */ 24 | public interface AnnotationParser { 25 | 26 | void parse (AnnotationInfo ai) throws ClassParseException; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/Attributor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | /** 21 | * interface to configure various method and field attributes at class 22 | * load time 23 | */ 24 | public interface Attributor { 25 | void setAttributes (ClassInfo ci); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/Backtracker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | 21 | public interface Backtracker { 22 | static interface RestorableState {}; 23 | 24 | void attach(VM vm); 25 | 26 | // the backtracking interface (depth first search only) 27 | boolean backtrack (); 28 | void pushSystemState (); 29 | void pushKernelState (); 30 | 31 | // the general restore interface 32 | RestorableState getRestorableState(); 33 | void restoreState (RestorableState bs); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/BytecodeAnnotationInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * type annotation for type instructions such as instanceof, new, cast 23 | */ 24 | public class BytecodeAnnotationInfo extends AbstractTypeAnnotationInfo { 25 | 26 | protected int offset; 27 | 28 | public BytecodeAnnotationInfo (AnnotationInfo base, int targetType, short[] typePath, int offset) { 29 | super(base, targetType, typePath); 30 | 31 | this.offset = offset; 32 | } 33 | 34 | public int getOffset(){ 35 | return offset; 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/ClassChangeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | /** 21 | * represents a IncompatibleClassChangeError that has to be thrown in the SUT 22 | */ 23 | public class ClassChangeException extends RuntimeException { 24 | 25 | public ClassChangeException (String details){ 26 | super(details); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/ClassParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * an exception while parsing a ClassFile 23 | */ 24 | public class ClassParseException extends Exception { 25 | 26 | public ClassParseException (String details){ 27 | super(details); 28 | } 29 | 30 | public ClassParseException (String details, Throwable cause){ 31 | super(details, cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/ClosedMemento.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | /** 21 | * this is a self-contained memento that remembers which object to restore, 22 | * and where to restore it into (e.g. a container). 23 | * 24 | * This differs from a normal Memento in that it requires nothing from the 25 | * caller except of being called at the right times. 26 | * 27 | * Normally, implementors keep a reference to the original object, and copy 28 | * the field values which have to be restored. 29 | */ 30 | public interface ClosedMemento { 31 | 32 | void restore(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/DebugStateSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | import java.io.OutputStream; 21 | 22 | /** 23 | * debug extensions of StateSerializer interface 24 | */ 25 | public interface DebugStateSerializer extends StateSerializer { 26 | 27 | void setOutputStream (OutputStream os); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/DoubleChoiceGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | /** 21 | * Choice Generator that creates double values - this is only an 22 | * interface so that we can type check implementors that use 23 | * their own generic hierarchy 24 | */ 25 | public interface DoubleChoiceGenerator extends ChoiceGenerator { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/DoubleSlotFieldInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * a double or long field 23 | */ 24 | public abstract class DoubleSlotFieldInfo extends FieldInfo { 25 | 26 | protected DoubleSlotFieldInfo (String name, String signature, int modifiers) { 27 | super(name, signature, modifiers); 28 | } 29 | 30 | @Override 31 | public boolean is2SlotField(){ 32 | return true; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/FieldLockInfoFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | /** 21 | * factory interface for creating concrete FieldLockInfo objects, which 22 | * are configurable class sets (that might encapsulate heuristics) 23 | */ 24 | public interface FieldLockInfoFactory { 25 | 26 | FieldLockInfo createFieldLockInfo (ThreadInfo ti, ElementInfo ei, FieldInfo fi); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/FieldsFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * abstract factory interface for creating Fields, i.e. the JPF object model 23 | */ 24 | public interface FieldsFactory { 25 | 26 | public Fields createInstanceFields (ClassInfo ci); 27 | public Fields createStaticFields (ClassInfo ci); 28 | public Fields createArrayFields (String type, ClassInfo ci, int nElements, 29 | int typeSize, boolean isReferenceArray); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/FloatChoiceGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * Choice Generator that creates float value - this is only an interface 23 | * we can use for type checks of implementors that have their own 24 | * generic hierarchy 25 | */ 26 | public interface FloatChoiceGenerator extends ChoiceGenerator { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/FullStateSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | import gov.nasa.jpf.util.IntArray; 21 | import gov.nasa.jpf.util.IntTable; 22 | 23 | /** 24 | * Implements a lossless StateSet 25 | */ 26 | public class FullStateSet extends SerializingStateSet { 27 | IntTable states = new IntTable(16); 28 | 29 | @Override 30 | public int size () { 31 | return states.size(); 32 | } 33 | 34 | @Override 35 | public int add (int[] state) { 36 | return states.poolIndex(new IntArray(state)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/GenericSignatureHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * something that can have a GenericSignature classfile attribute 23 | */ 24 | public interface GenericSignatureHolder { 25 | 26 | void setGenericSignature(String signature); 27 | 28 | String getGenericSignature(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/IncrementalChangeTracker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * This should be implemented by classes that read & reset "hasChanged"-type 23 | * information in the KernelState. Example: CollapsingSerializer 24 | * 25 | * @author peterd 26 | */ 27 | public interface IncrementalChangeTracker extends KernelState.ChangeListener { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/IntChoiceGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | 21 | /** 22 | * Choice Generator that creates Integer values - this is just an interface 23 | * so that we can type test for implementors that have their own generic hierarchy 24 | */ 25 | public interface IntChoiceGenerator extends ChoiceGenerator { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/IsEndStateProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | import gov.nasa.jpf.GenericProperty; 21 | import gov.nasa.jpf.search.Search; 22 | 23 | 24 | /** 25 | * property class to check if we have reached the end state of the program 26 | */ 27 | class IsEndStateProperty extends GenericProperty { 28 | @Override 29 | public String getErrorMessage () { 30 | return "End State Reached"; 31 | } 32 | 33 | @Override 34 | public boolean check (Search search, VM vm) { 35 | return vm.isEndState(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/LongChoiceGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | 22 | 23 | /** 24 | * ChoiceGenerator for Long values - this is only an interface so that 25 | * we can use it for type checks of implementors that use their own 26 | * generic hierarchy 27 | */ 28 | public interface LongChoiceGenerator extends ChoiceGenerator { 29 | } 30 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/MethodLocator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * an interface to lookup methods 23 | */ 24 | public interface MethodLocator { 25 | boolean match (MethodInfo mi); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/NativeStateHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | /** 21 | * interface for native state components that are not visible to the serializer, 22 | * i.e. are not stored in any form within static or instance fields or stackframes 23 | */ 24 | public interface NativeStateHolder { 25 | 26 | /** 27 | * this is called by serializers to compute the state hash 28 | */ 29 | int getHash(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/NoJPFExec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | import gov.nasa.jpf.SystemAttribute; 21 | 22 | /** 23 | * InfoObject attr that flags a certain construct (field, method, class) is not supposed 24 | * to be used under JPF. Useful for model classes that have or use features which have to be 25 | * cut off / abstracted by means of native peers, and we want to catch violations as 26 | * early as possible 27 | */ 28 | public class NoJPFExec implements SystemAttribute { 29 | 30 | // we only need one 31 | public static final NoJPFExec SINGLETON = new NoJPFExec(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/PredicateMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | public abstract class PredicateMap { 21 | public int ref = MJIEnv.NULL; 22 | public void setRef(int objref) { 23 | ref = objref; 24 | } 25 | public int getRef() { 26 | return ref; 27 | } 28 | abstract public void evaluate(); 29 | 30 | abstract public String getRep(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/ReferenceChoiceGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * that's a little bit counter-intuitive - references are just int values in JPF 23 | */ 24 | public interface ReferenceChoiceGenerator extends ChoiceGenerator { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/ReferenceProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | /** 21 | * a generic interface to process reference values 22 | */ 23 | public interface ReferenceProcessor { 24 | 25 | void processReference (int ref); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/Restorable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * generic interface of objects that can provide state storage/restore capabilities 23 | */ 24 | public interface Restorable { 25 | 26 | Memento getMemento(MementoFactory factory); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/Scheduler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * a policy interface that is used for all system operations that might 23 | * cause ThreadChoiceGenerators 24 | */ 25 | public interface Scheduler extends SyncPolicy, SharednessPolicy { 26 | 27 | /** 28 | * per application initialization 29 | */ 30 | void initialize (VM vm, ApplicationContext appCtx); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/SerializingStateSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | 21 | public abstract class SerializingStateSet implements StateSet { 22 | protected StateSerializer serializer; 23 | 24 | @Override 25 | public void attach(VM vm) { 26 | serializer = vm.getSerializer(); 27 | } 28 | 29 | @Override 30 | public int addCurrent () { 31 | return add(serializer.getStoringData()); 32 | } 33 | 34 | protected abstract int add(int[] state); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/SingleSlotFieldInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * field type that requires a single slot (all but long and double) 23 | */ 24 | public abstract class SingleSlotFieldInfo extends FieldInfo { 25 | 26 | protected SingleSlotFieldInfo (String name, String signature, int modifiers) { 27 | super(name, signature, modifiers); 28 | } 29 | 30 | @Override 31 | public boolean is1SlotField(){ 32 | return true; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/StateRestorer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | 21 | 22 | public interface StateRestorer { 23 | void attach(VM vm); 24 | 25 | /** 26 | * get saved version of current KernelState. 27 | */ 28 | Saved getRestorableData(); 29 | 30 | /** 31 | * restore from saved KernelState. 32 | */ 33 | void restore(Saved data); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/StateSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | 21 | 22 | public interface StateSerializer { 23 | void attach(VM vm); 24 | 25 | /** 26 | * serialize the current state and return as int[] 27 | */ 28 | int[] getStoringData(); 29 | 30 | 31 | void addNativeStateHolder (NativeStateHolder nsh); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/Storable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | /** 21 | * generic Memento interface for things that need to be stored/backtracked 22 | * @deprecated foo 23 | */ 24 | @Deprecated 25 | public interface Storable { 26 | 27 | void backtrackTo (ArrayOffset storing); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/ThreadChoiceGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm; 19 | 20 | import java.io.PrintWriter; 21 | 22 | public interface ThreadChoiceGenerator extends ChoiceGenerator { 23 | 24 | void printOn (PrintWriter pw); 25 | 26 | boolean contains (ThreadInfo ti); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/ThrowsAnnotationInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * type annotation for throws elements 23 | */ 24 | public class ThrowsAnnotationInfo extends AbstractTypeAnnotationInfo { 25 | 26 | protected int throwsIndex; 27 | 28 | public ThrowsAnnotationInfo (AnnotationInfo base, int targetType, short[] typePath, int throwsIndex) { 29 | super( base, targetType, typePath); 30 | 31 | this.throwsIndex = throwsIndex; 32 | } 33 | 34 | public int getThrowsIndex(){ 35 | return throwsIndex; 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/TypeAnnotationInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | /** 22 | * type annotation for classes, enums and interfaces 23 | * 24 | * Note that we need a separate type than AbstractTypeAnnotationInfo since the 25 | * type is used for queries (InfoObjects can have any number of type annotations 26 | * with different targets) 27 | */ 28 | public class TypeAnnotationInfo extends AbstractTypeAnnotationInfo { 29 | 30 | public TypeAnnotationInfo (AnnotationInfo base, int targetType, short[] typePath) { 31 | super( base, targetType, typePath); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/ArrayElementInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm.bytecode; 20 | 21 | import gov.nasa.jpf.vm.ElementInfo; 22 | import gov.nasa.jpf.vm.ThreadInfo; 23 | import gov.nasa.jpf.vm.Instruction; 24 | 25 | /** 26 | * abstract base for all array element access instructions 27 | */ 28 | public abstract class ArrayElementInstruction extends Instruction implements ReadOrWriteInstruction { 29 | 30 | public abstract ElementInfo peekArrayElementInfo (ThreadInfo ti); 31 | 32 | public abstract int peekIndex(ThreadInfo ti); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/InstanceInvokeInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm.bytecode; 20 | 21 | import gov.nasa.jpf.vm.MethodInfo; 22 | import gov.nasa.jpf.vm.StackFrame; 23 | import gov.nasa.jpf.vm.ThreadInfo; 24 | 25 | /** 26 | * common type for all method invocations on objects 27 | */ 28 | public interface InstanceInvokeInstruction extends InstructionInterface { 29 | 30 | MethodInfo getInvokedMethod(); 31 | int getObjectSlot (StackFrame frame); 32 | int getCalleeThis(ThreadInfo ti); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/LocalVariableInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm.bytecode; 19 | 20 | import gov.nasa.jpf.vm.LocalVarInfo; 21 | 22 | /** 23 | * common type for various instructions that access local variables 24 | */ 25 | public interface LocalVariableInstruction extends InstructionInterface { 26 | 27 | String getVariableId(); 28 | 29 | int getLocalVariableSlot(); 30 | LocalVarInfo getLocalVarInfo(); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/LookupSwitchInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm.bytecode; 19 | 20 | /** 21 | * interface to insulate us from any specific Instruction hierarchy 22 | */ 23 | public interface LookupSwitchInstruction { 24 | 25 | void setTarget(int index, int match, int targetPc); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/NewInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm.bytecode; 19 | 20 | import gov.nasa.jpf.vm.Instruction; 21 | 22 | /** 23 | * abstract base for all allocating instructions 24 | */ 25 | public abstract class NewInstruction extends Instruction { 26 | // nothing in here 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/ReadInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm.bytecode; 20 | 21 | /** 22 | * common type for all GETx insns 23 | * This has to be an interface since implementors have to be derived from the abstract FieldInstruction 24 | */ 25 | public interface ReadInstruction extends ReadOrWriteInstruction { 26 | // nothing here yet 27 | } 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/ReturnInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm.bytecode; 19 | 20 | import gov.nasa.jpf.vm.Instruction; 21 | 22 | /** 23 | * abstract base for return instructions 24 | * 25 | * since .jvm so far does not use any specific feature of ReturnInstructions, 26 | * we just need an empty type to make .jvm independent of a specific 27 | * Instruction set 28 | */ 29 | public abstract class ReturnInstruction extends Instruction { 30 | // nothing in here yet 31 | } 32 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/ReturnValueInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm.bytecode; 20 | 21 | import gov.nasa.jpf.vm.StackFrame; 22 | 23 | /** 24 | * common type for ReturnInstructions that return a value 25 | */ 26 | public interface ReturnValueInstruction extends InstructionInterface { 27 | 28 | /** 29 | * where do we get from what we return 30 | * NOTE: only makes sense in a executeInstruction() context 31 | */ 32 | int getValueSlot(StackFrame frame); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/StoreInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm.bytecode; 19 | 20 | /** 21 | * abstraction for various store instructions 22 | */ 23 | public interface StoreInstruction 24 | { 25 | // just a type tag for now 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/TableSwitchInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm.bytecode; 19 | 20 | /** 21 | * interface to insulate us from any specific Instruction hierarchy 22 | */ 23 | public interface TableSwitchInstruction { 24 | 25 | void setTarget(int index, int targetPc); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/bytecode/WriteInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm.bytecode; 20 | 21 | import gov.nasa.jpf.vm.FieldInfo; 22 | import gov.nasa.jpf.vm.StackFrame; 23 | 24 | 25 | /** 26 | * common type for all xPUT insns 27 | */ 28 | public interface WriteInstruction extends ReadOrWriteInstruction { 29 | 30 | /** 31 | * where do we store the value 32 | */ 33 | FieldInfo getFieldInfo(); 34 | 35 | /** 36 | * from where in the StackFrame do we get the value for the put 37 | */ 38 | int getValueSlot(StackFrame frame); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/serialize/Abstraction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm.serialize; 19 | 20 | /** 21 | * interface to abstract concrete primitive values for the sake of state matching 22 | */ 23 | public interface Abstraction { 24 | 25 | int getAbstractValue (int v); 26 | int getAbstractValue (float v); 27 | int getAbstractValue (long v); 28 | int getAbstractValue (double v); 29 | 30 | int getAbstractObject (int ref); 31 | boolean traverseObject (int ref); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/serialize/FilterConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm.serialize; 19 | 20 | import gov.nasa.jpf.Config; 21 | import gov.nasa.jpf.vm.ClassInfo; 22 | import gov.nasa.jpf.vm.FieldInfo; 23 | import gov.nasa.jpf.vm.MethodInfo; 24 | 25 | public interface FilterConfiguration { 26 | void init(Config config); 27 | 28 | Iterable getMatchedInstanceFields(ClassInfo ci); 29 | 30 | Iterable getMatchedStaticFields(ClassInfo ci); 31 | 32 | FramePolicy getFramePolicy(MethodInfo mi); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/gov/nasa/jpf/vm/serialize/Ignored.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.vm.serialize; 19 | 20 | /** 21 | * tag attribute to ignore elements (classes, objects, fields) from 22 | * state matching 23 | */ 24 | public class Ignored { 25 | 26 | public static final Ignored IGNORED = new Ignored(); 27 | } 28 | -------------------------------------------------------------------------------- /src/peers/gov/nasa/jpf/vm/JPF_java_lang_Boolean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | import gov.nasa.jpf.annotation.MJI; 22 | import gov.nasa.jpf.vm.MJIEnv; 23 | import gov.nasa.jpf.vm.NativePeer; 24 | 25 | public class JPF_java_lang_Boolean extends NativePeer { 26 | // <2do> at this point we deliberately do not override clinit 27 | 28 | @MJI 29 | public int valueOf__Z__Ljava_lang_Boolean_2 (MJIEnv env, int clsRef, boolean val) { 30 | return env.valueOfBoolean(val); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/peers/gov/nasa/jpf/vm/JPF_java_lang_Byte.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.vm; 20 | 21 | import gov.nasa.jpf.annotation.MJI; 22 | import gov.nasa.jpf.vm.MJIEnv; 23 | import gov.nasa.jpf.vm.NativePeer; 24 | 25 | public class JPF_java_lang_Byte extends NativePeer { 26 | // <2do> at this point we deliberately do not override clinit 27 | 28 | @MJI 29 | public int valueOf__B__Ljava_lang_Byte_2 (MJIEnv env, int clsRef, byte val) { 30 | return env.valueOfByte(val); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/peers/gov/nasa/jpf/vm/JPF_java_lang_StringUTF16.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.vm; 2 | 3 | import gov.nasa.jpf.annotation.MJI; 4 | 5 | import java.nio.ByteOrder; 6 | 7 | public class JPF_java_lang_StringUTF16 extends NativePeer { 8 | 9 | /** 10 | * NativePeer method for {@link StringUTF16#isBigEndian()} 11 | */ 12 | @MJI 13 | public static boolean isBigEndian____Z (MJIEnv env, int cref) { 14 | return ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/tests/CharBufferTest.java: -------------------------------------------------------------------------------- 1 | import gov.nasa.jpf.util.test.TestJPF; 2 | import org.junit.Test; 3 | 4 | import java.nio.CharBuffer; 5 | import java.nio.charset.CharacterCodingException; 6 | import java.nio.charset.CharsetEncoder; 7 | import java.nio.charset.StandardCharsets; 8 | 9 | public class CharBufferTest extends TestJPF { 10 | @Test 11 | public void Test_Wrap() throws CharacterCodingException { 12 | if(verifyNoPropertyViolation()){ 13 | java.nio.charset.StandardCharsets.UTF_8.newEncoder().encode(java.nio.CharBuffer.wrap("heyo")); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/tests/NullCharsetTest.java: -------------------------------------------------------------------------------- 1 | import gov.nasa.jpf.util.test.TestJPF; 2 | import org.junit.Test; 3 | import java.nio.file.Path; 4 | 5 | public class NullCharsetTest extends TestJPF 6 | { 7 | @Test 8 | public void testDirectPathEntry() 9 | { 10 | if (verifyNoPropertyViolation()) 11 | { 12 | try { 13 | Path.of("/tmp"); 14 | } catch (IllegalArgumentException iae) 15 | { 16 | if ("Null charset name".equals(iae.getMessage())) 17 | { 18 | fail("IllegalArgumentException with 'Null charset name' encountered"); 19 | } 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/tests/SingleThreadTest.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.test; 2 | 3 | /** 4 | * Used with JUnit's @Category annotation. 5 | */ 6 | public interface SingleThreadTest { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/tests/classloader_specific_tests/Class1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package classloader_specific_tests; 20 | 21 | public class Class1 extends Class2 implements Interface1, Interface2 { 22 | 23 | public static void causeArithmeticException() { 24 | System.out.println("Class1 now causing ArithmeticException"); 25 | int a = 10; 26 | a = 10/(a-10); 27 | } 28 | 29 | public static void assertFalse() { 30 | assert false; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/tests/classloader_specific_tests/Class2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package classloader_specific_tests; 20 | 21 | public class Class2 { 22 | public static void assertFalse() { 23 | assert false; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/tests/classloader_specific_tests/Class3.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package classloader_specific_tests; 20 | 21 | public class Class3 { 22 | public static void assertFalse() { 23 | assert false; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/tests/classloader_specific_tests/Interface1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package classloader_specific_tests; 20 | 21 | public interface Interface1 { 22 | final static Class3 f = new Class3(); 23 | } 24 | -------------------------------------------------------------------------------- /src/tests/classloader_specific_tests/Interface2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package classloader_specific_tests; 20 | 21 | public interface Interface2 { 22 | } 23 | -------------------------------------------------------------------------------- /src/tests/fault/injection/examples/CRCTest.java: -------------------------------------------------------------------------------- 1 | package fault.injection.examples; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | public class CRCTest { 8 | CRC crc; 9 | @Test(expected = AssertionError.class) 10 | public void testIllegal () { 11 | crc = new CRC("102"); 12 | } 13 | @Test 14 | public void testNull () { 15 | crc = new CRC("101"); 16 | assertTrue(!crc.check(null, null)); 17 | } 18 | @Test 19 | public void testPositive () { 20 | crc = new CRC("1011"); 21 | assertTrue(crc.check("11010011101100", "100")); 22 | } 23 | @Test 24 | public void testNegative () { 25 | crc = new CRC("1011"); 26 | assertTrue(!crc.check("11010011101100", "101")); 27 | assertTrue(!crc.check("11010011101100", "200")); 28 | assertTrue(!crc.check("11010011101100", null)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/tests/fault/injection/examples/LongEncodedCRCTest.java: -------------------------------------------------------------------------------- 1 | package fault.injection.examples; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | public class LongEncodedCRCTest { 8 | LongEncodedCRC crc; 9 | @Test 10 | public void testPositive () { 11 | crc = new LongEncodedCRC("1011"); 12 | assertTrue(crc.check(14, 0b11010011101100100l)); 13 | } 14 | @Test 15 | public void testNegative () { 16 | crc = new LongEncodedCRC("1011"); 17 | assertTrue(!crc.check(14, 0b11010011101100101l)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/configTestApp.jpf: -------------------------------------------------------------------------------- 1 | # test app properties 2 | 3 | target = urgh.org.MySystemUnderTest 4 | 5 | target.args = a,b,c 6 | 7 | #key expansion 8 | name = mySUT 9 | ${name}.location = ${config_path} -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/configTestCommon.jpf: -------------------------------------------------------------------------------- 1 | # this represents properties that are used from a set of app property files, 2 | # but cannot put into project props because of breaking other extensions 3 | 4 | my.common = whatever -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/configTestIncludes.jpf: -------------------------------------------------------------------------------- 1 | # test @include pseudo property 2 | 3 | # normally, this would probably be in a project dir, like ${jpf-symbc} 4 | @include = ${config_path}/configTestCommon.jpf 5 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/configTestRequires.jpf: -------------------------------------------------------------------------------- 1 | # property file that requires previous property settings 2 | 3 | #pseudo property that causes exception if the provided value is not a defined key 4 | @requires = jpf.core 5 | 6 | # just to check if we got loaded 7 | whoa = boa -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/configTestRequiresFail.jpf: -------------------------------------------------------------------------------- 1 | # this should fail 2 | 3 | @requires = thisDoesNotExist 4 | 5 | # just to check if we got loaded 6 | whoa = boa -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/configTestSite.properties: -------------------------------------------------------------------------------- 1 | # just a dummy for the config unit test 2 | 3 | jpf.root=/Users/pcmehlitz/projects/jpf-v5 4 | 5 | jpf.core = ${jpf.root}/jpf-core 6 | 7 | #---------- installed extensions 8 | 9 | ext.numeric=${jpf.root}/jpf-numeric 10 | extensions=,${ext.numeric} 11 | 12 | ext.swing=${jpf.root}/jpf-swing 13 | extensions+=,${ext.swing} 14 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/listener/VerTrackerTest.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.listener; 2 | import gov.nasa.jpf.util.test.TestJPF; 3 | import org.junit.Test; 4 | 5 | class Emptymain{ 6 | public static void main(String[] args) { 7 | 8 | } 9 | } 10 | public class VerTrackerTest extends TestJPF { 11 | @Test 12 | public void test_Emptymain(){ 13 | if(verifyNoPropertyViolation("+listener=gov.nasa.jpf.listener.VarTracker")){ 14 | Emptymain.main(null); 15 | } 16 | } 17 | public static void main(String[] args) { 18 | runTestsOfThisClass(null); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/java/concurrent/ThreadExceptionTest.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.test.java.concurrent; 2 | 3 | import gov.nasa.jpf.util.test.TestJPF; 4 | import org.junit.Test; 5 | 6 | public class ThreadExceptionTest extends TestJPF { 7 | @Test 8 | public void testResourceAcquisition() { 9 | if (verifyUnhandledException("java.lang.RuntimeException", 10 | "+search.class=gov.nasa.jpf.search.RandomSearch", 11 | "+cg.randomize_choices=FIXED_SEED", "+search.RandomSearch.path_limit=10", "+search.multiple_errors=true")) { 12 | Thread t = new Thread(() -> { 13 | throw new RuntimeException("Exception from thread"); 14 | }); 15 | t.start(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/java/lang/CloneTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.test.java.lang; 20 | 21 | import gov.nasa.jpf.util.test.TestJPF; 22 | 23 | import org.junit.Test; 24 | 25 | /** 26 | * clone related tests 27 | */ 28 | public class CloneTest extends TestJPF { 29 | 30 | @Test 31 | public void testCloneArray() { 32 | if (verifyNoPropertyViolation()){ 33 | int[] a = new int[3]; 34 | int[] b = a.clone(); 35 | for (int i = 0; i < b.length; i++) { 36 | b[i]++; 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/java/lang/DoubleTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.test.java.lang; 20 | 21 | import gov.nasa.jpf.util.test.TestJPF; 22 | 23 | import org.junit.Test; 24 | 25 | /** 26 | * double related tests 27 | */ 28 | public class DoubleTest extends TestJPF { 29 | 30 | @Test 31 | public void testDivision() { 32 | if (verifyNoPropertyViolation()) { 33 | double i = 0; 34 | double j = 10 / i; 35 | assert(Double.valueOf(j).isInfinite()); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/java/lang/FloatTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.test.java.lang; 20 | 21 | import gov.nasa.jpf.util.test.TestJPF; 22 | 23 | import org.junit.Test; 24 | 25 | /** 26 | * float related tests 27 | */ 28 | public class FloatTest extends TestJPF { 29 | 30 | @Test 31 | public void testDivision() { 32 | if (verifyNoPropertyViolation()) { 33 | float i = 0; 34 | float j = 10 / i; 35 | assert(Float.valueOf(j).isInfinite()); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/java/lang/ThrowableTest.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.test.java.lang; 2 | 3 | import org.junit.Test; 4 | 5 | import gov.nasa.jpf.util.test.TestJPF; 6 | 7 | public class ThrowableTest extends TestJPF { 8 | @Test 9 | public void testSetCause() { 10 | if(verifyNoPropertyViolation()) { 11 | RuntimeException e = new RuntimeException(); 12 | e.initCause(new NullPointerException()); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/java/lang/reflect/other_package/OtherPackageParent.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.test.java.lang.reflect.other_package; 2 | 3 | /** 4 | * Used in gov.nasa.jpf.test.java.lang.reflect.FieldTest as a superclass. 5 | */ 6 | public class OtherPackageParent { 7 | protected static int parentStaticProtectedField = 40; 8 | protected int parentStaticField = 50; 9 | } 10 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/java/lang/reflect/other_package/OtherPackagePublicClass.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.test.java.lang.reflect.other_package; 2 | 3 | /** 4 | * Used in gov.nasa.jpf.test.java.lang.reflect.FieldTest. 5 | */ 6 | public class OtherPackagePublicClass { 7 | public static final int publicStaticFinalField = 10; 8 | public final int publicFinalField = 20; 9 | public int publicField; 10 | 11 | protected int protectedField = 30; 12 | int packagePrivateField = 40; 13 | 14 | public OtherPackagePublicClass(int v) { 15 | this.publicField = v; 16 | } 17 | 18 | public static OtherPackageInternalClass getPackagePrivateObject() { 19 | return new OtherPackageInternalClass(); 20 | } 21 | } 22 | 23 | class OtherPackageInternalClass { 24 | public static int publicStaticField = 88; 25 | } 26 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/java/util/CalendarTest.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.test.java.util; 2 | 3 | import gov.nasa.jpf.util.test.TestJPF; 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | import java.util.Calendar; 7 | 8 | public class CalendarTest extends TestJPF { 9 | 10 | @Test 11 | public void testCalendarHourSet(){ 12 | Calendar cal = Calendar.getInstance(); 13 | cal.set(Calendar.HOUR_OF_DAY, 23); 14 | Assert.assertEquals(23, cal.get(Calendar.HOUR_OF_DAY)); 15 | } 16 | 17 | @Test 18 | public void testCalendarHourSetAfterYear(){ 19 | Calendar cal = Calendar.getInstance(); 20 | cal.set(Calendar.YEAR, 2014); 21 | cal.set(Calendar.HOUR_OF_DAY, 23); 22 | Assert.assertEquals(2014, cal.get(Calendar.YEAR)); 23 | Assert.assertEquals(23, cal.get(Calendar.HOUR_OF_DAY)); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/mc/basic/JPF_gov_nasa_jpf_test_mc_basic_InvokeListenerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.test.mc.basic; 20 | 21 | import gov.nasa.jpf.annotation.MJI; 22 | import gov.nasa.jpf.vm.MJIEnv; 23 | import gov.nasa.jpf.vm.NativePeer; 24 | 25 | /** 26 | * native peer for TestInvokeListener tests 27 | */ 28 | public class JPF_gov_nasa_jpf_test_mc_basic_InvokeListenerTest extends NativePeer { 29 | 30 | @MJI 31 | public double testNativeInstanceMethod__DI__D (MJIEnv env, int objref, double d, int c){ 32 | return d+c; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/mc/basic/JPF_gov_nasa_jpf_test_mc_basic_NoJPFExecTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package gov.nasa.jpf.test.mc.basic; 20 | 21 | import gov.nasa.jpf.annotation.MJI; 22 | import gov.nasa.jpf.vm.MJIEnv; 23 | import gov.nasa.jpf.vm.NativePeer; 24 | 25 | /** 26 | * native peer for NoJPFExecTest 27 | */ 28 | public class JPF_gov_nasa_jpf_test_mc_basic_NoJPFExecTest extends NativePeer { 29 | 30 | @MJI 31 | public void bar____V (MJIEnv env, int objRef){ 32 | System.out.println("this is the bar____V() method intercepted by the native peer"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/mc/threads/SchedulesTest-output: -------------------------------------------------------------------------------- 1 | main starting T 2 | main finished 3 | T started 4 | T sleeping 5 | T finished 6 | ~~~~~ 7 | main starting T 8 | T started 9 | T sleeping 10 | main finished 11 | T finished 12 | ~~~~~ 13 | main starting T 14 | T started 15 | T sleeping 16 | T finished 17 | main finished 18 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/test_classes/class_test/DiffPkgProtectedClass.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.test.test_classes.class_test; 2 | 3 | public class DiffPkgProtectedClass { 4 | public boolean assertData = true; 5 | 6 | protected DiffPkgProtectedClass() { 7 | } 8 | } -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/test/test_classes/class_test/DiffPkgProtectedSubClass.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.test.test_classes.class_test; 2 | 3 | import gov.nasa.jpf.test.java.lang.ClassTest; 4 | 5 | public class DiffPkgProtectedSubClass extends ClassTest { 6 | public boolean assertData = true; 7 | 8 | protected DiffPkgProtectedSubClass() { 9 | } 10 | } -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/util/SortedArrayIntSetTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | public class SortedArrayIntSetTest extends ArrayIntSetTestBase { 21 | 22 | @Override 23 | protected ArrayIntSet createArrayIntSet() { 24 | return new SortedArrayIntSet(); 25 | } 26 | 27 | @Override 28 | protected ArrayIntSet createArrayIntSet(int n) { 29 | return new SortedArrayIntSet(n); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/util/UnsortedArrayIntSetTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, United States Government, as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * All rights reserved. 5 | * 6 | * The Java Pathfinder core (jpf-core) platform is licensed under the 7 | * Apache License, Version 2.0 (the "License"); you may not use this file except 8 | * in compliance with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0. 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package gov.nasa.jpf.util; 19 | 20 | public class UnsortedArrayIntSetTest extends ArrayIntSetTestBase { 21 | 22 | @Override 23 | protected ArrayIntSet createArrayIntSet() { 24 | return new UnsortedArrayIntSet(); 25 | } 26 | 27 | @Override 28 | protected ArrayIntSet createArrayIntSet(int n) { 29 | return new UnsortedArrayIntSet(n); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/tests/gov/nasa/jpf/vm/AllocationTest.java: -------------------------------------------------------------------------------- 1 | package gov.nasa.jpf.vm; 2 | 3 | import gov.nasa.jpf.util.test.TestJPF; 4 | import org.junit.Test; 5 | 6 | public class AllocationTest extends TestJPF { 7 | @Test 8 | public void testEqualsHashCollisionSameContext() { 9 | AllocationContext ctx = new HashedAllocationContext(-987565178); 10 | // Two Allocations with the same context, different counts, but equal hash. 11 | Allocation alloc1 = new Allocation(ctx, 40933); 12 | Allocation alloc2 = new Allocation(ctx, 64242); 13 | assertEquals("the two Allocations should have equal hash", alloc1.hash, alloc2.hash); 14 | 15 | assertFalse(alloc1.equals(alloc2)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/tests/java11/StringEqualsTest.java: -------------------------------------------------------------------------------- 1 | package java11; 2 | 3 | import gov.nasa.jpf.util.test.TestJPF; 4 | import org.junit.Test; 5 | public class StringEqualsTest extends TestJPF { 6 | @Test 7 | public void testStringEqual_differentObj(){ 8 | if(verifyNoPropertyViolation()){ 9 | String word="a"; 10 | boolean actual=word.equals(new Object()); 11 | boolean expected =false; 12 | assertEquals(expected,actual); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/tests/java8/JPF_java8_DefaultMethodTest$G1.java: -------------------------------------------------------------------------------- 1 | package java8; 2 | 3 | import gov.nasa.jpf.annotation.MJI; 4 | import gov.nasa.jpf.vm.MJIEnv; 5 | import gov.nasa.jpf.vm.NativePeer; 6 | 7 | /** 8 | * Created by pcmehlitz on 4/1/15. 9 | */ 10 | public class JPF_java8_DefaultMethodTest$G1 extends NativePeer { 11 | @MJI 12 | public int foo____I (MJIEnv env, int objRef){ 13 | System.out.println("this is native G1.foo()"); 14 | return 42; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/tests/resources/TestClassJava11.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javapathfinder/jpf-core/70c3013c60d627bc8158316abcf82fe503f5ae15/src/tests/resources/TestClassJava11.class -------------------------------------------------------------------------------- /src/tests/resources/TestClassJava17.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javapathfinder/jpf-core/70c3013c60d627bc8158316abcf82fe503f5ae15/src/tests/resources/TestClassJava17.class -------------------------------------------------------------------------------- /src/tests/test.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javapathfinder/jpf-core/70c3013c60d627bc8158316abcf82fe503f5ae15/src/tests/test.zip --------------------------------------------------------------------------------