├── .github └── workflows │ └── pre-integration.yml ├── .gitignore ├── .jcheck └── conf ├── LICENSE ├── README.md ├── ROADMAP ├── THIRD_PARTY_README ├── jcstress-benchmarks ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── openjdk │ └── jcstress │ ├── LazyBench.java │ ├── SampleTest.java │ ├── SampleTestBench.java │ └── SingletonBench.java ├── jcstress-contended-autoinjector ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── openjdk │ │ └── jcstress │ │ └── ContendedAutoInjectorMain.java │ └── test │ └── java │ ├── jdk │ └── internal │ │ └── vm │ │ └── annotation │ │ └── Contended.java │ ├── org │ └── openjdk │ │ └── jcstress │ │ ├── annotations │ │ └── State.java │ │ ├── flat │ │ ├── TestBoth.java │ │ ├── TestNone.java │ │ ├── TestOnlyJdkInternal.java │ │ └── TestOnlySunMisc.java │ │ ├── inner │ │ ├── TestBoth.java │ │ ├── TestNone.java │ │ ├── TestOnlyJdkInternal.java │ │ └── TestOnlySunMisc.java │ │ └── nested │ │ └── inner │ │ ├── TestBoth.java │ │ ├── TestNone.java │ │ ├── TestOnlyJdkInternal.java │ │ └── TestOnlySunMisc.java │ └── sun │ └── misc │ └── Contended.java ├── jcstress-core ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── jdk │ │ │ └── internal │ │ │ │ └── vm │ │ │ │ └── annotation │ │ │ │ └── Contended.java │ │ ├── org │ │ │ └── openjdk │ │ │ │ └── jcstress │ │ │ │ ├── ForkFailedException.java │ │ │ │ ├── ForkedMain.java │ │ │ │ ├── JCStress.java │ │ │ │ ├── Main.java │ │ │ │ ├── Options.java │ │ │ │ ├── TestExecutor.java │ │ │ │ ├── TimeBudget.java │ │ │ │ ├── Verbosity.java │ │ │ │ ├── annotations │ │ │ │ ├── Actor.java │ │ │ │ ├── Arbiter.java │ │ │ │ ├── Description.java │ │ │ │ ├── Expect.java │ │ │ │ ├── JCStressMeta.java │ │ │ │ ├── JCStressTest.java │ │ │ │ ├── Mode.java │ │ │ │ ├── Outcome.java │ │ │ │ ├── Ref.java │ │ │ │ ├── Result.java │ │ │ │ ├── Signal.java │ │ │ │ └── State.java │ │ │ │ ├── infra │ │ │ │ ├── Copyable.java │ │ │ │ ├── StateCase.java │ │ │ │ ├── Status.java │ │ │ │ ├── TestInfo.java │ │ │ │ ├── collectors │ │ │ │ │ ├── DiskReadCollector.java │ │ │ │ │ ├── DiskWriteCollector.java │ │ │ │ │ ├── InProcessCollector.java │ │ │ │ │ ├── MuxCollector.java │ │ │ │ │ ├── SerializedBufferCollector.java │ │ │ │ │ ├── TestResult.java │ │ │ │ │ └── TestResultCollector.java │ │ │ │ ├── grading │ │ │ │ │ ├── ConsoleReportPrinter.java │ │ │ │ │ ├── ExceptionReportPrinter.java │ │ │ │ │ ├── GradingResult.java │ │ │ │ │ ├── HTMLReportPrinter.java │ │ │ │ │ ├── ReportUtils.java │ │ │ │ │ ├── TestGrading.java │ │ │ │ │ └── TextReportPrinter.java │ │ │ │ ├── processors │ │ │ │ │ ├── GenerationException.java │ │ │ │ │ ├── JCStressTestProcessor.java │ │ │ │ │ └── TestInfo.java │ │ │ │ └── runners │ │ │ │ │ ├── AbstractThread.java │ │ │ │ │ ├── Control.java │ │ │ │ │ ├── CounterThread.java │ │ │ │ │ ├── ForkedTestConfig.java │ │ │ │ │ ├── LongThread.java │ │ │ │ │ ├── ResourceEstimator.java │ │ │ │ │ ├── Runner.java │ │ │ │ │ ├── SpinLoopStyle.java │ │ │ │ │ ├── TestConfig.java │ │ │ │ │ ├── TestList.java │ │ │ │ │ ├── VoidThread.java │ │ │ │ │ └── WorkerSync.java │ │ │ │ ├── link │ │ │ │ ├── BinaryLinkClient.java │ │ │ │ ├── BinaryLinkServer.java │ │ │ │ ├── Protocol.java │ │ │ │ └── ServerListener.java │ │ │ │ ├── os │ │ │ │ ├── AffinityMode.java │ │ │ │ ├── AffinitySupport.java │ │ │ │ ├── AffinitySupportTestMain.java │ │ │ │ ├── CPUMap.java │ │ │ │ ├── NodeType.java │ │ │ │ ├── OSSupport.java │ │ │ │ ├── Scheduler.java │ │ │ │ ├── SchedulingClass.java │ │ │ │ └── topology │ │ │ │ │ ├── AbstractTopology.java │ │ │ │ │ ├── FallbackTopology.java │ │ │ │ │ ├── LinuxProcfsTopology.java │ │ │ │ │ ├── LinuxSysfsTopology.java │ │ │ │ │ ├── PresetListTopology.java │ │ │ │ │ ├── PresetRegularTopology.java │ │ │ │ │ ├── Topology.java │ │ │ │ │ └── TopologyParseException.java │ │ │ │ ├── util │ │ │ │ ├── ArrayUtils.java │ │ │ │ ├── Bridges.java │ │ │ │ ├── Counter.java │ │ │ │ ├── Environment.java │ │ │ │ ├── FileUtils.java │ │ │ │ ├── HashMultimap.java │ │ │ │ ├── HashMultiset.java │ │ │ │ ├── InputStreamCollector.java │ │ │ │ ├── InputStreamDrainer.java │ │ │ │ ├── Multimap.java │ │ │ │ ├── Multiset.java │ │ │ │ ├── Multisets.java │ │ │ │ ├── MutableLong.java │ │ │ │ ├── NonNullArrayList.java │ │ │ │ ├── NullOutputStream.java │ │ │ │ ├── OptionFormatter.java │ │ │ │ ├── Paddings.java │ │ │ │ ├── Promise.java │ │ │ │ ├── Reflections.java │ │ │ │ ├── ResultUtils.java │ │ │ │ ├── StringUtils.java │ │ │ │ ├── TestLineReader.java │ │ │ │ ├── TestLineWriter.java │ │ │ │ ├── TimeValue.java │ │ │ │ ├── TreeMultimap.java │ │ │ │ ├── TreesetMultimap.java │ │ │ │ └── UnsafeHolder.java │ │ │ │ └── vm │ │ │ │ ├── AllocProfileMain.java │ │ │ │ ├── AllocProfileSupport.java │ │ │ │ ├── CompileMode.java │ │ │ │ ├── ContendedTestMain.java │ │ │ │ ├── PrivilegedTestMain.java │ │ │ │ ├── SimpleTestMain.java │ │ │ │ ├── ThreadSpinWaitTestMain.java │ │ │ │ ├── VMSupport.java │ │ │ │ └── VMSupportException.java │ │ └── sun │ │ │ └── misc │ │ │ ├── Contended.java │ │ │ └── Unsafe.java │ └── resources │ │ ├── LICENSE │ │ ├── META-INF │ │ └── services │ │ │ └── javax.annotation.processing.Processor │ │ └── THIRD_PARTY_README │ └── test │ ├── java │ └── org │ │ └── openjdk │ │ └── jcstress │ │ ├── CompileModeTest.java │ │ ├── infra │ │ └── results │ │ │ ├── I_Result_Test.java │ │ │ └── L_Result_Test.java │ │ ├── os │ │ ├── AbstractSchedulerAffinityTest.java │ │ ├── AffinitySupportTest.java │ │ ├── SchedulerAffinityIrregularTest.java │ │ ├── SchedulerAffinityRegularTest.java │ │ ├── SchedulerTest.java │ │ ├── SchedulingClassInvariantsTest.java │ │ └── topology │ │ │ ├── AbstractTopologyTest.java │ │ │ ├── FallbackTopologyTest.java │ │ │ ├── LinuxProcfsTopologyTest.java │ │ │ ├── LinuxSysfsTopologyTest.java │ │ │ └── PresetRegularTopologyTest.java │ │ └── util │ │ ├── ArrayUtilsTest.java │ │ ├── CounterTest.java │ │ ├── FileUtilsTest.java │ │ ├── StringUtilsTest.java │ │ └── TestLineTest.java │ └── resources │ └── topology │ ├── cpuinfo-1.txt │ ├── cpuinfo-2.txt │ ├── cpuinfo-3.txt │ ├── cpuinfo-4.txt │ ├── cpuinfo-5.txt │ ├── cpuinfo-6.txt │ ├── cpuinfo-7.txt │ ├── cpuinfo-8.txt │ ├── cpuinfo-9.txt │ ├── sysfs-1.txt │ ├── sysfs-2.txt │ ├── sysfs-3.txt │ ├── sysfs-4.txt │ ├── sysfs-5.txt │ ├── sysfs-6.txt │ ├── sysfs-7.txt │ ├── sysfs-8.txt │ └── sysfs-9.txt ├── jcstress-java-test-archetype ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ ├── main │ └── resources │ │ ├── LICENSE │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype-metadata.xml │ │ ├── THIRD_PARTY_README │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ └── ConcurrencyTest.java │ └── test │ └── resources │ └── projects │ └── test │ ├── archetype.properties │ └── goal.txt ├── jcstress-result-gen ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── openjdk │ └── jcstress │ ├── ResultGenMain.java │ └── ResultGenerator.java ├── jcstress-samples ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── openjdk │ │ └── jcstress │ │ └── samples │ │ ├── api │ │ ├── API_01_Simple.java │ │ ├── API_02_Arbiters.java │ │ ├── API_03_Termination.java │ │ ├── API_04_Nesting.java │ │ ├── API_05_SharedMetadata.java │ │ └── API_06_Descriptions.java │ │ ├── jmm │ │ ├── advanced │ │ │ ├── AdvancedJMM_01_SynchronizedBarriers.java │ │ │ ├── AdvancedJMM_02_MultiCopyAtomic.java │ │ │ ├── AdvancedJMM_03_NonMCA_Coherence.java │ │ │ ├── AdvancedJMM_04_LosingUpdates.java │ │ │ ├── AdvancedJMM_05_MisplacedVolatile.java │ │ │ ├── AdvancedJMM_06_SemiSynchronized.java │ │ │ ├── AdvancedJMM_07_SemiVolatile.java │ │ │ ├── AdvancedJMM_08_ArrayVolatility.java │ │ │ ├── AdvancedJMM_09_WrongReleaseOrder.java │ │ │ ├── AdvancedJMM_10_WrongListReleaseOrder.java │ │ │ ├── AdvancedJMM_11_WrongAcquireOrder.java │ │ │ ├── AdvancedJMM_12_WrongAcquireReleaseOrder.java │ │ │ ├── AdvancedJMM_13_VolatileVsFinal.java │ │ │ ├── AdvancedJMM_14_SynchronizedAreNotFences.java │ │ │ └── AdvancedJMM_15_VolatilesAreNotFences.java │ │ └── basic │ │ │ ├── BasicJMM_01_DataRaces.java │ │ │ ├── BasicJMM_02_AccessAtomicity.java │ │ │ ├── BasicJMM_03_WordTearing.java │ │ │ ├── BasicJMM_04_Progress.java │ │ │ ├── BasicJMM_05_Coherence.java │ │ │ ├── BasicJMM_06_Causality.java │ │ │ ├── BasicJMM_07_Consensus.java │ │ │ ├── BasicJMM_08_Finals.java │ │ │ ├── BasicJMM_09_BenignRaces.java │ │ │ └── BasicJMM_10_OOTA.java │ │ ├── primitives │ │ ├── lazy │ │ │ ├── Lazy_01_BrokenFactory.java │ │ │ ├── Lazy_02_BrokenNulls.java │ │ │ ├── Lazy_03_Basic.java │ │ │ ├── Lazy_04_BrokenOneShot.java │ │ │ ├── Lazy_05_WrapperOneShot.java │ │ │ ├── Lazy_06_FencedOneShot.java │ │ │ ├── performance.md │ │ │ └── shared │ │ │ │ ├── Holder.java │ │ │ │ ├── HolderFactory.java │ │ │ │ ├── Lazy.java │ │ │ │ ├── NullHolderFactory.java │ │ │ │ └── SupplierDupException.java │ │ ├── library │ │ │ └── Library_01_CHM.java │ │ ├── mutex │ │ │ ├── Mutex_01_PetersonAlgorithm.java │ │ │ ├── Mutex_02_DekkerAlgorithm.java │ │ │ ├── Mutex_03_SpinLock.java │ │ │ ├── Mutex_04_Synchronized.java │ │ │ ├── Mutex_05_ReentrantLock.java │ │ │ └── Mutex_06_Semaphore.java │ │ ├── rmw │ │ │ ├── RMW_01_UncontendedSuccess.java │ │ │ ├── RMW_02_ContendedSuccess.java │ │ │ ├── RMW_03_ConflictSameValue.java │ │ │ ├── RMW_04_ConflictCoherence.java │ │ │ ├── RMW_05_AcquireOnSuccess.java │ │ │ ├── RMW_06_ReleaseOnSuccess.java │ │ │ ├── RMW_07_AcquireOnFailure.java │ │ │ ├── RMW_08_ReleaseOnFailure.java │ │ │ ├── RMW_09_GAS_Effects.java │ │ │ ├── RMW_10_FailureWitness.java │ │ │ ├── RMW_11_FailureWitnessRWL.java │ │ │ └── RMW_12_FailureWitnessLoops.java │ │ └── singletons │ │ │ ├── Singleton_01_BrokenUnsynchronized.java │ │ │ ├── Singleton_02_BrokenVolatile.java │ │ │ ├── Singleton_03_InefficientCAS.java │ │ │ ├── Singleton_04_InefficientSynchronized.java │ │ │ ├── Singleton_05_DCL.java │ │ │ ├── Singleton_06_AcquireReleaseDCL.java │ │ │ ├── Singleton_07_BrokenNonVolatileDCL.java │ │ │ ├── Singleton_08_FinalWrapper.java │ │ │ ├── Singleton_09_Holder.java │ │ │ ├── Singleton_10_ThreadLocalWitness.java │ │ │ ├── performance.md │ │ │ └── shared │ │ │ ├── Factory.java │ │ │ ├── FinalSingleton.java │ │ │ ├── MapResult.java │ │ │ ├── NonFinalSingleton.java │ │ │ └── Singleton.java │ │ └── problems │ │ ├── classic │ │ ├── Classic_01_DiningPhilosophers.java │ │ └── Classic_02_ProducerConsumerProblem.java │ │ └── racecondition │ │ ├── RaceCondition_01_RMW.java │ │ └── RaceCondition_02_CheckThenReact.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── jcstress-test-base └── pom.xml ├── jcstress-test-gen ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── openjdk │ │ └── jcstress │ │ ├── Spp.java │ │ ├── TestGenMain.java │ │ ├── Values.java │ │ ├── chapters │ │ ├── Chapter0aTestGenerator.java │ │ ├── Chapter0bTestGenerator.java │ │ ├── Chapter0cTestGenerator.java │ │ ├── Chapter0eTestGenerator.java │ │ ├── Chapter1aTestGenerator.java │ │ ├── Chapter1bTestGenerator.java │ │ ├── Chapter1cTestGenerator.java │ │ ├── Chapter1dTestGenerator.java │ │ ├── Chapter2aTestGenerator.java │ │ └── GeneratorUtils.java │ │ └── generator │ │ ├── AcqType.java │ │ ├── Atomic_Updater_X.java │ │ ├── Atomic_X.java │ │ ├── Primitive.java │ │ ├── RelType.java │ │ ├── SynchronizedBlock.java │ │ ├── TestGenerator.java │ │ ├── VolatileReadWrite.java │ │ └── seqcst │ │ ├── MultiThread.java │ │ ├── Op.java │ │ ├── Phase.java │ │ ├── Result.java │ │ ├── SeqCstTraceGenerator.java │ │ ├── Target.java │ │ ├── Trace.java │ │ ├── TraceResult.java │ │ └── Value.java │ └── resources │ ├── LICENSE │ ├── THIRD_PARTY_README │ ├── accessAtomic │ ├── X-ArrayAtomicityTest.java.template │ ├── X-ArrayCopyConflictAtomicityTest.java.template │ ├── X-ArrayCopyDstAtomicityTest.java.template │ ├── X-ArrayCopySrcAtomicityTest.java.template │ ├── X-FieldAtomicityTest.java.template │ ├── X-FieldConflictAtomicityTest.java.template │ ├── X-VarHandleArrayAtomicityTest.java.template │ ├── X-VarHandleByteArrayViewAtomicityTest.java.template │ ├── X-VarHandleDirectByteBufferViewAtomicityTest.java.template │ ├── X-VarHandleFieldAtomicityTest.java.template │ └── X-VarHandleHeapByteBufferViewAtomicityTest.java.template │ ├── acqrel │ ├── X-FieldAcqRelTest.java.template │ ├── X-VarHandleArrayAcqRelTest.java.template │ ├── X-VarHandleByteArrayViewAcqRelTest.java.template │ ├── X-VarHandleDirectByteBufferViewAcqRelTest.java.template │ ├── X-VarHandleFieldAcqRelTest.java.template │ └── X-VarHandleHeapByteBufferViewAcqRelTest.java.template │ ├── coherence │ ├── X-ArrayCoherenceTest.java.template │ ├── X-FieldCoherenceTest.java.template │ ├── X-VarHandleArrayCoherenceTest.java.template │ ├── X-VarHandleByteArrayViewCoherenceTest.java.template │ ├── X-VarHandleDirectByteBufferViewCoherenceTest.java.template │ ├── X-VarHandleFieldCoherenceTest.java.template │ └── X-VarHandleHeapByteBufferViewCoherenceTest.java.template │ ├── copy │ ├── arrays │ │ ├── X-Arraycopy.java.template │ │ ├── X-ArraysCopyOf.java.template │ │ ├── X-Clone.java.template │ │ ├── X-LargeArraycopy.java.template │ │ ├── X-LargeArraysCopyOf.java.template │ │ ├── X-LargeClone.java.template │ │ ├── X-LargeManual.java.template │ │ └── X-Manual.java.template │ └── objects │ │ ├── X-Clone.java.template │ │ └── X-Manual.java.template │ ├── defaultValues │ ├── X-ArrayDefaultValuesTest.java.template │ ├── X-ArrayLargeDefaultValuesTest.java.template │ └── X-FieldDefaultValuesTest.java.template │ ├── fences │ ├── X-LoadLoadFenceTest.java.template │ ├── X-LoadStoreFenceTest1.java.template │ ├── X-LoadStoreFenceTest2.java.template │ ├── X-StoreLoadFenceTest.java.template │ ├── X-StoreStoreFenceTest1.java.template │ └── X-StoreStoreFenceTest2.java.template │ ├── init │ ├── X-ArrayInitClassTest.java.template │ ├── X-ArrayInitLengthTest.java.template │ ├── X-ArrayInitTest.java.template │ ├── X-ArrayLargeInitClassTest.java.template │ ├── X-ArrayLargeInitLengthTest.java.template │ ├── X-ArrayLargeInitTest.java.template │ ├── X-FieldInitClassTest.java.template │ └── X-FieldInitTest.java.template │ ├── operationAtomic │ ├── arrays │ │ ├── X-CAETest.java.template │ │ ├── X-CASTest.java.template │ │ ├── X-GetAndAddTest.java.template │ │ ├── X-GetAndSetTest.java.template │ │ ├── X-WeakCASContendStrongTest.java.template │ │ └── X-WeakCASTest.java.template │ ├── byteArray │ │ ├── X-CAETest.java.template │ │ ├── X-CASTest.java.template │ │ ├── X-GetAndAddTest.java.template │ │ ├── X-GetAndSetTest.java.template │ │ ├── X-WeakCASContendStrongTest.java.template │ │ └── X-WeakCASTest.java.template │ ├── byteBuffer │ │ ├── X-CAETest.java.template │ │ ├── X-CASTest.java.template │ │ ├── X-GetAndAddTest.java.template │ │ ├── X-GetAndSetTest.java.template │ │ ├── X-WeakCASContendStrongTest.java.template │ │ └── X-WeakCASTest.java.template │ └── fields │ │ ├── X-CAETest.java.template │ │ ├── X-CASTest.java.template │ │ ├── X-GetAndAddTest.java.template │ │ ├── X-GetAndSetTest.java.template │ │ ├── X-WeakCASContendStrongTest.java.template │ │ └── X-WeakCASTest.java.template │ └── tearing │ ├── X-ArrayLargeTearingTest.java.template │ ├── X-ArrayTearingTest.java.template │ └── X-FieldTearingTest.java.template ├── pom.xml ├── src └── license │ ├── LICENSE │ └── gpl_cpe │ ├── header.txt │ └── license.txt ├── tests-all ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── Test.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── tests-chapter-0a ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── Test.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── tests-chapter-0b ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── Test.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── tests-chapter-0c ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── Test.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── tests-chapter-0d ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ ├── Test.java │ └── org │ │ └── openjdk │ │ └── jcstress │ │ └── tests │ │ └── causality │ │ ├── Test1.java │ │ ├── Test10.java │ │ ├── Test11.java │ │ ├── Test12.java │ │ ├── Test13.java │ │ ├── Test14.java │ │ ├── Test15.java │ │ ├── Test16.java │ │ ├── Test17.java │ │ ├── Test18.java │ │ ├── Test2.java │ │ ├── Test3.java │ │ ├── Test4.java │ │ ├── Test5.java │ │ ├── Test6.java │ │ ├── Test7.java │ │ ├── Test8.java │ │ └── Test9.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── tests-chapter-0e ├── pom.xml └── src │ └── main │ └── java │ └── Test.java ├── tests-chapter-1a ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── Test.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── tests-chapter-1b ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── Test.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── tests-chapter-1c ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── Test.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── tests-chapter-1d ├── pom.xml └── src │ └── main │ └── java │ └── Test.java ├── tests-chapter-2a ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── Test.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README ├── tests-chapter-2b ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src │ └── main │ ├── java │ └── Test.java │ └── resources │ ├── LICENSE │ └── THIRD_PARTY_README └── tests-custom ├── LICENSE ├── THIRD_PARTY_README ├── pom.xml └── src └── main ├── java └── org │ └── openjdk │ └── jcstress │ └── tests │ ├── atomicity │ ├── buffers │ │ ├── ByteBufferAtomicityTests.java │ │ ├── ByteBufferViewsAtomicityTests.java │ │ ├── CharBufferAtomicityTests.java │ │ ├── DirectByteBufferAtomicityTests.java │ │ ├── DirectByteBufferViewsAtomicityTests.java │ │ ├── DoubleBufferAtomicityTests.java │ │ ├── FloatBufferAtomicityTests.java │ │ ├── GradeChar.java │ │ ├── GradeDouble.java │ │ ├── GradeFloat.java │ │ ├── GradeInt.java │ │ ├── IntBufferAtomicityTests.java │ │ ├── LongBufferAtomicityTests.java │ │ └── ShortBufferAtomicityTests.java │ ├── crosscache │ │ ├── ByteBufferIntAtomicityTest.java │ │ ├── DirectByteBufferIntAtomicityTest.java │ │ └── UnsafeIntAtomicityTest.java │ └── primitives │ │ ├── Constants.java │ │ ├── perbyte │ │ ├── ByteAtomicityTest.java │ │ ├── CharAtomicityTest.java │ │ ├── DoubleAtomicityTest.java │ │ ├── FloatAtomicityTest.java │ │ ├── IntAtomicityTest.java │ │ ├── LongAtomicityTest.java │ │ ├── ShortAtomicityTest.java │ │ ├── VolatileByteAtomicityTest.java │ │ ├── VolatileCharAtomicityTest.java │ │ ├── VolatileDoubleAtomicityTest.java │ │ ├── VolatileFloatAtomicityTest.java │ │ ├── VolatileIntAtomicityTest.java │ │ ├── VolatileLongAtomicityTest.java │ │ └── VolatileShortAtomicityTest.java │ │ └── reflect │ │ ├── ByteAtomicityTest.java │ │ ├── CharAtomicityTest.java │ │ ├── DoubleAtomicityTest.java │ │ ├── FloatAtomicityTest.java │ │ ├── IntAtomicityTest.java │ │ ├── LongAtomicityTest.java │ │ ├── ShortAtomicityTest.java │ │ ├── VolatileByteAtomicityTest.java │ │ ├── VolatileCharAtomicityTest.java │ │ ├── VolatileDoubleAtomicityTest.java │ │ ├── VolatileFloatAtomicityTest.java │ │ ├── VolatileIntAtomicityTest.java │ │ ├── VolatileLongAtomicityTest.java │ │ └── VolatileShortAtomicityTest.java │ ├── atomics │ ├── booleans │ │ ├── AtomicBooleanInitialValueTest.java │ │ └── AtomicBooleanPairwiseTests.java │ ├── integer │ │ ├── AtomicIntegerArrayInitialValueTest.java │ │ ├── AtomicIntegerArrayInterleaveTest.java │ │ ├── AtomicIntegerArrayPairwiseTests.java │ │ ├── AtomicIntegerFieldUpdaterPairwiseTests.java │ │ ├── AtomicIntegerInitialValueTest.java │ │ └── AtomicIntegerPairwiseTests.java │ └── longs │ │ ├── AtomicLongArrayInitialValueTest.java │ │ ├── AtomicLongArrayInterleaveTest.java │ │ ├── AtomicLongArrayPairwiseTests.java │ │ ├── AtomicLongFieldUpdaterPairwiseTests.java │ │ ├── AtomicLongInitialValueTest.java │ │ └── AtomicLongPairwiseTests.java │ ├── collections │ └── HashMapFailureTest.java │ ├── countdownlatch │ ├── effects │ │ ├── IntBoundedTest.java │ │ ├── IntUnboundedTest.java │ │ ├── StringBoundedTest.java │ │ └── StringUnboundedTest.java │ ├── racy │ │ ├── BoundedSingleTest.java │ │ └── UnboundedSingleTest.java │ └── waits │ │ ├── BoundedDoubleTest.java │ │ ├── BoundedSingleTest.java │ │ ├── UnboundedDoubleTest.java │ │ └── UnboundedSingleTest.java │ ├── executors │ ├── ThreadPoolExecutorKeepAliveTest.java │ └── ThreadPoolExecutorSizesTest.java │ ├── fences │ ├── FencedAcquireReleaseTest.java │ ├── FencedDekkerTest.java │ ├── FencedPublicationTest.java │ ├── FencedReadTwiceTest.java │ ├── UnfencedAcquireReleaseTest.java │ ├── UnfencedDekkerTest.java │ ├── UnfencedPublicationTest.java │ └── UnfencedReadTwiceTest.java │ ├── future │ ├── FutureTaskSetTest.java │ └── ThreadNames.java │ ├── init │ ├── Grading_AllZeroes.java │ ├── Grading_AllZeroesBoolean.java │ ├── Grading_AllZeroesChar.java │ ├── Grading_AllZeroesFloat.java │ ├── Grading_CharCanSeeMost.java │ ├── Grading_CharShouldSeeFull.java │ ├── Grading_DoubleCanSeeMost.java │ ├── Grading_DoubleShouldSeeFull.java │ ├── Grading_FloatCanSeeMost.java │ ├── Grading_FloatShouldSeeFull.java │ ├── Grading_IntCanSeeMost.java │ ├── Grading_IntShouldSeeFull.java │ ├── Grading_LongCanSeeMost.java │ ├── Grading_LongShouldSeeFull.java │ └── primitives │ │ └── fenced │ │ ├── BooleanFencedTest.java │ │ ├── ByteFencedTest.java │ │ ├── CharFencedTest.java │ │ ├── DoubleFencedTest.java │ │ ├── FloatFencedTest.java │ │ ├── IntFencedTest.java │ │ ├── LongFencedTest.java │ │ └── ShortFencedTest.java │ ├── interrupt │ ├── CurrentThreadIsInterruptedBreakTest.java │ ├── CurrentThreadIsInterruptedMethodTest.java │ ├── CurrentThreadIsInterruptedTest.java │ ├── ObjectWaitInfiniteTest.java │ ├── ObjectWaitTimedTest.java │ ├── PlainBusyLoopTest.java │ ├── ReentrantLockInterruptiblyTest.java │ ├── ReentrantLockNonInterruptiblyTest.java │ ├── ThreadInterruptedBreakTest.java │ ├── ThreadInterruptedMethodTest.java │ ├── ThreadInterruptedTest.java │ ├── ThreadSleepTest.java │ ├── TimeUnitSleepTest.java │ ├── UnsafeBusyLoopTest.java │ ├── VolatileBusyLoopTest.java │ └── WeakReferenceTest.java │ ├── locks │ ├── BothSucceed.java │ ├── NoOneSucceeds.java │ ├── OneSucceeds.java │ ├── barriers │ │ ├── G.java │ │ ├── SyncBarrier0Test.java │ │ ├── SyncBarrier1Test.java │ │ ├── SyncBarrier2Test.java │ │ └── SyncBarrier3Test.java │ ├── mutex │ │ ├── ReentrantLockMutexTests.java │ │ ├── ReentrantRWLockMutexTests.java │ │ ├── SynchronizedMutexPoolTest.java │ │ └── SynchronizedMutexTest.java │ └── stamped │ │ ├── StampedLockPairwiseTests.java │ │ └── StampedLockTransitionTests.java │ ├── mxbeans │ └── ThreadMXBeanAlloc.java │ ├── oota │ ├── Sevcik_01_Redundant_WAR_Elimination.java │ ├── Sevcik_02_Redundant_RAR_Elimination.java │ ├── Sevcik_03_RoachMotel.java │ ├── Sevcik_04_IrrelevantRead.java │ └── Sevcik_05_IllegalTransform.java │ ├── sample │ └── SampleTest.java │ ├── strings │ ├── BigDecimalString.java │ ├── BigDecimalStringLen.java │ ├── BigIntegerString.java │ ├── BigIntegerStringLen.java │ ├── StringBufferAppendTest.java │ ├── StringBufferTest.java │ └── StringBuilderTest.java │ ├── tearing │ ├── ArrayInterleaveTest.java │ ├── UnsafeArrayInterleaveTest.java │ ├── UnsafeIntTearingTest.java │ └── buffers │ │ ├── ByteBufferInterleaveTest.java │ │ ├── CharBufferInterleaveTest.java │ │ ├── DirectByteBufferInterleaveTest.java │ │ ├── DoubleBufferInterleaveTest.java │ │ ├── FloatBufferInterleaveTest.java │ │ ├── IntBufferInterleaveTest.java │ │ ├── LongBufferInterleaveTest.java │ │ └── ShortBufferInterleaveTest.java │ ├── threadlocal │ └── ThreadLocalSharing.java │ ├── unsafe │ ├── UnsafeAddLong1.java │ ├── UnsafeAddLong42.java │ ├── UnsafePublication.java │ ├── UnsafePutOrderedTwice.java │ └── UnsafeReadTwiceOverVolatileReadTest.java │ ├── varhandles │ ├── DekkerRelaxation1Test.java │ ├── DekkerRelaxation2Test.java │ └── DekkerTest.java │ └── volatiles │ ├── DekkerTest.java │ ├── DoubleVolatileTest.java │ ├── LazySetTransitivityTest.java │ ├── ObservedVolatileBarrierTest.java │ ├── OpaqueIRIWTest.java │ ├── PowerSCViolation.java │ ├── ReadAfterReadTest.java │ ├── ReadAfterVolatileReadTest.java │ ├── ReadTwiceOverVolatileReadTest.java │ ├── RelaxedIRIWTest.java │ ├── ScalarReplacedVolatileBarrierTest.java │ ├── UnobservedVolatileBarrierTest.java │ ├── VolatileAcquireReleaseTest.java │ ├── VolatileIRIWTest.java │ └── VolatileIncrementAtomicityTest.java ├── resources ├── LICENSE └── THIRD_PARTY_README └── scratch ├── DoubleAtomicityTest.java ├── LongAtomicityTest.java └── completable ├── GetConflictTests.java ├── GetRaceTests.java ├── MyThrowable.java └── future-completable.xml /.github/workflows/pre-integration.yml: -------------------------------------------------------------------------------- 1 | name: JCStress Pre-Integration Tests 2 | 3 | on: 4 | push: 5 | branches-ignore: 6 | - master 7 | - pr/* 8 | workflow_dispatch: 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.ref }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | test: 16 | runs-on: ${{ matrix.os }} 17 | strategy: 18 | matrix: 19 | build-java: [17, 21] 20 | run-java: [8, 11, 17, 21] 21 | os: [ubuntu-latest, windows-latest, macos-latest] 22 | fail-fast: false 23 | name: Build JDK ${{ matrix.build-java }}, run JDK ${{ matrix.run-java }}, ${{ matrix.os }} 24 | 25 | steps: 26 | - uses: actions/checkout@v4 27 | - name: Set up build JDK ${{ matrix.build-java }} 28 | uses: actions/setup-java@v4 29 | with: 30 | distribution: corretto 31 | java-version: ${{ matrix.build-java }} 32 | cache: maven 33 | check-latest: true 34 | - name: Build/test 35 | run: mvn clean install -T 1C -B --file pom.xml 36 | - name: Set up run JDK ${{ matrix.run-java }} 37 | uses: actions/setup-java@v4 38 | with: 39 | distribution: corretto 40 | java-version: ${{ matrix.run-java }} 41 | check-latest: true 42 | - name: Run a trial test 43 | run: java -jar tests-custom/target/jcstress.jar -t UnfencedDekker -tb 1m 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | *.versionsBackup 4 | target/ 5 | jcstress.* 6 | -------------------------------------------------------------------------------- /.jcheck/conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. 3 | ; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | ; 5 | ; This code is free software; you can redistribute it and/or modify it 6 | ; under the terms of the GNU General Public License version 2 only, as 7 | ; published by the Free Software Foundation. 8 | ; 9 | ; This code is distributed in the hope that it will be useful, but WITHOUT 10 | ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | ; version 2 for more details (a copy is included in the LICENSE file that 13 | ; accompanied this code). 14 | ; 15 | ; You should have received a copy of the GNU General Public License version 16 | ; 2 along with this work; if not, write to the Free Software Foundation, 17 | ; Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 | ; 19 | ; Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 | ; or visit www.oracle.com if you need additional information or have any 21 | ; questions. 22 | ; 23 | 24 | [general] 25 | project=code-tools 26 | repository=jcstress 27 | jbs=codetools 28 | 29 | [checks] 30 | error=author,committer,reviewers,executable,symlink,whitespace 31 | 32 | [census] 33 | version=0 34 | domain=openjdk.org 35 | 36 | [checks "whitespace"] 37 | files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm 38 | 39 | [checks "reviewers"] 40 | committers=1 41 | ignore=duke 42 | 43 | [checks "committer"] 44 | role=committer 45 | -------------------------------------------------------------------------------- /THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /jcstress-benchmarks/src/main/java/org/openjdk/jcstress/SampleTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Red Hat Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package org.openjdk.jcstress; 27 | 28 | import org.openjdk.jcstress.annotations.*; 29 | import org.openjdk.jcstress.infra.results.IIII_Result; 30 | 31 | import static org.openjdk.jcstress.annotations.Expect.ACCEPTABLE; 32 | 33 | @JCStressTest 34 | @Description("Sample test") 35 | @Outcome(id = ".*", expect = ACCEPTABLE, desc = "All acceptable") 36 | @State 37 | public class SampleTest { 38 | 39 | int a; 40 | int b; 41 | 42 | @Actor 43 | public void actor1(IIII_Result r) { 44 | r.r1 = b; 45 | } 46 | 47 | @Actor 48 | public void actor2(IIII_Result r) { 49 | r.r2 = a; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/jdk/internal/vm/annotation/Contended.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package jdk.internal.vm.annotation; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target({ElementType.FIELD, ElementType.TYPE}) 34 | public @interface Contended { 35 | String value() default ""; // tag 36 | } 37 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/annotations/State.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.annotations; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | @Target(ElementType.TYPE) 33 | @Retention(RetentionPolicy.RUNTIME) 34 | public @interface State { 35 | } 36 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/flat/TestBoth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.flat; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | @State 31 | public class TestBoth { 32 | 33 | @sun.misc.Contended 34 | @jdk.internal.vm.annotation.Contended 35 | int field; 36 | 37 | @Test 38 | public void run() { 39 | System.out.println(field); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/flat/TestNone.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.flat; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | @State 31 | public class TestNone { 32 | int field; 33 | 34 | @Test 35 | public void run() { 36 | System.out.println(field); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/flat/TestOnlyJdkInternal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.flat; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | @State 31 | public class TestOnlyJdkInternal { 32 | 33 | @jdk.internal.vm.annotation.Contended 34 | int field; 35 | 36 | @Test 37 | public void run() { 38 | System.out.println(field); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/flat/TestOnlySunMisc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.flat; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | @State 31 | public class TestOnlySunMisc { 32 | 33 | @sun.misc.Contended 34 | int field; 35 | 36 | @Test 37 | public void run() { 38 | System.out.println(field); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/inner/TestBoth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.inner; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | public class TestBoth { 31 | 32 | @State 33 | class Inner { 34 | @sun.misc.Contended 35 | @jdk.internal.vm.annotation.Contended 36 | int field; 37 | } 38 | 39 | @Test 40 | public void run() { 41 | System.out.println(new Inner().field); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/inner/TestNone.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.inner; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | public class TestNone { 31 | 32 | @State 33 | class Inner { 34 | int field; 35 | } 36 | 37 | @Test 38 | public void run() { 39 | System.out.println(new Inner().field); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/inner/TestOnlyJdkInternal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.inner; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | public class TestOnlyJdkInternal { 31 | 32 | @State 33 | class Inner { 34 | @jdk.internal.vm.annotation.Contended 35 | int field; 36 | } 37 | 38 | @Test 39 | public void run() { 40 | System.out.println(new Inner().field); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/inner/TestOnlySunMisc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.inner; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | public class TestOnlySunMisc { 31 | 32 | @State 33 | class Inner { 34 | @sun.misc.Contended 35 | int field; 36 | } 37 | 38 | @Test 39 | public void run() { 40 | System.out.println(new Inner().field); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/nested/inner/TestBoth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.nested.inner; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | public class TestBoth { 31 | 32 | @State 33 | static class Nested { 34 | @sun.misc.Contended 35 | @jdk.internal.vm.annotation.Contended 36 | int field; 37 | } 38 | 39 | @Test 40 | public void run() { 41 | System.out.println(new Nested().field); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/nested/inner/TestNone.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.nested.inner; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | public class TestNone { 31 | 32 | @State 33 | static class Nested { 34 | int field; 35 | } 36 | 37 | @Test 38 | public void run() { 39 | System.out.println(new Nested().field); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/nested/inner/TestOnlyJdkInternal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.nested.inner; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | public class TestOnlyJdkInternal { 31 | 32 | @State 33 | static class Nested { 34 | @jdk.internal.vm.annotation.Contended 35 | int field; 36 | } 37 | 38 | @Test 39 | public void run() { 40 | System.out.println(new Nested().field); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/org/openjdk/jcstress/nested/inner/TestOnlySunMisc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.nested.inner; 26 | 27 | import org.junit.Test; 28 | import org.openjdk.jcstress.annotations.State; 29 | 30 | public class TestOnlySunMisc { 31 | 32 | @State 33 | static class Nested { 34 | @sun.misc.Contended 35 | int field; 36 | } 37 | 38 | @Test 39 | public void run() { 40 | System.out.println(new Nested().field); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jcstress-contended-autoinjector/src/test/java/sun/misc/Contended.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package sun.misc; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target({ElementType.FIELD, ElementType.TYPE}) 34 | public @interface Contended { 35 | String value() default ""; // tag 36 | } 37 | -------------------------------------------------------------------------------- /jcstress-core/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/jdk/internal/vm/annotation/Contended.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package jdk.internal.vm.annotation; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target({ElementType.FIELD, ElementType.TYPE}) 34 | public @interface Contended { 35 | String value() default ""; // tag 36 | } 37 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/ForkFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress; 26 | 27 | import java.util.Collections; 28 | import java.util.List; 29 | 30 | public class ForkFailedException extends RuntimeException { 31 | private List info; 32 | 33 | public ForkFailedException(String info) { 34 | this.info = Collections.singletonList(info); 35 | } 36 | 37 | public ForkFailedException(List info) { 38 | this.info = info; 39 | } 40 | 41 | public List getInfo() { 42 | return info; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/Verbosity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress; 26 | 27 | public class Verbosity { 28 | 29 | private final int level; 30 | 31 | public Verbosity(int level) { 32 | this.level = level; 33 | } 34 | 35 | public boolean printAllTests() { 36 | return level >= 1; 37 | } 38 | 39 | public boolean printAssembly() { 40 | return level >= 2; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/annotations/Description.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.annotations; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Inherited; 29 | import java.lang.annotation.Retention; 30 | import java.lang.annotation.RetentionPolicy; 31 | import java.lang.annotation.Target; 32 | 33 | /** 34 | * {@link Description} defines a human-readable test description. 35 | */ 36 | @Inherited 37 | @Target(ElementType.TYPE) 38 | @Retention(RetentionPolicy.RUNTIME) 39 | public @interface Description { 40 | 41 | /** 42 | * @return human-readable test description. 43 | */ 44 | String value(); 45 | } 46 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/annotations/Mode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.annotations; 26 | 27 | /** 28 | * JCStress test mode. 29 | */ 30 | public enum Mode { 31 | 32 | /** 33 | * Continuous mode: run several {@link Actor}, {@link Arbiter} threads, and 34 | * collect the histogram of {@link Result}s. 35 | */ 36 | Continuous, 37 | 38 | /** 39 | * Termination mode: run a single {@link Actor} with a blocking/looping operation, 40 | * and see if it responds to a {@link Signal}. 41 | */ 42 | Termination, 43 | 44 | } 45 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/annotations/Signal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.annotations; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | /** 33 | * {@link Signal} is useful for delivering a termination signal to {@link Actor} 34 | * in {@link Mode#Termination} tests. It will run after {@link Actor} in question 35 | * started executing. 36 | */ 37 | @Target(ElementType.METHOD) 38 | @Retention(RetentionPolicy.RUNTIME) 39 | public @interface Signal { 40 | } 41 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/Copyable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra; 26 | 27 | /** 28 | * Marks the class as directly copyable. 29 | */ 30 | public interface Copyable { 31 | 32 | /** 33 | * Produce the distinct copy of the object and all of its references. 34 | * @return object copy 35 | */ 36 | Object copy(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/Status.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra; 26 | 27 | /** 28 | * Test status. 29 | * 30 | * @author Aleksey Shipilev (aleksey.shipilev@oracle.com) 31 | */ 32 | public enum Status { 33 | 34 | NORMAL(0), 35 | API_MISMATCH(1), 36 | CHECK_TEST_ERROR(2), 37 | TIMEOUT_ERROR(3), 38 | TEST_ERROR(4), 39 | VM_ERROR(5); 40 | 41 | private int severity; 42 | 43 | Status(int severity) { 44 | this.severity = severity; 45 | } 46 | 47 | public Status combine(Status other) { 48 | return severity >= other.severity ? this : other; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/collectors/InProcessCollector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.collectors; 26 | 27 | import java.util.ArrayList; 28 | import java.util.Collection; 29 | import java.util.Collections; 30 | import java.util.List; 31 | 32 | /** 33 | * @author Aleksey Shipilev (aleksey.shipilev@oracle.com) 34 | */ 35 | public class InProcessCollector implements TestResultCollector { 36 | 37 | private final List results = Collections.synchronizedList(new ArrayList<>()); 38 | 39 | @Override 40 | public void add(TestResult result) { 41 | results.add(result); 42 | } 43 | 44 | public Collection getTestResults() { 45 | return results; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/collectors/TestResultCollector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.collectors; 26 | 27 | /** 28 | * @author Aleksey Shipilev (aleksey.shipilev@oracle.com) 29 | */ 30 | public interface TestResultCollector { 31 | void add(TestResult result); 32 | } 33 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/GradingResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.grading; 26 | 27 | import org.openjdk.jcstress.annotations.Expect; 28 | 29 | public class GradingResult { 30 | 31 | public final String id; 32 | public final Expect expect; 33 | public final long count; 34 | public final String description; 35 | 36 | public GradingResult(String id, Expect expect, long count, String description) { 37 | this.id = id; 38 | this.expect = expect; 39 | this.count = count; 40 | this.description = description; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/processors/GenerationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.processors; 26 | 27 | import javax.lang.model.element.Element; 28 | 29 | public class GenerationException extends RuntimeException { 30 | private Element element; 31 | 32 | public GenerationException(String s, Element e) { 33 | super(s); 34 | element = e; 35 | } 36 | 37 | public Element getElement() { 38 | return element; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/AbstractThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.runners; 26 | 27 | import java.util.concurrent.atomic.AtomicInteger; 28 | 29 | public abstract class AbstractThread extends Thread { 30 | protected volatile Throwable throwable; 31 | 32 | @SuppressWarnings("this-escape") 33 | public AbstractThread(String name) { 34 | setDaemon(true); 35 | setName(name); 36 | } 37 | 38 | @Override 39 | public abstract void run(); 40 | 41 | public Throwable throwable() { return throwable; } 42 | 43 | public abstract void purge(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Control.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.runners; 26 | 27 | /** 28 | * @author Aleksey Shipilev (aleksey.shipilev@oracle.com) 29 | */ 30 | public class Control { 31 | public volatile boolean stopping; 32 | } 33 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/LongThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.runners; 26 | 27 | public abstract class LongThread extends AbstractThread { 28 | 29 | private LongThread() { // Cannot touch this 30 | super("N/A"); 31 | } 32 | 33 | protected LongThread(String name) { 34 | super(name); 35 | } 36 | 37 | private long result; 38 | public long result() { 39 | return result; 40 | } 41 | @Override 42 | public void run() { 43 | try { 44 | result = internalRun(); 45 | } catch (Throwable e) { 46 | throwable = e; 47 | } 48 | } 49 | 50 | protected abstract long internalRun(); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/ResourceEstimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.runners; 26 | 27 | public interface ResourceEstimator { 28 | void runWith(int size, long[] counters); 29 | } 30 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/SpinLoopStyle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.runners; 26 | 27 | public enum SpinLoopStyle { 28 | HARD("plain hard busywait"), 29 | THREAD_YIELD("Thread.yield()"), 30 | THREAD_SPIN_WAIT("Thread.onSpinWait()"), 31 | LOCKSUPPORT_PARK_NANOS("LockSupport.parkNanos()"), 32 | ; 33 | 34 | private String desc; 35 | 36 | SpinLoopStyle(String desc) { 37 | this.desc = desc; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return desc; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/VoidThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.infra.runners; 26 | 27 | public abstract class VoidThread extends AbstractThread { 28 | 29 | private VoidThread() { // Cannot touch this 30 | super("N/A"); 31 | } 32 | 33 | protected VoidThread(String name) { 34 | super(name); 35 | } 36 | 37 | @Override 38 | public void run() { 39 | try { 40 | internalRun(); 41 | } catch (Throwable e) { 42 | throwable = e; 43 | } 44 | } 45 | 46 | protected abstract void internalRun(); 47 | } 48 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/link/ServerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.link; 26 | 27 | import org.openjdk.jcstress.infra.collectors.TestResult; 28 | import org.openjdk.jcstress.infra.runners.ForkedTestConfig; 29 | 30 | public interface ServerListener { 31 | 32 | ForkedTestConfig onJobRequest(int token); 33 | 34 | void onResult(int token, TestResult result); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/os/AffinityMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.os; 26 | 27 | public enum AffinityMode { 28 | 29 | // No affinity whatsoever 30 | NONE, 31 | 32 | // Affnity for the entire JVM 33 | GLOBAL, 34 | 35 | // Affinity for the individual actors 36 | LOCAL, 37 | 38 | } 39 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/os/AffinitySupportTestMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.os; 26 | 27 | public class AffinitySupportTestMain { 28 | 29 | public static void main(String... args) { 30 | AffinitySupport.tryBind(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/os/topology/FallbackTopology.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.os.topology; 26 | 27 | import org.openjdk.jcstress.vm.VMSupport; 28 | 29 | import java.io.PrintStream; 30 | 31 | public class FallbackTopology extends PresetRegularTopology { 32 | 33 | public FallbackTopology() throws TopologyParseException { 34 | super(1, VMSupport.figureOutHotCPUs(), 1); 35 | } 36 | 37 | public void printStatus(PrintStream pw) { 38 | pw.println(" Fallback topology, faking CPU layout, downgrading to \"NONE\" affinity mode"); 39 | } 40 | 41 | @Override 42 | public boolean trustworthy() { 43 | return false; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/os/topology/PresetListTopology.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.os.topology; 26 | 27 | public class PresetListTopology extends AbstractTopology { 28 | 29 | public void add(int nodeId, int coreId, int threadId) throws TopologyParseException { 30 | super.add(nodeId, coreId, threadId); 31 | } 32 | 33 | public void finish() throws TopologyParseException { 34 | renumberAll(); 35 | super.finish(); 36 | } 37 | 38 | @Override 39 | public boolean trustworthy() { 40 | return true; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/os/topology/TopologyParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.os.topology; 26 | 27 | /** 28 | * This exception is thrown when topology parsers fail. 29 | */ 30 | public class TopologyParseException extends Exception { 31 | public TopologyParseException(String message) { 32 | super(message); 33 | } 34 | 35 | public TopologyParseException(Throwable cause) { 36 | super(cause); 37 | } 38 | 39 | public TopologyParseException(String message, Throwable cause) { 40 | super(message, cause); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/util/MutableLong.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.util; 26 | 27 | public class MutableLong { 28 | long v; 29 | 30 | public MutableLong(long count) { 31 | v = count; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/util/NonNullArrayList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.util; 26 | 27 | import java.util.ArrayList; 28 | 29 | public class NonNullArrayList extends ArrayList { 30 | 31 | @Override 32 | public boolean add(E e) { 33 | return (e != null) && super.add(e); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/util/NullOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.util; 26 | 27 | import java.io.IOException; 28 | import java.io.OutputStream; 29 | 30 | public class NullOutputStream extends OutputStream { 31 | @Override 32 | public void write(int b) throws IOException { 33 | // do nothing 34 | } 35 | 36 | @Override 37 | public void write(byte[] b) throws IOException { 38 | // do nothing 39 | } 40 | 41 | @Override 42 | public void write(byte[] b, int off, int len) throws IOException { 43 | // do nothing 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/vm/PrivilegedTestMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.vm; 26 | 27 | public class PrivilegedTestMain { 28 | 29 | public static void main(String... args) { 30 | ClassLoader cl = PrivilegedTestMain.class.getClassLoader(); 31 | if (cl != null) { 32 | throw new IllegalStateException("We are not loaded with a privileged classloader: " + cl); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/vm/SimpleTestMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.vm; 26 | 27 | public class SimpleTestMain { 28 | 29 | public static void main(String... args) { 30 | // do nothing 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/vm/ThreadSpinWaitTestMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.vm; 26 | 27 | public class ThreadSpinWaitTestMain { 28 | 29 | public static void main(String... args) { 30 | Thread.onSpinWait(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/org/openjdk/jcstress/vm/VMSupportException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.vm; 26 | 27 | public class VMSupportException extends Exception { 28 | public VMSupportException(String msg) { 29 | super(msg); 30 | } 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /jcstress-core/src/main/java/sun/misc/Contended.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package sun.misc; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target({ElementType.FIELD, ElementType.TYPE}) 34 | public @interface Contended { 35 | String value() default ""; // tag 36 | } 37 | -------------------------------------------------------------------------------- /jcstress-core/src/main/resources/META-INF/services/javax.annotation.processing.Processor: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 2 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 | # 4 | # This code is free software; you can redistribute it and/or modify it 5 | # under the terms of the GNU General Public License version 2 only, as 6 | # published by the Free Software Foundation. Oracle designates this 7 | # particular file as subject to the "Classpath" exception as provided 8 | # by Oracle in the LICENSE file that accompanied this code. 9 | # 10 | # This code is distributed in the hope that it will be useful, but WITHOUT 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | # version 2 for more details (a copy is included in the LICENSE file that 14 | # accompanied this code). 15 | # 16 | # You should have received a copy of the GNU General Public License version 17 | # 2 along with this work; if not, write to the Free Software Foundation, 18 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 | # 20 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 | # or visit www.oracle.com if you need additional information or have any 22 | # questions. 23 | # 24 | org.openjdk.jcstress.infra.processors.JCStressTestProcessor 25 | -------------------------------------------------------------------------------- /jcstress-core/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /jcstress-core/src/test/java/org/openjdk/jcstress/os/AffinitySupportTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, Red Hat, Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.os; 26 | 27 | import org.junit.Assume; 28 | import org.junit.Before; 29 | import org.junit.Test; 30 | import org.openjdk.jcstress.vm.VMSupport; 31 | 32 | public class AffinitySupportTest { 33 | 34 | @Before 35 | public void preconditions() { 36 | Assume.assumeTrue(VMSupport.isLinux()); 37 | } 38 | 39 | @Test 40 | public void prepare() { 41 | AffinitySupport.prepare(); 42 | } 43 | 44 | @Test 45 | public void tryBind() { 46 | AffinitySupport.tryBind(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /jcstress-core/src/test/java/org/openjdk/jcstress/util/ArrayUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2017, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.util; 26 | 27 | import org.junit.Assert; 28 | import org.junit.Test; 29 | 30 | public class ArrayUtilsTest { 31 | 32 | @Test 33 | public void testConcat() { 34 | Assert.assertArrayEquals("add one element to array of two", 35 | new String[]{"1", "2", "3"}, 36 | ArrayUtils.concat(new String[]{"1", "2"}, "3")); 37 | 38 | Assert.assertArrayEquals("add one element to empty array", 39 | new String[]{"1"}, 40 | ArrayUtils.concat(new String[0], "1")); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jcstress-core/src/test/resources/topology/cpuinfo-2.txt: -------------------------------------------------------------------------------- 1 | processor : 0 2 | BogoMIPS : 38.40 3 | Features : fp asimd evtstrm crc32 4 | CPU implementer : 0x41 5 | CPU architecture: 8 6 | CPU variant : 0x0 7 | CPU part : 0xd03 8 | CPU revision : 4 9 | 10 | processor : 1 11 | BogoMIPS : 38.40 12 | Features : fp asimd evtstrm crc32 13 | CPU implementer : 0x41 14 | CPU architecture: 8 15 | CPU variant : 0x0 16 | CPU part : 0xd03 17 | CPU revision : 4 18 | 19 | processor : 2 20 | BogoMIPS : 38.40 21 | Features : fp asimd evtstrm crc32 22 | CPU implementer : 0x41 23 | CPU architecture: 8 24 | CPU variant : 0x0 25 | CPU part : 0xd03 26 | CPU revision : 4 27 | 28 | processor : 3 29 | BogoMIPS : 38.40 30 | Features : fp asimd evtstrm crc32 31 | CPU implementer : 0x41 32 | CPU architecture: 8 33 | CPU variant : 0x0 34 | CPU part : 0xd03 35 | CPU revision : 4 -------------------------------------------------------------------------------- /jcstress-core/src/test/resources/topology/cpuinfo-6.txt: -------------------------------------------------------------------------------- 1 | processor : 0 2 | vendor_id : GenuineIntel 3 | cpu family : 6 4 | model : 42 5 | model name : Intel Xeon E312xx (Sandy Bridge, IBRS update) 6 | stepping : 1 7 | microcode : 0x1 8 | cpu MHz : 1999.999 9 | cache size : 4096 KB 10 | physical id : 0 11 | siblings : 1 12 | core id : 0 13 | cpu cores : 1 14 | apicid : 0 15 | initial apicid : 0 16 | fpu : yes 17 | fpu_exception : yes 18 | cpuid level : 13 19 | wp : yes 20 | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm pti ssbd ibrs ibpb stibp xsaveopt 21 | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 22 | bogomips : 3999.99 23 | clflush size : 64 24 | cache_alignment : 64 25 | address sizes : 46 bits physical, 48 bits virtual 26 | power management: 27 | 28 | processor : 1 29 | vendor_id : GenuineIntel 30 | cpu family : 6 31 | model : 42 32 | model name : Intel Xeon E312xx (Sandy Bridge, IBRS update) 33 | stepping : 1 34 | microcode : 0x1 35 | cpu MHz : 1999.999 36 | cache size : 4096 KB 37 | physical id : 1 38 | siblings : 1 39 | core id : 0 40 | cpu cores : 1 41 | apicid : 1 42 | initial apicid : 1 43 | fpu : yes 44 | fpu_exception : yes 45 | cpuid level : 13 46 | wp : yes 47 | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm pti ssbd ibrs ibpb stibp xsaveopt 48 | bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 49 | bogomips : 3999.99 50 | clflush size : 64 51 | cache_alignment : 64 52 | address sizes : 46 bits physical, 48 bits virtual 53 | power management: 54 | 55 | -------------------------------------------------------------------------------- /jcstress-core/src/test/resources/topology/sysfs-2.txt: -------------------------------------------------------------------------------- 1 | cpu/cpu3/topology/physical_package_id: 0 2 | cpu/cpu3/topology/thread_siblings_list: 3 3 | cpu/cpu3/topology/core_siblings_list: 0-3 4 | cpu/cpu3/topology/thread_siblings: 8 5 | cpu/cpu3/topology/core_siblings: f 6 | cpu/cpu3/topology/core_id: 3 7 | cpu/cpu1/topology/physical_package_id: 0 8 | cpu/cpu1/topology/thread_siblings_list: 1 9 | cpu/cpu1/topology/core_siblings_list: 0-3 10 | cpu/cpu1/topology/thread_siblings: 2 11 | cpu/cpu1/topology/core_siblings: f 12 | cpu/cpu1/topology/core_id: 1 13 | cpu/cpu2/topology/physical_package_id: 0 14 | cpu/cpu2/topology/thread_siblings_list: 2 15 | cpu/cpu2/topology/core_siblings_list: 0-3 16 | cpu/cpu2/topology/thread_siblings: 4 17 | cpu/cpu2/topology/core_siblings: f 18 | cpu/cpu2/topology/core_id: 2 19 | cpu/cpu0/topology/physical_package_id: 0 20 | cpu/cpu0/topology/thread_siblings_list: 0 21 | cpu/cpu0/topology/core_siblings_list: 0-3 22 | cpu/cpu0/topology/thread_siblings: 1 23 | cpu/cpu0/topology/core_siblings: f 24 | cpu/cpu0/topology/core_id: 0 25 | -------------------------------------------------------------------------------- /jcstress-core/src/test/resources/topology/sysfs-6.txt: -------------------------------------------------------------------------------- 1 | cpu/cpu1/topology/die_id: 0 2 | cpu/cpu1/topology/physical_package_id: 1 3 | cpu/cpu1/topology/core_cpus_list: 1 4 | cpu/cpu1/topology/die_cpus_list: 1 5 | cpu/cpu1/topology/core_siblings: 2 6 | cpu/cpu1/topology/core_siblings_list: 1 7 | cpu/cpu1/topology/package_cpus: 2 8 | cpu/cpu1/topology/package_cpus_list: 1 9 | cpu/cpu1/topology/die_cpus: 2 10 | cpu/cpu1/topology/thread_siblings_list: 1 11 | cpu/cpu1/topology/core_id: 0 12 | cpu/cpu1/topology/core_cpus: 2 13 | cpu/cpu1/topology/thread_siblings: 2 14 | cpu/cpu0/topology/die_id: 0 15 | cpu/cpu0/topology/physical_package_id: 0 16 | cpu/cpu0/topology/core_cpus_list: 0 17 | cpu/cpu0/topology/die_cpus_list: 0 18 | cpu/cpu0/topology/core_siblings: 1 19 | cpu/cpu0/topology/core_siblings_list: 0 20 | cpu/cpu0/topology/package_cpus: 1 21 | cpu/cpu0/topology/package_cpus_list: 0 22 | cpu/cpu0/topology/die_cpus: 1 23 | cpu/cpu0/topology/thread_siblings_list: 0 24 | cpu/cpu0/topology/core_id: 0 25 | cpu/cpu0/topology/core_cpus: 1 26 | cpu/cpu0/topology/thread_siblings: 1 27 | -------------------------------------------------------------------------------- /jcstress-java-test-archetype/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /jcstress-java-test-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml: -------------------------------------------------------------------------------- 1 | 25 | 26 | 29 | 30 | 31 | src/main/java 32 | 33 | **/*.java 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /jcstress-java-test-archetype/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /jcstress-java-test-archetype/src/test/resources/projects/test/archetype.properties: -------------------------------------------------------------------------------- 1 | groupId=org.openjdk.jcstress 2 | artifactId=jcstress-java-test-testproject 3 | version=1.0-SNAPSHOT 4 | package=foo.bar 5 | -------------------------------------------------------------------------------- /jcstress-java-test-archetype/src/test/resources/projects/test/goal.txt: -------------------------------------------------------------------------------- 1 | verify -------------------------------------------------------------------------------- /jcstress-samples/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/lazy/shared/Holder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.lazy.shared; 26 | 27 | public class Holder { 28 | String data; 29 | 30 | public Holder(String data) { 31 | this.data = data; 32 | } 33 | } -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/lazy/shared/HolderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.lazy.shared; 26 | 27 | import java.util.function.Supplier; 28 | 29 | public class HolderFactory implements Supplier { 30 | 31 | boolean first = true; 32 | 33 | @Override 34 | public Holder get() { 35 | if (first) { 36 | first = false; 37 | return new Holder("data"); 38 | } 39 | throw new SupplierDupException(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/lazy/shared/Lazy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.lazy.shared; 26 | 27 | public interface Lazy { 28 | T get(); 29 | 30 | static String map(Lazy lazy) { 31 | if (lazy == null) { 32 | return "null-lazy"; 33 | } 34 | try { 35 | Holder holder = lazy.get(); 36 | if (holder == null) { 37 | return "null-holder"; 38 | } 39 | return holder.data; 40 | } catch (SupplierDupException e) { 41 | return "dup"; 42 | } catch (Exception e) { 43 | return "exception"; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/lazy/shared/NullHolderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.lazy.shared; 26 | 27 | import java.util.function.Supplier; 28 | 29 | public class NullHolderFactory implements Supplier { 30 | 31 | boolean first = true; 32 | 33 | @Override 34 | public Holder get() { 35 | if (first) { 36 | first = false; 37 | return null; 38 | } 39 | throw new SupplierDupException(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/lazy/shared/SupplierDupException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.lazy.shared; 26 | 27 | public class SupplierDupException extends RuntimeException { 28 | @Override 29 | public synchronized Throwable fillInStackTrace() { 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/singletons/shared/Factory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.singletons.shared; 26 | 27 | import java.util.function.Supplier; 28 | 29 | public interface Factory { 30 | 31 | T get(Supplier supplier); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/singletons/shared/FinalSingleton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.singletons.shared; 26 | 27 | public class FinalSingleton implements Singleton { 28 | final String data; 29 | 30 | public FinalSingleton(String data) { 31 | this.data = data; 32 | } 33 | 34 | @Override 35 | public String data() { 36 | return data; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/singletons/shared/MapResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.singletons.shared; 26 | 27 | import java.util.function.Supplier; 28 | 29 | public class MapResult { 30 | 31 | public static String map(Factory factory, Supplier supplier) { 32 | if (factory == null) { 33 | return "null-factory"; 34 | } 35 | Singleton singleton = factory.get(supplier); 36 | if (singleton == null) { 37 | return "null-singleton"; 38 | } 39 | String data = singleton.data(); 40 | if (data == null) { 41 | return "null-data"; 42 | } 43 | return data; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/singletons/shared/NonFinalSingleton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.singletons.shared; 26 | 27 | public class NonFinalSingleton implements Singleton { 28 | String data; 29 | 30 | public NonFinalSingleton(String data) { 31 | this.data = data; 32 | } 33 | 34 | @Override 35 | public String data() { 36 | return data; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/java/org/openjdk/jcstress/samples/primitives/singletons/shared/Singleton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.samples.primitives.singletons.shared; 26 | 27 | public interface Singleton { 28 | String data(); 29 | } 30 | -------------------------------------------------------------------------------- /jcstress-samples/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /jcstress-test-gen/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /jcstress-test-gen/src/main/java/org/openjdk/jcstress/TestGenMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress; 26 | 27 | import org.openjdk.jcstress.generator.TestGenerator; 28 | 29 | import java.io.IOException; 30 | 31 | public class TestGenMain { 32 | 33 | public static void main(String[] args) throws IOException { 34 | if (args.length >= 2) { 35 | new TestGenerator(args[0]).run(); 36 | } else { 37 | throw new IllegalStateException("Please provide the destination dir"); 38 | } 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /jcstress-test-gen/src/main/java/org/openjdk/jcstress/generator/AcqType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.generator; 26 | 27 | public enum AcqType { 28 | get, 29 | compareAndSet, 30 | getAndAdd, 31 | getAndSet, 32 | } 33 | -------------------------------------------------------------------------------- /jcstress-test-gen/src/main/java/org/openjdk/jcstress/generator/Primitive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.generator; 26 | 27 | public interface Primitive { 28 | String printStateField(String klassName); 29 | 30 | String printAcquire(String region); 31 | 32 | String printRelease(String region); 33 | 34 | String getClassName(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /jcstress-test-gen/src/main/java/org/openjdk/jcstress/generator/RelType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.generator; 26 | 27 | public enum RelType { 28 | set, 29 | compareAndSet, 30 | getAndAdd, 31 | getAndSet, 32 | } 33 | -------------------------------------------------------------------------------- /jcstress-test-gen/src/main/java/org/openjdk/jcstress/generator/seqcst/Target.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.generator.seqcst; 26 | 27 | public enum Target { 28 | VOLATILE, 29 | SYNCHRONIZED, 30 | } 31 | -------------------------------------------------------------------------------- /jcstress-test-gen/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /src/license/gpl_cpe/header.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 | 4 | This code is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU General Public License version 2 only, as 6 | published by the Free Software Foundation. Oracle designates this 7 | particular file as subject to the "Classpath" exception as provided 8 | by Oracle in the LICENSE file that accompanied this code. 9 | 10 | This code is distributed in the hope that it will be useful, but WITHOUT 11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | version 2 for more details (a copy is included in the LICENSE file that 14 | accompanied this code). 15 | 16 | You should have received a copy of the GNU General Public License version 17 | 2 along with this work; if not, write to the Free Software Foundation, 18 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 | 20 | Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 | or visit www.oracle.com if you need additional information or have any 22 | questions. 23 | -------------------------------------------------------------------------------- /tests-all/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-all/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-all/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-0a/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-0a/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Red Hat Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-0a/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-0b/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-0b/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-0b/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-0c/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-0c/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-0c/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-0d/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-0d/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-0d/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-0e/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Red Hat Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-1a/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-1a/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-1a/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-1b/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-1b/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-1b/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-1c/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-1c/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-1c/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-1d/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Red Hat Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-2a/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-2a/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-2a/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-2b/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-chapter-2b/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | // Stub to break the habit of revision control systems to remove empty dirs 26 | public class Test { 27 | } 28 | -------------------------------------------------------------------------------- /tests-chapter-2b/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-custom/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.atomicity.primitives; 26 | 27 | public class Constants { 28 | 29 | public static final double DOUBLE_SAMPLE = Double.longBitsToDouble(0xFFFFFFFFFFFFFFFFL); 30 | public static final float FLOAT_SAMPLE = Float.intBitsToFloat(0xFFFFFFFF); 31 | public static final char CHAR_SAMPLE = (char)0xFFFF; 32 | public static final byte BYTE_SAMPLE = (byte)0xFF; 33 | public static final short SHORT_SAMPLE = (short)0xFFFF; 34 | public static final int INT_SAMPLE = 0xFFFFFFFF; 35 | public static final long LONG_SAMPLE = 0xFFFFFFFFFFFFFFFFL; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/future/ThreadNames.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Red Hat Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.future; 26 | 27 | import org.openjdk.jcstress.annotations.*; 28 | import org.openjdk.jcstress.infra.results.LLL_Result; 29 | 30 | @JCStressTest 31 | @Outcome(expect = Expect.ACCEPTABLE, desc = "acceptable") 32 | @State 33 | public class ThreadNames { 34 | 35 | @Actor 36 | public void actor1(LLL_Result r) { 37 | r.r1 = Thread.currentThread().getName(); 38 | } 39 | 40 | @Actor 41 | public void actor2(LLL_Result r) { 42 | r.r2 = Thread.currentThread().getName(); 43 | } 44 | 45 | @Arbiter 46 | public void arbiter(LLL_Result r) { 47 | r.r3 = Thread.currentThread().getName(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/init/Grading_AllZeroes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.init; 26 | 27 | import org.openjdk.jcstress.annotations.Expect; 28 | import org.openjdk.jcstress.annotations.Outcome; 29 | 30 | 31 | @Outcome(id = "-1, -1, -1, -1", expect = Expect.ACCEPTABLE, desc = "Seeing the null object. This is legal case since there is a race between actor and observer.") 32 | @Outcome(id = "0, 0, 0, 0", expect = Expect.ACCEPTABLE, desc = "Seeing the completely initialized objects, and all elements are with default values.") 33 | public class Grading_AllZeroes { 34 | } 35 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/init/Grading_AllZeroesBoolean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.init; 26 | 27 | import org.openjdk.jcstress.annotations.Expect; 28 | import org.openjdk.jcstress.annotations.Outcome; 29 | 30 | @Outcome(id = "false, false, false, false", expect = Expect.ACCEPTABLE, desc = "Seeing the completely initialized objects, and all elements are with default values.") 31 | public class Grading_AllZeroesBoolean { 32 | } 33 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/init/Grading_AllZeroesChar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.init; 26 | 27 | import org.openjdk.jcstress.annotations.Expect; 28 | import org.openjdk.jcstress.annotations.Outcome; 29 | 30 | 31 | @Outcome(id = "N, N, N, N", expect = Expect.ACCEPTABLE, desc = "Seeing the null object. This is legal case since there is a race between actor and observer.") 32 | @Outcome(id = "A, A, A, A", expect = Expect.ACCEPTABLE, desc = "Seeing the completely initialized objects, and all elements are with default values.") 33 | public class Grading_AllZeroesChar { 34 | } 35 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/init/Grading_AllZeroesFloat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.init; 26 | 27 | import org.openjdk.jcstress.annotations.Expect; 28 | import org.openjdk.jcstress.annotations.Outcome; 29 | 30 | 31 | @Outcome(id = "-1.0, -1.0, -1.0, -1.0", expect = Expect.ACCEPTABLE, desc = "Seeing the null object. This is legal case since there is a race between actor and observer.") 32 | @Outcome(id = "0.0, 0.0, 0.0, 0.0", expect = Expect.ACCEPTABLE, desc = "Seeing the completely initialized objects, and all elements are with default values.") 33 | public class Grading_AllZeroesFloat { 34 | } 35 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/init/Grading_CharShouldSeeFull.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.init; 26 | 27 | import org.openjdk.jcstress.annotations.Expect; 28 | import org.openjdk.jcstress.annotations.Outcome; 29 | 30 | 31 | @Outcome(id = "B", expect = Expect.ACCEPTABLE, desc = "The value set by the actor thread. Observer sees the complete update.") 32 | @Outcome(id = "N", expect = Expect.ACCEPTABLE, desc = "The observer sees the empty shell. This is a legal JMM behavior, since there is a race between actor and observer.") 33 | public class Grading_CharShouldSeeFull { 34 | } 35 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/init/Grading_FloatShouldSeeFull.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.init; 26 | 27 | import org.openjdk.jcstress.annotations.Expect; 28 | import org.openjdk.jcstress.annotations.Outcome; 29 | 30 | 31 | @Outcome(id = "NaN", expect = Expect.ACCEPTABLE, desc = "The value set by the actor thread. Observer sees the complete update.") 32 | @Outcome(id = "42.0", expect = Expect.ACCEPTABLE, desc = "The observer sees the empty shell. This is a legal JMM behavior, since there is a race between actor and observer.") 33 | public class Grading_FloatShouldSeeFull { 34 | } 35 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/init/Grading_IntShouldSeeFull.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.init; 26 | 27 | import org.openjdk.jcstress.annotations.Expect; 28 | import org.openjdk.jcstress.annotations.Outcome; 29 | 30 | @Outcome(id = "-1", expect = Expect.ACCEPTABLE, desc = "The value set by the actor thread. Observer sees the complete update.") 31 | @Outcome(id = "42", expect = Expect.ACCEPTABLE, desc = "The observer sees the empty shell. This is a legal JMM behavior, since there is a race between actor and observer.") 32 | public class Grading_IntShouldSeeFull { 33 | } 34 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/BothSucceed.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.locks; 26 | 27 | import org.openjdk.jcstress.annotations.Description; 28 | import org.openjdk.jcstress.annotations.Expect; 29 | import org.openjdk.jcstress.annotations.Outcome; 30 | 31 | @Description("Tests the mutual exclusion") 32 | @Outcome(id = "1, 0", expect = Expect.ACCEPTABLE, desc = "T1 -> T2 execution") 33 | @Outcome(id = "0, 1", expect = Expect.ACCEPTABLE, desc = "T2 -> T1 execution") 34 | public class BothSucceed { 35 | } 36 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/NoOneSucceeds.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.locks; 26 | 27 | import org.openjdk.jcstress.annotations.Description; 28 | import org.openjdk.jcstress.annotations.Expect; 29 | import org.openjdk.jcstress.annotations.Outcome; 30 | 31 | @Description("Tests the mutual exclusion") 32 | @Outcome(id = "1, 0", expect = Expect.ACCEPTABLE, desc = "T1 -> T2 execution") 33 | @Outcome(id = "0, 1", expect = Expect.ACCEPTABLE, desc = "T2 -> T1 execution") 34 | @Outcome(id = {"-1, .*", ".*, -1"}, expect = Expect.ACCEPTABLE, desc = "One of the threads fails to acquire the lock. Other thread had succeeded.") 35 | public class NoOneSucceeds { 36 | } 37 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/OneSucceeds.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.locks; 26 | 27 | import org.openjdk.jcstress.annotations.Description; 28 | import org.openjdk.jcstress.annotations.Expect; 29 | import org.openjdk.jcstress.annotations.Outcome; 30 | 31 | @Description("Tests the mutual exclusion") 32 | @Outcome(id = "1, 0", expect = Expect.ACCEPTABLE, desc = "T1 -> T2 execution") 33 | @Outcome(id = "0, 1", expect = Expect.ACCEPTABLE, desc = "T2 -> T1 execution") 34 | @Outcome(id = {"-1, 1", "1, -1"}, expect = Expect.ACCEPTABLE, desc = "One of the threads fails to acquire the lock. Other thread had succeeded.") 35 | public class OneSucceeds { 36 | } 37 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/strings/BigDecimalStringLen.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Red Hat Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.strings; 26 | 27 | import org.openjdk.jcstress.annotations.*; 28 | import org.openjdk.jcstress.infra.results.II_Result; 29 | 30 | import java.math.BigDecimal; 31 | 32 | @JCStressTest 33 | @Outcome(id = "4, 4", expect = Expect.ACCEPTABLE, desc = "The only possible outcome") 34 | @State 35 | public class BigDecimalStringLen { 36 | private final BigDecimal bd = new BigDecimal("0.42"); 37 | 38 | @Actor 39 | public void actor1(II_Result r) { 40 | r.r1 = bd.toString().length(); 41 | } 42 | 43 | @Actor 44 | public void actor2(II_Result r) { 45 | r.r2 = bd.toString().length(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/strings/BigIntegerString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Red Hat Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.strings; 26 | 27 | import org.openjdk.jcstress.annotations.*; 28 | import org.openjdk.jcstress.infra.results.LL_Result; 29 | 30 | import java.math.BigInteger; 31 | 32 | @JCStressTest 33 | @Outcome(id = "42, 42", expect = Expect.ACCEPTABLE, desc = "The only possible outcome") 34 | @State 35 | public class BigIntegerString { 36 | private final BigInteger bi = new BigInteger("42"); 37 | 38 | @Actor 39 | public void actor1(LL_Result r) { 40 | r.r1 = bi.toString(); 41 | } 42 | 43 | @Actor 44 | public void actor2(LL_Result r) { 45 | r.r2 = bi.toString(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests-custom/src/main/java/org/openjdk/jcstress/tests/strings/BigIntegerStringLen.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Red Hat Inc. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.strings; 26 | 27 | import org.openjdk.jcstress.annotations.*; 28 | import org.openjdk.jcstress.infra.results.II_Result; 29 | 30 | import java.math.BigInteger; 31 | 32 | @JCStressTest 33 | @Outcome(id = "2, 2", expect = Expect.ACCEPTABLE, desc = "The only possible outcome") 34 | @State 35 | public class BigIntegerStringLen { 36 | private final BigInteger bi = new BigInteger("42"); 37 | 38 | @Actor 39 | public void actor1(II_Result r) { 40 | r.r1 = bi.toString().length(); 41 | } 42 | 43 | @Actor 44 | public void actor2(II_Result r) { 45 | r.r2 = bi.toString().length(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests-custom/src/main/resources/THIRD_PARTY_README: -------------------------------------------------------------------------------- 1 | DO NOT TRANSLATE OR LOCALIZE. 2 | ----------------------------- 3 | 4 | %% This notice is provided with respect to JOpt-Simple v4.6. 5 | 6 | --- begin of LICENSE --- 7 | 8 | Copyright (c) SourceForge 9 | 10 | The MIT License Copyright (c) Permission is hereby granted, free of 11 | charge, to any person obtaining a copy of this software and associated 12 | documentation files (the "Software"), to deal in the Software without 13 | restriction, including without limitation the rights to use, copy, 14 | modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished 16 | to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included 19 | in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | OTHER DEALINGS IN THE SOFTWARE. 28 | 29 | --- end of LICENSE --- 30 | -------------------------------------------------------------------------------- /tests-custom/src/main/scratch/completable/MyThrowable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | package org.openjdk.jcstress.tests.future.completable; 26 | 27 | public class MyThrowable extends Throwable { 28 | 29 | } 30 | --------------------------------------------------------------------------------