From cbdbba0ab06898cd7ab6d69e33d2db990d8b8799 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Thu, 15 Feb 2024 09:36:18 +0700 Subject: [PATCH] Globally replace "http:" by "https:" in non-XML files Maybe, the XML files and Maven wrapper files will follow. First, let us find out if this breaks the build, maybe some tests are asserting on "http:". But there, the replacement would also have taken place, so probably it just works. Signed-off-by: Alexander Kriegisch --- .../org/aspectj/apache/bcel/Constants.java | 4 +- .../apache/bcel/ConstantsInitializer.java | 6 +- .../apache/bcel/ExceptionConstants.java | 6 +- .../org/aspectj/apache/bcel/Repository.java | 4 +- .../apache/bcel/classfile/Attribute.java | 4 +- .../bcel/classfile/BootstrapMethods.java | 4 +- .../bcel/classfile/ClassFormatException.java | 5 +- .../apache/bcel/classfile/ClassParser.java | 4 +- .../apache/bcel/classfile/ClassVisitor.java | 6 +- .../aspectj/apache/bcel/classfile/Code.java | 4 +- .../apache/bcel/classfile/CodeException.java | 4 +- .../apache/bcel/classfile/Constant.java | 4 +- .../apache/bcel/classfile/ConstantCP.java | 4 +- .../apache/bcel/classfile/ConstantClass.java | 4 +- .../apache/bcel/classfile/ConstantDouble.java | 4 +- .../bcel/classfile/ConstantDynamic.java | 6 +- .../bcel/classfile/ConstantFieldref.java | 4 +- .../apache/bcel/classfile/ConstantFloat.java | 4 +- .../bcel/classfile/ConstantInteger.java | 4 +- .../classfile/ConstantInterfaceMethodref.java | 4 +- .../bcel/classfile/ConstantInvokeDynamic.java | 6 +- .../apache/bcel/classfile/ConstantLong.java | 4 +- .../bcel/classfile/ConstantMethodHandle.java | 6 +- .../bcel/classfile/ConstantMethodType.java | 6 +- .../bcel/classfile/ConstantMethodref.java | 4 +- .../apache/bcel/classfile/ConstantModule.java | 6 +- .../bcel/classfile/ConstantNameAndType.java | 4 +- .../apache/bcel/classfile/ConstantObject.java | 4 +- .../bcel/classfile/ConstantPackage.java | 6 +- .../apache/bcel/classfile/ConstantPool.java | 4 +- .../apache/bcel/classfile/ConstantString.java | 4 +- .../apache/bcel/classfile/ConstantUtf8.java | 4 +- .../apache/bcel/classfile/ConstantValue.java | 4 +- .../apache/bcel/classfile/Deprecated.java | 4 +- .../apache/bcel/classfile/ExceptionTable.java | 4 +- .../aspectj/apache/bcel/classfile/Field.java | 4 +- .../apache/bcel/classfile/FieldOrMethod.java | 4 +- .../apache/bcel/classfile/InnerClass.java | 4 +- .../apache/bcel/classfile/InnerClasses.java | 4 +- .../apache/bcel/classfile/JavaClass.java | 4 +- .../apache/bcel/classfile/LineNumber.java | 4 +- .../bcel/classfile/LineNumberTable.java | 4 +- .../apache/bcel/classfile/LocalVariable.java | 4 +- .../bcel/classfile/LocalVariableTable.java | 4 +- .../aspectj/apache/bcel/classfile/Method.java | 4 +- .../bcel/classfile/MethodParameters.java | 2 +- .../apache/bcel/classfile/Modifiers.java | 4 +- .../aspectj/apache/bcel/classfile/Module.java | 10 +- .../bcel/classfile/ModuleMainClass.java | 6 +- .../apache/bcel/classfile/ModulePackages.java | 6 +- .../apache/bcel/classfile/NestHost.java | 4 +- .../apache/bcel/classfile/NestMembers.java | 4 +- .../aspectj/apache/bcel/classfile/Node.java | 4 +- .../apache/bcel/classfile/Signature.java | 6 +- .../apache/bcel/classfile/SimpleConstant.java | 4 +- .../apache/bcel/classfile/SourceFile.java | 4 +- .../apache/bcel/classfile/StackMap.java | 8 +- .../apache/bcel/classfile/StackMapEntry.java | 4 +- .../apache/bcel/classfile/StackMapType.java | 4 +- .../apache/bcel/classfile/Synthetic.java | 4 +- .../apache/bcel/classfile/Unknown.java | 4 +- .../apache/bcel/classfile/Utility.java | 6 +- .../apache/bcel/generic/ArrayType.java | 4 +- .../apache/bcel/generic/BasicType.java | 4 +- .../apache/bcel/generic/BranchHandle.java | 4 +- .../aspectj/apache/bcel/generic/ClassGen.java | 4 +- .../bcel/generic/ClassGenException.java | 5 +- .../apache/bcel/generic/CodeExceptionGen.java | 4 +- .../aspectj/apache/bcel/generic/FieldGen.java | 4 +- .../bcel/generic/FieldGenOrMethodGen.java | 4 +- .../apache/bcel/generic/FieldInstruction.java | 4 +- .../apache/bcel/generic/FieldOrMethod.java | 4 +- .../org/aspectj/apache/bcel/generic/IINC.java | 4 +- .../apache/bcel/generic/INVOKEINTERFACE.java | 4 +- .../apache/bcel/generic/InstVisitor.java | 4 +- .../apache/bcel/generic/Instruction.java | 4 +- .../bcel/generic/InstructionBranch.java | 4 +- .../apache/bcel/generic/InstructionByte.java | 4 +- .../apache/bcel/generic/InstructionCP.java | 4 +- .../bcel/generic/InstructionConstants.java | 4 +- .../bcel/generic/InstructionFactory.java | 4 +- .../bcel/generic/InstructionHandle.java | 4 +- .../apache/bcel/generic/InstructionLV.java | 4 +- .../apache/bcel/generic/InstructionList.java | 4 +- .../bcel/generic/InstructionSelect.java | 4 +- .../apache/bcel/generic/InstructionShort.java | 4 +- .../bcel/generic/InstructionTargeter.java | 4 +- .../apache/bcel/generic/InvokeDynamic.java | 4 +- .../bcel/generic/InvokeInstruction.java | 4 +- .../apache/bcel/generic/LOOKUPSWITCH.java | 4 +- .../apache/bcel/generic/LineNumberGen.java | 4 +- .../apache/bcel/generic/LocalVariableGen.java | 4 +- .../apache/bcel/generic/MULTIANEWARRAY.java | 4 +- .../apache/bcel/generic/MethodGen.java | 6 +- .../apache/bcel/generic/ObjectType.java | 4 +- .../org/aspectj/apache/bcel/generic/RET.java | 4 +- .../apache/bcel/generic/ReferenceType.java | 4 +- .../bcel/generic/ReturnaddressType.java | 6 +- .../apache/bcel/generic/SwitchBuilder.java | 4 +- .../apache/bcel/generic/TABLESWITCH.java | 4 +- .../bcel/generic/TargetLostException.java | 4 +- .../org/aspectj/apache/bcel/generic/Type.java | 4 +- .../apache/bcel/util/ByteSequence.java | 4 +- .../bcel/util/ClassLoaderReference.java | 4 +- .../bcel/util/ClassLoaderRepository.java | 4 +- .../aspectj/apache/bcel/util/ClassPath.java | 4 +- .../util/DefaultClassLoaderReference.java | 4 +- .../util/NonCachingClassLoaderRepository.java | 4 +- .../aspectj/apache/bcel/util/Repository.java | 4 +- .../apache/bcel/util/SyntheticRepository.java | 4 +- .../bcel/util/ThreadLocalAwareRepository.java | 4 +- .../LocalVariableTableConcurrencyTest.java | 2 +- .../bcel/classfile/tests/ModuleTest.java | 2 +- .../NonCachingClassLoaderRepositoryTest.java | 4 +- .../bcel/verifier/DescendingVisitor.java | 4 +- .../bcel/verifier/EmptyClassVisitor.java | 4 +- .../bcel/verifier/EmptyInstVisitor.java | 4 +- .../bcel/verifier/GraphicalVerifier.java | 8 +- .../bcel/verifier/InstructionWalker.java | 4 +- .../apache/bcel/verifier/NativeVerifier.java | 14 +- .../apache/bcel/verifier/PassVerifier.java | 10 +- .../apache/bcel/verifier/TransitiveHull.java | 12 +- .../bcel/verifier/VerificationResult.java | 10 +- .../apache/bcel/verifier/Verifier.java | 8 +- .../bcel/verifier/VerifierAppFrame.java | 6 +- .../apache/bcel/verifier/VerifierFactory.java | 14 +- .../verifier/VerifierFactoryListModel.java | 4 +- .../verifier/VerifierFactoryObserver.java | 6 +- .../apache/bcel/verifier/VerifyDialog.java | 28 +- .../exc/AssertionViolatedException.java | 8 +- .../exc/ClassConstraintException.java | 8 +- .../verifier/exc/CodeConstraintException.java | 8 +- .../verifier/exc/InvalidMethodException.java | 6 +- .../exc/LinkingConstraintException.java | 6 +- .../bcel/verifier/exc/LoadingException.java | 8 +- ...ocalVariableInfoInconsistentException.java | 8 +- .../exc/StaticCodeConstraintException.java | 6 +- ...ticCodeInstructionConstraintException.java | 6 +- ...InstructionOperandConstraintException.java | 6 +- .../StructuralCodeConstraintException.java | 6 +- .../apache/bcel/verifier/exc/Utility.java | 6 +- .../verifier/exc/VerificationException.java | 6 +- .../VerifierConstraintViolatedException.java | 6 +- .../aspectj/apache/bcel/verifier/package.html | 2 +- .../bcel/verifier/statics/DOUBLE_Upper.java | 6 +- .../apache/bcel/verifier/statics/IntList.java | 6 +- .../bcel/verifier/statics/LONG_Upper.java | 6 +- .../verifier/statics/LocalVariableInfo.java | 6 +- .../verifier/statics/LocalVariablesInfo.java | 12 +- .../bcel/verifier/statics/Pass1Verifier.java | 12 +- .../bcel/verifier/statics/Pass2Verifier.java | 26 +- .../bcel/verifier/statics/Pass3aVerifier.java | 16 +- .../statics/StringRepresentation.java | 6 +- .../apache/bcel/verifier/statics/package.html | 2 +- .../structurals/ControlFlowGraph.java | 12 +- .../structurals/ExceptionHandler.java | 10 +- .../structurals/ExceptionHandlers.java | 10 +- .../structurals/ExecutionVisitor.java | 322 +++++++++--------- .../bcel/verifier/structurals/Frame.java | 8 +- .../verifier/structurals/GenericArray.java | 8 +- .../structurals/InstConstraintVisitor.java | 163 +++++---- .../structurals/InstructionContext.java | 6 +- .../verifier/structurals/LocalVariables.java | 6 +- .../verifier/structurals/OperandStack.java | 14 +- .../verifier/structurals/Pass3bVerifier.java | 6 +- .../bcel/verifier/structurals/Subroutine.java | 6 +- .../verifier/structurals/Subroutines.java | 74 ++-- .../structurals/UninitializedObjectType.java | 8 +- .../bcel/verifier/structurals/package.html | 2 +- .../bcel/verifier/util/BCELFactory.java | 6 +- .../apache/bcel/verifier/util/BCELifier.java | 34 +- .../bcel/verifier/util/InstructionFinder.java | 8 +- .../tools/ant/taskdefs/Checklics.java | 5 +- .../aspectj/internal/tools/build/Util.java | 2 +- docs/LICENSE-AspectJ.adoc | 8 +- .../traces/ajc_batchBuild_annotated.htm | 2 +- docs/developer/traces/ajc_hello_annotated.htm | 2 +- docs/devguide/ajc.adoc | 4 +- docs/devguide/ajdoc.adoc | 2 +- docs/faq/faq.adoc | 52 +-- docs/pdguide/ajcore.adoc | 4 +- docs/pdguide/trace.adoc | 2 +- docs/release/README-1.1.adoc | 6 +- docs/release/README-1.6.10.adoc | 2 +- docs/release/README-1.6.11.adoc | 2 +- docs/release/README-1.6.4.adoc | 2 +- docs/release/README-1.6.7.adoc | 10 +- docs/release/README-1.6.9.adoc | 6 +- docs/release/changes.adoc | 70 ++-- docs/sandbox/trails/links.adoc | 6 +- docs/sandbox/trails/myeclipseide.adoc | 2 +- .../ubc-design-patterns/docs/readme.adoc | 2 +- .../aspectj/ComponentFactory.java | 30 +- .../ComponentFactoryImplementation.java | 32 +- .../abstractFactory/aspectj/Display.java | 56 +-- .../aspectj/FramedFactory.java | 38 +-- .../abstractFactory/aspectj/Main.java | 70 ++-- .../aspectj/RegularFactory.java | 34 +- .../java/ComponentFactory.java | 30 +- .../abstractFactory/java/Display.java | 58 ++-- .../abstractFactory/java/FramedFactory.java | 42 +-- .../examples/abstractFactory/java/Main.java | 72 ++-- .../abstractFactory/java/RegularFactory.java | 36 +- .../examples/adapter/aspectj/Main.java | 52 +-- .../adapter/aspectj/PrinterAdapter.java | 32 +- .../adapter/aspectj/SystemOutPrinter.java | 22 +- .../examples/adapter/aspectj/Writer.java | 6 +- .../examples/adapter/java/Main.java | 4 +- .../examples/adapter/java/PrinterAdapter.java | 6 +- .../adapter/java/SystemOutPrinter.java | 18 +- .../examples/adapter/java/Writer.java | 22 +- .../aspectj/AbstractionImplementation.java | 35 +- .../aspectj/CrossCapitalImplementation.java | 28 +- .../bridge/aspectj/GreetingScreen.java | 22 +- .../bridge/aspectj/InformationScreen.java | 31 +- .../examples/bridge/aspectj/Main.java | 54 +-- .../examples/bridge/aspectj/Screen.java | 21 +- .../bridge/aspectj/ScreenImplementation.java | 26 +- .../bridge/aspectj/StarImplementation.java | 26 +- .../java/CrossCapitalImplementation.java | 28 +- .../examples/bridge/java/GreetingScreen.java | 6 +- .../bridge/java/InformationScreen.java | 31 +- .../examples/bridge/java/Main.java | 56 +-- .../examples/bridge/java/Screen.java | 47 ++- .../bridge/java/ScreenImplementation.java | 4 +- .../bridge/java/StarImplementation.java | 4 +- .../examples/builder/aspectj/Creator.java | 35 +- .../aspectj/CreatorImplementation.java | 32 +- .../examples/builder/aspectj/Main.java | 40 +-- .../examples/builder/aspectj/TextCreator.java | 26 +- .../examples/builder/aspectj/XMLCreator.java | 48 +-- .../examples/builder/java/Creator.java | 41 ++- .../examples/builder/java/Main.java | 36 +- .../examples/builder/java/TextCreator.java | 26 +- .../examples/builder/java/XMLCreator.java | 4 +- .../chainOfResponsibility/aspectj/Button.java | 44 +-- .../chainOfResponsibility/aspectj/Click.java | 64 ++-- .../aspectj/ClickChain.java | 62 ++-- .../chainOfResponsibility/aspectj/Frame.java | 7 +- .../chainOfResponsibility/aspectj/Main.java | 58 ++-- .../chainOfResponsibility/aspectj/Panel.java | 15 +- .../chainOfResponsibility/java/Button.java | 44 ++- .../chainOfResponsibility/java/Click.java | 64 ++-- .../java/ClickHandler.java | 15 +- .../chainOfResponsibility/java/Frame.java | 43 ++- .../chainOfResponsibility/java/Main.java | 58 ++-- .../chainOfResponsibility/java/Panel.java | 35 +- .../examples/command/aspectj/Button.java | 6 +- .../command/aspectj/ButtonCommand.java | 27 +- .../command/aspectj/ButtonCommand2.java | 5 +- .../command/aspectj/ButtonCommanding.java | 31 +- .../examples/command/aspectj/Main.java | 64 ++-- .../examples/command/aspectj/Printer.java | 4 +- .../examples/command/java/Button.java | 32 +- .../examples/command/java/ButtonCommand.java | 21 +- .../examples/command/java/ButtonCommand2.java | 23 +- .../examples/command/java/Command.java | 4 +- .../examples/command/java/Main.java | 58 ++-- .../examples/composite/aspectj/Directory.java | 25 +- .../examples/composite/aspectj/File.java | 30 +- .../aspectj/FileSystemComposition.java | 95 +++--- .../examples/composite/aspectj/Main.java | 6 +- .../examples/composite/java/Directory.java | 37 +- .../examples/composite/java/File.java | 32 +- .../composite/java/FileSystemComponent.java | 32 +- .../examples/composite/java/Main.java | 68 ++-- .../decorator/aspectj/BracketDecorator.java | 24 +- .../decorator/aspectj/ConcreteOutput.java | 22 +- .../examples/decorator/aspectj/Main.java | 48 +-- .../decorator/aspectj/StarDecorator.java | 6 +- .../decorator/java/BracketDecorator.java | 20 +- .../decorator/java/ConcreteOutput.java | 16 +- .../examples/decorator/java/Main.java | 40 +-- .../examples/decorator/java/Output.java | 21 +- .../decorator/java/OutputDecorator.java | 38 +-- .../decorator/java/StarDecorator.java | 18 +- .../examples/facade/aspectj/Decoration.java | 14 +- .../aspectj/FacadePolicyEnforcement.java | 30 +- .../examples/facade/aspectj/Main.java | 36 +- .../examples/facade/aspectj/OutputFacade.java | 28 +- .../facade/aspectj/RegularScreen.java | 16 +- .../facade/aspectj/StringTransformer.java | 14 +- .../examples/facade/java/Decoration.java | 6 +- .../examples/facade/java/Main.java | 32 +- .../examples/facade/java/OutputFacade.java | 28 +- .../examples/facade/java/RegularScreen.java | 16 +- .../facade/java/StringTransformer.java | 14 +- .../AlternateLabelCreatorImplementation.java | 38 +-- .../factoryMethod/aspectj/ButtonCreator.java | 20 +- .../aspectj/CreatorImplementation.java | 50 +-- .../aspectj/GUIComponentCreator.java | 36 +- .../factoryMethod/aspectj/LabelCreator.java | 20 +- .../examples/factoryMethod/aspectj/Main.java | 42 +-- .../factoryMethod/java/ButtonCreator.java | 20 +- .../java/GUIComponentCreator.java | 64 ++-- .../factoryMethod/java/LabelCreator.java | 20 +- .../examples/factoryMethod/java/Main.java | 44 +-- .../flyweight/aspectj/CharacterFlyweight.java | 32 +- .../aspectj/FlyweightImplementation.java | 48 +-- .../examples/flyweight/aspectj/Main.java | 70 ++-- .../flyweight/aspectj/PrintableFlyweight.java | 22 +- .../aspectj/WhitespaceFlyweight.java | 34 +- .../flyweight/java/CharacterFlyweight.java | 6 +- .../examples/flyweight/java/Main.java | 62 ++-- .../flyweight/java/PrintableFlyweight.java | 26 +- .../java/PrintableFlyweightFactory.java | 36 +- .../flyweight/java/WhitespaceFlyweight.java | 34 +- .../interpreter/aspectj/AndExpression.java | 4 +- .../interpreter/aspectj/BooleanConstant.java | 24 +- .../aspectj/BooleanExpression.java | 18 +- .../aspectj/BooleanInterpretation.java | 75 ++-- .../aspectj/ExpressionException.java | 14 +- .../examples/interpreter/aspectj/Main.java | 59 ++-- .../interpreter/aspectj/NotExpression.java | 28 +- .../interpreter/aspectj/OrExpression.java | 28 +- .../interpreter/aspectj/VariableContext.java | 6 +- .../aspectj/VariableExpression.java | 32 +- .../interpreter/java/AndExpression.java | 36 +- .../interpreter/java/BooleanConstant.java | 34 +- .../interpreter/java/BooleanExpression.java | 18 +- .../interpreter/java/ExpressionException.java | 14 +- .../examples/interpreter/java/Main.java | 65 ++-- .../interpreter/java/NotExpression.java | 6 +- .../interpreter/java/OrExpression.java | 6 +- .../interpreter/java/VariableContext.java | 26 +- .../interpreter/java/VariableExpression.java | 40 +-- .../examples/iterator/aspectj/Main.java | 52 +-- .../examples/iterator/aspectj/OpenList.java | 42 +-- .../iterator/aspectj/OpenListIteration.java | 55 ++- .../examples/iterator/aspectj/SimpleList.java | 35 +- .../examples/iterator/java/Main.java | 6 +- .../examples/iterator/java/OpenList.java | 50 +-- .../iterator/java/ReverseIterator.java | 52 +-- .../examples/iterator/java/SimpleList.java | 35 +- .../examples/mediator/aspectj/Button.java | 30 +- .../examples/mediator/aspectj/Label.java | 22 +- .../examples/mediator/aspectj/Main.java | 48 +-- .../aspectj/MediatorImplementation.java | 36 +- .../examples/mediator/java/Button.java | 38 +-- .../examples/mediator/java/GUIColleague.java | 20 +- .../examples/mediator/java/GUIMediator.java | 22 +- .../examples/mediator/java/Label.java | 34 +- .../examples/mediator/java/Main.java | 52 +-- .../examples/memento/aspectj/Counter.java | 28 +- .../memento/aspectj/CounterMemento.java | 6 +- .../examples/memento/aspectj/Main.java | 54 +-- .../examples/memento/java/Counter.java | 46 +-- .../examples/memento/java/CounterMemento.java | 6 +- .../examples/memento/java/Main.java | 44 +-- .../observer/aspectj/ColorObserver.java | 4 +- .../observer/aspectj/CoordinateObserver.java | 24 +- .../examples/observer/aspectj/Main.java | 66 ++-- .../examples/observer/aspectj/Point.java | 52 +-- .../examples/observer/aspectj/Screen.java | 28 +- .../observer/aspectj/ScreenObserver.java | 29 +- .../observer/java/ChangeObserver.java | 18 +- .../examples/observer/java/ChangeSubject.java | 28 +- .../examples/observer/java/Main.java | 84 ++--- .../examples/observer/java/Point.java | 80 ++--- .../examples/observer/java/Screen.java | 52 +-- .../examples/prototype/aspectj/Main.java | 58 ++-- .../prototype/aspectj/StringPrototypeA.java | 5 +- .../prototype/aspectj/StringPrototypeB.java | 6 +- .../prototype/aspectj/StringPrototypes.java | 24 +- .../examples/prototype/java/Main.java | 70 ++-- .../prototype/java/StringPrototypeA.java | 37 +- .../prototype/java/StringPrototypeB.java | 38 +-- .../AlternateOutputImplementation.java | 20 +- .../examples/proxy/aspectj/Main.java | 62 ++-- .../proxy/aspectj/OutputImplementation.java | 22 +- .../proxy/aspectj/RequestBlocking.java | 36 +- .../proxy/aspectj/RequestCounting.java | 44 +-- .../proxy/aspectj/RequestDelegation.java | 58 ++-- .../examples/proxy/java/Main.java | 42 +-- .../proxy/java/OutputImplementation.java | 18 +- .../examples/proxy/java/OutputSubject.java | 24 +- .../examples/proxy/java/RequestBlocker.java | 52 +-- .../examples/proxy/java/RequestCounter.java | 60 ++-- .../examples/singleton/aspectj/Main.java | 72 ++-- .../examples/singleton/aspectj/Printer.java | 25 +- .../singleton/aspectj/PrinterSubclass.java | 20 +- .../singleton/aspectj/SingletonInstance.java | 30 +- .../examples/singleton/java/Main.java | 86 ++--- .../singleton/java/PrinterSingleton.java | 5 +- .../singleton/java/PrinterSubclass.java | 20 +- .../examples/state/aspectj/Main.java | 49 ++- .../examples/state/aspectj/Queue.java | 46 +-- .../examples/state/aspectj/QueueEmpty.java | 36 +- .../examples/state/aspectj/QueueFull.java | 42 +-- .../examples/state/aspectj/QueueNormal.java | 50 +-- .../examples/state/aspectj/QueueState.java | 6 +- .../state/aspectj/QueueStateAspect.java | 62 ++-- .../examples/state/java/Main.java | 51 ++- .../examples/state/java/Queue.java | 48 +-- .../examples/state/java/QueueContext.java | 16 +- .../examples/state/java/QueueEmpty.java | 42 +-- .../examples/state/java/QueueFull.java | 48 +-- .../examples/state/java/QueueNormal.java | 60 ++-- .../examples/state/java/QueueState.java | 38 +-- .../examples/strategy/aspectj/BubbleSort.java | 17 +- .../examples/strategy/aspectj/LinearSort.java | 24 +- .../examples/strategy/aspectj/Main.java | 50 ++- .../examples/strategy/aspectj/Sorter.java | 6 +- .../strategy/aspectj/SortingStrategy.java | 4 +- .../examples/strategy/java/BubbleSort.java | 5 +- .../examples/strategy/java/LinearSort.java | 24 +- .../examples/strategy/java/Main.java | 42 ++- .../examples/strategy/java/Sorter.java | 28 +- .../strategy/java/SortingStrategy.java | 10 +- .../aspectj/DecoratedStringGenerator.java | 7 +- .../aspectj/FancyGenerator.java | 22 +- .../templateMethod/aspectj/Generating.java | 15 +- .../examples/templateMethod/aspectj/Main.java | 30 +- .../aspectj/SimpleGenerator.java | 14 +- .../java/DecoratedStringGenerator.java | 26 +- .../templateMethod/java/FancyGenerator.java | 26 +- .../examples/templateMethod/java/Main.java | 30 +- .../templateMethod/java/SimpleGenerator.java | 16 +- .../visitor/aspectj/BinaryTreeLeaf.java | 24 +- .../visitor/aspectj/BinaryTreeNode.java | 6 +- .../examples/visitor/aspectj/Main.java | 72 ++-- .../visitor/aspectj/SummationVisitor.java | 30 +- .../visitor/aspectj/TraversalVisitor.java | 6 +- .../examples/visitor/aspectj/Visitable.java | 5 +- .../examples/visitor/aspectj/Visiting.java | 18 +- .../examples/visitor/java/BinaryTreeLeaf.java | 32 +- .../examples/visitor/java/BinaryTreeNode.java | 6 +- .../visitor/java/BinaryTreeVisitor.java | 28 +- .../examples/visitor/java/Main.java | 6 +- .../visitor/java/SummationVisitor.java | 32 +- .../visitor/java/TraversalVisitor.java | 30 +- .../examples/visitor/java/Visitable.java | 15 +- .../ChainOfResponsibilityException.java | 6 +- .../ChainOfResponsibilityProtocol.java | 6 +- .../patternLibrary/Command.java | 20 +- .../patternLibrary/CommandInvoker.java | 18 +- .../patternLibrary/CommandProtocol.java | 140 ++++---- .../patternLibrary/CommandReceiver.java | 18 +- .../patternLibrary/CompositeProtocol.java | 101 +++--- .../patternLibrary/FlyweightProtocol.java | 30 +- .../patternLibrary/MediatorProtocol.java | 48 +-- .../patternLibrary/Memento.java | 22 +- .../patternLibrary/MementoException.java | 18 +- .../patternLibrary/MementoProtocol.java | 26 +- .../patternLibrary/ObserverProtocol.java | 64 ++-- .../patternLibrary/PrototypeProtocol.java | 44 +-- .../patternLibrary/ProxyProtocol.java | 82 ++--- .../patternLibrary/SingletonProtocol.java | 42 +-- .../patternLibrary/StrategyProtocol.java | 6 +- .../patternLibrary/VisitorProtocol.java | 64 ++-- docs/teaching/demos/oopsla2002-script.html | 2 +- docs/teaching/exercises/README.txt | 7 +- docs/teaching/exercises/figures_classes.svg | 4 +- docs/teaching/exercises/index.html | 6 +- docs/teaching/exercises/pre-letter.txt | 26 +- lib/readme-lib-module.adoc | 4 +- .../org/aspectj/weaver/ReferenceType.java | 2 +- .../org/aspectj/tools/ant/taskdefs/Ajc2.java | 2 +- .../ant/taskdefs/AjcCompilerAdapter.java | 2 +- .../tools/ant/taskdefs/compilers/Ajc.java | 2 +- .../differentFile/actual/TestUtilTest.java | 16 +- .../differentFile/expected/TestUtilTest.java | 16 +- .../sameFile/actual/TestUtilTest.java | 16 +- .../sameFile/expected/TestUtilTest.java | 16 +- .../aspectj/testing/XMLBasedAjcTestCase.java | 2 +- .../org/aspectj/testing/util/LinkCheck.java | 2 +- .../org/aspectj/testing/util/WebInstall.java | 2 +- .../aspectj/testing/xml/AjcSpecXmlReader.java | 3 +- testing/testdata/badLinks.html | 10 +- tests/bugs1612/pr328099/readme | 2 +- .../AbstractDependencyInjectionAspect.aj | 2 +- tests/doc/allclasses-frame.html | 2 +- tests/doc/allclasses-noframe.html | 2 +- tests/doc/constant-values.html | 2 +- tests/doc/deprecated-list.html | 2 +- tests/doc/help-doc.html | 2 +- tests/doc/index-files/index-1.html | 4 +- tests/doc/index-files/index-10.html | 4 +- tests/doc/index-files/index-2.html | 4 +- tests/doc/index-files/index-3.html | 20 +- tests/doc/index-files/index-4.html | 12 +- tests/doc/index-files/index-5.html | 4 +- tests/doc/index-files/index-6.html | 2 +- tests/doc/index-files/index-7.html | 4 +- tests/doc/index-files/index-8.html | 4 +- tests/doc/index-files/index-9.html | 4 +- tests/doc/index.html | 2 +- .../aspectj/testing/XMLBasedAjcTestCase.html | 6 +- .../class-use/XMLBasedAjcTestCase.html | 2 +- .../org/aspectj/testing/package-frame.html | 2 +- .../org/aspectj/testing/package-summary.html | 2 +- .../doc/org/aspectj/testing/package-tree.html | 2 +- .../doc/org/aspectj/testing/package-use.html | 2 +- .../aspectj/tools/ajc/CompilationResult.html | 4 +- .../ajc/class-use/CompilationResult.html | 2 +- .../org/aspectj/tools/ajc/package-frame.html | 2 +- .../aspectj/tools/ajc/package-summary.html | 2 +- .../org/aspectj/tools/ajc/package-tree.html | 2 +- .../org/aspectj/tools/ajc/package-use.html | 2 +- tests/doc/overview-frame.html | 2 +- tests/doc/overview-summary.html | 2 +- tests/doc/overview-tree.html | 2 +- tests/doc/packages.html | 2 +- .../pr290741/base/src/demo/Converter.java | 2 +- .../pr290741/base/src/demo/ConverterTest.java | 10 +- tests/profiling/build.properties | 6 +- tests/profiling/build.properties.shadows | 6 +- tests/profiling/build.properties.tjp | 6 +- tests/readme-tests-module.html | 70 ++-- .../systemtest/ajc1810/Ajc1810Tests.java | 2 +- .../systemtest/ajc190/ModuleTests.java | 2 +- .../org/aspectj/systemtest/apt/AptTests.java | 2 +- .../java/org/aspectj/testing/Harness.java | 4 +- .../main/java/org/aspectj/util/LangUtil.java | 4 +- .../loadtime/definition/DocumentParser.java | 6 +- .../cache/DefaultCacheKeyResolverTest.java | 2 +- .../org/aspectj/weaver/test/Aspect.java | 4 +- 517 files changed, 5254 insertions(+), 5331 deletions(-) diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java index 77477747c7..14e6a7f294 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java @@ -23,7 +23,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -53,7 +53,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/ConstantsInitializer.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/ConstantsInitializer.java index 8f33b85236..7b912a5ac8 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/ConstantsInitializer.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/ConstantsInitializer.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel; @@ -394,4 +394,4 @@ public static Object initialize() { } return null; } -} \ No newline at end of file +} diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/ExceptionConstants.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/ExceptionConstants.java index b03b3cd0c4..4eff2b9531 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/ExceptionConstants.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/ExceptionConstants.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,14 +51,14 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** * Exception constants. * * @version $Id: ExceptionConstants.java,v 1.5 2009/09/14 20:29:10 aclement Exp $ - * @author E. Haase + * @author E. Haase */ @SuppressWarnings("rawtypes") public interface ExceptionConstants { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/Repository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/Repository.java index 43db690789..82616fa5e9 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/Repository.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/Repository.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Attribute.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Attribute.java index bd80bfe4c0..2b78108705 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Attribute.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Attribute.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/BootstrapMethods.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/BootstrapMethods.java index a1178fbfae..638acdfee8 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/BootstrapMethods.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/BootstrapMethods.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.ByteArrayInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassFormatException.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassFormatException.java index 5cdec92c85..dd42f23283 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassFormatException.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassFormatException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -66,4 +66,3 @@ public class ClassFormatException extends RuntimeException { public ClassFormatException() { super(); } public ClassFormatException(String s) { super(s); } } - diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassParser.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassParser.java index 48fb2d99c1..26c8ffe9c7 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassParser.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassParser.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.BufferedInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassVisitor.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassVisitor.java index 695c78c4e4..0912a29b18 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassVisitor.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassVisitor.java @@ -28,7 +28,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -58,14 +58,14 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** * Interface to make use of the Visitor pattern programming style. I.e. a class that implements this interface can traverse the * contents of a Java class just by calling the `accept' method which all classes have. * - * Implemented by wish of Boris Bokowski. + * Implemented by wish of Boris Bokowski. * * @version $Id: ClassVisitor.java,v 1.4 2009/09/15 19:40:13 aclement Exp $ * @author M. Dahm diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Code.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Code.java index 5f6af45189..dc6cb7309c 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Code.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Code.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/CodeException.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/CodeException.java index 328c458fb5..d489fed76f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/CodeException.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/CodeException.java @@ -26,7 +26,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -56,7 +56,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Constant.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Constant.java index 86563c2e4c..02bea4eac1 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Constant.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Constant.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantCP.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantCP.java index c37e61f27d..c4c26eaa64 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantCP.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantCP.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; import java.io.DataOutputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantClass.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantClass.java index b8154f7b5d..0ef44adbeb 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantClass.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantClass.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantDouble.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantDouble.java index 4b2e373f0e..e83a796bcb 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantDouble.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantDouble.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantDynamic.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantDynamic.java index fc240e6fe1..8119b1941b 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantDynamic.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantDynamic.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; @@ -64,7 +64,7 @@ * This class is derived from the abstract Constant class and * represents a reference to the name and signature of a field or method. * - * http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.10 + * https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.10 * * @author Andy Clement * @see Constant diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantFieldref.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantFieldref.java index 34423a8608..bf0588aff8 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantFieldref.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantFieldref.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantFloat.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantFloat.java index bda7e8d4a4..c6324f3437 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantFloat.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantFloat.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInteger.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInteger.java index 933dc68ecd..88f187df20 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInteger.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInteger.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInterfaceMethodref.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInterfaceMethodref.java index 495c5e5c07..153558967f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInterfaceMethodref.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInterfaceMethodref.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInvokeDynamic.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInvokeDynamic.java index 3db916ee22..37d271b56c 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInvokeDynamic.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantInvokeDynamic.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; @@ -64,7 +64,7 @@ * This class is derived from the abstract Constant class and * represents a reference to the name and signature of a field or method. * - * http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.10 + * https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.10 * * @author Andy Clement * @see Constant diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantLong.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantLong.java index 160523739b..8cd1be81fa 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantLong.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantLong.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodHandle.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodHandle.java index 8925d38ff8..3fd4105212 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodHandle.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodHandle.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; @@ -64,7 +64,7 @@ * This class is derived from the abstract Constant class and * represents a reference to the name and signature of a field or method. * - * http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.8 + * https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.8 * * @author Andy Clement * @see Constant diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodType.java index be2f29e415..b48d6df242 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodType.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; @@ -64,7 +64,7 @@ * This class is derived from the abstract Constant class and * represents a reference to the name and signature of a field or method. * - * http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.9 + * https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.9 * * @author Andy Clement * @see Constant diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodref.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodref.java index d59b6d57cc..c0db92a9a1 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodref.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantMethodref.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantModule.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantModule.java index 793e3d2d0e..d25eda3f8d 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantModule.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantModule.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; @@ -62,7 +62,7 @@ /** * Represents a module. * - * See http://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.4.11 + * See https://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.4.11 * * @author Andy Clement */ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantNameAndType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantNameAndType.java index fd8f480003..789fa2f26f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantNameAndType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantNameAndType.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantObject.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantObject.java index d9e342a662..2c0180656f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantObject.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantObject.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPackage.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPackage.java index de35453394..daf0e2cabb 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPackage.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPackage.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; @@ -62,7 +62,7 @@ /** * Represents a module. * - * See http://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.4.12 + * See https://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.4.12 * * @author Andy Clement */ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java index ba188b064c..b41065d4ab 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantString.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantString.java index e3a28ffbc8..ff4de4585c 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantString.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantString.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantUtf8.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantUtf8.java index 24e58a96c5..3deae7c60f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantUtf8.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantUtf8.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantValue.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantValue.java index 709700e91a..4c4d5ae34f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantValue.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantValue.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Deprecated.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Deprecated.java index bf34569eac..ba70f35593 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Deprecated.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Deprecated.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ExceptionTable.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ExceptionTable.java index adb796249b..07452615b1 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ExceptionTable.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ExceptionTable.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Field.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Field.java index 2d3c276b5f..bbd48b3def 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Field.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Field.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java index 59e4d2b374..d2c46c8b8f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/FieldOrMethod.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; import java.io.DataOutputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/InnerClass.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/InnerClass.java index 59fd620759..a8fe5caa1a 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/InnerClass.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/InnerClass.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/InnerClasses.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/InnerClasses.java index 16a6098145..aa07fd4fbd 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/InnerClasses.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/InnerClasses.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java index 5d2ec65e55..7eff83fbaa 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/JavaClass.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.ByteArrayOutputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LineNumber.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LineNumber.java index 8b86ad3847..8633a6e157 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LineNumber.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LineNumber.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LineNumberTable.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LineNumberTable.java index ee852cf23b..6ac693760a 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LineNumberTable.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LineNumberTable.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.ByteArrayInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariable.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariable.java index 13ff6b2fc5..076621df3b 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariable.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariable.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariableTable.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariableTable.java index b32ca71792..f84032abe3 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariableTable.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariableTable.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.ByteArrayInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java index 8f9003744f..e67a42cf43 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Method.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/MethodParameters.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/MethodParameters.java index df331ac4e6..64068e955a 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/MethodParameters.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/MethodParameters.java @@ -19,7 +19,7 @@ import org.aspectj.apache.bcel.Constants; -// see http://cr.openjdk.java.net/~abuckley/8misc.pdf +// see https://cr.openjdk.java.net/~abuckley/8misc.pdf public class MethodParameters extends Attribute { public final static int[] NO_PARAMETER_NAME_INDEXES = new int[0]; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Modifiers.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Modifiers.java index 8804a8d7b3..228532cba2 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Modifiers.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Modifiers.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Module.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Module.java index a1dbc2322f..088e451d59 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Module.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Module.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; @@ -62,8 +62,8 @@ /** * This class is derived from Attribute and represents the module * information captured in a class file. - * http://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html - * http://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.7.25 + * https://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html + * https://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.7.25 * * @author Andy Clement */ @@ -367,7 +367,7 @@ private final int readUnsignedShort(int offset) { return ((moduleInfo[offset++] & 0xff) << 8) + (moduleInfo[offset] & 0xff); } - // Format: http://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.7.25 + // Format: https://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.7.25 private void ensureUnpacked() { if (!unpacked) { ptr = 0; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ModuleMainClass.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ModuleMainClass.java index c9357eeb21..5be5be1a85 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ModuleMainClass.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ModuleMainClass.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; @@ -61,7 +61,7 @@ /** * Indicates the main class of a module. - * http://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.7.26 + * https://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.7.26 * * @author Andy Clement */ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ModulePackages.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ModulePackages.java index 1ce96a8bac..5025ea7638 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ModulePackages.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ModulePackages.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; @@ -61,7 +61,7 @@ /** * Indicates all the packages of a module that are exported or opened by the module attribute. - * http://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.7.26 + * https://cr.openjdk.java.net/~mr/jigsaw/spec/java-se-9-jvms-diffs.pdf 4.7.26 * * @author Andy Clement */ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/NestHost.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/NestHost.java index 547b71dae2..0474569f1a 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/NestHost.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/NestHost.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/NestMembers.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/NestMembers.java index 8179aaf18d..568b1da19a 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/NestMembers.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/NestMembers.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Node.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Node.java index 6bc1da6ef4..04c0dad57c 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Node.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Node.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Signature.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Signature.java index a9a9b1a923..12f0a5ecb2 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Signature.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Signature.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . * * Extended by Adrian Colyer, June 2005 to support unpacking of Signature * attribute @@ -65,7 +65,7 @@ import org.aspectj.apache.bcel.Constants; /** - * This class is derived from Attribute and represents a reference to a GJ + * This class is derived from Attribute and represents a reference to a GJ * attribute. * * @version $Id: Signature.java,v 1.11 2009/09/15 19:40:12 aclement Exp $ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/SimpleConstant.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/SimpleConstant.java index d775d1f0a4..fdb96050ba 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/SimpleConstant.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/SimpleConstant.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/SourceFile.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/SourceFile.java index 1e7ef1ea59..5ac43b12ee 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/SourceFile.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/SourceFile.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMap.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMap.java index 263cda9af6..5e4c4e7709 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMap.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMap.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; @@ -61,8 +61,8 @@ import org.aspectj.apache.bcel.Constants; /** - * This class represents a stack map attribute used for preverification of Java classes for the - * Java 2 Micro Edition (J2ME). This attribute is used by the KVM and contained + * This class represents a stack map attribute used for preverification of Java classes for the + * Java 2 Micro Edition (J2ME). This attribute is used by the KVM and contained * within the Code attribute of a method. See CLDC specification 5.3.1.2 * * @version $Id: StackMap.java,v 1.6 2009/09/15 19:40:12 aclement Exp $ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapEntry.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapEntry.java index 1ed14cd016..de1043d674 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapEntry.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapEntry.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapType.java index d4c3589157..b55bd2b50f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapType.java @@ -25,7 +25,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -55,7 +55,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Synthetic.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Synthetic.java index 3c63f11312..0f5f5aabef 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Synthetic.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Synthetic.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Unknown.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Unknown.java index 6d55e311ed..6585689968 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Unknown.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Unknown.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java index 6ac083bcef..699fb9d855 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/Utility.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.ByteArrayOutputStream; @@ -996,7 +996,7 @@ public static final String codeToString(ByteSequence bytes, ConstantPool constan // space break; - case Constants.INVOKEDYNAMIC://http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.invokedynamic + case Constants.INVOKEDYNAMIC://https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.invokedynamic index = bytes.readUnsignedShort(); bytes.readUnsignedShort(); // zeroes buf.append("\t" + constant_pool.constantToString(index) + (verbose ? " (" + index + ")" : "")); diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ArrayType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ArrayType.java index 63f6db57b9..476fbd6233 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ArrayType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ArrayType.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/BasicType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/BasicType.java index 2c0970b3aa..e32247db5b 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/BasicType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/BasicType.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/BranchHandle.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/BranchHandle.java index 09b5cd807d..c63cd9ae6b 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/BranchHandle.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/BranchHandle.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java index ce4eb98eaa..34bf325d40 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGen.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.ByteArrayOutputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGenException.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGenException.java index e87aacaa60..e689f02584 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGenException.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ClassGenException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -65,4 +65,3 @@ public class ClassGenException extends RuntimeException { public ClassGenException() { super(); } public ClassGenException(String s) { super(s); } } - diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/CodeExceptionGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/CodeExceptionGen.java index 2e0b0ddd9e..95baabbcf9 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/CodeExceptionGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/CodeExceptionGen.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.classfile.CodeException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java index 78ba1f4658..9ce4214cc4 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.List; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java index 7d5a9b22b0..f429d4c99b 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGenOrMethodGen.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.ArrayList; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldInstruction.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldInstruction.java index ce82c6c438..78ff663acd 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldInstruction.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldInstruction.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.classfile.ConstantPool; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldOrMethod.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldOrMethod.java index 987b6c6b94..c3775ceee9 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldOrMethod.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldOrMethod.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.classfile.Constant; import org.aspectj.apache.bcel.classfile.ConstantCP; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/IINC.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/IINC.java index a80d2cb026..157aa741f0 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/IINC.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/IINC.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/INVOKEINTERFACE.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/INVOKEINTERFACE.java index 9e63d1f4cf..51c9d38aed 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/INVOKEINTERFACE.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/INVOKEINTERFACE.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstVisitor.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstVisitor.java index b4eaa488da..4da55f382e 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstVisitor.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstVisitor.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java index 3754e47b92..11c7119fa7 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionBranch.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionBranch.java index aedd31aaf3..cd29598fe7 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionBranch.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionBranch.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.generic; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionByte.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionByte.java index dfac2a9bd5..8d2525684e 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionByte.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionByte.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.generic; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionCP.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionCP.java index 77fadcf265..1ce9adb151 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionCP.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionCP.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionConstants.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionConstants.java index 8b5a0da5c9..3dc4732673 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionConstants.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionConstants.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionFactory.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionFactory.java index 39e61bd297..72c8ff856a 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionFactory.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionFactory.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.ConstantPool; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java index 7192e6cff2..490a0995f9 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionHandle.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.Collections; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionLV.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionLV.java index 64a2a388ab..d3ce3913d2 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionLV.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionLV.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java index cb580de26d..5bc5d972ef 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionList.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.ByteArrayOutputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionSelect.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionSelect.java index 771461ab56..e296bd2536 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionSelect.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionSelect.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionShort.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionShort.java index 99054cbff4..8df8214179 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionShort.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionShort.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionTargeter.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionTargeter.java index 27bace608d..90569b7c7a 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionTargeter.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InstructionTargeter.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InvokeDynamic.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InvokeDynamic.java index 43ac4a1a55..86807920f6 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InvokeDynamic.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InvokeDynamic.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.generic; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InvokeInstruction.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InvokeInstruction.java index f3030eaab1..8d5797ce1f 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InvokeInstruction.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/InvokeInstruction.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.StringTokenizer; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LOOKUPSWITCH.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LOOKUPSWITCH.java index 722bff6ee5..20e27995bd 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LOOKUPSWITCH.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LOOKUPSWITCH.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LineNumberGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LineNumberGen.java index 94112f34e5..9df79f0565 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LineNumberGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LineNumberGen.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.classfile.LineNumber; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LocalVariableGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LocalVariableGen.java index e99d1e7406..99e586d989 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LocalVariableGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LocalVariableGen.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MULTIANEWARRAY.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MULTIANEWARRAY.java index ad0994e524..47f16ab800 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MULTIANEWARRAY.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MULTIANEWARRAY.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java index ced5e3be51..620a56b6d1 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/MethodGen.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.ArrayList; import java.util.Hashtable; @@ -85,7 +85,7 @@ * * @version $Id: MethodGen.java,v 1.17 2011/05/19 23:23:46 aclement Exp $ * @author M. Dahm - * @author Patrick C. Beard [setMaxStack()] + * @author Patrick C. Beard [setMaxStack()] * @see InstructionList * @see Method */ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ObjectType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ObjectType.java index d7282122cb..361b414bf0 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ObjectType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ObjectType.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.Repository; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/RET.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/RET.java index 47d469064f..c0e6498bad 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/RET.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/RET.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.DataOutputStream; import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReferenceType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReferenceType.java index 0cbb6f09ff..c98b2acbee 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReferenceType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReferenceType.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReturnaddressType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReturnaddressType.java index d22f661303..bfb22d13a5 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReturnaddressType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReturnaddressType.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; @@ -60,7 +60,7 @@ * * see vmspec2 3.3.3 * @version $Id: ReturnaddressType.java,v 1.3 2008/05/28 23:52:56 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class ReturnaddressType extends Type { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/SwitchBuilder.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/SwitchBuilder.java index bd20f44fd4..ae579235d1 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/SwitchBuilder.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/SwitchBuilder.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TABLESWITCH.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TABLESWITCH.java index ea669f642e..ea348f0879 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TABLESWITCH.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TABLESWITCH.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.generic; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TargetLostException.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TargetLostException.java index 9b3d5971bd..06e80413b8 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TargetLostException.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TargetLostException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java index 79361a7ed1..14b3968a68 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Type.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.ArrayList; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ByteSequence.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ByteSequence.java index 37951c25f2..cf444f11cd 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ByteSequence.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ByteSequence.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.ByteArrayInputStream; import java.io.DataInputStream; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderReference.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderReference.java index 7465a92b47..1657720f95 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderReference.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderReference.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.util; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java index cc3290b29b..a706488804 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassLoaderRepository.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java index 4189fab5bb..a2776ed06b 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.util; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/DefaultClassLoaderReference.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/DefaultClassLoaderReference.java index e124051206..4998ba9722 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/DefaultClassLoaderReference.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/DefaultClassLoaderReference.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.util; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java index 88616fe838..c108cbdcea 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/Repository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/Repository.java index 1f6031b718..ffc80cbb59 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/Repository.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/Repository.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.classfile.JavaClass; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java index 052c503e54..eee2092747 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/SyntheticRepository.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.IOException; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ThreadLocalAwareRepository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ThreadLocalAwareRepository.java index 414a4b9af0..2a08641fb5 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ThreadLocalAwareRepository.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ThreadLocalAwareRepository.java @@ -20,7 +20,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -50,7 +50,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.util; diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/LocalVariableTableConcurrencyTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/LocalVariableTableConcurrencyTest.java index b62ffe3806..e0fe9a5672 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/LocalVariableTableConcurrencyTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/LocalVariableTableConcurrencyTest.java @@ -4,7 +4,7 @@ * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-v10.html * * Contributors: * Dmitry Mikhaylov - initial implementation diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ModuleTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ModuleTest.java index 2eab96c54e..f8012a983b 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ModuleTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ModuleTest.java @@ -25,7 +25,7 @@ import org.aspectj.apache.bcel.classfile.SourceFile; /** - * http://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html + * https://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html * * @author Andy Clement */ diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/NonCachingClassLoaderRepositoryTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/NonCachingClassLoaderRepositoryTest.java index e9fd785615..b181f6c490 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/NonCachingClassLoaderRepositoryTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/NonCachingClassLoaderRepositoryTest.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.classfile.tests; diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/DescendingVisitor.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/DescendingVisitor.java index 531af4d05a..e803f5a92e 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/DescendingVisitor.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/DescendingVisitor.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.Stack; diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/EmptyClassVisitor.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/EmptyClassVisitor.java index 0873dee5c1..91d88b2f27 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/EmptyClassVisitor.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/EmptyClassVisitor.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.verifier; diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/EmptyInstVisitor.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/EmptyInstVisitor.java index d498ecdc0b..77a06285b1 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/EmptyInstVisitor.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/EmptyInstVisitor.java @@ -36,7 +36,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -66,7 +66,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/GraphicalVerifier.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/GraphicalVerifier.java index 834e58f22d..2eed5e0c24 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/GraphicalVerifier.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/GraphicalVerifier.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.awt.Dimension; @@ -74,8 +74,8 @@ public class GraphicalVerifier { /** Constructor. */ public GraphicalVerifier() { VerifierAppFrame frame = new VerifierAppFrame(); - //Frames überprüfen, die voreingestellte Größe haben - //Frames packen, die nutzbare bevorzugte Größeninformationen enthalten, z.B. aus ihrem Layout + //Frames �berpr�fen, die voreingestellte Gr��e haben + //Frames packen, die nutzbare bevorzugte Gr��eninformationen enthalten, z.B. aus ihrem Layout if (packFrame) { frame.pack(); } diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/InstructionWalker.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/InstructionWalker.java index 19a888cbdc..6fbcde48d0 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/InstructionWalker.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/InstructionWalker.java @@ -19,7 +19,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "i product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, i acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -49,7 +49,7 @@ * i software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ package org.aspectj.apache.bcel.verifier; diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/NativeVerifier.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/NativeVerifier.java index 70a58abe1f..ce446097f3 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/NativeVerifier.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/NativeVerifier.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -62,7 +62,7 @@ * and JustIce. * * @version $Id: NativeVerifier.java,v 1.2 2008/05/28 23:53:01 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public abstract class NativeVerifier{ @@ -71,7 +71,7 @@ public abstract class NativeVerifier{ */ private NativeVerifier(){ } - + /** * Works only on the first argument. */ @@ -86,14 +86,14 @@ public static void main(String [] args){ args[0] = args[0].replace('/','.'); //System.out.println(args[0]); - + try{ Class.forName(args[0]); } catch(ExceptionInInitializerError eiie){ //subclass of LinkageError! System.out.println("NativeVerifier: ExceptionInInitializerError encountered on '"+args[0]+"'."); System.out.println(eiie); - System.exit(1); + System.exit(1); } catch(LinkageError le){ System.out.println("NativeVerifier: LinkageError encountered on '"+args[0]+"'."); @@ -108,7 +108,7 @@ public static void main(String [] args){ System.out.println("NativeVerifier: Unspecified verification error on'"+args[0]+"'."); System.exit(1); } - + System.out.println("NativeVerifier: Class file '"+args[0]+"' seems to be okay."); System.exit(0); diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/PassVerifier.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/PassVerifier.java index 20aa499637..e48619a945 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/PassVerifier.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/PassVerifier.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.ArrayList; @@ -78,7 +78,7 @@ * pass you must use a new instance of a given PassVerifier. * * @version $Id: PassVerifier.java,v 1.3 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see org.aspectj.apache.bcel.verifier.Verifier * @see #verify() */ @@ -86,7 +86,7 @@ public abstract class PassVerifier{ /** The (warning) messages. */ private ArrayList messages = new ArrayList(); //Type of elements: String - + /** The VerificationResult cache. */ private VerificationResult verificationResult = null; @@ -117,7 +117,7 @@ public VerificationResult verify(){ * This method adds a (warning) message to the message pool of this * PassVerifier. This method is normally only internally used by * BCEL's class file verifier "JustIce" and should not be used from - * the outside. + * the outside. * * @see #getMessages() */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/TransitiveHull.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/TransitiveHull.java index 00be6fa3db..146e7e028b 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/TransitiveHull.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/TransitiveHull.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Repository; @@ -64,7 +64,7 @@ * more notably, memory. * * @version $Id: TransitiveHull.java,v 1.2 2008/05/28 23:53:00 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class TransitiveHull implements VerifierFactoryObserver{ @@ -74,7 +74,7 @@ public class TransitiveHull implements VerifierFactoryObserver{ /** Not publicly instantiable. */ private TransitiveHull(){ } - + /* Implementing VerifierFactoryObserver. */ public void update(String classname){ @@ -87,7 +87,7 @@ public void update(String classname){ indent += 1; Verifier v = VerifierFactory.getVerifier(classname); - + VerificationResult vr; vr = v.doPass1(); if (vr != VerificationResult.VR_OK) //System.exit(1); @@ -128,7 +128,7 @@ public static void main(String[] args){ int dotclasspos = args[0].lastIndexOf(".class"); if (dotclasspos != -1) args[0] = args[0].substring(0,dotclasspos); args[0] = args[0].replace('/', '.'); - + TransitiveHull th = new TransitiveHull(); VerifierFactory.attach(th); VerifierFactory.getVerifier(args[0]); // the observer is called back and does the actual trick. diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerificationResult.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerificationResult.java index b3e3cce801..8097405488 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerificationResult.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerificationResult.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -59,7 +59,7 @@ * after verifying. * * @version $Id: VerificationResult.java,v 1.2 2008/05/28 23:53:00 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * */ public class VerificationResult{ @@ -114,13 +114,13 @@ public String getMessage(){ /** * Returns if two VerificationResult instances are equal. - */ + */ public boolean equals(Object o){ if (! (o instanceof VerificationResult)) return false; VerificationResult other = (VerificationResult) o; return ((other.numeric == this.numeric) && (other.detailMessage.equals(this.detailMessage))); } - + /** * Returns a String representation of the VerificationResult. */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/Verifier.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/Verifier.java index 150a07ec59..568dc88e57 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/Verifier.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/Verifier.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.ArrayList; @@ -76,7 +76,7 @@ * Verifier instances are usually generated by the VerifierFactory. * * @version $Id: Verifier.java,v 1.3 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see org.aspectj.apache.bcel.verifier.VerifierFactory * @see org.aspectj.apache.bcel.verifier.PassVerifier */ @@ -237,7 +237,7 @@ public String[] getMessages(){ * into the BCEL Repository yourself (via 'addClass(JavaClass)'). */ public static void main(String [] args){ - System.out.println("JustIce by Enver Haase, (C) 2001-2002.\n\n\n"); + System.out.println("JustIce by Enver Haase, (C) 2001-2002.\n\n\n"); for(int k=0; k < args.length; k++) { if (args[k].endsWith(".class")){ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierAppFrame.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierAppFrame.java index b6a483bf8d..e8ff15c69b 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierAppFrame.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierAppFrame.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.awt.AWTEvent; @@ -397,7 +397,7 @@ synchronized void pass3bJList_valueChanged(ListSelectionEvent e) { void aboutMenuItem_actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(this, - "JustIce is a Java class file verifier.\nIt was implemented by Enver Haase in 2001, 2002.\n", + "JustIce is a Java class file verifier.\nIt was implemented by Enver Haase in 2001, 2002.\n", JUSTICE_VERSION, JOptionPane.INFORMATION_MESSAGE); } diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactory.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactory.java index 9fab69b1fc..dbe76fa016 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactory.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactory.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.HashMap; @@ -65,7 +65,7 @@ * class name) there is exactly one Verifier. * * @version $Id: VerifierFactory.java,v 1.3 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see org.aspectj.apache.bcel.verifier.Verifier */ public class VerifierFactory{ @@ -84,7 +84,7 @@ public class VerifierFactory{ * The VerifierFactory is not instantiable. */ private VerifierFactory(){} - + /** * Returns the (only) verifier responsible for the class with the given name. * Possibly a new Verifier object is transparently created. @@ -92,14 +92,14 @@ private VerifierFactory(){} */ public static Verifier getVerifier(String fully_qualified_classname){ // fully_qualified_classname = fully_qualified_classname; - + Verifier v = (hashMap.get(fully_qualified_classname)); if (v==null){ v = new Verifier(fully_qualified_classname); hashMap.put(fully_qualified_classname, v); notify(fully_qualified_classname); } - + return v; } @@ -133,7 +133,7 @@ public static Verifier[] getVerifiers(){ public static void attach(VerifierFactoryObserver o){ observers.addElement(o); } - + /** * Removes the VerifierFactoryObserver o from the list of observers. */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactoryListModel.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactoryListModel.java index 485223e042..96d5aab48d 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactoryListModel.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactoryListModel.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactoryObserver.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactoryObserver.java index b00f4adc2f..18a11bb503 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactoryObserver.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifierFactoryObserver.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -59,7 +59,7 @@ * instances are created. * * @version $Id: VerifierFactoryObserver.java,v 1.2 2008/05/28 23:53:00 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * * @see VerifierFactory#getVerifier(String) * @see VerifierFactory#getVerifiers() diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifyDialog.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifyDialog.java index 9eb2d37c0d..6e0513961a 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifyDialog.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/VerifyDialog.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.awt.Color; @@ -69,7 +69,7 @@ * [This class was created using VisualAge for Java, * but it does not work under VAJ itself (Version 3.02 JDK 1.2)] * @version $Id: VerifyDialog.java,v 1.2 2008/05/28 23:53:01 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see #main(String[]) * @see #VerifyDialog(String) */ @@ -108,13 +108,13 @@ public class VerifyDialog extends javax.swing.JDialog { /** Machine-generated. */ class IvjEventHandler implements java.awt.event.ActionListener { public void actionPerformed(java.awt.event.ActionEvent e) { - if (e.getSource() == VerifyDialog.this.getPass1Button()) + if (e.getSource() == VerifyDialog.this.getPass1Button()) connEtoC1(e); - if (e.getSource() == VerifyDialog.this.getPass2Button()) + if (e.getSource() == VerifyDialog.this.getPass2Button()) connEtoC2(e); - if (e.getSource() == VerifyDialog.this.getPass3Button()) + if (e.getSource() == VerifyDialog.this.getPass3Button()) connEtoC3(e); - if (e.getSource() == VerifyDialog.this.getFlushButton()) + if (e.getSource() == VerifyDialog.this.getFlushButton()) connEtoC4(e); }; }; @@ -173,7 +173,7 @@ public VerifyDialog(java.awt.Frame owner, boolean modal) { */ public VerifyDialog(String fully_qualified_class_name) { super(); - + int dotclasspos = fully_qualified_class_name.lastIndexOf(".class"); if (dotclasspos != -1) fully_qualified_class_name = fully_qualified_class_name.substring(0,dotclasspos); fully_qualified_class_name = fully_qualified_class_name.replace('/', '.'); @@ -472,7 +472,7 @@ private void initialize() { */ public static void main(java.lang.String[] args) { classes_to_verify = args.length; - + for (int i=0; i. + * . */ /** @@ -59,7 +59,7 @@ * this is due to an INTERNAL ERROR of BCEL's class file verifier "JustIce". * * @version $Id: AssertionViolatedException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public final class AssertionViolatedException extends RuntimeException{ /** The error message. */ @@ -95,7 +95,7 @@ public String getMessage(){ return detailMessage; } - /** + /** * DO NOT USE. It's for experimental testing during development only. */ public static void main(String[] args){ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/ClassConstraintException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/ClassConstraintException.java index 3378c2ea54..a3528f882d 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/ClassConstraintException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/ClassConstraintException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -60,7 +60,7 @@ * in the Java Virtual Machine specification, 2nd edition. * * @version $Id: ClassConstraintException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class ClassConstraintException extends VerificationException{ /** @@ -69,7 +69,7 @@ public class ClassConstraintException extends VerificationException{ public ClassConstraintException(){ super(); } - + /** * Constructs a new ClassConstraintException with the specified error message. */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/CodeConstraintException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/CodeConstraintException.java index e33e4f9ac1..fcc4ae57eb 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/CodeConstraintException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/CodeConstraintException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** * Instances of this class are thrown by BCEL's class file verifier "JustIce" when @@ -59,7 +59,7 @@ * "JustIce" involves verification that is usually delayed to pass 4. * * @version $Id: CodeConstraintException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public abstract class CodeConstraintException extends VerificationException{ /** @@ -73,5 +73,5 @@ public abstract class CodeConstraintException extends VerificationException{ */ CodeConstraintException(String message){ super(message); - } + } } diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/InvalidMethodException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/InvalidMethodException.java index eb6099cd4e..fed372dc60 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/InvalidMethodException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/InvalidMethodException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,14 +51,14 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** * Instances of this class are thrown by BCEL's class file verifier "JustIce" * when the verification of a method is requested that does not exist. * * @version $Id: InvalidMethodException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class InvalidMethodException extends RuntimeException{ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LinkingConstraintException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LinkingConstraintException.java index 3e63fea832..478e853cc0 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LinkingConstraintException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LinkingConstraintException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** * Instances of this class are thrown by BCEL's class file verifier "JustIce" when @@ -68,7 +68,7 @@ * TODO: At this time, this class is not used in JustIce. * * @version $Id: LinkingConstraintException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class LinkingConstraintException extends StructuralCodeConstraintException{ } diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LoadingException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LoadingException.java index 177ac4c7bc..31469bc9d9 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LoadingException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LoadingException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -59,7 +59,7 @@ * the class file is malformed; so it is not conforming to the "Pass 1" verification * process as described in the Java Virtual Machine specification, 2nd. edition. * @version $Id: LoadingException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class LoadingException extends VerifierConstraintViolatedException{ @@ -69,7 +69,7 @@ public class LoadingException extends VerifierConstraintViolatedException{ public LoadingException(){ super(); } - + /** * Constructs a new LoadingException with the specified error message. */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LocalVariableInfoInconsistentException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LocalVariableInfoInconsistentException.java index b4a44a4808..c8249587ca 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LocalVariableInfoInconsistentException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/LocalVariableInfoInconsistentException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -62,7 +62,7 @@ * Method object. * * @version $Id: LocalVariableInfoInconsistentException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class LocalVariableInfoInconsistentException extends ClassConstraintException{ /** @@ -71,7 +71,7 @@ public class LocalVariableInfoInconsistentException extends ClassConstraintExcep public LocalVariableInfoInconsistentException(){ super(); } - + /** * Constructs a new LocalVariableInfoInconsistentException with the specified error message. */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeConstraintException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeConstraintException.java index 5738a48d4c..c8195d25ec 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeConstraintException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeConstraintException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -62,7 +62,7 @@ * is called pass 3a in JustIce. * * @version $Id: StaticCodeConstraintException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public abstract class StaticCodeConstraintException extends CodeConstraintException{ public StaticCodeConstraintException(String message){ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeInstructionConstraintException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeInstructionConstraintException.java index 35c1f1ae29..126b6fc357 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeInstructionConstraintException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeInstructionConstraintException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -65,7 +65,7 @@ * Second Edition. * * @version $Id: StaticCodeInstructionConstraintException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class StaticCodeInstructionConstraintException extends StaticCodeConstraintException{ public StaticCodeInstructionConstraintException(String message){ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeInstructionOperandConstraintException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeInstructionOperandConstraintException.java index 2ddc9e9de8..9d5324f6da 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeInstructionOperandConstraintException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StaticCodeInstructionOperandConstraintException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -65,7 +65,7 @@ * Second Edition. * * @version $Id: StaticCodeInstructionOperandConstraintException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class StaticCodeInstructionOperandConstraintException extends StaticCodeConstraintException{ public StaticCodeInstructionOperandConstraintException(String message){ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StructuralCodeConstraintException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StructuralCodeConstraintException.java index 3cbee2e869..a37fd208f4 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StructuralCodeConstraintException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/StructuralCodeConstraintException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** * Instances of this class are thrown by BCEL's class file verifier "JustIce" when @@ -64,7 +64,7 @@ * The data flow analysis of pass 3 is called pass 3b in JustIce. * * @version $Id: StructuralCodeConstraintException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class StructuralCodeConstraintException extends CodeConstraintException{ /** diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/Utility.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/Utility.java index 8c5bc966dd..af17b9ec1d 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/Utility.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/Utility.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.*; @@ -59,7 +59,7 @@ /** * A utility class providing convenience methods concerning Throwable instances. * @version $Id: Utility.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see java.lang.Throwable */ public final class Utility{ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/VerificationException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/VerificationException.java index 0df4b3d602..4dfba2d578 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/VerificationException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/VerificationException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -64,7 +64,7 @@ * defined to be the verification happening in passes 2 and 3. * * @version $Id: VerificationException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public abstract class VerificationException extends VerifierConstraintViolatedException{ /** diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/VerifierConstraintViolatedException.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/VerifierConstraintViolatedException.java index 3cb718e2fc..116a32bb42 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/VerifierConstraintViolatedException.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/exc/VerifierConstraintViolatedException.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -63,7 +63,7 @@ * throw. * * @version $Id: VerifierConstraintViolatedException.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public abstract class VerifierConstraintViolatedException extends RuntimeException{ // /** The name of the offending class that did not pass the verifier. */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/package.html b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/package.html index 7a117a8b75..a22baed3af 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/package.html +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/package.html @@ -18,7 +18,7 @@

Related Documentation

For a simple demonstration of JustIce working, please see: diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/DOUBLE_Upper.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/DOUBLE_Upper.java index 062d6bbbca..b2455aff68 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/DOUBLE_Upper.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/DOUBLE_Upper.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; @@ -60,7 +60,7 @@ /** * This class represents the upper half of a DOUBLE variable. * @version $Id: DOUBLE_Upper.java,v 1.2 2008/05/28 23:52:54 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public final class DOUBLE_Upper extends Type{ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/IntList.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/IntList.java index f7656ef7bf..39904c7b4a 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/IntList.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/IntList.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.ArrayList; @@ -60,7 +60,7 @@ * A small utility class representing a set of basic int values. * * @version $Id: IntList.java,v 1.3 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class IntList{ /** The int are stored as Integer objects here. */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LONG_Upper.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LONG_Upper.java index 55e9052e3d..6b43c11212 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LONG_Upper.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LONG_Upper.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; @@ -60,7 +60,7 @@ /** * This class represents the upper half of a LONG variable. * @version $Id: LONG_Upper.java,v 1.2 2008/05/28 23:52:54 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public final class LONG_Upper extends Type{ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LocalVariableInfo.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LocalVariableInfo.java index ce92b19c5c..bc94c092f2 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LocalVariableInfo.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LocalVariableInfo.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.generic.Type; @@ -65,7 +65,7 @@ * often changes in course of byte code offsets. * * @version $Id: LocalVariableInfo.java,v 1.3 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class LocalVariableInfo{ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LocalVariablesInfo.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LocalVariablesInfo.java index b094b58672..6b236d583b 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LocalVariablesInfo.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/LocalVariablesInfo.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.generic.Type; @@ -63,10 +63,10 @@ * a given method. * * @version $Id: LocalVariablesInfo.java,v 1.2 2008/05/28 23:52:54 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class LocalVariablesInfo{ - + /** The information about the local variables is stored here. */ private LocalVariableInfo[] localVariableInfos; @@ -87,14 +87,14 @@ public LocalVariableInfo getLocalVariableInfo(int slot){ } /** - * Adds information about the local variable in slot 'slot'. Automatically + * Adds information about the local variable in slot 'slot'. Automatically * adds information for slot+1 if 't' is Type.LONG or Type.DOUBLE. * @throws LocalVariableInfoInconsistentException if the new information conflicts * with already gathered information. */ public void add(int slot, String name, int startpc, int length, Type t) throws LocalVariableInfoInconsistentException{ // The add operation on LocalVariableInfo may throw the '...Inconsistent...' exception, we don't throw it explicitely here. - + if (slot < 0 || slot >= localVariableInfos.length){ throw new AssertionViolatedException("Slot number for local variable information out of range."); } diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass1Verifier.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass1Verifier.java index fcbddb6246..559a59df2d 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass1Verifier.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass1Verifier.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Repository; @@ -69,7 +69,7 @@ * documentation. * * @version $Id: Pass1Verifier.java,v 1.2 2008/05/28 23:52:54 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see #do_verify() */ public final class Pass1Verifier extends PassVerifier{ @@ -91,7 +91,7 @@ private JavaClass getJavaClass(){ } return jc; } - + /** * Should only be instantiated by a Verifier. * @@ -149,7 +149,7 @@ public Pass1Verifier(Verifier owner){ *
  • the name and signature of fields and methods are verified to be of legal format. * * - * (From the Paper The Mysterious Pass One, first draft, September 2, 1997.) + * (From the Paper The Mysterious Pass One, first draft, September 2, 1997.) *
    * However, most of this is done by parsing a class file or generating a class file into BCEL's internal data structure. * Therefore, all that is really done here is look up the class file from BCEL's repository. @@ -172,7 +172,7 @@ public VerificationResult do_verify(){ throw new LoadingException("Wrong name: the internal name of the .class file '"+jc.getClassName()+"' does not match the file's name '"+myOwner.getClassName()+"'."); } } - + } catch(LoadingException e){ return new VerificationResult(VerificationResult.VERIFIED_REJECTED, e.getMessage()); diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass2Verifier.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass2Verifier.java index b02c351281..c05f29de71 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass2Verifier.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass2Verifier.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.HashMap; @@ -107,9 +107,9 @@ /** * This PassVerifier verifies a class file according to pass 2 as described in The Java Virtual Machine Specification, 2nd edition. * More detailed information is to be found at the do_verify() method's documentation. - * + * * @version $Id: Pass2Verifier.java,v 1.5 2009/09/10 15:35:05 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see #do_verify() */ public final class Pass2Verifier extends PassVerifier implements Constants { @@ -125,7 +125,7 @@ public final class Pass2Verifier extends PassVerifier implements Constants { /** * Should only be instantiated by a Verifier. - * + * * @see Verifier */ public Pass2Verifier(Verifier owner) { @@ -157,7 +157,7 @@ public LocalVariablesInfo getLocalVariablesInfo(int method_nr) { * Very few checks that conceptually belong here are delayed until pass 3a in JustIce. JustIce does not only check for * syntactical correctness but also for semantical sanity - therefore it needs access to the "Code" array of methods in a few * cases. Please see the pass 3a documentation, too. - * + * * @see org.aspectj.apache.bcel.verifier.statics.Pass3aVerifier */ @Override @@ -188,7 +188,7 @@ public VerificationResult do_verify() { * Pass2Verifier operates on has proper super classes (transitively) up to java.lang.Object. The reason for really loading (and * Pass1-verifying) all of those classes here is that we need them in Pass2 anyway to verify no final methods are overridden * (that could be declared anywhere in the ancestor hierarchy). - * + * * @throws ClassConstraintException otherwise. */ private void every_class_has_an_accessible_superclass() { @@ -229,7 +229,7 @@ private void every_class_has_an_accessible_superclass() { * Ensures that final methods are not overridden. Precondition to run this method: * constant_pool_entries_satisfy_static_constraints() and every_class_has_an_accessible_superclass() have to be invoked before * (in that order). - * + * * @throws ClassConstraintException otherwise. * @see #constant_pool_entries_satisfy_static_constraints() * @see #every_class_has_an_accessible_superclass() @@ -271,7 +271,7 @@ private void final_methods_are_not_overridden() { /** * Ensures that the constant pool entries satisfy the static constraints as described in The Java Virtual Machine Specification, * 2nd Edition. - * + * * @throws ClassConstraintException otherwise. */ private void constant_pool_entries_satisfy_static_constraints() { @@ -285,7 +285,7 @@ private void constant_pool_entries_satisfy_static_constraints() { /** * A Visitor class that ensures the constant pool satisfies the static constraints. The visitXXX() methods throw * ClassConstraintException instances otherwise. - * + * * @see #constant_pool_entries_satisfy_static_constraints() */ private class CPESSC_Visitor extends org.aspectj.apache.bcel.verifier.EmptyClassVisitor { @@ -1225,7 +1225,7 @@ public void visitLineNumber(LineNumber obj) { * only the formal correctness (such as well-formed signatures). The visitXXX() methods throw ClassConstraintException instances * otherwise. Precondition: index-style cross referencing in the constant pool must be valid. Simply invoke * constant_pool_entries_satisfy_static_constraints() before. - * + * * @throws ClassConstraintException otherwise. * @see #constant_pool_entries_satisfy_static_constraints() */ @@ -1238,7 +1238,7 @@ private void field_and_method_refs_are_valid() { /** * A Visitor class that ensures the ConstantCP-subclassed entries of the constant pool are valid. Precondition: index-style * cross referencing in the constant pool must be valid. - * + * * @see #constant_pool_entries_satisfy_static_constraints() * @see org.aspectj.apache.bcel.classfile.ConstantCP */ @@ -1388,7 +1388,7 @@ private static boolean validClassMethodName(String name) { /** * This method returns true if and only if the supplied String represents a valid Java programming language method name stored - * as a simple (non-qualified) name. Conforming to: The Java Virtual Machine Specification, Second Edition, §2.7, §2.7.1, §2.2. + * as a simple (non-qualified) name. Conforming to: The Java Virtual Machine Specification, Second Edition, �2.7, �2.7.1, �2.2. */ private static boolean validJavaLangMethodName(String name) { if (!Character.isJavaIdentifierStart(name.charAt(0))) diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass3aVerifier.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass3aVerifier.java index 8afbdb5eaf..d8c45d19d4 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass3aVerifier.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/Pass3aVerifier.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; @@ -110,9 +110,9 @@ /** * This PassVerifier verifies a class file according to pass 3, static part as described in The Java Virtual Machine Specification, * 2nd edition. More detailed information is to be found at the do_verify() method's documentation. - * + * * @version $Id: Pass3aVerifier.java,v 1.5 2009/09/10 15:35:06 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see #do_verify() */ public final class Pass3aVerifier extends PassVerifier { @@ -148,7 +148,7 @@ public Pass3aVerifier(Verifier owner, int method_no) { * Code attribute and correct line number entries in a LineNumberTable attribute of a Code attribute (which conceptually belong * to pass 2) to this pass. Also, most of the check for valid local variable entries in a LocalVariableTable attribute of a Code * attribute is delayed until this pass. All these checks need access to the code array of the Code attribute. - * + * * @throws InvalidMethodException if the method to verify does not exist. */ @Override @@ -211,7 +211,7 @@ public VerificationResult do_verify() { * These are the checks that could be done in pass 2 but are delayed to pass 3 for performance reasons. Also, these checks need * access to the code array of the Code attribute of a Method so it's okay to perform them here. Also see the description of the * do_verify() method. - * + * * @throws ClassConstraintException if the verification fails. * @see #do_verify() */ @@ -316,7 +316,7 @@ private void delayedPass2Checks() { /** * These are the checks if constraints are satisfied which are described in the Java Virtual Machine Specification, Second * Edition as Static Constraints on the instructions of Java Virtual Machine Code (chapter 4.8.1). - * + * * @throws StaticCodeConstraintException if the verification fails. */ private void pass3StaticInstructionChecks() { @@ -381,7 +381,7 @@ private void pass3StaticInstructionChecks() { * Second Edition as Static Constraints on the operands of instructions of Java Virtual Machine Code (chapter 4.8.1). BCEL * parses the code array to create an InstructionList and therefore has to check some of these constraints. Additional checks * are also implemented here. - * + * * @throws StaticCodeConstraintException if the verification fails. */ private void pass3StaticInstructionOperandsChecks() { diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/StringRepresentation.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/StringRepresentation.java index 6b9fa39123..6a9557029b 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/StringRepresentation.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/StringRepresentation.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.classfile.AnnotationDefault; @@ -107,7 +107,7 @@ * handling in future versions of JustIce. * * @version $Id: StringRepresentation.java,v 1.4 2009/09/15 19:40:22 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class StringRepresentation extends org.aspectj.apache.bcel.verifier.EmptyClassVisitor{ /** The string representation, created by a visitXXX() method, output by toString(). */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/package.html b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/package.html index a354da1b7e..8eb5258cce 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/package.html +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/statics/package.html @@ -19,7 +19,7 @@

    Related Documentation

    For a simple demonstration of JustIce working, please see: diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ControlFlowGraph.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ControlFlowGraph.java index c5a54fde78..8c9cb1d753 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ControlFlowGraph.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ControlFlowGraph.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.ArrayList; @@ -71,9 +71,9 @@ /** * This class represents a control flow graph of a method. - * + * * @version $Id: ControlFlowGraph.java,v 1.4 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class ControlFlowGraph { @@ -84,7 +84,7 @@ private class InstructionContextImpl implements InstructionContext { /** * The TAG field is here for external temporary flagging, such as graph colouring. - * + * * @see #getTag() * @see #setTag(int) */ @@ -167,7 +167,7 @@ public Frame getOutFrame(ArrayList execChain) { * "inFrame". The execPreds ArrayList must contain the InstructionContext objects executed so far in the correct order. This * is just one execution path [out of many]. This is needed to correctly "merge" in the special case of a RET's successor. * The InstConstraintVisitor and ExecutionVisitor instances must be set up correctly. - * + * * @return true - if and only if the "outgoing" frame situation changed from the one before execute()ing. */ public boolean execute(Frame inFrame, ArrayList execPreds, InstConstraintVisitor icv, ExecutionVisitor ev) { diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExceptionHandler.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExceptionHandler.java index 3853a84ddf..19db4de95f 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExceptionHandler.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExceptionHandler.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.generic.*; @@ -60,14 +60,14 @@ * This class represents an exception handler; that is, an ObjectType * representing a subclass of java.lang.Throwable and the instruction * the handler starts off (represented by an InstructionContext). - * + * * @version $Id: ExceptionHandler.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class ExceptionHandler{ /** The type of the exception to catch. NULL means ANY. */ private ObjectType catchtype; - + /** The InstructionHandle where the handling begins. */ private InstructionHandle handlerpc; diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExceptionHandlers.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExceptionHandlers.java index 40abf8f7c6..a66923d284 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExceptionHandlers.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExceptionHandlers.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.generic.*; @@ -63,7 +63,7 @@ * This class allows easy access to ExceptionHandler objects. * * @version $Id: ExceptionHandlers.java,v 1.3 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class ExceptionHandlers{ /** @@ -71,7 +71,7 @@ public class ExceptionHandlers{ * Key: InstructionHandle objects, Values: HashSet instances. */ private Hashtable> exceptionhandlers; - + /** * Constructor. Creates a new ExceptionHandlers instance. */ @@ -91,7 +91,7 @@ public ExceptionHandlers(MethodGen mg){ } } } - + /** * Returns all the ExceptionHandler instances representing exception * handlers that protect the instruction ih. diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExecutionVisitor.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExecutionVisitor.java index d0326f7e64..2fc2f0f79a 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExecutionVisitor.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/ExecutionVisitor.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; @@ -92,7 +92,7 @@ * stack slot containing a Type.INT is pushed (where you could also * pop only one slot if you know there are two Type.INT on top of the * stack). Monitor-specific behaviour is not simulated. - * + * *

    Conventions: * * Type.VOID will never be pushed onto the stack. Type.DOUBLE and Type.LONG @@ -103,12 +103,12 @@ * is given the type Type.UNKNOWN. * * @version $Id: ExecutionVisitor.java,v 1.3 2008/08/28 00:02:13 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see #visitDSTORE(DSTORE o) * @see InstConstraintVisitor */ public class ExecutionVisitor extends EmptyInstVisitor { - + /** * The executionframe we're operating on. */ @@ -147,7 +147,7 @@ private LocalVariables locals(){ public void setConstantPoolGen(ConstantPool cpg){ this.cpg = cpg; } - + /** * The only method granting access to the single instance of * the ExecutionVisitor class. Before actively using this @@ -158,7 +158,7 @@ public void setFrame(Frame f){ this.frame = f; } - ///** Symbolically executes the corresponding Java Virtual Machine instruction. */ + ///** Symbolically executes the corresponding Java Virtual Machine instruction. */ //public void visitWIDE(WIDE o){ // The WIDE instruction is modelled as a flag // of the embedded instructions in BCEL. @@ -168,7 +168,7 @@ public void setFrame(Frame f){ // here. //} - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitAALOAD(Instruction o){ stack().pop(); // pop the index int //System.out.print(stack().peek()); @@ -177,46 +177,46 @@ public void visitAALOAD(Instruction o){ stack().push(Type.NULL); } // Do nothing stackwise --- a NullPointerException is thrown at Run-Time else{ - ArrayType at = (ArrayType) t; + ArrayType at = (ArrayType) t; stack().push(at.getElementType()); } } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitAASTORE(Instruction o){ stack().pop(); stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitACONST_NULL(Instruction o){ stack().push(Type.NULL); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitALOAD(Instruction o){ stack().push(locals().get(o.getIndex())); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitANEWARRAY(Instruction o){ stack().pop(); //count stack().push( new ArrayType(o.getType(cpg), 1) ); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitARETURN(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitARRAYLENGTH(Instruction o){ stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitASTORE(Instruction o){ locals().set(o.getIndex(), stack().pop()); //System.err.println("TODO-DEBUG: set LV '"+o.getIndex()+"' to '"+locals().get(o.getIndex())+"'."); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitATHROW(Instruction o){ Type t = stack().pop(); stack().clear(); @@ -226,38 +226,38 @@ public void visitATHROW(Instruction o){ stack().push(t); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitBALOAD(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitBASTORE(Instruction o){ stack().pop(); stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitBIPUSH(Instruction o){ stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitCALOAD(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitCASTORE(Instruction o){ stack().pop(); stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitCHECKCAST(Instruction o){ // It's possibly wrong to do so, but SUN's // ByteCode verifier seems to do (only) this, too. @@ -268,104 +268,104 @@ public void visitCHECKCAST(Instruction o){ stack().push(o.getType(cpg)); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitD2F(Instruction o){ stack().pop(); stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitD2I(Instruction o){ stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitD2L(Instruction o){ stack().pop(); stack().push(Type.LONG); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDADD(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDALOAD(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDASTORE(Instruction o){ stack().pop(); stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDCMPG(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDCMPL(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDCONST(Instruction o){ stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDDIV(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDLOAD(Instruction o){ stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDMUL(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDNEG(Instruction o){ stack().pop(); stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDREM(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDRETURN(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDSTORE(Instruction o){ locals().set(o.getIndex(), stack().pop()); locals().set(o.getIndex()+1, Type.UNKNOWN); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDSUB(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDUP(Instruction o){ Type t = stack().pop(); stack().push(t); stack().push(t); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDUP_X1(Instruction o){ Type w1 = stack().pop(); Type w2 = stack().pop(); @@ -373,7 +373,7 @@ public void visitDUP_X1(Instruction o){ stack().push(w2); stack().push(w1); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDUP_X2(Instruction o){ Type w1 = stack().pop(); Type w2 = stack().pop(); @@ -390,7 +390,7 @@ public void visitDUP_X2(Instruction o){ stack().push(w1); } } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDUP2(Instruction o){ Type t = stack().pop(); if (t.getSize() == 2){ @@ -405,7 +405,7 @@ public void visitDUP2(Instruction o){ stack().push(t); } } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDUP2_X1(Instruction o){ Type t = stack().pop(); if (t.getSize() == 2){ @@ -424,7 +424,7 @@ public void visitDUP2_X1(Instruction o){ stack().push(t); } } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitDUP2_X2(Instruction o){ Type t = stack().pop(); if (t.getSize() == 2){ @@ -461,97 +461,97 @@ public void visitDUP2_X2(Instruction o){ } } } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitF2D(Instruction o){ stack().pop(); stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitF2I(Instruction o){ stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitF2L(Instruction o){ stack().pop(); stack().push(Type.LONG); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFADD(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFALOAD(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFASTORE(Instruction o){ stack().pop(); stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFCMPG(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFCMPL(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFCONST(Instruction o){ stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFDIV(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFLOAD(Instruction o){ stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFMUL(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFNEG(Instruction o){ stack().pop(); stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFREM(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFRETURN(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFSTORE(Instruction o){ locals().set(o.getIndex(), stack().pop()); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitFSUB(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitGETFIELD(FieldInstruction o){ stack().pop(); Type t = o.getFieldType(cpg); @@ -562,7 +562,7 @@ public void visitGETFIELD(FieldInstruction o){ t = Type.INT; stack().push(t); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitGETSTATIC(FieldInstruction o){ Type t = o.getFieldType(cpg); if ( t.equals(Type.BOOLEAN) || @@ -572,175 +572,175 @@ public void visitGETSTATIC(FieldInstruction o){ t = Type.INT; stack().push(t); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitGOTO(Instruction o){ // no stack changes. } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitGOTO_W(Instruction o){ // no stack changes. } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitI2B(Instruction o){ stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitI2C(Instruction o){ stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitI2D(Instruction o){ stack().pop(); stack().push(Type.DOUBLE); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitI2F(Instruction o){ stack().pop(); stack().push(Type.FLOAT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitI2L(Instruction o){ stack().pop(); stack().push(Type.LONG); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitI2S(Instruction o){ stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIADD(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIALOAD(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIAND(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIASTORE(Instruction o){ stack().pop(); stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitICONST(Instruction o){ stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIDIV(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIF_ACMPEQ(Instruction o){ stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIF_ACMPNE(Instruction o){ stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIF_ICMPEQ(Instruction o){ stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIF_ICMPGE(Instruction o){ stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIF_ICMPGT(Instruction o){ stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIF_ICMPLE(Instruction o){ stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIF_ICMPLT(Instruction o){ stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIF_ICMPNE(Instruction o){ stack().pop(); stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIFEQ(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIFGE(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIFGT(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIFLE(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIFLT(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIFNE(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIFNONNULL(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIFNULL(Instruction o){ stack().pop(); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIINC(IINC o){ // stack is not changed. } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitILOAD(Instruction o){ stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitIMUL(Instruction o){ stack().pop(); stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitINEG(Instruction o){ stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitINSTANCEOF(Instruction o){ stack().pop(); stack().push(Type.INT); } - /** Symbolically executes the corresponding Java Virtual Machine instruction. */ + /** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitINVOKEINTERFACE(INVOKEINTERFACE o){ stack().pop(); //objectref for (int i=0; i. + * . */ @@ -60,9 +60,9 @@ * a local variable array and an operand stack. * * @version $Id: Frame.java,v 1.2 2008/05/28 23:53:03 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ - + public class Frame{ /** diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/GenericArray.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/GenericArray.java index 6b9a6ec259..895473cd33 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/GenericArray.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/GenericArray.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** @@ -60,7 +60,7 @@ * and java.io.Serializable and they extend java.lang.Object. * * @version $Id: GenericArray.java,v 1.2 2008/05/28 23:53:03 aclement Exp $ - * @author Enver Haase - */ + * @author Enver Haase + */ public class GenericArray extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable{ } diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/InstConstraintVisitor.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/InstConstraintVisitor.java index 7c146ced77..e1e8f5f337 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/InstConstraintVisitor.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/InstConstraintVisitor.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; @@ -71,7 +71,7 @@ import org.aspectj.apache.bcel.verifier.VerificationResult; import org.aspectj.apache.bcel.verifier.Verifier; import org.aspectj.apache.bcel.verifier.VerifierFactory; -import org.aspectj.apache.bcel.verifier.exc.*; +import org.aspectj.apache.bcel.verifier.exc.*; import org.aspectj.apache.bcel.generic.ArrayType; import org.aspectj.apache.bcel.generic.FieldInstruction; import org.aspectj.apache.bcel.generic.IINC; @@ -100,7 +100,7 @@ * MONITOREXIT) is not modeled in JustIce. * * @version $Id: InstConstraintVisitor.java,v 1.3 2008/08/28 00:02:13 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see org.aspectj.apache.bcel.verifier.exc.StructuralCodeConstraintException * @see org.aspectj.apache.bcel.verifier.exc.LinkingConstraintException */ @@ -126,7 +126,7 @@ public InstConstraintVisitor(){} /** * The MethodGen we're working on. - * + * * @see #setMethodGen(MethodGen mg) */ private MethodGen mg = null; @@ -177,7 +177,7 @@ public void setFrame(Frame f){ /** * Sets the ConstantPoolGen instance needed for constraint * checking prior to execution. - */ + */ public void setConstantPoolGen(ConstantPool cpg){ this.cpg = cpg; } @@ -285,7 +285,7 @@ public void visitLoadClass(Instruction o){ public void visitStackConsumer(Instruction o){ _visitStackAccessor(o); } - + /** * Ensures the general preconditions of a StackProducer instance. */ @@ -310,7 +310,7 @@ public void visitFieldInstruction(Instruction o){ // visitLoadClass(o) has been called before: Every FieldOrMethod // implements LoadClass. // visitCPInstruction(o) has been called before. - // A FieldInstruction may be: GETFIELD, GETSTATIC, PUTFIELD, PUTSTATIC + // A FieldInstruction may be: GETFIELD, GETSTATIC, PUTFIELD, PUTSTATIC Constant c = cpg.getConstant(o.getIndex()); if (!(c instanceof ConstantFieldref)){ constraintViolated(o, "Index '"+o.getIndex()+"' should refer to a CONSTANT_Fieldref_info structure, but refers to '"+c+"'."); @@ -326,14 +326,14 @@ public void visitFieldInstruction(Instruction o){ } } } - + public void visitInvokeInstruction(InvokeInstruction o){ // visitLoadClass(o) has been called before: Every FieldOrMethod // implements LoadClass. // visitCPInstruction(o) has been called before. //TODO } - + public void visitStackInstruction(Instruction o){ _visitStackAccessor(o); } @@ -347,7 +347,7 @@ public void visitLocalVariableInstruction(InstructionLV o){ constraintViolated(o, "The 'index' is not a valid index into the local variable array."); } } - + public void visitLoadInstruction(Instruction o){ //visitLocalVariableInstruction(o) is called before, because it is more generic. @@ -450,12 +450,12 @@ public void visitReturnInstruction(Instruction o){ public void visitAALOAD(Instruction o){ Type arrayref = stack().peek(1); Type index = stack().peek(0); - + indexOfInt(o, index); if (arrayrefOfArrayType(o, arrayref)){ if (! (((ArrayType) arrayref).getElementType() instanceof ReferenceType)){ constraintViolated(o, "The 'arrayref' does not refer to an array with elements of a ReferenceType but to an array of "+((ArrayType) arrayref).getElementType()+"."); - } + } referenceTypeIsInitialized(o, (ReferenceType) (((ArrayType) arrayref).getElementType())); } } @@ -475,7 +475,7 @@ public void visitAASTORE(Instruction o){ referenceTypeIsInitialized(o, (ReferenceType) value); } // Don't bother further with "referenceTypeIsInitialized()", there are no arrays - // of an uninitialized object type. + // of an uninitialized object type. if (arrayrefOfArrayType(o, arrayref)){ if (! (((ArrayType) arrayref).getElementType() instanceof ReferenceType)){ constraintViolated(o, "The 'arrayref' does not refer to an array with elements of a ReferenceType but to an array of "+((ArrayType) arrayref).getElementType()+"."); @@ -501,7 +501,7 @@ public void visitANEWARRAY(Instruction o){ // The runtime constant pool item at that index must be a symbolic reference to a class, // array, or interface type. See Pass 3a. } - + /** * Ensures the specific preconditions of the said instruction. */ @@ -511,7 +511,7 @@ public void visitARETURN(Instruction o){ } ReferenceType objectref = (ReferenceType) (stack().peek()); referenceTypeIsInitialized(o, objectref); - + // The check below should already done via visitReturnInstruction(ReturnInstruction), see there. // It cannot be done using Staerk-et-al's "set of object types" instead of a // "wider cast object type", anyway. @@ -549,10 +549,10 @@ public void visitATHROW(Instruction o){ if (! ((stack().peek() instanceof ObjectType) || (stack().peek().equals(Type.NULL))) ){ constraintViolated(o, "The 'objectref' is not of an (initialized) ObjectType but of type "+stack().peek()+"."); } - + // NULL is a subclass of every class, so to speak. if (stack().peek().equals(Type.NULL)) return; - + ObjectType exc = (ObjectType) (stack().peek()); ObjectType throwable = (ObjectType) (Type.getType("Ljava/lang/Throwable;")); if ( (! (exc.subclassOf(throwable)) ) && (! (exc.equals(throwable))) ){ @@ -612,7 +612,7 @@ public void visitBREAKPOINT(Instruction o){ public void visitCALOAD(Instruction o){ Type arrayref = stack().peek(1); Type index = stack().peek(0); - + indexOfInt(o, index); arrayrefOfArrayType(o, arrayref); } @@ -624,7 +624,7 @@ public void visitCASTORE(Instruction o){ Type arrayref = stack().peek(2); Type index = stack().peek(1); Type value = stack().peek(0); - + indexOfInt(o, index); valueOfInt(o, value); if (arrayrefOfArrayType(o, arrayref)){ @@ -647,7 +647,7 @@ public void visitCHECKCAST(Instruction o){ referenceTypeIsInitialized(o, (ReferenceType) objectref); } // The unsigned indexbyte1 and indexbyte2 are used to construct an index into the runtime constant pool of the - // current class (§3.6), where the value of the index is (indexbyte1 << 8) | indexbyte2. The runtime constant + // current class (�3.6), where the value of the index is (indexbyte1 << 8) | indexbyte2. The runtime constant // pool item at the index must be a symbolic reference to a class, array, or interface type. Constant c = cpg.getConstant(o.getIndex()); if (! (c instanceof ConstantClass)){ @@ -670,7 +670,7 @@ public void visitDALOAD(Instruction o){ indexOfInt(o, stack().peek()); if (stack().peek(1) == Type.NULL){ return; - } + } if (! (stack().peek(1) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-top must be of type double[] but is '"+stack().peek(1)+"'."); } @@ -687,7 +687,7 @@ public void visitDASTORE(Instruction o){ indexOfInt(o, stack().peek(1)); if (stack().peek(2) == Type.NULL){ return; - } + } if (! (stack().peek(2) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-next-to-top must be of type double[] but is '"+stack().peek(2)+"'."); } @@ -714,7 +714,7 @@ public void visitDCMPL(Instruction o){ public void visitDCONST(Instruction o){ // There's nothing to be done here. } - + public void visitDDIV(Instruction o){ checkTop(o,Type.DOUBLE); if (stack().peek(1) != Type.DOUBLE){ @@ -724,7 +724,7 @@ public void visitDDIV(Instruction o){ public void visitDLOAD(Instruction o){ //visitLoadInstruction(LoadInstruction) is called before. - + // Nothing else needs to be done here. } @@ -745,9 +745,9 @@ public void visitDREM(Instruction o){ constraintViolated(o, "The value at the stack next-to-top is not of type 'double', but of type '"+stack().peek(1)+"'."); } } - + private void checkTop(Instruction o,Type t) { - if (stack().peek()!=t) + if (stack().peek()!=t) constraintViolated(o, "The value at the stack top is not of type '"+t+"', but of type '"+stack().peek()+"'."); } @@ -763,7 +763,7 @@ public void visitDRETURN(Instruction o){ */ public void visitDSTORE(Instruction o){ //visitStoreInstruction(StoreInstruction) is called before. - + // Nothing else needs to be done here. } @@ -902,7 +902,7 @@ public void visitF2I(Instruction o){ public void visitF2L(Instruction o){ checkTop(o,Type.FLOAT); } - + /** * Ensures the specific preconditions of the said instruction. */ @@ -920,7 +920,7 @@ public void visitFALOAD(Instruction o){ indexOfInt(o, stack().peek()); if (stack().peek(1) == Type.NULL){ return; - } + } if (! (stack().peek(1) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-top must be of type float[] but is '"+stack().peek(1)+"'."); } @@ -938,7 +938,7 @@ public void visitFASTORE(Instruction o){ indexOfInt(o, stack().peek(1)); if (stack().peek(2) == Type.NULL){ return; - } + } if (! (stack().peek(2) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-next-to-top must be of type float[] but is '"+stack().peek(2)+"'."); } @@ -990,7 +990,7 @@ public void visitFDIV(Instruction o){ */ public void visitFLOAD(Instruction o){ //visitLoadInstruction(LoadInstruction) is called before. - + // Nothing else needs to be done here. } @@ -1033,7 +1033,7 @@ public void visitFRETURN(Instruction o){ */ public void visitFSTORE(Instruction o){ //visitStoreInstruction(StoreInstruction) is called before. - + // Nothing else needs to be done here. } @@ -1057,9 +1057,9 @@ public void visitGETFIELD(FieldInstruction o){ if (! ( (objectref instanceof ObjectType) || (objectref == Type.NULL) ) ){ constraintViolated(o, "Stack top should be an object reference that's not an array reference, but is '"+objectref+"'."); } - + String field_name = o.getFieldName(cpg); - + JavaClass jc = Repository.lookupClass(o.getClassType(cpg).getClassName()); Field[] fields = jc.getFields(); Field f = null; @@ -1094,9 +1094,9 @@ public void visitGETFIELD(FieldInstruction o){ // "Wider" object types don't allow us to check for things like that below. //constraintViolated(o, "The referenced field has the ACC_PROTECTED modifier, and it's a member of the current class or a superclass of the current class. However, the referenced object type '"+stack().peek()+"' is not the current class or a subclass of the current class."); } - } + } } - + // TODO: Could go into Pass 3a. if (f.isStatic()){ constraintViolated(o, "Referenced field '"+f+"' is static which it shouldn't be."); @@ -1169,7 +1169,7 @@ public void visitIALOAD(Instruction o){ indexOfInt(o, stack().peek()); if (stack().peek(1) == Type.NULL){ return; - } + } if (! (stack().peek(1) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-top must be of type int[] but is '"+stack().peek(1)+"'."); } @@ -1201,7 +1201,7 @@ public void visitIASTORE(Instruction o){ indexOfInt(o, stack().peek(1)); if (stack().peek(2) == Type.NULL){ return; - } + } if (! (stack().peek(2) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-next-to-top must be of type int[] but is '"+stack().peek(2)+"'."); } @@ -1236,12 +1236,12 @@ public void visitIF_ACMPEQ(Instruction o){ constraintViolated(o, "The value at the stack top is not of a ReferenceType, but of type '"+stack().peek()+"'."); } referenceTypeIsInitialized(o, (ReferenceType) (stack().peek()) ); - + if (!(stack().peek(1) instanceof ReferenceType)){ constraintViolated(o, "The value at the stack next-to-top is not of a ReferenceType, but of type '"+stack().peek(1)+"'."); } referenceTypeIsInitialized(o, (ReferenceType) (stack().peek(1)) ); - + } /** @@ -1391,7 +1391,7 @@ public void visitIFNONNULL(Instruction o){ if (!(stack().peek() instanceof ReferenceType)){ constraintViolated(o, "The value at the stack top is not of a ReferenceType, but of type '"+stack().peek()+"'."); } - referenceTypeIsInitialized(o, (ReferenceType) (stack().peek()) ); + referenceTypeIsInitialized(o, (ReferenceType) (stack().peek()) ); } /** @@ -1401,7 +1401,7 @@ public void visitIFNULL(Instruction o){ if (!(stack().peek() instanceof ReferenceType)){ constraintViolated(o, "The value at the stack top is not of a ReferenceType, but of type '"+stack().peek()+"'."); } - referenceTypeIsInitialized(o, (ReferenceType) (stack().peek()) ); + referenceTypeIsInitialized(o, (ReferenceType) (stack().peek()) ); } /** @@ -1471,7 +1471,7 @@ public void visitINSTANCEOF(Instruction o){ referenceTypeIsInitialized(o, (ReferenceType) objectref); } // The unsigned indexbyte1 and indexbyte2 are used to construct an index into the runtime constant pool of the - // current class (§3.6), where the value of the index is (indexbyte1 << 8) | indexbyte2. The runtime constant + // current class (�3.6), where the value of the index is (indexbyte1 << 8) | indexbyte2. The runtime constant // pool item at the index must be a symbolic reference to a class, array, or interface type. Constant c = cpg.getConstant(o.getIndex()); if (! (c instanceof ConstantClass)){ @@ -1484,7 +1484,7 @@ public void visitINSTANCEOF(Instruction o){ */ public void visitINVOKEINTERFACE(INVOKEINTERFACE o){ // Method is not native, otherwise pass 3 would not happen. - + int count = o.getCount(); if (count == 0){ constraintViolated(o, "The 'count' argument must not be 0."); @@ -1492,7 +1492,7 @@ public void visitINVOKEINTERFACE(INVOKEINTERFACE o){ // It is a ConstantInterfaceMethodref, Pass 3a made it sure. // TODO: Do we want to do anything with it? //ConstantInterfaceMethodref cimr = (ConstantInterfaceMethodref) (cpg.getConstant(o.getIndex())); - + // the o.getClassType(cpg) type has passed pass 2; see visitLoadClass(o). Type t = o.getType(cpg); @@ -1508,7 +1508,7 @@ public void visitINVOKEINTERFACE(INVOKEINTERFACE o){ Type[] argtypes = o.getArgumentTypes(cpg); int nargs = argtypes.length; - + for (int i=nargs-1; i>=0; i--){ Type fromStack = stack().peek( (nargs-1) - i ); // 0 to nargs-1 Type fromDesc = argtypes[i]; @@ -1533,7 +1533,7 @@ public void visitINVOKEINTERFACE(INVOKEINTERFACE o){ } } } - + Type objref = stack().peek(nargs); if (objref == Type.NULL){ return; @@ -1550,14 +1550,14 @@ public void visitINVOKEINTERFACE(INVOKEINTERFACE o){ objref = GENERIC_ARRAY; } } - + // String objref_classname = ((ObjectType) objref).getClassName(); // String theInterface = o.getClassName(cpg); // TODO: This can only be checked if we're using Staerk-et-al's "set of object types" // instead of "wider cast object types" generated during verification. //if ( ! Repository.implementationOf(objref_classname, theInterface) ){ // constraintViolated(o, "The 'objref' item '"+objref+"' does not implement '"+theInterface+"' as expected."); - //} + //} int counted_count = 1; // 1 for the objectref for (int i=0; i=0; i--){ Type fromStack = stack().peek( (nargs-1) - i ); // 0 to nargs-1 Type fromDesc = argtypes[i]; @@ -1617,7 +1617,7 @@ public void visitINVOKESPECIAL(InvokeInstruction o){ } } } - + Type objref = stack().peek(nargs); if (objref == Type.NULL){ return; @@ -1637,7 +1637,7 @@ public void visitINVOKESPECIAL(InvokeInstruction o){ } } - objref_classname = ((ObjectType) objref).getClassName(); + objref_classname = ((ObjectType) objref).getClassName(); } else{ if (!(objref instanceof UninitializedObjectType)){ @@ -1645,13 +1645,13 @@ public void visitINVOKESPECIAL(InvokeInstruction o){ } objref_classname = ((UninitializedObjectType) objref).getInitialized().getClassName(); } - + String theClass = o.getClassName(cpg); if ( ! Repository.instanceOf(objref_classname, theClass) ){ constraintViolated(o, "The 'objref' item '"+objref+"' does not implement '"+theClass+"' as expected."); - } - + } + } /** @@ -1659,7 +1659,7 @@ public void visitINVOKESPECIAL(InvokeInstruction o){ */ public void visitINVOKESTATIC(InvokeInstruction o){ // Method is not native, otherwise pass 3 would not happen. - + Type t = o.getType(cpg); if (t instanceof ObjectType){ String name = ((ObjectType)t).getClassName(); @@ -1672,7 +1672,7 @@ public void visitINVOKESTATIC(InvokeInstruction o){ Type[] argtypes = o.getArgumentTypes(cpg); int nargs = argtypes.length; - + for (int i=nargs-1; i>=0; i--){ Type fromStack = stack().peek( (nargs-1) - i ); // 0 to nargs-1 Type fromDesc = argtypes[i]; @@ -1718,7 +1718,7 @@ public void visitINVOKEVIRTUAL(InvokeInstruction o){ Type[] argtypes = o.getArgumentTypes(cpg); int nargs = argtypes.length; - + for (int i=nargs-1; i>=0; i--){ Type fromStack = stack().peek( (nargs-1) - i ); // 0 to nargs-1 Type fromDesc = argtypes[i]; @@ -1743,7 +1743,7 @@ public void visitINVOKEVIRTUAL(InvokeInstruction o){ } } } - + Type objref = stack().peek(nargs); if (objref == Type.NULL){ return; @@ -1760,14 +1760,14 @@ public void visitINVOKEVIRTUAL(InvokeInstruction o){ objref = GENERIC_ARRAY; } } - + String objref_classname = ((ObjectType) objref).getClassName(); String theClass = o.getClassName(cpg); - + if ( ! Repository.instanceOf(objref_classname, theClass) ){ constraintViolated(o, "The 'objref' item '"+objref+"' does not implement '"+theClass+"' as expected."); - } + } } /** @@ -1828,7 +1828,7 @@ public void visitISHR(Instruction o){ */ public void visitISTORE(Instruction o){ //visitStoreInstruction(StoreInstruction) is called before. - + // Nothing else needs to be done here. } @@ -1924,7 +1924,7 @@ public void visitLALOAD(Instruction o){ indexOfInt(o, stack().peek()); if (stack().peek(1) == Type.NULL){ return; - } + } if (! (stack().peek(1) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-top must be of type long[] but is '"+stack().peek(1)+"'."); } @@ -1956,7 +1956,7 @@ public void visitLASTORE(Instruction o){ indexOfInt(o, stack().peek(1)); if (stack().peek(2) == Type.NULL){ return; - } + } if (! (stack().peek(2) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-next-to-top must be of type long[] but is '"+stack().peek(2)+"'."); } @@ -1990,7 +1990,7 @@ public void visitLCONST(Instruction o){ */ public void visitLDC(Instruction o){ // visitCPInstruction is called first. - + Constant c = cpg.getConstant(o.getIndex()); if (! ( ( c instanceof ConstantInteger) || ( c instanceof ConstantFloat ) || @@ -2004,7 +2004,7 @@ public void visitLDC(Instruction o){ */ public void visitLDC_W(Instruction o){ // visitCPInstruction is called first. - + Constant c = cpg.getConstant(o.getIndex()); if (! ( ( c instanceof ConstantInteger) || ( c instanceof ConstantFloat ) || @@ -2018,7 +2018,7 @@ public void visitLDC_W(Instruction o){ */ public void visitLDC2_W(Instruction o){ // visitCPInstruction is called first. - + Constant c = cpg.getConstant(o.getIndex()); if (! ( ( c instanceof ConstantLong) || ( c instanceof ConstantDouble ) ) ){ @@ -2043,7 +2043,7 @@ public void visitLDIV(Instruction o){ */ public void visitLLOAD(Instruction o){ //visitLoadInstruction(LoadInstruction) is called before. - + // Nothing else needs to be done here. } @@ -2062,7 +2062,7 @@ public void visitLMUL(Instruction o){ public void visitLNEG(Instruction o){ checkTop(o,Type.LONG); } - + public void visitLOOKUPSWITCH(LOOKUPSWITCH o){ checkTop(o,Type.INT); // See also pass 3a. @@ -2103,13 +2103,13 @@ public void visitLSHR(Instruction o){ constraintViolated(o, "The value at the stack next-to-top is not of type 'long', but of type '"+stack().peek(1)+"'."); } } - + /** * Ensures the specific preconditions of the said instruction. */ public void visitLSTORE(Instruction o){ //visitStoreInstruction(StoreInstruction) is called before. - + // Nothing else needs to be done here. } @@ -2184,7 +2184,7 @@ public void visitMULTIANEWARRAY(MULTIANEWARRAY o){ public void visitNEW(Instruction o){ //visitCPInstruction(CPInstruction) has been called before. //visitLoadClass(LoadClass) has been called before. - + Type t = o.getType(cpg); if (! (t instanceof ReferenceType)){ throw new AssertionViolatedException("NEW.getType() returning a non-reference type?!"); @@ -2197,7 +2197,7 @@ public void visitNEW(Instruction o){ //e.g.: Don't instantiate interfaces if (! obj.referencesClass()){ constraintViolated(o, "Expecting a class type (ObjectType) to work on. Found: '"+obj+"'."); - } + } } public void visitNEWARRAY(Instruction o) { checkTop(o,Type.INT); } @@ -2227,9 +2227,9 @@ public void visitPUTFIELD(FieldInstruction o){ if (! ( (objectref instanceof ObjectType) || (objectref == Type.NULL) ) ){ constraintViolated(o, "Stack next-to-top should be an object reference that's not an array reference, but is '"+objectref+"'."); } - + String field_name = o.getFieldName(cpg); - + JavaClass jc = Repository.lookupClass(o.getClassType(cpg).getClassName()); Field[] fields = jc.getFields(); Field f = null; @@ -2273,7 +2273,7 @@ public void visitPUTFIELD(FieldInstruction o){ constraintViolated(o, "The stack top type '"+value+"' is not of type '"+shouldbe+"' as expected."); } } - + if (f.isProtected()){ ObjectType classtype = o.getClassType(cpg); ObjectType curr = new ObjectType(mg.getClassName()); @@ -2292,7 +2292,7 @@ public void visitPUTFIELD(FieldInstruction o){ objreftype.subclassOf(curr) ) ){ constraintViolated(o, "The referenced field has the ACC_PROTECTED modifier, and it's a member of the current class or a superclass of the current class. However, the referenced object type '"+stack().peek()+"' is not the current class or a subclass of the current class."); } - } + } } // TODO: Could go into Pass 3a. @@ -2384,7 +2384,7 @@ public void visitSALOAD(Instruction o){ indexOfInt(o, stack().peek()); if (stack().peek(1) == Type.NULL){ return; - } + } if (! (stack().peek(1) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-top must be of type short[] but is '"+stack().peek(1)+"'."); } @@ -2404,7 +2404,7 @@ public void visitSASTORE(Instruction o){ indexOfInt(o, stack().peek(1)); if (stack().peek(2) == Type.NULL){ return; - } + } if (! (stack().peek(2) instanceof ArrayType)){ constraintViolated(o, "Stack next-to-next-to-top must be of type short[] but is '"+stack().peek(2)+"'."); } @@ -2442,4 +2442,3 @@ public void visitTABLESWITCH(TABLESWITCH o){ } } - diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/InstructionContext.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/InstructionContext.java index 2127579f32..7b7b9d60c3 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/InstructionContext.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/InstructionContext.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.ArrayList; @@ -64,7 +64,7 @@ * such. * * @version $Id: InstructionContext.java,v 1.3 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public interface InstructionContext{ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/LocalVariables.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/LocalVariables.java index e665575c6c..8aed044bc1 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/LocalVariables.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/LocalVariables.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.generic.Type; @@ -63,7 +63,7 @@ * simulation. * * @version $Id: LocalVariables.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class LocalVariables{ /** The Type[] containing the local variable slots. */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/OperandStack.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/OperandStack.java index 7559f5c6a7..9ffc3f0cb0 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/OperandStack.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/OperandStack.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.generic.*; @@ -64,7 +64,7 @@ * Elements of this stack are org.aspectj.apache.bcel.generic.Type objects. * * @version $Id: OperandStack.java,v 1.3 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class OperandStack{ @@ -88,7 +88,7 @@ public OperandStack(int maxStack){ public OperandStack(int maxStack, ObjectType obj){ this.maxStack = maxStack; this.push(obj); - } + } /** * Returns a deep copy of this object; that means, the clone operates * on a new stack. However, the Type objects on the stack are @@ -198,7 +198,7 @@ int size(){ /** * Returns the number of stack slots used. * @see #maxStack() - */ + */ public int slotsUsed(){ /* XXX change this to a better implementation using a variable that keeps track of the actual slotsUsed()-value monitoring @@ -210,7 +210,7 @@ all push()es and pop()s. } return slots; } - + /** * Returns a String representation of this OperandStack instance. */ @@ -230,7 +230,7 @@ public String toString(){ public void merge(OperandStack s){ if ( (slotsUsed() != s.slotsUsed()) || (size() != s.size()) ) throw new StructuralCodeConstraintException("Cannot merge stacks of different size:\nOperandStack A:\n"+this+"\nOperandStack B:\n"+s); - + for (int i=0; i. + * . */ import java.io.PrintWriter; @@ -86,7 +86,7 @@ * documentation. * * @version $Id: Pass3bVerifier.java,v 1.3 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see #do_verify() */ diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/Subroutine.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/Subroutine.java index be35a451e5..d5dca1071d 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/Subroutine.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/Subroutine.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.generic.*; @@ -62,7 +62,7 @@ * consistent fashion, too. * * @version $Id: Subroutine.java,v 1.2 2008/05/28 23:53:02 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public interface Subroutine{ /** diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/Subroutines.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/Subroutines.java index 53f170c26a..285bc4a34f 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/Subroutines.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/Subroutines.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.Constants; @@ -86,7 +86,7 @@ * TODO: refer to the paper. * * @version $Id: Subroutines.java,v 1.4 2009/09/09 19:56:20 aclement Exp $ - * @author Enver Haase + * @author Enver Haase * @see #getTopLevel() */ public class Subroutines{ @@ -111,25 +111,25 @@ private class SubroutineImpl implements Subroutine{ /** The instructions that belong to this subroutine. */ private HashSet instructions = new HashSet(); // Elements: InstructionHandle - + /* * Refer to the Subroutine interface for documentation. */ public boolean contains(InstructionHandle inst){ return instructions.contains(inst); } - + /** * The JSR or JSR_W instructions that define this * subroutine by targeting it. */ private HashSet theJSRs = new HashSet(); - + /** * The RET instruction that leaves this subroutine. */ private InstructionHandle theRET; - + /** * Returns a String representation of this object, merely * for debugging purposes. @@ -139,7 +139,7 @@ public boolean contains(InstructionHandle inst){ */ public String toString(){ String ret = "Subroutine: Local variable is '"+localVariable+"', JSRs are '"+theJSRs+"', RET is '"+theRET+"', Instructions: '"+instructions.toString()+"'."; - + ret += " Accessed local variable slots: '"; int[] alv = getAccessedLocalsIndices(); for (int i=0; i iter = sub_leaders.iterator(); while (iter.hasNext()){ @@ -428,13 +428,13 @@ public Subroutines(MethodGen mg){ ((SubroutineImpl) getSubroutine(leader)).addEnteringJsrInstruction(all[i]); } } - + // Now do a BFS from every subroutine leader to find all the // instructions that belong to a subroutine. HashSet instructions_assigned = new HashSet(); // we don't want to assign an instruction to two or more Subroutine objects. - + Hashtable colors = new Hashtable(); //Graph colouring. Key: InstructionHandle, Value: java.awt.Color . - + iter = sub_leaders.iterator(); while (iter.hasNext()){ // Do some BFS with "actual" as the root of the graph. @@ -447,7 +447,7 @@ public Subroutines(MethodGen mg){ // Init Queue ArrayList Q = new ArrayList(); Q.add(actual); // add(Obj) adds to the end, remove(0) removes from the start. - + /* BFS ALGORITHM MODIFICATION: Start out with multiple "root" nodes, as exception handlers are starting points of top-level code, too. [why top-level? TODO: Refer to the special JustIce notion of subroutines.]*/ if (actual == all[0]){ for (int j=0; j set){ for (int i=0; i set){ } noRecursiveCalls(subs[i], set); - + set.remove(new Integer(index)); } - } - + } + /** * Returns the Subroutine object associated with the given * leader (that is, the first instruction of the subroutine). @@ -553,7 +553,7 @@ private void noRecursiveCalls(Subroutine sub, HashSet set){ */ public Subroutine getSubroutine(InstructionHandle leader){ Subroutine ret = subroutines.get(leader); - + if (ret == null){ throw new AssertionViolatedException("Subroutine requested for an InstructionHandle that is not a leader of a subroutine."); } @@ -561,7 +561,7 @@ public Subroutine getSubroutine(InstructionHandle leader){ if (ret == TOPLEVEL){ throw new AssertionViolatedException("TOPLEVEL special subroutine requested; use getTopLevel()."); } - + return ret; } @@ -610,24 +610,24 @@ private static InstructionHandle[] getSuccessors(InstructionHandle instruction){ final InstructionHandle[] empty = new InstructionHandle[0]; final InstructionHandle[] single = new InstructionHandle[1]; final InstructionHandle[] pair = new InstructionHandle[2]; - + Instruction inst = instruction.getInstruction(); - + if (inst instanceof RET){ return empty; } - + // Terminates method normally. if (inst.isReturnInstruction()){ return empty; } - + // Terminates method abnormally, because JustIce mandates // subroutines not to be protected by exception handlers. if (inst.getOpcode()==Constants.ATHROW){ return empty; } - + // See method comment. if (inst.isJsrInstruction()){ single[0] = instruction.getNext(); @@ -656,7 +656,7 @@ private static InstructionHandle[] getSuccessors(InstructionHandle instruction){ } } - // default case: Fall through. + // default case: Fall through. single[0] = instruction.getNext(); return single; } diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/UninitializedObjectType.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/UninitializedObjectType.java index 72fe44e94f..1a4b5d3696 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/UninitializedObjectType.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/UninitializedObjectType.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import org.aspectj.apache.bcel.*; @@ -63,13 +63,13 @@ * more details. * * @version $Id: UninitializedObjectType.java,v 1.2 2008/05/28 23:53:03 aclement Exp $ - * @author Enver Haase + * @author Enver Haase */ public class UninitializedObjectType extends ReferenceType implements Constants{ /** The "initialized" version. */ private ObjectType initialized; - + /** Creates a new instance. */ public UninitializedObjectType(ObjectType t){ super(T_UNKNOWN, ""); diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/package.html b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/package.html index 84af3bb939..b937a29386 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/package.html +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/structurals/package.html @@ -20,7 +20,7 @@

    Related Documentation

    For a simple demonstration of JustIce working, please see: diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/BCELFactory.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/BCELFactory.java index e24a4a665e..0b7912bc0e 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/BCELFactory.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/BCELFactory.java @@ -48,7 +48,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -78,12 +78,12 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ /** * Factory creates il.append() statements, and sets instruction targets. A helper class for BCELifier. - * + * * @see BCELifier * @version $Id: BCELFactory.java,v 1.6 2009/09/14 20:29:10 aclement Exp $ * @author M. Dahm diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/BCELifier.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/BCELifier.java index 2b0fb010b1..0e2eddb002 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/BCELifier.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/BCELifier.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.io.OutputStream; import java.io.PrintWriter; @@ -69,7 +69,7 @@ import org.aspectj.apache.bcel.generic.MethodGen; import org.aspectj.apache.bcel.generic.Type; -/** +/** * This class takes a given JavaClass object and converts it to a * Java program that creates that very class using BCEL. This * gives new users of BCEL a useful example showing how things @@ -77,7 +77,7 @@ * but tries to mimic hand-written code as close as possible. * * @version $Id: BCELifier.java,v 1.2 2008/05/28 23:53:04 aclement Exp $ - * @author M. Dahm + * @author M. Dahm */ public class BCELifier extends org.aspectj.apache.bcel.verifier.EmptyClassVisitor { private JavaClass _clazz; @@ -139,56 +139,56 @@ public void visitJavaClass(JavaClass clazz) { Field[] fields = clazz.getFields(); if(fields.length > 0) { - _out.println(" private void createFields() {"); + _out.println(" private void createFields() {"); _out.println(" FieldGen field;"); for(int i=0; i < fields.length; i++) { fields[i].accept(this); } - _out.println(" }\n"); + _out.println(" }\n"); } Method[] methods = clazz.getMethods(); for(int i=0; i < methods.length; i++) { - _out.println(" private void createMethod_" + i + "() {"); + _out.println(" private void createMethod_" + i + "() {"); methods[i].accept(this); - _out.println(" }\n"); + _out.println(" }\n"); } printMain(); _out.println("}"); } - + private void printCreate() { _out.println(" public void create(OutputStream out) throws IOException {"); Field[] fields = _clazz.getFields(); if(fields.length > 0) { - _out.println(" createFields();"); + _out.println(" createFields();"); } Method[] methods = _clazz.getMethods(); for(int i=0; i < methods.length; i++) { - _out.println(" createMethod_" + i + "();"); + _out.println(" createMethod_" + i + "();"); } - _out.println(" _cg.getJavaClass().dump(out);"); - - _out.println(" }\n"); + _out.println(" _cg.getJavaClass().dump(out);"); + + _out.println(" }\n"); } private void printMain() { String class_name = _clazz.getClassName(); - + _out.println(" public static void main(String[] args) throws Exception {"); _out.println(" " + class_name + "Creator creator = new " + class_name + "Creator();"); _out.println(" creator.create(new FileOutputStream(\"" + class_name + ".class\"));"); - _out.println(" }"); + _out.println(" }"); } public void visitField(Field field) { @@ -222,7 +222,7 @@ public void visitMethod(Method method) { BCELifier.printArray(mg.getArgumentNames(), false, true) + " }, \"" + method.getName() + "\", \"" + _clazz.getClassName() + "\", il, _cp);\n"); - + BCELFactory factory = new BCELFactory(mg, _out); factory.start(); diff --git a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/InstructionFinder.java b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/InstructionFinder.java index ba1f752c1d..a695ac9dbc 100644 --- a/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/InstructionFinder.java +++ b/bcel-builder/verifier-src/org/aspectj/apache/bcel/verifier/util/InstructionFinder.java @@ -21,7 +21,7 @@ * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." + * Apache Software Foundation (https://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * @@ -51,7 +51,7 @@ * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see - * . + * . */ import java.util.*; @@ -66,7 +66,7 @@ * a peep hole optimizer that looks for code patterns and replaces * them with faster equivalents. * - *

    This class internally uses the + *

    This class internally uses the * Regexp package to search for regular expressions. * * A typical application would look like this: @@ -82,7 +82,7 @@ } * @version $Id: InstructionFinder.java,v 1.4 2009/09/09 19:56:20 aclement Exp $ - * @author M. Dahm + * @author M. Dahm * @see Instruction * @see InstructionList */ diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java index aa3d2ba28c..6851898601 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java @@ -54,8 +54,8 @@ public class Checklics extends MatchingTask { final String IBM = "IBM"; final String VMWARE = "VMware"; final String IBM_LONG = "International Business Machines"; - final String LIC_APL = "Apache Software Foundation (http://www.apache.org/)"; - final String LIC_MPL = "http://aspectj.org/MPL/"; + final String LIC_APL = "Apache Software Foundation (https://www.apache.org/)"; + final String LIC_MPL = "https://aspectj.org/MPL/"; final String LIC_CPL = "Eclipse Public License"; final String LIC_ECPL = " Public License"; License APL = new License(APACHE_TAG, LIC_APL, APACHE); @@ -655,4 +655,3 @@ private static boolean checkLine(String line, List years) { } } // class Header - diff --git a/build/src/main/java/org/aspectj/internal/tools/build/Util.java b/build/src/main/java/org/aspectj/internal/tools/build/Util.java index 74dd8d93bb..ca729b47d7 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/Util.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/Util.java @@ -333,7 +333,7 @@ private static final String[] copy(String[] ra) { * Currently very limited, and will only support the subset of * features that we use. * sources: - * http://www-128.ibm.com/developerworks/library/os-ecl-osgi/index.html + * https://www-128.ibm.com/developerworks/library/os-ecl-osgi/index.html * https://help.eclipse.org/help30/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/osgi/org/osgi/framework/Constants.html */ public static class OSGIBundle { diff --git a/docs/LICENSE-AspectJ.adoc b/docs/LICENSE-AspectJ.adoc index 387a985e50..c53ebe6e00 100644 --- a/docs/LICENSE-AspectJ.adoc +++ b/docs/LICENSE-AspectJ.adoc @@ -30,7 +30,7 @@ conditions of use. === BCEL v5.1 This product contains software developed by the Apache Software -Foundation (http://www.apache.org/[http://www.apache.org]). +Foundation (https://www.apache.org/[https://www.apache.org]). AspectJ includes a modified version of the Apache Jakarta Byte Code Engineering Library (BCEL) v5.1. BCEL is available at @@ -41,11 +41,11 @@ code is made available under the Apache Software License v1.1 === ASM v2.2.1 AspectJ includes a binary version of ASM v2.2.1 -(http://asm.objectweb.org/index.html[http://asm.objectweb.org/]) The +(https://asm.objectweb.org/index.html[https://asm.objectweb.org/]) The source code for ASM is available from the ObjectWeb download site at -http://asm.objectweb.org/download/. +https://asm.objectweb.org/download/. -The ASM license is available at http://asm.objectweb.org/license.html. +The ASM license is available at https://asm.objectweb.org/license.html. The license is also reproduced here: [source, text] diff --git a/docs/developer/traces/ajc_batchBuild_annotated.htm b/docs/developer/traces/ajc_batchBuild_annotated.htm index 50f1062c80..c151a00bd9 100644 --- a/docs/developer/traces/ajc_batchBuild_annotated.htm +++ b/docs/developer/traces/ajc_batchBuild_annotated.htm @@ -1,6 +1,6 @@ +xmlns="https://www.w3.org/TR/REC-html40"> diff --git a/docs/developer/traces/ajc_hello_annotated.htm b/docs/developer/traces/ajc_hello_annotated.htm index d4577f302f..4fde93329b 100644 --- a/docs/developer/traces/ajc_hello_annotated.htm +++ b/docs/developer/traces/ajc_hello_annotated.htm @@ -1,6 +1,6 @@ +xmlns="https://www.w3.org/TR/REC-html40"> diff --git a/docs/devguide/ajc.adoc b/docs/devguide/ajc.adoc index 51091ee1ec..5e47018e12 100644 --- a/docs/devguide/ajc.adoc +++ b/docs/devguide/ajc.adoc @@ -251,9 +251,9 @@ including these files in your existing packages instead. AspectJ is a compatible extension to the Java programming language. The AspectJ compiler adheres to the -http://java.sun.com/docs/books/jls/index.html[The Java Language +https://java.sun.com/docs/books/jls/index.html[The Java Language Specification, Second Edition] and to the -http://java.sun.com/docs/books/vmspec/index.html[The Java Virtual +https://java.sun.com/docs/books/vmspec/index.html[The Java Virtual Machine Specification, Second Edition] and runs on any Java 2 compatible platform. The code it generates runs on any Java 1.1 or later compatible platform. For more information on compatibility with Java and with diff --git a/docs/devguide/ajdoc.adoc b/docs/devguide/ajdoc.adoc index eaa0ee1b56..a1585abca4 100644 --- a/docs/devguide/ajdoc.adoc +++ b/docs/devguide/ajdoc.adoc @@ -21,7 +21,7 @@ To run `ajdoc`, use one of the scripts in the AspectJ `bin` directory. The `ajdoc` implementation builds on Sun's `javadoc` command line tool, and you use it in the same way with many of the same options (`javadoc` options are not documented here; for more information on `javadoc` -usage, see the http://java.sun.com/j2se/javadoc/[Javadoc homepage].) +usage, see the https://java.sun.com/j2se/javadoc/[Javadoc homepage].) As with `ajc` (but unlike `javadoc`), you pass `ajdoc` all your aspect source files and any files containing types affected by the aspects; diff --git a/docs/faq/faq.adoc b/docs/faq/faq.adoc index f52d9d5ed6..160594c93c 100644 --- a/docs/faq/faq.adoc +++ b/docs/faq/faq.adoc @@ -92,7 +92,7 @@ under the https://eclipse.org/legal/cpl-v10.html[Common Public License 1.0]. The AspectJ 1.0 tools are open-source software available under the -http://www.opensource.org/licenses/mozilla1.1[Mozilla Public License +https://www.opensource.org/licenses/mozilla1.1[Mozilla Public License 1.1]. That documentation is available under a separate license that precludes for-profit or commercial redistribution. @@ -106,7 +106,7 @@ https://www.eclipse.org/legal/eplfaq.php[Eclipse Public License FAQ]. *Q:* What is the AspectJ Project? *A:* AspectJ is based on over ten years of research at -http://www.parc.xerox.com[Xerox Palo Alto Research Center] as funded by +https://www.parc.xerox.com[Xerox Palo Alto Research Center] as funded by Xerox, a U.S. Government grant (NISTATP), and a DARPA contract. It has evolved through open-source releases to a strong user community @@ -226,12 +226,12 @@ tool integrations: https://eclipse.org/ajdt * Emacs (GNU version 20.3) and XEmacs (version 21.1 on Unix and 21.4 on Windows), in the SourceForge AspectJ for Emacs project -http://aspectj4emacs.sourceforge.net +https://aspectj4emacs.sourceforge.net * JBuilder (versions 4 through 7) from Borland in the SourceForge -AspectJ for JBuilder project http://aspectj4jbuildr.sourceforge.net +AspectJ for JBuilder project https://aspectj4jbuildr.sourceforge.net * Netbeans up to 3.4 (and Sun Microsystems' Forte for Java (versions 2 and 3), Sun/One) in the SourceForge AspectJ for NetBeans project -http://aspectj4netbean.sourceforge.net +https://aspectj4netbean.sourceforge.net Finally, as mentioned above, AspectJ also supports building with Ant by providing task interfaces to the ajc and ajdoc tools. @@ -394,7 +394,7 @@ programming language innovations also do that, as will future developments. (Slides for a long talk on this topic were once available at -http://www.cs.ubc.ca/~gregor/vinst-2-17-01.zip.) +https://www.cs.ubc.ca/~gregor/vinst-2-17-01.zip.) *Q:* Is AOP restricted to domain-specific applications? @@ -679,7 +679,7 @@ dangerous code. One paper someone else just reminded me of that talks some more about this is: -http://www.cs.ubc.ca/~kdvolder/Workshops/OOPSLA2001/submissions/12-nordberg.pdf +https://www.cs.ubc.ca/~kdvolder/Workshops/OOPSLA2001/submissions/12-nordberg.pdf *Q:* Why does AspectJ permit aspects to access and add members of another type? Isn't that violating OO encapsulation? @@ -1034,12 +1034,12 @@ of developers who are working on platforms without Java 2 support. Here is a list of starting places where you might find support for your system. -* http://java.sun.com/j2se/[Java 2 Platform, Standard Edition] -* http://www-106.ibm.com/developerworks/java/jdk/[developerWorks : Java +* https://java.sun.com/j2se/[Java 2 Platform, Standard Edition] +* https://www-106.ibm.com/developerworks/java/jdk/[developerWorks : Java technology : Tools and products - Developer kits] -* http://www-124.ibm.com/developerworks/oss/jikes/[developerWorks : Open +* https://www-124.ibm.com/developerworks/oss/jikes/[developerWorks : Open Source - Jikes Project] -* http://java.sun.com/cgi-bin/java-ports.cgi[Java Platform Ports] +* https://java.sun.com/cgi-bin/java-ports.cgi[Java Platform Ports] The requirement of Java 2 support is only for _running_ the AspectJ compiler. The AspectJ compiler can be used to build programs that will @@ -1250,10 +1250,10 @@ interest, so interested developer may want to join with others in their developer communities to build the integration. * IDEA/IntelliJ has an enthusiastic community and the developers are -working on an extensibility API - http://intellij.com +working on an extensibility API - https://intellij.com * jEdit comes from a very active open-source community. * Some have suggested Codeguide from Omnicore -http://www.omnicore.com[http://www.omnicore.com/] +https://www.omnicore.com[https://www.omnicore.com/] For questions on AJDE, join the developer's list `aspectj-dev@eclipse.org`. For questions on the current IDE @@ -1406,9 +1406,9 @@ without changing intervening signatures. For more details, see link:progguide/index.html[The AspectJ Programming Guide]. In the case of `synchronized`, we have what we consider a better solution that uses around advice instead of introduction. This solution is described in -http://aspectj.org/pipermail/users/2000/000534.html[this thread (no +https://aspectj.org/pipermail/users/2000/000534.html[this thread (no longer available)] on the AspectJ users list, with some -http://aspectj.org/pipermail/users/2000/000536.html[additional comments +https://aspectj.org/pipermail/users/2000/000536.html[additional comments (no longer available)] . *Q:* I don't understand what join points exist. How can I see them? @@ -1876,7 +1876,7 @@ important when using serialization for the long-term persistence of objects. Using standard Java serialization for long-term persistence has a number of drawbacks and many developers already use alternative solutions. For one possibly standard solution, see -http://jcp.org/jsr/detail/057.jsp[Long-Term Persistence for JavaBeans +https://jcp.org/jsr/detail/057.jsp[Long-Term Persistence for JavaBeans Specification] . *Q:* How can I use AspectJ with applets? @@ -1903,7 +1903,7 @@ The above markup has worked reliably with the Java Plugin (included in the JRE 1.4.x) in IE 6, Mozilla 1.1 (Win32), and Mozilla 1.0.1 (Red Hat Linux 8.0). The following link describes how to configure Mozilla/Netscape 6.x/7.x to use the Java Plugin from a JRE/SDK -installation: http://java.sun.com/j2se/1.4.1/manual_install_linux.html. +installation: https://java.sun.com/j2se/1.4.1/manual_install_linux.html. (Thanks to Chris Bartling for this answer.) *Q:* How can I specify types for advice that captures primitives, void, @@ -2189,7 +2189,7 @@ vmparam -Xmx384m If it turns out that your project is too big to use with AJDE, your IDE may nonetheless support external commands or Ant build processes, which run outside the IDE memory space. For a JBuilder Ant plugin, some people -have directed us to http://antrunner.sourceforge.net[]. +have directed us to https://antrunner.sourceforge.net[]. *Q:* When I run, I get a `NoAspectBoundException` or a ClassNotFound message for `NoAspectBoundException`. @@ -2571,9 +2571,9 @@ compiler. Similarly, Sourceforge has projects integrating AspectJ into other development environments using the AJDE API's: -http://aspectj4emacs.sourceforge.net[AspectJ for Emacs], -http://aspectj4jbuildr.sourceforge.net[AspectJ for JBuilder], and -http://aspectj4netbean.sourceforge.net[AspectJ for NetBeans]. +https://aspectj4emacs.sourceforge.net[AspectJ for Emacs], +https://aspectj4jbuildr.sourceforge.net[AspectJ for JBuilder], and +https://aspectj4netbean.sourceforge.net[AspectJ for NetBeans]. This is the right level of separation/integration. AspectJ is available standalone, leverages an existing open-source compliant Java compiler, @@ -2709,7 +2709,7 @@ or view the source code (see xref:#Developers[AspectJ Project Development]). We hope to write papers on the bytecode weaving model used in AspectJ-1.1 if we can find the time. Erik Hilsdale and Jim Hugunin did draft a paper for AOSD 2004, now available on Jim's web -site: http://hugunin.net/papers.html Jim summarized advice weaving in +site: https://hugunin.net/papers.html Jim summarized advice weaving in the AspectJ 1.1 implementation in the https://dev.eclipse.org/mhonarc/lists/aspectj-dev/msg00519.html[following mailing-list reply]: @@ -2777,7 +2777,7 @@ you have an additional option if your application is based on the Spring framework. If you deploy in one of the supported web servers or application servers, you can avoid modifications to the startup script. Please see -http://static.springframework.org/spring/docs/2.5.x/reference/aop.html#aop-aj-ltw-spring +https://static.springframework.org/spring/docs/2.5.x/reference/aop.html#aop-aj-ltw-spring for more details. *Q:* Does AspectJ use reflection at runtime? @@ -3126,7 +3126,7 @@ from the AspectJ home page https://eclipse.org/aspectj . *Q:* How can I search the email archives or the web site? *A:* It is very effective to do a google search of the form, -http://www.google.com/search?q=site:eclipse.org+cflowbelow , and you can +https://www.google.com/search?q=site:eclipse.org+cflowbelow , and you can use the eclipse.org search at https://www.eclipse.org/search/search.cgi . You can also check the old archives available for download from the AspectJ home page https://eclipse.org/aspectj . @@ -3153,8 +3153,8 @@ without additional libraries or source files. For the mail lists, we try to follow the conventions for open-source discussions that help avoid "the tragedy of the commons." For example -conventions, see http://jakarta.apache.org/site/mail.html and -http://www.tuxedo.org/%7Eesr/faqs/smart-questions.html . +conventions, see https://jakarta.apache.org/site/mail.html and +https://www.tuxedo.org/%7Eesr/faqs/smart-questions.html . *Q:* How do I write bugs for IDE support? diff --git a/docs/pdguide/ajcore.adoc b/docs/pdguide/ajcore.adoc index 39b7272861..44c937ddbf 100644 --- a/docs/pdguide/ajcore.adoc +++ b/docs/pdguide/ajcore.adoc @@ -73,7 +73,7 @@ java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition sun.boot.library.path=C:\jdk1.3.1_16\jre\bin java.vm.version=1.3.1_16-b06 java.vm.vendor=Sun Microsystems Inc. -java.vendor.url=http://java.sun.com/ +java.vendor.url=https://java.sun.com/ path.separator=; java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io @@ -110,7 +110,7 @@ java.ext.dirs=C:\jdk1.3.1_16\jre\lib\ext sun.boot.class.path=C:\jdk1.3.1_16\jre\lib\rt.jar;... java.vendor=Sun Microsystems Inc. file.separator=\ -java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi +java.vendor.url.bug=https://java.sun.com/cgi-bin/bugreport.cgi sun.io.unicode.encoding=UnicodeLittle sun.cpu.endian=little user.region=GB diff --git a/docs/pdguide/trace.adoc b/docs/pdguide/trace.adoc index d9c9de1d91..2ce9eec74f 100644 --- a/docs/pdguide/trace.adoc +++ b/docs/pdguide/trace.adoc @@ -25,7 +25,7 @@ can then be attached to the bug report. === Configuring Tracing When available (Java 5 or later) AspectJ will use the -http://java.sun.com/j2se/1.5.0/docs/guide/logging/index.html[java.util.logging] +https://java.sun.com/j2se/1.5.0/docs/guide/logging/index.html[java.util.logging] infrastructure configured using a `logging.properties` file. By default only error and fatal events will be logged but less severe warnings as well as fine-grained method entry and exit events can be obtained using diff --git a/docs/release/README-1.1.adoc b/docs/release/README-1.1.adoc index f78e4ce707..eb1a63a433 100644 --- a/docs/release/README-1.1.adoc +++ b/docs/release/README-1.1.adoc @@ -268,9 +268,9 @@ because they came under different licenses. All of AspectJ 1.1 is licensed under the CPL 1.0, so the tools, Ant tasks, and documentation are all in one distribution available from https://eclipse.org/aspectj. To retain their MPL 1.1 license, Ajde for -http://aspectj4emacs.sourceforge.net/[Emacs], -http://aspectj4netbean.sourceforge.net/[NetBeans] and -http://aspectj4jbuildr.sourceforge.net/[JBuilder] are now independent +https://aspectj4emacs.sourceforge.net/[Emacs], +https://aspectj4netbean.sourceforge.net/[NetBeans] and +https://aspectj4jbuildr.sourceforge.net/[JBuilder] are now independent SourceForge projects. ''''' diff --git a/docs/release/README-1.6.10.adoc b/docs/release/README-1.6.10.adoc index 31a44ab8fd..52b8a03ebf 100644 --- a/docs/release/README-1.6.10.adoc +++ b/docs/release/README-1.6.10.adoc @@ -32,7 +32,7 @@ specify: If I can get enough positive feedback about this option, it will be made the default. For a more detailed write up, check out the blog post: -http://andrewclement.blogspot.com/2010/07/ajdt-memory-usage-reduction.html +https://andrewclement.blogspot.com/2010/07/ajdt-memory-usage-reduction.html === Runtime changes diff --git a/docs/release/README-1.6.11.adoc b/docs/release/README-1.6.11.adoc index b2e982c717..9d2f281bec 100644 --- a/docs/release/README-1.6.11.adoc +++ b/docs/release/README-1.6.11.adoc @@ -45,7 +45,7 @@ issues have now all been sorted out in 1.6.11.M2. More changes have been made for users trying out the -Xset:minimalModel=true option to try and reduce the memory used in their Eclipse/AJDT configurations. This option is discussed in detail -http://andrewclement.blogspot.com/2010/07/ajdt-memory-usage-reduction.html[here]. +https://andrewclement.blogspot.com/2010/07/ajdt-memory-usage-reduction.html[here]. It now saves even more memory. Also, previously the amount of memory it recovered depended on compilation order (which the user has no control over), but now it is insensitive to ordering and should always recover diff --git a/docs/release/README-1.6.4.adoc b/docs/release/README-1.6.4.adoc index 8529d9985d..4868f5d005 100644 --- a/docs/release/README-1.6.4.adoc +++ b/docs/release/README-1.6.4.adoc @@ -113,7 +113,7 @@ Under https://bugs.eclipse.org/bugs/show_bug.cgi?id=246393[bug 246393] the problem has been addressed where sometimes spurious errors would appear throughout the editor for a file in AJDT when just one single simple syntax errors exists. More detail on this problem can be found -http://andrewclement.blogspot.com/2009/02/aspectj-fixing-reverse-cascade-errors.html[here]. +https://andrewclement.blogspot.com/2009/02/aspectj-fixing-reverse-cascade-errors.html[here]. ''''' diff --git a/docs/release/README-1.6.7.adoc b/docs/release/README-1.6.7.adoc index 464f340060..c2b1020275 100644 --- a/docs/release/README-1.6.7.adoc +++ b/docs/release/README-1.6.7.adoc @@ -13,7 +13,7 @@ one of your pointcuts that is hurting your weaving performance. In 1.6.7 it is possible to turn on timers for pointcuts. These timers show the time spent in the weaver matching the pointcut components against join points. The details on this feature are here: -http://andrewclement.blogspot.com/2009/11/aspectj-profiling-pointcut-matching.html[Profiling +https://andrewclement.blogspot.com/2009/11/aspectj-profiling-pointcut-matching.html[Profiling pointcut matching]. Basically by turning on the options '-timers -verbose' on the command line (or via Ant), output will be produced that looks a little like this: @@ -36,7 +36,7 @@ Time:4ms (jps:#662) matching against It shows the component, the number of joinpoints (jps) the weaver attempted to match it against and how many milliseconds were spent performing those matches. The options can also be turned on -http://contraptionsforprogramming.blogspot.com/2009/11/getting-aspectj-pointcut-matching-timer.html[]through +https://contraptionsforprogramming.blogspot.com/2009/11/getting-aspectj-pointcut-matching-timer.html[]through AJDT. Armed with this information you can optimize your pointcuts or post on the mailing list asking for help. The timers can even be turned on for load time weaving. @@ -48,7 +48,7 @@ be done on the matching algorithms. These have remained unchanged for a few years, but in 1.6.7 have received a bit of an overhaul. 'Fast match' has been implemented for the execution() pointcut, drastically reducing weave times for heavy users of execution - more details -http://andrewclement.blogspot.com/2009/11/aspectj-how-much-faster-is-aspectj-167.html[here]. +https://andrewclement.blogspot.com/2009/11/aspectj-how-much-faster-is-aspectj-167.html[here]. The pointcut cost calculator (which is used to sort pointcuts to optimize matching speed) has been reviewed and after determining that this() ought to be considered cheaper than call() - any user combining @@ -67,7 +67,7 @@ The processing of include/exclude entries in aop.xml has been rewritten. It now optimizes for many more common patterns. If a pattern is optimized then there is no need to ask the weaver to do an expensive include/exclude match. More details -http://andrewclement.blogspot.com/2009/12/aspectj-167-and-faster-load-time.html[here]. +https://andrewclement.blogspot.com/2009/12/aspectj-167-and-faster-load-time.html[here]. == Less need to tweak options for load time weaving @@ -87,7 +87,7 @@ will now do the right thing out of the box. All those changes above, and some additional tweaks, mean we are now using less memory than ever before and getting things done more quickly. -http://andrewclement.blogspot.com/2009/12/aspectj-167-and-faster-load-time.html[This +https://andrewclement.blogspot.com/2009/12/aspectj-167-and-faster-load-time.html[This post] discusses the details. From that article, the graph below shows the speed and memory consumption of the various AspectJ 1.6 releases when load time weaving a small application loading in Tomcat. For each diff --git a/docs/release/README-1.6.9.adoc b/docs/release/README-1.6.9.adoc index a7923cf01c..38d7202004 100644 --- a/docs/release/README-1.6.9.adoc +++ b/docs/release/README-1.6.9.adoc @@ -82,7 +82,7 @@ Here is an example, 'AspectA' will switch itself off if the type === Reduction in class file sizes: https://bugs.eclipse.org/bugs/show_bug.cgi?id=312839[312839] More details here: -http://andrewclement.blogspot.com/2010/05/aspectj-size-is-important.html +https://andrewclement.blogspot.com/2010/05/aspectj-size-is-important.html but basically some work has been done to improve the serialized form of aspects. As an example, a compiled Roo petclinic sample (which uses lots of aspects and ITDs) is down from 1Meg (AspectJ 1.6.9m2) to 630k @@ -110,7 +110,7 @@ Overweaving can cope with 'other tools' modifying the bytecode in between AspectJ weaves, whereas reweaving cannot. More details are in the related bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=293450[293450] and in this -http://andrewclement.blogspot.com/2010/05/aspectj-overweaving.html[blog +https://andrewclement.blogspot.com/2010/05/aspectj-overweaving.html[blog article]. A weaver is switched into overweaving mode by the option -Xset:overWeaving=true - which can be specified on the command line or in the weaver options section of aop.xml. There is still more work to be @@ -285,7 +285,7 @@ magic: maven.springframework.org SpringSource snapshots - http://maven.springframework.org/snapshot + https://maven.springframework.org/snapshot .... diff --git a/docs/release/changes.adoc b/docs/release/changes.adoc index 5a790a0ff0..7793ca6ac0 100644 --- a/docs/release/changes.adoc +++ b/docs/release/changes.adoc @@ -423,17 +423,17 @@ synch with resources on disk. JBuilder 7 is now supported. All known bugs have been fixed including: -* http://aspectj.org/bugs/resolved?id=787[787] AJDE for JBuilder throws +* https://aspectj.org/bugs/resolved?id=787[787] AJDE for JBuilder throws exception given non-existent file -* http://aspectj.org/bugs/resolved?id=788[788] Label too small in error +* https://aspectj.org/bugs/resolved?id=788[788] Label too small in error message -* http://aspectj.org/bugs/resolved?id=789[789] Index-out-of-bounds +* https://aspectj.org/bugs/resolved?id=789[789] Index-out-of-bounds exception in JBuilder AJDE -* http://aspectj.org/bugs/resolved?id=792[792] Required libraries +* https://aspectj.org/bugs/resolved?id=792[792] Required libraries disappear from JBuilder 6 -* http://aspectj.org/bugs/resolved?id=795[795] Unable to compile open +* https://aspectj.org/bugs/resolved?id=795[795] Unable to compile open tools -* http://aspectj.org/bugs/resolved?id=802[802] AJDE loses current +* https://aspectj.org/bugs/resolved?id=802[802] AJDE loses current (cursor) position in file when switching files In addition, thanks to user feedback that indicated trouble building @@ -443,9 +443,9 @@ with itself. [[_1_0_6ajdoc]] == Ajdoc -* Fixed http://aspectj.org/bugs/resolved?id=790[790] aspect code +* Fixed https://aspectj.org/bugs/resolved?id=790[790] aspect code comments suppressed by fix to bug 710 -* Known problems: http://aspectj.org/bugs/ajdoc +* Known problems: https://aspectj.org/bugs/ajdoc ''''' @@ -545,14 +545,14 @@ your path, and the class that you expect to execute on your classpath. Bug fixes: -* http://aspectj.org/bugs/resolved?id=710[710 - compiler-generated +* https://aspectj.org/bugs/resolved?id=710[710 - compiler-generated constructor shown with class comment] -* http://aspectj.org/bugs/resolved?id=712[712 - comments lost in aspect +* https://aspectj.org/bugs/resolved?id=712[712 - comments lost in aspect docs for methods or constructors declared on other types.] -* http://aspectj.org/bugs/resolved?id=719[719 - poor support for @link, +* https://aspectj.org/bugs/resolved?id=719[719 - poor support for @link, @see tags] -* http://aspectj.org/bugs/resolved?id=742[742 - crash with @see tag] -* http://aspectj.org/bugs/resolved?id=751[751 - error loading doclet +* https://aspectj.org/bugs/resolved?id=742[742 - crash with @see tag] +* https://aspectj.org/bugs/resolved?id=751[751 - error loading doclet resource] [[_1_0_5anttasks]] @@ -560,7 +560,7 @@ resource] Bug fixes: -* http://aspectj.org/bugs/resolved?id=730[730 - document all supported +* https://aspectj.org/bugs/resolved?id=730[730 - document all supported ajc flags] ''''' @@ -657,7 +657,7 @@ J2SE 1.3 be on the classpath. * Repackaged to fit into the AspectJ product directory - e.g., `aspectj-ant.jar` moved to `lib` as expected by `examples/build.xml`. -* Fixed bugs, esp. http://aspectj.org/bugs/resolved?id=682[682]: Throw +* Fixed bugs, esp. https://aspectj.org/bugs/resolved?id=682[682]: Throw BuildException if failonerror and ajdoc detects misconfiguration. [[_1_0_4doc]] @@ -712,9 +712,9 @@ reported in 1.0.1. == Compiler * Official support for `-source 1.4` option to compile new -http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html[1.4 +https://java.sun.com/j2se/1.4/docs/guide/lang/assert.html[1.4 assertions]. This makes ajc completely compatible with j2se-1.4. -* Implementation of http://jcp.org/jsr/detail/45.jsp[JSR-45 Debugging +* Implementation of https://jcp.org/jsr/detail/45.jsp[JSR-45 Debugging Support for Other Languages] so that debuggers which correctly implement this specification will be able to accurately debug any AspectJ program at a source code level. We are not currently aware of any debuggers that @@ -726,27 +726,27 @@ type patterns used in pcds have no bindings. We are very interested in feedback on the usefulness and suggested improvements for this feature. * Several significant bugs in the implementation of around advice have been fixed. These include issues with -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=632[dynamic +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=632[dynamic tests], with -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=620[complicated +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=620[complicated local types in an around body], and with -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=636[capturing +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=636[capturing proceed in a closure]. * All but two -(http://aspectj.org/jitterbug/aspectj-bugs/compiler?id=626[1], -http://aspectj.org/jitterbug/aspectj-bugs/compiler?id=645[2]) verified +(https://aspectj.org/jitterbug/aspectj-bugs/compiler?id=626[1], +https://aspectj.org/jitterbug/aspectj-bugs/compiler?id=645[2]) verified bugs in 1.0.1 have been fixed. The two outstanding bugs have relatively easy work-arounds. Thanks as usual to everyone who submitted a bug report. * We no longer use the `SYNTHETIC` attribute to label declarations added by the aspectj compiler. We were using this attribute in compliance with -http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#80128[the +https://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#80128[the JVM Specification]; however, we've found that many tools expect this attribute to only be used for the narrow purpose of implementing Java's inner classes and that using it for other synthetic members can confuse them. This led to problems both -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=649[with javap] -and http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=646[with +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=649[with javap] +and https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=646[with javac]. * Changes required adding runtime classes, so please compile and run using the latest `aspectjrt.jar` @@ -801,7 +801,7 @@ This release fixes a significant performance issue in the compiler, reported by Rich Price, that could lead to extremely long compiles in systems with many aspects and classes. Several other small bugs related to reporting compilation errors have also been fixed, see -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=610[this bug +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=610[this bug report] for an example. A new experimental flag has been added, `-XaddSafePrefix`, that will @@ -855,10 +855,10 @@ below: which are also produced by other compilers) that caused verify errors when dealing with nested try-finally and synchronized statements. These are now fixed. More details are available -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=601[here] and -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=595[here] +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=601[here] and +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=595[here] * Jan Hannemann submitted a -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=600[succint and +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=600[succint and clear bug report] for a difficult intermittant bug. The bug led to the compiler sometimes generating illegal code when introduced methods on a class overrode introduced methods on an interface implemented by that @@ -886,7 +886,7 @@ visibility === AJBrowser * Documentation for the browser is now available at -http://aspectj.org/docs +https://aspectj.org/docs === Emacs Support: aspectj-mode and AJDEE @@ -918,11 +918,11 @@ There have been several minor clarifications/changes to the language. * Thanks to Robin Green for suggesting that we could relax the rules for inheriting multiple concrete members in order to allow those unambiguous cases where one member has already overridden the other. -http://aspectj.org/pipermail/users/2001/001289.html[More details...] +https://aspectj.org/pipermail/users/2001/001289.html[More details...] * Ron Bodkin encouraged us to examine the details of privileged aspects more closely. This led to several small improvements and clarifications to this language feature. -http://aspectj.org/pipermail/users/2001/001258.html[More details...] +https://aspectj.org/pipermail/users/2001/001258.html[More details...] [[_1_0rc3compiler]] == Compiler @@ -936,14 +936,14 @@ for some references to interface fields result in verify errors on certain JVMs. While this is a known bug in those JVMs, we've modified ajc to be bug compatible with all the other Java compilers out there to work-around this JVM bug. -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=551[More +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=551[More details...] * Frank Hunleth discovered a similar bug where ajc's correct bytecodes could lead to essentially random method dispath due to a bad bug in the 1.3.0 JVM from Sun. Even though this bug was fixed in the 1.3.1 and 1.2.2 JVMs, we have introduced the appropriate work-around in ajc's code generation. -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=580[More +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=580[More details...] * Thomas Haug (as well as several other members of his group) reported a problem with name binding where ajc was behaving differently than javac. @@ -952,7 +952,7 @@ that conflicted with his package names. The JLS doesn't clearly specify which of these two behaviors is correct. Nevertheless, ajc has been changed to treat packages more like javac does in order to minimize this sort of problem in the future. -http://aspectj.org/jitterbug/aspectj-bugs/resolved?id=574[More +https://aspectj.org/jitterbug/aspectj-bugs/resolved?id=574[More details...] * Several "real" bugs in ajc were also reported and fixed. Toby Allsopp gets credit for reporting two of them. The most interesting of these diff --git a/docs/sandbox/trails/links.adoc b/docs/sandbox/trails/links.adoc index 7ec1e74594..0e58a0403d 100644 --- a/docs/sandbox/trails/links.adoc +++ b/docs/sandbox/trails/links.adoc @@ -13,7 +13,7 @@ https://eclipse.org/aspectj *"AspectJ in Action"* by Ramnivas Laddad has sample code including four patterns: the worker object creation pattern, the exception introduction pattern, the participant pattern, and the wormhole pattern. -Find the code at http://www.manning.com/laddad/. +Find the code at https://www.manning.com/laddad/. In the OOPSLA 2002 paper *"Design Pattern Implementation in Java and AspectJ"*, Jan Hannemann and Gregor Kiczales discuss the implementation @@ -21,7 +21,7 @@ in AspectJ of 23 of the traditional "gang of four" design patterns (from the book "Design Patterns: elements of reusable object-oriented software" by Gamma, Helm, Johnson, and Vlissides). Their paper and the code for those patterns are available from -http://www.cs.ubc.ca/~jan/AODPs/. The code is also available from the +https://www.cs.ubc.ca/~jan/AODPs/. The code is also available from the AspectJ web site as ubc-design-patterns.zip. The latest version is checked into the CVS repository along with other sample code at `org.aspectj/modules/docs/sandbox/ubc-design-patterns`. For instructions @@ -33,7 +33,7 @@ source bug tracking application that demonstrates use of Aspect-Oriented Programming (AOP) with AspectJ. It uses AOP pragmatically to provide systematic support for technical, middleware, and business concerns. -The http://sourceforge.net/projects/cricketcage/[*CricketCage project*] +The https://sourceforge.net/projects/cricketcage/[*CricketCage project*] automatically creates JUnit TestCases for repeatable bugs and test scenarios. Include Cricket Cage's AspectJ code to install a code generator, then run the program to generate the TestCase. diff --git a/docs/sandbox/trails/myeclipseide.adoc b/docs/sandbox/trails/myeclipseide.adoc index 3725911317..87f29fcd8f 100644 --- a/docs/sandbox/trails/myeclipseide.adoc +++ b/docs/sandbox/trails/myeclipseide.adoc @@ -2,7 +2,7 @@ _Last updated: 2003-07-08 by wisberg_ -MyEclipseIde (http://www.myeclipseide.com/[http://www.myeclipseide.com]) +MyEclipseIde (https://www.myeclipseide.com/[https://www.myeclipseide.com]) aims to make it easy to develop J2EE applications using Eclipse. AJDT (https://eclipse.org/ajdt) is an Eclipse plug-in that supports AspectJ. diff --git a/docs/sandbox/ubc-design-patterns/docs/readme.adoc b/docs/sandbox/ubc-design-patterns/docs/readme.adoc index f485a54f0e..9293b3a972 100644 --- a/docs/sandbox/ubc-design-patterns/docs/readme.adoc +++ b/docs/sandbox/ubc-design-patterns/docs/readme.adoc @@ -17,7 +17,7 @@ Within the ajdoc documentation, we tried to separate type names used in our exam == Questions, feedback, suggestions, etc. -The AODP web page is http://www.cs.ubc.ca/labs/spl/aodp.html +The AODP web page is https://www.cs.ubc.ca/labs/spl/aodp.html Please send all questions, feedback, and suggestions to Jan Hannemann (jan [AT] cs.ubc.ca). We are very much interested in improving our code. Please do not hesitate to drop us a line. diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/ComponentFactory.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/ComponentFactory.java index 669aa042dd..ba3c7f0435 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/ComponentFactory.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/ComponentFactory.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JLabel; @@ -32,33 +32,33 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/20/04 - * + * */ public interface ComponentFactory { - + /** - * Creates factory-specific JLabel products. + * Creates factory-specific JLabel products. * * @return the factory-specific JLabel */ - - public JLabel createLabel(); + + public JLabel createLabel(); /** - * Creates factory-specific JButton products. + * Creates factory-specific JButton products. * * @return the factory-specific JButton */ - - public JButton createButton(String label); + public JButton createButton(String label); - /** + + /** * Returns the name of the factory. * * @return the name of the factory */ - + public String getName(); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/ComponentFactoryImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/ComponentFactoryImplementation.java index 4a983c8c7b..18e5f8d6a9 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/ComponentFactoryImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/ComponentFactoryImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,20 +15,20 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -import javax.swing.JLabel; -import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JButton; /** - * Illustrates AspectJ's inter-type declarations: a default implementation - * of the two factory methods declared in the AbstractFactory - * interface is provided here. + * Illustrates AspectJ's inter-type declarations: a default implementation + * of the two factory methods declared in the AbstractFactory + * interface is provided here. * * @author Jan Hannemann * @author Gregor Kiczales @@ -40,24 +40,24 @@ /** * Provides a default implementation for all ComponentFactories - * for the createLabel() method. + * for the createLabel() method. * * @return a regular JLabel */ - + public JLabel ComponentFactory.createLabel() { return new JLabel("This Label was created by " +getName()); } - + /** * Provides a default implementation for all ComponentFactories - * for the createButton() method. + * for the createButton() method. * * @param a label for the new JButton * @return a regular JButton */ - + public JButton ComponentFactory.createButton(String label) { return new JButton(label); - } -} \ No newline at end of file + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/Display.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/Display.java index 2575cf8175..365cbe8133 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/Display.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/Display.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.JPanel; import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JButton; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.ActionListener; @@ -39,21 +39,21 @@ * @version 1.1, 01/20/04 * */ - -public class Display extends JFrame { - + +public class Display extends JFrame { + /** * Sets up the frame with a label and a button created by the respective - * ConcreteFactory. Both button and frame receive their appropriate + * ConcreteFactory. Both button and frame receive their appropriate * listeners to close the frame when either the button is clicked or * the frame is closing. * * @param factory the concrete factory to use for creating GUI elements - */ + */ Display(ComponentFactory factory) { - super("New GUI"); - JLabel label = factory.createLabel(); + super("New GUI"); + JLabel label = factory.createLabel(); JButton button = factory.createButton("OK"); button.addActionListener(new myActionListener(this)); JPanel panel = new JPanel(); @@ -61,43 +61,43 @@ public class Display extends JFrame { panel.add(button); this.getContentPane().add(panel); this.pack(); - this.setVisible(true); + this.setVisible(true); this.addWindowListener(new myWindowListener(this)); } - + /** - * Adds a window listener that closes the frame on demand + * Adds a window listener that closes the frame on demand */ private class myWindowListener extends WindowAdapter { - + Display display = null; - + protected myWindowListener(Display display) { super(); - this.display = display; + this.display = display; } - + public void windowClosing(WindowEvent e) { display.setVisible(false); } } - + /** - * Adds a button listener that closes the frame on demand + * Adds a button listener that closes the frame on demand */ private class myActionListener implements ActionListener { - + Display display; - + protected myActionListener(Display display) { super(); this.display = display; } - - public void actionPerformed(ActionEvent e) { + + public void actionPerformed(ActionEvent e) { display.setVisible(false); } } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/FramedFactory.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/FramedFactory.java index 2666d1754d..77eed17702 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/FramedFactory.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/FramedFactory.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - -import javax.swing.JLabel; + +import javax.swing.JLabel; import javax.swing.border.Border; import javax.swing.BorderFactory; import javax.swing.JButton; @@ -31,7 +31,7 @@ /** * This Concrete Factory implements the ComcreteFactory * interface to provide framed Swing GUI components. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/20/04 @@ -41,11 +41,11 @@ public class FramedFactory implements ComponentFactory { /** - * Factroy method to create framed JLabel objects. + * Factroy method to create framed JLabel objects. * * @return the framed JLabel */ - + public JLabel createLabel() { JLabel label = new JLabel("This Label was created by " + getName()); @@ -53,32 +53,32 @@ public JLabel createLabel() { Border loweredbevel = BorderFactory.createLoweredBevelBorder(); label.setBorder(BorderFactory.createCompoundBorder( raisedbevel, loweredbevel)); - + return label; - } - + } + /** - * Factory method to create framed JButton objects. + * Factory method to create framed JButton objects. * * @param the label for the new JButton * @return the framed JButton */ - + public JButton createButton(String label) { JButton button = new JButton(label); Border raisedbevel = BorderFactory.createRaisedBevelBorder(); Border loweredbevel = BorderFactory.createLoweredBevelBorder(); button.setBorder(BorderFactory.createCompoundBorder(raisedbevel, loweredbevel)); return button; - } + } - /** + /** * Returns the name of the factory. * * @return the name of the factory */ - + public String getName() { return "Framed Factory"; - } -} \ No newline at end of file + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/Main.java index 8cff6d26dc..e20d4a27d3 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JFrame; import javax.swing.JRadioButton; import javax.swing.JButton; -import javax.swing.JPanel; +import javax.swing.JPanel; import javax.swing.ButtonGroup; import java.awt.event.WindowAdapter; @@ -43,22 +43,22 @@ * * * As an example scenario, our abstract factory interface defines two - * factory methods, createLabel() and - * createButton(), that create related products - * (here: Swing GUI elements). + * factory methods, createLabel() and + * createButton(), that create related products + * (here: Swing GUI elements). * - * The driver is a GUI that allows the user to choose between the two + * The driver is a GUI that allows the user to choose between the two * concrete factories (RegularFactory and FramedFactory * ), and creates a new GUI with elements from the respective factory. *

    - * + * * RegularFactory creates standard Swing GUI elements, while * FramedFactory produces elements which are framed. * *

    This is the AspectJ implementation.

    * * We decided to implement AbstractFactory as an interace, - * not an abstract class. In the AspectJ solution, we can still define + * not an abstract class. In the AspectJ solution, we can still define * default implementations for the interface methods. This approach uses * AspectJ's inter-type declaration mechanism. * @@ -73,27 +73,27 @@ * @version 1.1, 01/20/04 * */ -public class Main +public class Main { /** * a concrete factory that creates regular GUI components */ - + private static ComponentFactory factory1 = new RegularFactory(); - + /** * a concrete factory that creates framed GUI components */ - + private static ComponentFactory factory2 = new FramedFactory(); /** * stores the currently selected factory */ - + private static ComponentFactory factory = factory1; - - + + /** * Creates the initial GUI that allows the user to choose a factory * and generate a new GUI with the elements that the respective @@ -101,7 +101,7 @@ public class Main * * @return a JPanel containing the GUI */ - + private static JPanel createGUI() { ActionListener radioListener = new ActionListener() { @@ -110,49 +110,49 @@ public void actionPerformed(ActionEvent e) { else factory = factory2; } }; - + JPanel panel = new JPanel(); - JRadioButton factoryButton1 = new JRadioButton("use Factory 1"); + JRadioButton factoryButton1 = new JRadioButton("use Factory 1"); JRadioButton factoryButton2 = new JRadioButton("use Factory 2"); factoryButton1.setActionCommand("factory1"); - factoryButton2.setActionCommand("factory2"); + factoryButton2.setActionCommand("factory2"); factoryButton1.addActionListener(radioListener); - factoryButton2.addActionListener(radioListener); + factoryButton2.addActionListener(radioListener); JButton create = new JButton("Create GUI"); - + ButtonGroup choices = new ButtonGroup(); - + choices.add(factoryButton1); choices.add(factoryButton2); - + create.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(ActionEvent e) { Display display = new Display(factory); } }); - + panel.add(factoryButton1); panel.add(factoryButton2); panel.add(create); - + return panel; } /** * Implements the driver for this design pattern example. It sets up * the initial GUI. - */ - + */ + public static void main(String[] args) { JFrame frame = new JFrame("Abstract Factory Demo"); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} - }); - + }); + frame.getContentPane().add(createGUI()); - + frame.pack(); frame.setVisible(true); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/RegularFactory.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/RegularFactory.java index 573f89571a..9701d35fa0 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/RegularFactory.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/aspectj/RegularFactory.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,44 +15,44 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code please see - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JLabel; -import javax.swing.JButton; +import javax.swing.JButton; /** - * This Concrete Factory implements the - * AbstractFactory interface to provide + * This Concrete Factory implements the + * AbstractFactory interface to provide * regular Swing GUI components. - * + * * The factroy methods createLabel() and Button() * do not need to be defined here, they recieve their implementation from - * the inter-type declarations in aspect + * the inter-type declarations in aspect * AbstractFactroyEnhancement. - * - * This is done so that future concrete factories can reuse the + * + * This is done so that future concrete factories can reuse the * implementations of the factory methods and will only have to specify those * that differ from the default ones. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/20/04 * */ public class RegularFactory implements ComponentFactory { - - /** + + /** * Returns the name of the factory. * * @return the name of the factory */ - + public String getName() { return ("Regular Factory"); - } -} \ No newline at end of file + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/ComponentFactory.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/ComponentFactory.java index ea20364300..df069990af 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/ComponentFactory.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/ComponentFactory.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JLabel; @@ -32,32 +32,32 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/20/04 - * + * */ public interface ComponentFactory { - + /** - * Creates factory-specific JLabel products. + * Creates factory-specific JLabel products. * * @return the factory-specific JLabel */ - - public JLabel createLabel(); + + public JLabel createLabel(); /** - * Creates factory-specific JButton products. + * Creates factory-specific JButton products. * * @return the factory-specific JButton */ - - public JButton createButton(String label); + public JButton createButton(String label); - /** + + /** * Returns the name of the factory. * * @return the name of the factory */ - + public String getName(); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/Display.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/Display.java index 40e2b5b481..432557c9cb 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/Display.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/Display.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.JPanel; import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JButton; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.ActionListener; @@ -37,22 +37,22 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/20/04 - * + * */ -public class Display extends JFrame { - +public class Display extends JFrame { + /** * Sets up the frame with a label and a button created by the respective - * concrete factories. Both button and frame receive their appropriate + * concrete factories. Both button and frame receive their appropriate * listeners to close the frame when either the button is clicked or * the frame is closing. * * @param factory the factory to create GUI elements - */ + */ public Display(ComponentFactory factory) { - super("New GUI"); - JLabel label = factory.createLabel(); + super("New GUI"); + JLabel label = factory.createLabel(); JButton button = factory.createButton("OK"); button.addActionListener(new myActionListener(this)); JPanel panel = new JPanel(); @@ -60,43 +60,43 @@ public Display(ComponentFactory factory) { panel.add(button); this.getContentPane().add(panel); this.pack(); - this.setVisible(true); + this.setVisible(true); this.addWindowListener(new myWindowListener(this)); } - + /** - * Adds a window listener that closes the frame on demand + * Adds a window listener that closes the frame on demand */ - + private class myWindowListener extends WindowAdapter { - + Display display = null; - + protected myWindowListener(Display display) { super(); - this.display = display; + this.display = display; } - + public void windowClosing(WindowEvent e) { display.setVisible(false); } } - + /** - * Adds a button listener that closes the frame on demand + * Adds a button listener that closes the frame on demand */ private class myActionListener implements ActionListener { - + Display display; - + protected myActionListener(Display display) { super(); this.display = display; } - - public void actionPerformed(ActionEvent e) { + + public void actionPerformed(ActionEvent e) { display.setVisible(false); } } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/FramedFactory.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/FramedFactory.java index 0a2f5b4b8b..53c9328b70 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/FramedFactory.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/FramedFactory.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,23 +15,23 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - -import javax.swing.JLabel; + +import javax.swing.JLabel; import javax.swing.border.Border; import javax.swing.BorderFactory; import javax.swing.JButton; /** - * This Concrete Factory implements the - * ComponentFactory interface to provide + * This Concrete Factory implements the + * ComponentFactory interface to provide * framed Swing GUI components. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/20/04 @@ -41,43 +41,43 @@ public class FramedFactory implements ComponentFactory { /** - * Factory method to create framed JLabel objects. + * Factory method to create framed JLabel objects. * * @return the framed JLabel */ - + public JLabel createLabel() { JLabel label = new JLabel("This Label was created by " +getName()); Border raisedbevel = BorderFactory.createRaisedBevelBorder(); Border loweredbevel = BorderFactory.createLoweredBevelBorder(); label.setBorder(BorderFactory.createCompoundBorder(raisedbevel, loweredbevel)); - + return label; - } - + } + /** - * Factory method to create framed JButton objects. + * Factory method to create framed JButton objects. * * @param the label for the new JButton * @return the framed JButton */ - + public JButton createButton(String label) { JButton button = new JButton(label); Border raisedbevel = BorderFactory.createRaisedBevelBorder(); Border loweredbevel = BorderFactory.createLoweredBevelBorder(); button.setBorder(BorderFactory.createCompoundBorder(raisedbevel, loweredbevel)); return button; - } + } - /** + /** * Returns the name of the factory. * * @return the name of the factory */ - + public String getName() { return "Framed Factory"; - } -} \ No newline at end of file + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/Main.java index 001e36a257..cbf7841902 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code please see - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JFrame; import javax.swing.JRadioButton; import javax.swing.JButton; -import javax.swing.JPanel; +import javax.swing.JPanel; import javax.swing.ButtonGroup; import java.awt.event.WindowAdapter; @@ -36,19 +36,19 @@ /** * Implements the driver for the Abstract Factory design pattern example.

    - * - * Intent: Provide an interface for creating families of related or + * + * Intent: Provide an interface for creating families of related or * dependent objects without specifying their concrete classes.

    * * As an example scenario, our abstract factory interface defines two * factory methods createLabel() and createButton() - * that create related products (Swing GUI elements). + * that create related products (Swing GUI elements). * - * The driver is a swing GUI that allows the user to choose between the two + * The driver is a swing GUI that allows the user to choose between the two * concrete factories RegularFactory and FramedFactory * , and creates a new GUI with elements from the respective factory. *

    - * + * * RegularFactory creates standard Swing GUI elements, while * FramedFactory produces elements which are framed. * @@ -63,34 +63,34 @@ * we want an existing class to become a factory (e.g. because we * want to make use of its functionality. *

  • By defining the abstract factory as an interface we cannot attach - * any (default) implementations to its methods, nor is it possible + * any (default) implementations to its methods, nor is it possible * to include fields (such as the name field in this * example. * - * + * */ -public class Main +public class Main { /** * a concrete factory that creates regular GUI components */ - + private static ComponentFactory factory1 = new RegularFactory(); - + /** * a concrete factory that creates framed GUI components */ - + private static ComponentFactory factory2 = new FramedFactory(); /** * stores the currently selected factory */ - + private static ComponentFactory factory = factory1; - - + + /** * Creates the initial GUI that allows the user to choose a factory * and generate a new GUI with the elements that the respective @@ -98,7 +98,7 @@ public class Main * * @return a JPanel containing the GUI */ - + private static JPanel createGUI() { ActionListener radioListener = new ActionListener() { @@ -107,49 +107,49 @@ public void actionPerformed(ActionEvent e) { else factory = factory2; } }; - + JPanel panel = new JPanel(); - JRadioButton factoryButton1 = new JRadioButton("use Factory 1"); + JRadioButton factoryButton1 = new JRadioButton("use Factory 1"); JRadioButton factoryButton2 = new JRadioButton("use Factory 2"); factoryButton1.setActionCommand("factory1"); - factoryButton2.setActionCommand("factory2"); + factoryButton2.setActionCommand("factory2"); factoryButton1.addActionListener(radioListener); - factoryButton2.addActionListener(radioListener); + factoryButton2.addActionListener(radioListener); JButton create = new JButton("Create GUI"); - + ButtonGroup choices = new ButtonGroup(); - + choices.add(factoryButton1); choices.add(factoryButton2); - + create.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(ActionEvent e) { Display display = new Display(factory); } }); - + panel.add(factoryButton1); panel.add(factoryButton2); panel.add(create); - + return panel; } /** * Implements the driver for this design pattern example. It sets up * the initial GUI. - */ - + */ + public static void main(String[] args) { JFrame frame = new JFrame("Abstract Factory Demo"); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} - }); - + }); + frame.getContentPane().add(createGUI()); - + frame.pack(); frame.setVisible(true); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/RegularFactory.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/RegularFactory.java index b6aa6376e9..472d7bd6e9 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/RegularFactory.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/abstractFactory/java/RegularFactory.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,20 +15,20 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code please see - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JLabel; -import javax.swing.JButton; +import javax.swing.JButton; /** - * This Concrete Factory implements the ComponentFactory + * This Concrete Factory implements the ComponentFactory * interface to provide regular Swing GUI components. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/20/04 @@ -36,35 +36,35 @@ */ public class RegularFactory implements ComponentFactory { - + /** - * Factroy method to create regular JLabel objects. + * Factroy method to create regular JLabel objects. * * @return the regular JLabel */ - + public JLabel createLabel() { return new JLabel("This Label was created by " +getName()); } - + /** - * Factory method to create regular JButton objects. + * Factory method to create regular JButton objects. * * @param the label for the new JButton * @return the regular JButton */ - + public JButton createButton(String label) { return new JButton(label); } - /** + /** * Returns the name of the factory. * * @return the name of the factory */ - + public String getName() { return ("Regular Factory"); - } - -} \ No newline at end of file + } + +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/Main.java index 3ffc6a0835..cc359fb352 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Adapter design pattern example.

    + * Implements the driver for the Adapter design pattern example.

    * * Intent: Convert the interface of a class into another interface clients * expect. Adapter lets classes work together that couldn't otherwise because @@ -31,50 +31,50 @@ * * Experimental setup: anloguous to the pattern structure as described on page * 141 of the "Design Patterns" book: - * - * Adaptee can print strings to System.out. + * + * Adaptee can print strings to System.out. * Adapter allows to access Adaptee's functionality - * via Target's interface.

    - * + * via Target's interface.

    + * * This is the AspectJ implementation.

    * * The implementation is that of an object adapter (NOT class adapter), - * as the latter requires multiple inheritance which Java does not provide. - * + * as the latter requires multiple inheritance which Java does not provide. + * * In this implementation, the Adaptee is effectively made to conform - * with the Target interface directly. Adapter is an - * aspect that ensures that by using the declare parents + * with the Target interface directly. Adapter is an + * aspect that ensures that by using the declare parents * construct (to ensure Adaptee is of type Target) and an - * inter-type declaration of the missing interface method. + * inter-type declaration of the missing interface method. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 - * + * * @see Target * @see Adaptee * @see Adapter */ -public class Main { - +public class Main { + /** - * the Adaptee in the scenario. Note that our adaptee can be used as a - * Writer because of the declare parents statement in the + * the Adaptee in the scenario. Note that our adaptee can be used as a + * Writer because of the declare parents statement in the * aspect. */ - - private static Writer adaptee; + + private static Writer adaptee; /** - * Implements the driver. - * + * Implements the driver. + * * In this implementation, the Adaptee becomes its own * Adapter, so only one variable is needed. - * + * * @param args required for a main method, but ignored */ - + public static void main(String[] args) { System.out.println("Creating Adaptee (which is its own Adapter)..."); @@ -86,4 +86,4 @@ public static void main(String[] args) { System.out.println("Issuing the request() to the Adapter..."); adaptee.write("Test successful."); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/PrinterAdapter.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/PrinterAdapter.java index 86360ec43a..1a7f611af7 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/PrinterAdapter.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/PrinterAdapter.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * Adapts SystemOutPrinter to match the Writer - * interface. + * interface. * * @author Jan Hannemann * @author Gregor Kiczales @@ -33,30 +33,30 @@ * @see Target * @see Adaptee */ - -public aspect PrinterAdapter { - + +public aspect PrinterAdapter { + /** * Ensures that SystemOutPrinter implements Writer - * . This means that the Adaptee effectively becomes its - * own Adapter. + * . This means that the Adaptee effectively becomes its + * own Adapter. */ - + declare parents: SystemOutPrinter implements Writer; - + /** * Defines a write(String) method on Adaptee * to ensure compliance with the Writer interface. - * + * * On the pattern level, this means that Adaptee now implements - * request(). + * request(). * * @param s the string to print * @see Writer#write(String) * @see SystemOutPrinter#printToSystemOut(String) */ - + public void SystemOutPrinter.write(String s) { printToSystemOut(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/SystemOutPrinter.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/SystemOutPrinter.java index abe34d6e80..c244311692 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/SystemOutPrinter.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/SystemOutPrinter.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,44 +15,44 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Provides a specialized print method. Acts as the Adaptee in the + * Provides a specialized print method. Acts as the Adaptee in the * pattern context. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 */ - + /** - * Provides a specialized print method. Acts as the Adaptee in the + * Provides a specialized print method. Acts as the Adaptee in the * pattern context. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 */ - + public class SystemOutPrinter { /** * Prints the argument string to System.out. In the pattern - * context, this is the specificRequest() method on + * context, this is the specificRequest() method on * the Adaptee. * * @param s the string to be printed * @see Writer#write(String) the adapted method */ - + public void printToSystemOut(String s) { System.out.println(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/Writer.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/Writer.java index bd1ad3f4b6..bc7a196412 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/Writer.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/aspectj/Writer.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -42,4 +42,4 @@ public interface Writer { */ public void write(String s); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/Main.java index b7e01fd30c..80548eb884 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -89,4 +89,4 @@ public static void main(String[] args) { myTarget.write("Test successful."); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/PrinterAdapter.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/PrinterAdapter.java index bcc5196fdd..6e1c62c551 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/PrinterAdapter.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/PrinterAdapter.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -70,4 +70,4 @@ public PrinterAdapter(SystemOutPrinter adaptee) { public void write(String s) { adaptee.printToSystemOut(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/SystemOutPrinter.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/SystemOutPrinter.java index 023ab46db1..8323abea38 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/SystemOutPrinter.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/SystemOutPrinter.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,35 +15,35 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Provides a specialized print method. Acts as the Adaptee in the + * Provides a specialized print method. Acts as the Adaptee in the * pattern context. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 */ - + public class SystemOutPrinter { /** * Prints the argument string to System.out. In the pattern - * context, this is the specificRequest() method on + * context, this is the specificRequest() method on * the Adaptee. * * @param s the string to be printed * @see Writer#write(String) the adapted method */ - + public void printToSystemOut(String s) { System.out.println(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/Writer.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/Writer.java index 63f0e09787..af4e1de4f5 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/Writer.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/adapter/java/Writer.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,31 +15,31 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Declares the target interface with a general output method. Acts as the + * Declares the target interface with a general output method. Acts as the * Target in the pattern context. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 */ - + public interface Writer { - + /** * Prints the argument string. In the pattern context, this is the - * request() method on the Target. + * request() method on the Target. * * @param s the string to print - * @see PrinterAdapter + * @see PrinterAdapter */ - + public void write(String s); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/AbstractionImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/AbstractionImplementation.java index 35f47ca168..a54047eacb 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/AbstractionImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/AbstractionImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -34,33 +34,33 @@ * */ -public aspect AbstractionImplementation { +public aspect AbstractionImplementation { /** - * stores the actual Implementor to use + * stores the actual Implementor to use */ - private ScreenImplementation Screen.implementor; - + private ScreenImplementation Screen.implementor; + /** - * Draws or prints a text to an output device determined by the + * Draws or prints a text to an output device determined by the * current Implementor. * * @param text The text to be drawn/printed */ - + public void Screen.drawText(String text) { implementor.printText(text); implementor.printLine(); } - + /** - * Draws or prints a text in a box to an output device determined + * Draws or prints a text in a box to an output device determined * by the current Implementor. * * @param text The text to be drawn/printed */ - + public void Screen.drawTextBox(String text) { int length = text.length(); @@ -74,23 +74,22 @@ implementor.printText(" "+text+" "); implementor.printDecor(); implementor.printLine(); - + for(int i=0; iImplementor. * * @param implementor The new implementor */ - + public void Screen.setImplementor(ScreenImplementation implementor) { this.implementor = implementor; } } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/CrossCapitalImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/CrossCapitalImplementation.java index 99088ed254..3fb9eba8b6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/CrossCapitalImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/CrossCapitalImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -/** - * Prints capitalized text and uses the double cross ("#") to decorate. - * Represents a ConcreteImplementation in the context of the Bridge +/** + * Prints capitalized text and uses the double cross ("#") to decorate. + * Represents a ConcreteImplementation in the context of the Bridge * design pattern. * * @author Jan Hannemann @@ -32,10 +32,10 @@ * @version 1.1, 01/26/04 * */ - + public class CrossCapitalImplementation implements ScreenImplementation { - + /** * Does a line feed (to System.out). */ @@ -43,21 +43,21 @@ public class CrossCapitalImplementation implements ScreenImplementation { public void printLine() { System.out.println(); } - - /** + + /** * Prints a double cross ("#") to System.out. */ - + public void printDecor() { System.out.print("X"); } - + /** * Prints the argument text in capitals to System.out. * * @param text the text to print */ - + public void printText(String text) { System.out.print(text.toUpperCase()); } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/GreetingScreen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/GreetingScreen.java index 4fb5fbc4a3..dd2ef57634 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/GreetingScreen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/GreetingScreen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,14 +15,14 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -/** +/** * Prints/draws a greeting in a text box. Represents a RefinedAbstraction * in the context of the Bridge design pattern. * @@ -31,20 +31,20 @@ * @version 1.1, 01/26/04 * */ - + public class GreetingScreen implements Screen { - - /** + + /** * Creates a new GreetingScreen object with the provided * Implementor. * * @param si the implementor to use - */ + */ public GreetingScreen(ScreenImplementation si) { setImplementor(si); } - + /** * Draws/prints a greeting in a text box */ @@ -53,5 +53,3 @@ public void drawGreeting() { drawTextBox("Greetings!"); } } - - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/InformationScreen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/InformationScreen.java index 3a4eed2809..2c39dde013 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/InformationScreen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/InformationScreen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -/** - * Prints/draws the current system time in a text box. Represents a +/** + * Prints/draws the current system time in a text box. Represents a * RefinedAbstraction in the context of the Bridge design pattern. * * @author Jan Hannemann @@ -31,31 +31,30 @@ * @version 1.1, 01/26/04 * */ - -import java.util.Date; -public class InformationScreen implements Screen { - - - /** +import java.util.Date; + +public class InformationScreen implements Screen { + + + /** * Creates a new InformationScreen object with the provided * Implementor. * * @param si the implementor to use - */ + */ public InformationScreen(ScreenImplementation si) { setImplementor(si); } - + /** * Draws/prints the system time in a text box */ - public void drawInfo() { + public void drawInfo() { Date date = new Date(); drawTextBox("Current system time: "+date); } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/Main.java index 3c4a97e263..68f70df142 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,34 +15,34 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Bridge design pattern example.

    + * Implements the driver for the Bridge design pattern example.

    * - * Intent: Decouple an abstraction from its implementation so that the + * Intent: Decouple an abstraction from its implementation so that the * two can vary independently.

    * * Scenario: Have seperate hierarchies for Abstractions (here: Screens) - * and Implementors (here: ScreenImplementation), so that both - * can change independently of each other + * and Implementors (here: ScreenImplementation), so that both + * can change independently of each other * * Participants:

      * - *
    • Screen - Abstraction that defines - * an interface for printing text and boxedText to stdout. + *
    • Screen - Abstraction that defines + * an interface for printing text and boxedText to stdout. *
    • GreetingScreen - RefinedAbstraction that prints * a boxed greeting message *
    • InformationScreen - RefinedAbstraction that prints * the system time (boxed) - *
    • ScreenImplementation - Implementor interface, + *
    • ScreenImplementation - Implementor interface, * defines basic operations to output formatted strings - *
    • StarImplementation - ConcreteImplementation that + *
    • StarImplementation - ConcreteImplementation that * creates textBoxes of stars *
    • CrossCapitalImplementation - ConcreteImplementation * that creates textBoxes of double crosses (hashes) and prints all @@ -52,7 +52,7 @@ *

    * * This is the AspectJ implementation.

    - * + * * The implementations for methods on the Abstraction are declared * in the AbstractImplementation aspect. * @@ -68,8 +68,8 @@ * @see CrossCapitalImplementation * @see AbstractionImplementation */ - - + + public class Main { /** @@ -78,33 +78,33 @@ public class Main { * * @param args required by Java, but ignored */ - - public static void main(String[] args) { - + + public static void main(String[] args) { + System.out.println("Creating implementations..."); - + ScreenImplementation i1 = new StarImplementation(); ScreenImplementation i2 = new CrossCapitalImplementation(); - + System.out.println("Creating abstraction (screens) / implementation combinations..."); - + GreetingScreen gs1 = new GreetingScreen(i1); GreetingScreen gs2 = new GreetingScreen(i2); InformationScreen is1 = new InformationScreen(i1); - InformationScreen is2 = new InformationScreen(i2); - + InformationScreen is2 = new InformationScreen(i2); + System.out.println("Starting test:\n"); - + gs1.drawText("\nScreen 1 (Refined Abstraction 1, Implementation 1):"); gs1.drawGreeting(); - + gs2.drawText("\nScreen 2 (Refined Abstraction 1, Implementation 2):"); gs2.drawGreeting(); - + is1.drawText("\nScreen 3 (Refined Abstraction 2, Implementation 1):"); is1.drawInfo(); is2.drawText("\nScreen 4 (Refined Abstraction 2, Implementation 2):"); is2.drawInfo(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/Screen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/Screen.java index 67f0a34ff5..79e8e43a8d 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/Screen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/Screen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ @@ -36,23 +36,22 @@ */ public interface Screen { - + /** - * Draws or prints a text to an output device determined by the + * Draws or prints a text to an output device determined by the * current Implementor. * * @param text The text to be drawn/printed */ - + public void drawText(String text); - + /** - * Draws or prints a text in a box to an output device determined + * Draws or prints a text in a box to an output device determined * by the current Implementor. * * @param text The text to be drawn/printed */ - + public void drawTextBox(String text); } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/ScreenImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/ScreenImplementation.java index 050912c6fb..76ea88203f 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/ScreenImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/ScreenImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -/** - * Prints lines, decorators and text. Represents a +/** + * Prints lines, decorators and text. Represents a * Implementor in the context of the Bridge design pattern. * * @author Jan Hannemann @@ -33,24 +33,24 @@ */ public interface ScreenImplementation { - + /** * Prints a line feed. */ void printLine(); - - /** + + /** * Prints a decorator symbol (a string of length 1). */ - + void printDecor(); - + /** * Prints the argument text. * * @param text the text to print */ - - void printText(String text); + + void printText(String text); } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/StarImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/StarImplementation.java index eddcdebee3..9b74dd4559 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/StarImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/aspectj/StarImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -/** - * Prints regular text and uses the star ("*") to decorate. Represents a +/** + * Prints regular text and uses the star ("*") to decorate. Represents a * ConcreteImplementation in the context of the Bridge design pattern. * * @author Jan Hannemann @@ -31,9 +31,9 @@ * @version 1.1, 01/26/04 * */ - + public class StarImplementation implements ScreenImplementation { - + /** * Does a line feed (to System.out). */ @@ -41,21 +41,21 @@ public class StarImplementation implements ScreenImplementation { public void printLine() { System.out.println(); } - - /** + + /** * Prints a star ("*") to System.out. */ - + public void printDecor() { System.out.print("*"); } - + /** * Prints the argument text to System.out. * * @param text the text to print */ - + public void printText(String text) { System.out.print(text); } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/CrossCapitalImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/CrossCapitalImplementation.java index 32456bda8d..18ae61e736 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/CrossCapitalImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/CrossCapitalImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -/** - * Prints capitalized text and uses double crosses ("#") to decorate. - * Represents a ConcreteImplementation in the context of the Bridge +/** + * Prints capitalized text and uses double crosses ("#") to decorate. + * Represents a ConcreteImplementation in the context of the Bridge * design pattern. * * @author Jan Hannemann @@ -32,10 +32,10 @@ * @version 1.1, 01/26/04 * */ - + public class CrossCapitalImplementation implements ScreenImplementation { - + /** * Does a line feed (to System.out). */ @@ -43,21 +43,21 @@ public class CrossCapitalImplementation implements ScreenImplementation { public void printLine() { System.out.println(); } - - /** + + /** * Prints a double cross ("#") to System.out. */ - + public void printDecor() { System.out.print("X"); } - + /** * Prints the argument text in capitals to System.out. * * @param text the text to print */ - + public void printText(String text) { System.out.print(text.toUpperCase()); } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/GreetingScreen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/GreetingScreen.java index 5ce3507a23..98ef502116 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/GreetingScreen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/GreetingScreen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -53,5 +53,3 @@ public void drawGreeting() { drawTextBox("Greetings!"); } } - - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/InformationScreen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/InformationScreen.java index a15b6f562b..c1692ff060 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/InformationScreen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/InformationScreen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -/** - * Prints/draws the current system time in a text box. Represents a +/** + * Prints/draws the current system time in a text box. Represents a * RefinedAbstraction in the context of the Bridge design pattern. * * @author Jan Hannemann @@ -32,31 +32,30 @@ * @version 1.1, 01/26/04 * */ - -import java.util.Date; -public class InformationScreen extends Screen { - - - /** +import java.util.Date; + +public class InformationScreen extends Screen { + + + /** * Creates a new InformationScreen object with the provided * Implementor. * * @param si the implementor to use - */ + */ public InformationScreen(ScreenImplementation si) { super(si); } - + /** * Draws/prints the system time in a text box */ - public void drawInfo() { + public void drawInfo() { Date date = new Date(); drawTextBox("Current system time: "+date); } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/Main.java index a058cffb76..033b3aaf7b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,34 +15,34 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Bridge design pattern example.

    + * Implements the driver for the Bridge design pattern example.

    * - * Intent: Decouple an abstraction from its implementation so that the + * Intent: Decouple an abstraction from its implementation so that the * two can vary independently.

    * * Scenario: Have seperate hierarchies for Abstractions (here: Screens) - * and Implementors (here: ScreenImplementation), so that both - * can change independently of each other + * and Implementors (here: ScreenImplementation), so that both + * can change independently of each other * * Participants:

      * - *
    • Screen - Abstraction that defines - * an interface for printing text and boxedText to System.out. + *
    • Screen - Abstraction that defines + * an interface for printing text and boxedText to System.out. *
    • GreetingScreen - RefinedAbstraction that prints * a boxed greeting message *
    • InformationScreen - RefinedAbstraction that prints * the system time (boxed) - *
    • ScreenImplementation - Implementor interface, + *
    • ScreenImplementation - Implementor interface, * defines basic operations to output formatted strings - *
    • StarImplementation - ConcreteImplementation that + *
    • StarImplementation - ConcreteImplementation that * creates textBoxes of stars *
    • CrossCapitalImplementation - ConcreteImplementation * that creates textBoxes of double crosses (hashes) and prints all @@ -52,8 +52,8 @@ * This is the Java implementation.

      * * Note that Abstraction cannot be an interface in Java, as we need to - * specify how operation() is performed using the interface of - * Implementor. As Abstraction is not necessarily a defining + * specify how operation() is performed using the interface of + * Implementor. As Abstraction is not necessarily a defining * role, this is a limitation. With multiple inheritance, this would not be * the case. * @@ -68,8 +68,8 @@ * @see StarImplementation * @see CrossCapitalImplementation */ - - + + public class Main { /** @@ -78,33 +78,33 @@ public class Main { * * @param args required by Java, but ignored */ - - public static void main(String[] args) { - + + public static void main(String[] args) { + System.out.println("Creating implementations..."); - + ScreenImplementation i1 = new StarImplementation(); ScreenImplementation i2 = new CrossCapitalImplementation(); - + System.out.println("Creating abstraction (screens) / implementation combinations..."); - + GreetingScreen gs1 = new GreetingScreen(i1); GreetingScreen gs2 = new GreetingScreen(i2); InformationScreen is1 = new InformationScreen(i1); - InformationScreen is2 = new InformationScreen(i2); - + InformationScreen is2 = new InformationScreen(i2); + System.out.println("Starting test:\n"); - + gs1.drawText("\nScreen 1 (Refined Abstraction 1, Implementation 1):"); gs1.drawGreeting(); - + gs2.drawText("\nScreen 2 (Refined Abstraction 1, Implementation 2):"); gs2.drawGreeting(); - + is1.drawText("\nScreen 3 (Refined Abstraction 2, Implementation 1):"); is1.drawInfo(); is2.drawText("\nScreen 4 (Refined Abstraction 2, Implementation 2):"); is2.drawInfo(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/Screen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/Screen.java index 5fbed961d2..1f7b5ac63e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/Screen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/bridge/java/Screen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ @@ -28,11 +28,11 @@ * provides two methods to draw/print: drawText(String) and * drawTextBox(String). Both methods call appropriate methods * on the ScreenImplementor of this Screen object. - * - * Note that cannot be an interface, since it has implementation - * associated with it (otherwise it would require multiple inheritance). - * This restricts the flexibility of the patter somewhat as all - * RefinedAbstractions consequently can not have additional + * + * Note that cannot be an interface, since it has implementation + * associated with it (otherwise it would require multiple inheritance). + * This restricts the flexibility of the patter somewhat as all + * RefinedAbstractions consequently can not have additional * superclasses. * * @author Jan Hannemann @@ -42,43 +42,43 @@ */ public abstract class Screen { - + /** - * stores the actual Implementor to use + * stores the actual Implementor to use */ - private ScreenImplementation implementor; - + private ScreenImplementation implementor; + /** * Creates a new Screen object given an Implementor * - * @param implementor the implementor to use for calls to + * @param implementor the implementor to use for calls to * operationImpl() */ - + public Screen(ScreenImplementation implementor) { this.implementor = implementor; } - + /** - * Draws or prints a text to an output device determined by the + * Draws or prints a text to an output device determined by the * current Implementor. * * @param text The text to be drawn/printed */ - + public void drawText(String text) { implementor.printText(text); implementor.printLine(); } - + /** - * Draws or prints a text in a box to an output device determined + * Draws or prints a text in a box to an output device determined * by the current Implementor. * * @param text The text to be drawn/printed */ - + public void drawTextBox(String text) { int length = text.length(); @@ -92,12 +92,11 @@ public void drawTextBox(String text) { implementor.printText(" "+text+" "); implementor.printDecor(); implementor.printLine(); - + for(int i=0; iBuilders. + * Defines the interface for Builders. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 - * + * * @see TextBuilder * @see StructureBuilder */ public interface Creator { - - /** + + /** * Defines the buildPart() operation for type parts. * * @param type the type to process - */ + */ public abstract void processType(String type); - /** + /** * Defines the buildPart() operation for attribute parts. * * @param type the type to process - */ + */ public abstract void processAttribute(String type); - /** + /** * Defines the buildPart() operation for value parts. * * @param type the type to process - */ + */ + + public abstract void processValue(String type); - public abstract void processValue(String type); - - /** + /** * Defines the getResult() operation for Builders. * * @param type the type to process - */ + */ public String getRepresentation(); } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/CreatorImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/CreatorImplementation.java index 6a2a2638ff..c1631e2e3e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/CreatorImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/CreatorImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -28,7 +28,7 @@ * without losing the possibility to declare default implementations and even * variables. * - * This also illiustrates the tradeoffs: The current version of AspectJ + * This also illiustrates the tradeoffs: The current version of AspectJ * (1.0.4) does not allow protected introduction. To achieve the same result * as in the OO case, the result variable has to be introduced as public * (to be inherited). To make sure that no other classes can access that @@ -38,22 +38,22 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 - * + * * @see Builder * @see TextBuilder * @see StructureBuilder */ public aspect CreatorImplementation { - + /** * Declares the result variable on the Creator interface. */ - + public String Creator.representation; /** - * Declares the getResult() method with a default implementation + * Declares the getResult() method with a default implementation * to the Creator interface. * * @returns the representation string for the builder. @@ -62,15 +62,15 @@ public String Creator.getRepresentation() { return representation; } - + /** - * Declares a compiler error that gets reported if other classes + * Declares a compiler error that gets reported if other classes * (except Creators or this aspect) try to access the result variable. */ - - declare error: (set(public String Creator+.representation) - || get(public String Creator+.representation)) - && ! (within(Creator+) - || within(CreatorImplementation)): + + declare error: (set(public String Creator+.representation) + || get(public String Creator+.representation)) + && ! (within(Creator+) + || within(CreatorImplementation)): "variable result is aspect protected. Use getResult() to access it"; } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/Main.java index e3101e89ed..3b9c326dac 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,21 +15,21 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Builder design pattern example.

      + * Implements the driver for the Builder design pattern example.

      * - * Intent: Separate the construction of a complex object from its - * representation so that the same construction process can create different + * Intent: Separate the construction of a complex object from its + * representation so that the same construction process can create different * representations

      * - * Participating objects are TextCreator and + * Participating objects are TextCreator and * XMLCreator as Builders that implement the * Creator interface.

      * @@ -38,17 +38,17 @@ * person. TextCreator creates a text-like representation, * XMLCreator an XML-like one. * - *

      This is the AspectJ version.

      + *

      This is the AspectJ version.

      * * The abstract class is now replaced by an interface. A concrete aspect - * declares the instance variable and default method implementations. - * This frees the participants (ConcreteBuilders) to be + * declares the instance variable and default method implementations. + * This frees the participants (ConcreteBuilders) to be * subclasses of something else. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 - * + * * @see Builder * @see TextCreator * @see XMLCreator @@ -56,7 +56,7 @@ public class Main { - /** + /** * Builds a string representation of a person using a given builder. * * @param the builder to use. @@ -69,29 +69,29 @@ protected static void build(Creator builder) { builder.processAttribute("Age"); builder.processValue("33"); builder.processAttribute("Occupation"); - builder.processValue("Builder"); + builder.processValue("Builder"); } /** - * Implements the driver for the Builder design pattern example.

      + * Implements the driver for the Builder design pattern example.

      * * In this example, Main acts as the Director that * uses two different builders to build string representations of a * person. TextCreator creates a text-like representation, * XMLCreator an XML-like one. - * + * * @param args the command-line parameters, unused. */ public static void main(String[] args) { - + Creator builder1 = new TextCreator(); Creator builder2 = new XMLCreator(); - + build(builder1); build(builder2); - + System.out.println(builder1.getRepresentation()); System.out.println(builder2.getRepresentation()); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/TextCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/TextCreator.java index 43307c0211..5ca3edcc37 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/TextCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/TextCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -34,33 +34,33 @@ public class TextCreator implements Creator { - /** + /** * Defines a buildPart() operation for type parts. * * @param newType the type to process - */ + */ public void processType(String newType) { representation = "This is a new "+newType+":\n"; } - - /** + + /** * Defines a buildPart() operation for attribute parts. * * @param newAttribute the type to process - */ + */ public void processAttribute(String newAttribute) { representation += ("Its " + newAttribute + " is "); } - - /** + + /** * Defines a buildPart() operation for value parts. * * @param newValue the value to process - */ + */ public void processValue(String newValue) { representation += (newValue + ".\n"); } -} +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/XMLCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/XMLCreator.java index ff66a41843..1932925351 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/XMLCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/aspectj/XMLCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -30,74 +30,74 @@ * @author Gregor Kiczales * @version 1.1, 01/26/04 */ - + public class XMLCreator implements Creator { protected String type = null; protected String attribute = null; - /** + /** * Defines a buildPart() operation for type parts. * * @param newType the type to process - */ + */ public void processType(String newType) { representation = "<"+newType+">\n"; type = newType; } - - /** + + /** * Defines a buildPart() operation for attribute parts. * * @param newAttribute the attribute to process - */ + */ public void processAttribute(String newAttribute) { checkAttribute(); representation += ("\t<" + newAttribute + ">"); this.attribute = newAttribute; } - - /** + + /** * Defines a buildPart() operation for value parts. * * @param newValue the type to process - */ + */ public void processValue(String newValue) { representation += newValue; - } - + } + /** * Checks wether the opening type tag is closed and closes it if not. */ - + protected void checkType() { if (type != null) { representation += ("\n"); type = null; } } - + /** * Checks wether the opening attribute tag is closed and closes it if not. */ - protected void checkAttribute() { + protected void checkAttribute() { if (attribute != null) { representation += ("\n"); attribute = null; } } - - /** - * Defines the getResult() operation for Builders. - */ - public String getRepresentation() { + /** + * Defines the getResult() operation for Builders. + */ + + public String getRepresentation() { checkAttribute(); checkType(); return representation; } -} +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/Creator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/Creator.java index 8285408063..3c05b19d77 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/Creator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/Creator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,65 +15,64 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Defines the interface for Builders. + * Defines the interface for Builders. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 - * + * * @see TextCreator * @see XMLCreator */ public abstract class Creator { - - /** + + /** * An inheritable variable that carries the result of the build. */ - + protected String representation; - /** + /** * Defines a buildPart() operation for type parts. * * @param type the type to process - */ + */ public abstract void processType(String type); - /** + /** * Defines a buildPart() operation for attribute parts. * * @param newAttribute the attribute to process - */ + */ public abstract void processAttribute(String newAttribute); - /** + /** * Defines a buildPart() operation for value parts. * * @param newValue the value to process - */ + */ public abstract void processValue(String newValue); - - /** + + /** * Defines a getResult() operation for Builders. * This is the default implementation. - * + * * @return a representation of the build result - */ + */ public String getRepresentation() { return representation; - } + } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/Main.java index 217eda258d..7f049f00ac 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,21 +15,21 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Builder design pattern example.

      + * Implements the driver for the Builder design pattern example.

      * - * Intent: Separate the construction of a complex object from its - * representation so that the same construction process can create different + * Intent: Separate the construction of a complex object from its + * representation so that the same construction process can create different * representations

      * - * Participating objects are TextCreator and + * Participating objects are TextCreator and * XMLCreator which act as Builders that implement the * Creator interface.

      * @@ -41,7 +41,7 @@ *

      This is the Java version.

      * * In Java, the Builder has to be an abstract class (as opposed to - * an interface) to allow to define variables or default implementations. + * an interface) to allow to define variables or default implementations. * Consequently, all ConcreteBuilders have to have that * class as their superclass, making it impossible to be part of another * class hierarchy. @@ -49,7 +49,7 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/26/04 - * + * * @see Builder * @see TextCreator * @see XMLCreator @@ -57,7 +57,7 @@ public class Main { - /** + /** * Builds a string representation of a person using a given builder. * * @param builder the builder to use. @@ -70,30 +70,30 @@ protected static void build(Creator builder) { builder.processAttribute("Age"); builder.processValue("33"); builder.processAttribute("Occupation"); - builder.processValue("Builder"); + builder.processValue("Builder"); } /** - * Implements the driver for the Builder design pattern example.

      + * Implements the driver for the Builder design pattern example.

      * * In this example, Main acts as the Director that * uses two different builders to build string representations of a * person. TextCreator creates a text-like representation, * XMLCreator an XML-like one. - * + * * @param args the command-line parameters, unused. * */ public static void main(String[] args) { - + Creator builder1 = new TextCreator(); Creator builder2 = new XMLCreator(); - + build(builder1); build(builder2); - + System.out.println(builder1.getRepresentation()); System.out.println(builder2.getRepresentation()); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/TextCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/TextCreator.java index 3971441080..cdd795bb94 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/TextCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/TextCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -34,33 +34,33 @@ public class TextCreator extends Creator { - /** + /** * Defines a buildPart() operation for type parts. * * @param newType the type to process - */ + */ public void processType(String newType) { representation = "This is a new "+newType+":\n"; } - - /** + + /** * Defines a buildPart() operation for attribute parts. * * @param newAttribute the attribute to process - */ + */ public void processAttribute(String newAttribute) { representation += ("Its " + newAttribute + " is "); } - - /** + + /** * Defines a buildPart() operation for value parts. * * @param newValue the value to process - */ + */ public void processValue(String newValue) { representation += (newValue + ".\n"); } -} +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/XMLCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/XMLCreator.java index 8c678ea9c3..eb8f9132db 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/XMLCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/builder/java/XMLCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Button.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Button.java index ba0aa96f66..71fb784e3c 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Button.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Button.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,34 +15,34 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.*; import java.awt.event.*; -/** +/** * A simple GUI button that implements its own ActionListener. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/27/04 - * - */ - -public class Button extends JButton { + * + */ - /** +public class Button extends JButton { + + /** * Creates a Button widget. An ActionListener is also added that calls * the doClick(Click) method when the button is pressed * - * @param label the button label - */ - + * @param label the button label + */ + public Button(String label) { super(label); this.addActionListener( new ActionListener() { @@ -50,16 +50,16 @@ public void actionPerformed(ActionEvent ae) { doClick(new Click(ae)); } }); - } + } - - /** + + /** * An empty method that is called when the button is clicked. This method * could also be defined in the concrete aspect. * - * @param click the Click that was created when the - * button was clicked. - */ - + * @param click the Click that was created when the + * button was clicked. + */ + public void doClick(Click click) {} -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Click.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Click.java index fc524c0eb5..640cf247e8 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Click.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Click.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,20 +15,20 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import java.awt.event.ActionEvent; -/** +/** * Represents the Request in the Chain of Responsibility * pattern, which is a button click in this case. Provides methods for * accessing key masks associated with the click (to find out whether - * the SHIFT, ALT, or CTRL keys were pressed during the click). + * the SHIFT, ALT, or CTRL keys were pressed during the click). * * @author Jan Hannemann * @author Gregor Kiczales @@ -36,58 +36,56 @@ * */ -public class Click { - +public class Click { + /** * the ActionEvent that describes this Click */ protected ActionEvent description; - /** + /** * Creates a Click described by the provided - * ActionEvent. + * ActionEvent. * * @param description the ActionEvent that describes this Click - */ - + */ + public Click(ActionEvent description) { - this.description = description; - } - - /** + this.description = description; + } + + /** * Convenience method for inquiring whether SHIFT was pressed while - * the click occured. - * + * the click occured. + * * @return whether the SHIFT key was pressed when the click occured - */ - + */ + public boolean hasShiftMask() { return ((description.getModifiers() & ActionEvent.SHIFT_MASK) != 0 ); } - /** + /** * Convenience method for inquiring whether ALT was pressed while - * the click occured. - * + * the click occured. + * * @return whether the ALT key was pressed when the click occured - */ - + */ + public boolean hasAltMask() { return ((description.getModifiers() & ActionEvent.ALT_MASK) != 0 ); } - /** + /** * Convenience method for inquiring whether CTRL was pressed while - * the click occured. - * + * the click occured. + * * @return whether the CTRL key was pressed when the click occured - */ - + */ + public boolean hasCtrlMask() { return ((description.getModifiers() & ActionEvent.CTRL_MASK) != 0 ); } } - - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/ClickChain.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/ClickChain.java index 96223074c1..e29def195b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/ClickChain.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/ClickChain.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,23 +15,23 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - -import java.awt.event.ActionEvent; + +import java.awt.event.ActionEvent; import ca.ubc.cs.spl.aspectPatterns.patternLibrary.ChainOfResponsibilityProtocol; /** * Implements an instance of the abstracted ChainOfResponsibility design - * pattern. Here, the a click on the button triggers an event (request) - * that gets passed along the widget hierarchy (button -> panel -> frame). - * - * In this implementation, the request is handled by the panel if the - * CTRL mask is active (i.e., if the CTRL key was pressed while the button + * pattern. Here, the a click on the button triggers an event (request) + * that gets passed along the widget hierarchy (button -> panel -> frame). + * + * In this implementation, the request is handled by the panel if the + * CTRL mask is active (i.e., if the CTRL key was pressed while the button * was clicked). If the SHIFT mask is active, the frame handles the request. * Otherwise, the request is unhandled. * @@ -40,7 +40,7 @@ * @version 1.1, 01/27/04 * */ - + public aspect ClickChain extends ChainOfResponsibilityProtocol { /** @@ -49,52 +49,52 @@ declare parents: Frame implements Handler; declare parents: Panel implements Handler; - declare parents: Button implements Handler; + declare parents: Button implements Handler; - declare parents: Click implements Request; - - - protected pointcut eventTrigger(Handler handler, Request request): + declare parents: Click implements Request; + + + protected pointcut eventTrigger(Handler handler, Request request): call(void Button.doClick(Click)) && target(handler) && args(request); - + public boolean Button.acceptRequest(Request request) { System.out.println("Button is asked to accept the request..."); if (request instanceof Click) { Click click = (Click) request; return (click.hasShiftMask()); - } + } return false; - } - + } + public void Button.handleRequest(Request request) { System.out.println("Button is handling the event.\n"); } - - - public boolean Panel.acceptRequest(Request request) { + + + public boolean Panel.acceptRequest(Request request) { System.out.println("Panel is asked to accept the request..."); if (request instanceof Click) { Click click = (Click) request; return (click.hasCtrlMask()); - } + } return false; - } - + } + public void Panel.handleRequest(Request event) { System.out.println("Panel is handling the event.\n"); } - public boolean Frame.acceptRequest(Request request) { + public boolean Frame.acceptRequest(Request request) { System.out.println("Frame is asked to accept the request..."); if (request instanceof Click) { Click click = (Click) request; return (click.hasAltMask()); - } + } return false; - } - + } + public void Frame.handleRequest(Request event) { System.out.println("Frame is handling the event.\n"); } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Frame.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Frame.java index c91e12c4a3..b6c8cb52c7 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Frame.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Frame.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -56,6 +56,3 @@ public void windowClosing(WindowEvent e) { }); } } - - - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Main.java index 28add4a5f0..7ad83b7165 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,37 +15,37 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): - */ + * Contributor(s): + */ /** * Implements a GUI-motivated example for the Chain Of Rspsonsibility design - * pattern.

      + * pattern.

      * * Intent: Avoid coupling the sender of a request to its receiver by giving - * more than one object a chance to handle the request. Chain the receiving + * more than one object a chance to handle the request. Chain the receiving * objects and pass the request along the chain until an object handles it. *

      * - * Participatng objects are a Frame, a Panel, and + * Participatng objects are a Frame, a Panel, and * Button * * A click on the button triggers an event (request) that gets passed along * the widget hierarchy (button -> panel -> frame). * * The Handler interface defines the handleRequest() - * method for asking an object if it is willing to handle the request. + * method for asking an object if it is willing to handle the request. * * Clicking the button will start a request, that gets passed on - * along the following chain: button, panel, frame. Depending on - * whether the ALT, SHIFT, or CTRL keys are pressed during the + * along the following chain: button, panel, frame. Depending on + * whether the ALT, SHIFT, or CTRL keys are pressed during the * button click, a different object in the chain will handle the * request: - * + * *

        *
      1. If the SHIFT key is pressed, Button will handle the request *
      2. If the CTRL key is pressed, Panel will handle the request @@ -54,22 +54,22 @@ * an exception will be raised. *
      * - *

      This is the AspectJ version.

      + *

      This is the AspectJ version.

      * * In this implementation, the former ConcreteHandlers do not * contain any pattern code at all. The shared logic for forwarding requests - * is implemented once in the reusable abstract library aspect. The current + * is implemented once in the reusable abstract library aspect. The current * implementation does require some casts (as generally the case in AspectJ * solutions that employ similar approaches), due to the lack of support for * generics. - * + * * For limitations of this approach, see the ChainOfResponsibilityProtocol * library aspect. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/27/04 - * + * * @see Button * @see Panel * @see Frame @@ -78,31 +78,31 @@ */ public class Main { - + /** * Implements a GUI-motivated example for the Chain Of Responsibility design - * pattern.

      + * pattern.

      * - * In this implementation, the request is handled by the panel if the - * CTRL mask is active (i.e., if the CTRL key was pressed while the button + * In this implementation, the request is handled by the panel if the + * CTRL mask is active (i.e., if the CTRL key was pressed while the button * was clicked). If the SHIFT mask is active, the frame handles the request. - * Otherwise, the request is unhandled. + * Otherwise, the request is unhandled. * * @param args command line parameters, unused */ - + public static void main(String[] args) { Frame frame = new Frame("Chain of Responsibility pattern example"); Panel panel = new Panel(); - Button button = new Button("Click me to see the pattern in action! Use , , and during clicks to see different behavior"); - + Button button = new Button("Click me to see the pattern in action! Use , , and during clicks to see different behavior"); + ClickChain.aspectOf().setSuccessor(button, panel); - ClickChain.aspectOf().setSuccessor(panel, frame); - + ClickChain.aspectOf().setSuccessor(panel, frame); + frame.getContentPane().add(panel); panel.add(button); - + frame.pack(); - frame.setVisible(true); + frame.setVisible(true); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Panel.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Panel.java index 1e268a840f..cdc577be12 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Panel.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/aspectj/Panel.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.*; - -/** + +/** * A regular GUI JPanel with no modifications * * @author Jan Hannemann @@ -34,4 +34,3 @@ */ public class Panel extends JPanel {} - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Button.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Button.java index 5513ea367a..91868b43e2 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Button.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Button.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,18 +15,18 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.*; import java.awt.event.*; -/** - * GUI element at the start of the responsibility chain. A click on the +/** + * GUI element at the start of the responsibility chain. A click on the * button starts a request. The Button will only handle the * request if the SHIFT key was pressed when the button was clicked. * @@ -36,39 +36,39 @@ * */ -public class Button extends JButton implements ClickHandler { - +public class Button extends JButton implements ClickHandler { + /** * the successor in the chain of responsibility */ protected ClickHandler successor; - /** - * Creates a Button with a given label and successor. + /** + * Creates a Button with a given label and successor. * * @param label The button label * @param successor The successor in the chain of responsibility - */ - + */ + public Button(String label, ClickHandler successor) { super(label); - this.successor = successor; + this.successor = successor; this.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent ae) { handleClick(new Click(ae)); } }); - } - - /** + } + + /** * Implements the method to handle requests as defined by the * ClickHandler interface. The request is only handled here * if the SHIFT key was pressed. - * + * * @see ClickHandler - */ - + */ + public void handleClick(Click click) { System.out.println("Button is asked to handle the request..."); if (click.hasShiftMask()) { @@ -79,8 +79,6 @@ public void handleClick(Click click) { } else { successor.handleClick(click); } - } + } } } - - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Click.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Click.java index 334fbfac58..98f2e3e3aa 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Click.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Click.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,20 +15,20 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import java.awt.event.ActionEvent; -/** +/** * Represents the Request in the Chain of Responsibility * pattern, which is a button click in this case. Provides methods for * accessing key masks associated with the click (to find out whether - * the SHIFT, ALT, or CTRL keys were pressed during the click). + * the SHIFT, ALT, or CTRL keys were pressed during the click). * * @author Jan Hannemann * @author Gregor Kiczales @@ -36,58 +36,56 @@ * */ -public class Click { - +public class Click { + /** * the ActionEvent that describes this Click */ protected ActionEvent description; - /** + /** * Creates a Click described by the provided - * ActionEvent. + * ActionEvent. * * @param description the ActionEvent that describes this Click - */ - + */ + public Click(ActionEvent description) { - this.description = description; - } - - /** + this.description = description; + } + + /** * Convenience method for inquiring whether SHIFT was pressed while - * the click occured. - * + * the click occured. + * * @return whether the SHIFT key was pressed when the click occured - */ - + */ + public boolean hasShiftMask() { return ((description.getModifiers() & ActionEvent.SHIFT_MASK) != 0 ); } - /** + /** * Convenience method for inquiring whether ALT was pressed while - * the click occured. - * + * the click occured. + * * @return whether the ALT key was pressed when the click occured - */ - + */ + public boolean hasAltMask() { return ((description.getModifiers() & ActionEvent.ALT_MASK) != 0 ); } - /** + /** * Convenience method for inquiring whether CTRL was pressed while - * the click occured. - * + * the click occured. + * * @return whether the CTRL key was pressed when the click occured - */ - + */ + public boolean hasCtrlMask() { return ((description.getModifiers() & ActionEvent.CTRL_MASK) != 0 ); } } - - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/ClickHandler.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/ClickHandler.java index c0436fc38d..5f39f272ab 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/ClickHandler.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/ClickHandler.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - -/** + +/** * Defines the interface for letting ConcreteHandlers handle a request - * (here: a button click). + * (here: a button click). * * @author Jan Hannemann * @author Gregor Kiczales @@ -35,4 +35,3 @@ public interface ClickHandler { public void handleClick(Click click); } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Frame.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Frame.java index 10e1ac2a5b..4c7d3a0e95 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Frame.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Frame.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,23 +15,23 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.JFrame; import java.awt.event.WindowEvent; -import java.awt.event.WindowAdapter; +import java.awt.event.WindowAdapter; -/** - * Represents a regular GUI frame modified to play its role in the +/** + * Represents a regular GUI frame modified to play its role in the * Chain of Responisiblity pattern, i.e. to handle requests and/or * forward them to its successor in the chain. - * + * * Requests are only handled if the ALT key is pressed during a click. * * @author Jan Hannemann @@ -49,31 +49,31 @@ public class Frame extends JFrame implements ClickHandler { protected ClickHandler successor; - /** - * Creates a Frame with a given title that responds + /** + * Creates a Frame with a given title that responds * properly to WindowClosing events. The frame * does not have a successor and handles request that it receives. * * @param title the frame title - */ - + */ + public Frame(String title) { super(title); - + this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); - } - - /** + } + + /** * Implements the method to handle requests as defined by the * ClickHandler interface. The request is only handled here * if the ALT key was pressed. - * + * * @see ClickHandler - */ + */ public void handleClick(Click click) { System.out.println("Frame is asked to handle the request..."); @@ -85,9 +85,6 @@ public void handleClick(Click click) { } else { successor.handleClick(click); } - } + } } } - - - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Main.java index fda1db4e3c..533a1da0ae 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,39 +15,39 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): - */ + * Contributor(s): + */ /** * Implements a GUI-motivated example for the Chain Of Rspsonsibility design - * pattern.

      + * pattern.

      * * Intent: Avoid coupling the sender of a request to its receiver by giving - * more than one object a chance to handle the request. Chain the receiving + * more than one object a chance to handle the request. Chain the receiving * objects and pass the request along the chain until an object handles it. *

      * - * Participatng objects are a Frame, a Panel, and + * Participatng objects are a Frame, a Panel, and * Button * * A click on the button triggers an event (request) that gets passed along * the widget hierarchy (button -> panel -> frame). * * The Handler interface defines the handleRequest() - * method for asking an object if it is willing to handle the request. + * method for asking an object if it is willing to handle the request. * * If an object chooses not to handle a click, the event gets forwarded to - * the the object's successor. If such a successor does not exist, an - * appropriate message is shown. + * the the object's successor. If such a successor does not exist, an + * appropriate message is shown. * - *

      This is the Java version.

      + *

      This is the Java version.

      * - * In this version, it is not possible to extract the common code for - * the case that the object does not want to handle the click into the + * In this version, it is not possible to extract the common code for + * the case that the object does not want to handle the click into the * ClickHandler interface. The reason for this is that this would * turn ClickHandler into an abstract class. Since Java * does not support multiple inheritance and the individual @@ -58,7 +58,7 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 01/27/04 - * + * * @see Button * @see Panel * @see Frame @@ -66,18 +66,18 @@ */ public class Main { - + /** - * Implements the driver for the chain of responisbility example. - * It creates a simple GUI consisting of a Button in a - * Panel in a Frame. + * Implements the driver for the chain of responisbility example. + * It creates a simple GUI consisting of a Button in a + * Panel in a Frame. * * Clicking the button will start a request, that gets passed on - * along the following chain: button, panel, frame. Depending on - * whether the ALT, SHIFT, or CTRL keys are pressed during the + * along the following chain: button, panel, frame. Depending on + * whether the ALT, SHIFT, or CTRL keys are pressed during the * button click, a different object in the chain will handle the * request: - * + * *

        *
      1. If the SHIFT key is pressed, Button will handle the request *
      2. If the CTRL key is pressed, Panel will handle the request @@ -85,18 +85,18 @@ public class Main { *
      3. If no keys are pressed, the request will not be handled and * an exception will be raised. *
      - */ + */ + + public static void main(String[] args) { - public static void main(String[] args) { - Frame frame = new Frame("Chain of Responsibility"); Panel panel = new Panel(frame); - Button button = new Button("Click me to see the pattern in action! Use , , and during clicks to see different behavior", panel); - + Button button = new Button("Click me to see the pattern in action! Use , , and during clicks to see different behavior", panel); + frame.getContentPane().add(panel); panel.add(button); - + frame.pack(); frame.setVisible(true); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Panel.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Panel.java index 30ed133789..e68f11af3b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Panel.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/chainOfResponsibility/java/Panel.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.*; -/** - * Represents a regular GUI panel modified to play its role in the +/** + * Represents a regular GUI panel modified to play its role in the * Chain of Responisiblity pattern, i.e. to handle requests and/or * forward them to its successor in the chain. * @@ -37,7 +37,7 @@ * */ -public class Panel extends JPanel implements ClickHandler { +public class Panel extends JPanel implements ClickHandler { /** * the successor in the chain of responsibility @@ -45,25 +45,25 @@ public class Panel extends JPanel implements ClickHandler { protected ClickHandler successor; - /** - * Creates a Panel with a given successor. + /** + * Creates a Panel with a given successor. * * @param successor The successor in the chain of responsibility - */ - + */ + public Panel(ClickHandler successor) { super(); this.successor = successor; } - - /** + + /** * Implements the method to handle requests as defined by the * ClickHandler interface. The request is only handled here. * if the CTRL key was pressed. - * + * * @see ClickHandler - */ + */ public void handleClick(Click click) { System.out.println("Panel is asked to handle the request..."); @@ -75,7 +75,6 @@ public void handleClick(Click click) { } else { successor.handleClick(click); } - } + } } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Button.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Button.java index 4bdba09369..d13f904282 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Button.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Button.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -60,4 +60,4 @@ public void actionPerformed(ActionEvent e) { */ public void clicked() {} -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommand.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommand.java index 573bcda5e6..1f8bc730b5 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommand.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommand.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,38 +15,37 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.Command; import ca.ubc.cs.spl.aspectPatterns.patternLibrary.CommandReceiver; /** - * Implements a sample command. This one prints a short message to + * Implements a sample command. This one prints a short message to * System.out whenever it executes. The message is - * "ButtonCommand executed". + * "ButtonCommand executed". * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 */ -public class ButtonCommand implements Command { +public class ButtonCommand implements Command { private Printer printer = new Printer(); - + /** - * Implements a sample command. This one prints a short message to + * Implements a sample command. This one prints a short message to * System.out whenever it executes. The message is - * "ButtonCommand executed". - */ - + * "ButtonCommand executed". + */ + public void executeCommand(CommandReceiver receiver ) { printer.println("ButtonCommand executed"); - } + } } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommand2.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommand2.java index 393c721eb7..91b91babc3 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommand2.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommand2.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -37,4 +37,3 @@ */ public class ButtonCommand2 {} - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommanding.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommanding.java index a53f98fa99..defb593a1f 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommanding.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/ButtonCommanding.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,26 +15,26 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.CommandProtocol; import ca.ubc.cs.spl.aspectPatterns.patternLibrary.Command; import ca.ubc.cs.spl.aspectPatterns.patternLibrary.CommandInvoker; -import ca.ubc.cs.spl.aspectPatterns.patternLibrary.CommandReceiver; +import ca.ubc.cs.spl.aspectPatterns.patternLibrary.CommandReceiver; import java.io.PrintStream; /** * Sets up the Command pattern. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 - * + * * @see Button */ @@ -45,28 +45,27 @@ declare parents: ButtonCommand implements Command; // Unneccessay declare parents: ButtonCommand2 implements Command; // "Making" a class // a Command - + /** - * Implements a sample Command for the ButtonCommand2 class. - * This one prints a short message to System.out + * Implements a sample Command for the ButtonCommand2 class. + * This one prints a short message to System.out * whenever it executes. The message is - * "ButtonCommand number 2 executed". + * "ButtonCommand number 2 executed". */ - + public void ButtonCommand2.executeCommand(CommandReceiver receiver) { ((Printer) receiver).println("ButtonCommand number 2 executed"); - } + } /** * The join points after which to execute the command. - * This replaces the normally scattered myCommand.execute() calls. + * This replaces the normally scattered myCommand.execute() calls. * In this example, a call to Button.clicked() triggers * the execution of the command. * * @param invoker the object invoking the command */ - protected pointcut commandTrigger(CommandInvoker invoker): + protected pointcut commandTrigger(CommandInvoker invoker): call(void Button.clicked()) && target(invoker); } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Main.java index e3953d23da..5480495e6d 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,43 +15,43 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - -import javax.swing.JFrame; + +import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; +import java.awt.event.WindowEvent; import ca.ubc.cs.spl.aspectPatterns.patternLibrary.Command; /** - * Implements the driver for the command design pattern example.

      + * Implements the driver for the command design pattern example.

      * - * Intent: Encapsulate a request as an object, thereby letting you - * parameterize clients with different requests, queue or log requests, + * Intent: Encapsulate a request as an object, thereby letting you + * parameterize clients with different requests, queue or log requests, * and support undoable operations.

      * * Participating objects are Buttons as Invokers, - * and a ButtonCommand and ButtonCommand2 as + * and a ButtonCommand and ButtonCommand2 as * two ConcreteCommands. * - * This example creates a simple GUI with three buttons. Each button has a - * command associated with it that is executed when the button is pressed. + * This example creates a simple GUI with three buttons. Each button has a + * command associated with it that is executed when the button is pressed. * Button1 and button3 have the same command, button2 has a different one. * - *

      This is the Java version.

      + *

      This is the Java version.

      * - * This version of the pattern lets the developer specify what should trigger + * This version of the pattern lets the developer specify what should trigger * a call to executeCommand(), without changing the Invoker * code. * - * Neither Commands nor Invoker have to know of their - * involvement in the pattern and can actually act as both. + * Neither Commands nor Invoker have to know of their + * involvement in the pattern and can actually act as both. * ButtonCommanding2 is an example of a Command that * is unaware of its role. In such cases, the concrete pattern instance * aspect assigns the role and defines the Command's behavior. @@ -59,46 +59,46 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 - * + * * @see Button * @see ButtonCommand * @see Buttoncommand2 */ public class Main extends JFrame { - + /** - * This example creates a simple GUI with three buttons. Each - * button has a Command associated with it that is executed when - * the button is pressed. Button1 and button3 have the same command, + * This example creates a simple GUI with three buttons. Each + * button has a Command associated with it that is executed when + * the button is pressed. Button1 and button3 have the same command, * button2 has a different one. */ public static void main(String[] args) { Button button1 = new Button("Button1"); Button button2 = new Button("Button2"); - Button button3 = new Button("Button3"); - + Button button3 = new Button("Button3"); + Command com1 = new ButtonCommand(); Command com2 = new ButtonCommand2(); - + JPanel pane = new JPanel(); - pane.add(button1); + pane.add(button1); ButtonCommanding.aspectOf().setCommand(button1, com1); - + pane.add(button2); ButtonCommanding.aspectOf().setCommand(button2, com2); ButtonCommanding.aspectOf().setReceiver(com2, new Printer()); - + pane.add(button3); ButtonCommanding.aspectOf().setCommand(button3, com1); - - JFrame frame = new JFrame("Command Pattern Example"); - + + JFrame frame = new JFrame("Command Pattern Example"); + frame.getContentPane().add(pane); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} - }); + }); frame.pack(); frame.setVisible(true); } } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Printer.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Printer.java index edc7d9d39e..017142d627 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Printer.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/aspectj/Printer.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Button.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Button.java index 3e5784fcda..02de439ceb 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Button.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Button.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,19 +15,19 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; /** - * Implements a simple extension of JButton that supplies its own + * Implements a simple extension of JButton that supplies its own * ActionListener and calls its own clicked() method * whenever the button is pressed. This method calls the * executeCommand() method on the button's associated Command @@ -44,9 +44,9 @@ public class Button extends JButton { /** * the command object associated with this button */ - + protected Command command; - + /** * Creates a new button with the provided label * @@ -58,23 +58,23 @@ public Button(String label) { this.setActionCommand(label); this.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - clicked(); + clicked(); } - }); + }); } /** - * Calls ececuteCommand() on the associated - * command object. This method gets called whenever the + * Calls ececuteCommand() on the associated + * command object. This method gets called whenever the * button is pressed. */ - + public void clicked() { if (command != null) { command.executeCommand(); } } - + /** * Sets the associated command object for this button * @@ -83,5 +83,5 @@ public void clicked() { public void setCommand(Command command) { this.command = command; - } -} \ No newline at end of file + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/ButtonCommand.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/ButtonCommand.java index 9d0bb69d12..962d9648b6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/ButtonCommand.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/ButtonCommand.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a sample command. This one prints a short message to + * Implements a sample command. This one prints a short message to * System.out whenever it executes. The message is - * "ButtonCommand executed". + * "ButtonCommand executed". * * @author Jan Hannemann * @author Gregor Kiczales @@ -33,14 +33,13 @@ */ public class ButtonCommand implements Command { - + /** - * Implements a sample command. This one prints a short message to + * Implements a sample command. This one prints a short message to * System.out whenever it executes. The message is - * "ButtonCommand executed". + * "ButtonCommand executed". */ public void executeCommand() { System.out.println("ButtonCommand executed"); - } + } } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/ButtonCommand2.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/ButtonCommand2.java index 3844bda1a7..1d63824dbd 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/ButtonCommand2.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/ButtonCommand2.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,33 +15,32 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a sample command. This one prints a short message to + * Implements a sample command. This one prints a short message to * System.out whenever it executes. The message is - * "ButtonCommand number 2 executed". + * "ButtonCommand number 2 executed". * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 */ - + public class ButtonCommand2 implements Command { /** - * Implements a sample command. This one prints a short message to + * Implements a sample command. This one prints a short message to * System.out whenever it executes. The message is - * "ButtonCommand number 2 executed". + * "ButtonCommand number 2 executed". */ - + public void executeCommand() { System.out.println("ButtonCommand number 2 executed"); - } + } } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Command.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Command.java index d441f43ab6..2bd85052fd 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Command.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Command.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Main.java index 3a81bda07a..a1c922e510 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/command/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,41 +15,41 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - -import javax.swing.JFrame; + +import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; /** - * Implements the driver for the command design pattern example.

      + * Implements the driver for the command design pattern example.

      * - * Intent: Encapsulate a request as an object, thereby letting you - * parameterize clients with different requests, queue or log requests, + * Intent: Encapsulate a request as an object, thereby letting you + * parameterize clients with different requests, queue or log requests, * and support undoable operations.

      * * Participating objects are Buttons as Invokers, - * and a ButtonCommand and ButtonCommand2 as + * and a ButtonCommand and ButtonCommand2 as * two ConcreteCommands. * - * This example creates a simple GUI with three buttons. Each button has a - * command associated with it that is executed when the button is pressed. + * This example creates a simple GUI with three buttons. Each button has a + * command associated with it that is executed when the button is pressed. * Button1 and button3 have the same command, button2 has a different one. * - *

      This is the Java version.

      + *

      This is the Java version.

      * * Both commands and invoker have to have pattern-related code. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 - * + * * @see Button * @see Command * @see ButtonCommand @@ -57,41 +57,41 @@ */ public class Main { - + /** - * This example creates a simple GUI with three buttons. Each button has a - * command associated with it that is executed when the button is pressed. + * This example creates a simple GUI with three buttons. Each button has a + * command associated with it that is executed when the button is pressed. * Button1 and button3 have the same command, button2 has a different one. */ - - public static void main(String[] args) { - + + public static void main(String[] args) { + Button button1 = new Button("Print Date"); Button button2 = new Button("Command 1"); - Button button3 = new Button("Command 2"); - + Button button3 = new Button("Command 2"); + Command com1 = new ButtonCommand(); Command com2 = new ButtonCommand2(); JPanel pane = new JPanel(); - pane.add(button1); + pane.add(button1); button1.setCommand(com1); - + pane.add(button2); button2.setCommand(com2); - + pane.add(button3); button3.setCommand(com1); - + // Note: Can not have two commands. // That is within the pattern specification - JFrame frame = new JFrame("Command Pattern Example"); - + JFrame frame = new JFrame("Command Pattern Example"); + frame.getContentPane().add(pane); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} - }); + }); frame.pack(); frame.setVisible(true); } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/Directory.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/Directory.java index d40f6363b3..90936634f8 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/Directory.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/Directory.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,34 +15,34 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements a Composite. Note that in this AspectJ version, the + * Implements a Composite. Note that in this AspectJ version, the * participants are decoupled from the pattern. Thus, this composite does * not need to implement an interface or even keep track of its children. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 - * - * @see Component + * + * @see Component * @see File */ - -public class Directory { + +public class Directory { /** * stores the name of this Directory */ protected String name; - + /** * Creates a new Directory with a given name * @@ -52,7 +52,7 @@ public class Directory { public Directory(String name) { this.name = name; } - + /** * Overwrites the toString() method from Object * to print information about this Directory @@ -62,4 +62,3 @@ public String toString() { return ("Directory: "+name); } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/File.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/File.java index 6231b140b4..e750d48cff 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/File.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/File.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,34 +15,34 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements a Leaf. Note that in this AspectJ version, the + * Implements a Leaf. Note that in this AspectJ version, the * participants are decoupled from the pattern. Thus, this leaf does * not need to implement the Component interface. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 - * - * @see Component + * + * @see Component * @see Directory */ - -public class File { - + +public class File { + /** * stores the name for this File */ protected String name; - + /** * stores the size for this File */ @@ -59,7 +59,7 @@ public File(String name, int size) { this.name = name; this.size = size; } - + /** * Overwrites the toString() method from Object * to print information about this object @@ -68,10 +68,10 @@ public File(String name, int size) { public String toString() { return ("File: "+name+" ("+size+" KB)"); } - + /** * Returns the size of this File - * + * * @return the size of this File (on disk) */ public int getSize() { diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/FileSystemComposition.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/FileSystemComposition.java index 559c84d782..6bb15e9c1e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/FileSystemComposition.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/FileSystemComposition.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,36 +15,36 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - -import java.io.PrintStream; -import java.util.Enumeration; + +import java.io.PrintStream; +import java.util.Enumeration; import ca.ubc.cs.spl.aspectPatterns.patternLibrary.CompositeProtocol; /** - * Implements a concrete instance of the Composite design pattern.

      - * - * It maintains the mapping between Composites and their children, - * defines the Component, Composite, and Leaf roles, - * and provides facilities to implement methods that work on the whole + * Implements a concrete instance of the Composite design pattern.

      + * + * It maintains the mapping between Composites and their children, + * defines the Component, Composite, and Leaf roles, + * and provides facilities to implement methods that work on the whole * aggregate structure. * - *

      This is the AspectJ version.

      + *

      This is the AspectJ version.

      * * This concrete subaspect does the following things:

        *
      • Defines which classes are Components and Leafs *
      • Defines methods that operate on the whole aggregate * structure (using visitors) *
      - * + * * Note that implementing the two visitors is just done for fun. Similar * implementations are possible in the OO case of course, although that would - * require changing the Components. + * require changing the Components. * * @author Jan Hannemann * @author Gregor Kiczales @@ -53,20 +53,20 @@ public aspect FileSystemComposition extends CompositeProtocol { - /** + /** * Assigns the Composite role to Directory */ - + declare parents: Directory implements Composite; - /** + /** * Assigns the Leaf role to File */ declare parents: File implements Leaf; - - - + + + // Test 1: Printing the stucture using a visitor @@ -86,7 +86,7 @@ private static void indent() { } /** - * Provides a client-accessible method that pretty-prints the + * Provides a client-accessible method that pretty-prints the * structure of the aggregate structure using a Visitor * * @param s the PrintStream to print to @@ -95,11 +95,11 @@ private static void indent() { public void Component.printStructure(PrintStream s) { indent(); s.println(""+this); - } - + } + /** - * Implements printStructure for Composites: The indent - * is appropriately updated and the method call is forwarded to all + * Implements printStructure for Composites: The indent + * is appropriately updated and the method call is forwarded to all * children. * * @param s the PrintStream to print to @@ -109,8 +109,8 @@ private static void indent() { indent(); s.println(""+this); indent +=4; - FileSystemComposition.aspectOf().recurseOperation(this, new Visitor() { - public void doOperation(Component c) { c.printStructure(s); } + FileSystemComposition.aspectOf().recurseOperation(this, new Visitor() { + public void doOperation(Component c) { c.printStructure(s); } } ); indent -=4; } @@ -125,47 +125,47 @@ private static void indent() { indent(); s.println(""+this); } - - - - - + + + + + // Test2: Collecting statistics on the structure (aggregation) - + /** - * Provides a client-accessible method that pretty-prints the - * structure of the aggregate structure using a FunctionVisitor. + * Provides a client-accessible method that pretty-prints the + * structure of the aggregate structure using a FunctionVisitor. * Calculates the sum of all File (Leaf) sizes in the structure. * * @returns the sum of Leaf sizes of all elements in this structure - */ - + */ + public int Component.subSum() { return 0; } /** - * Implements subSum() for Composites: The method call + * Implements subSum() for Composites: The method call * is forwarded to all children, then the results are summed up. * * @returns the sum of leaf sizes of all elements in this structure */ - public int Directory.subSum() { + public int Directory.subSum() { Enumeration enum = FileSystemComposition.aspectOf().recurseFunction( - this, new FunctionVisitor() { - public Object doFunction(Component c) { - return new Integer(c.subSum()); + this, new FunctionVisitor() { + public Object doFunction(Component c) { + return new Integer(c.subSum()); } - }); - + }); + int sum = 0; while (enum.hasMoreElements()) { sum += ((Integer) enum.nextElement()).intValue(); } return sum; } - + /** * Implements subSum() for Leafs: Simply returns * the Leaf's size. @@ -176,5 +176,4 @@ public Object doFunction(Component c) { public int File.subSum() { return size; } -} - +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/Main.java index 820faa6c28..81d8ab036f 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -138,4 +138,4 @@ public static void main(String[] args) { System.out.println("\n<<< Test completed >>>\n"); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/Directory.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/Directory.java index dc9b300af8..58fe961732 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/Directory.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/Directory.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,14 +15,14 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - -import java.util.LinkedList; + +import java.util.LinkedList; /** * Implements a Composite. Children are stored in a linked list. @@ -30,16 +30,16 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 - * + * * @see File */ public class Directory implements FileSystemComponent { - + /** * stores the children for this Directory (files and subdirectories) */ - + protected LinkedList children = new LinkedList(); // Component interface /** @@ -47,7 +47,7 @@ public class Directory implements FileSystemComponent { */ protected String name; - + /** * Creates a new Directory with a given name * @@ -57,7 +57,7 @@ public class Directory implements FileSystemComponent { public Directory(String name) { this.name = name; } - + /** * Overwrites the toString() method from Object * to print information about this Directory @@ -67,16 +67,16 @@ public String toString() { return ("Directory: "+name); } - + /** * Adds a child to the component * * @param component the child to add */ - + public void add(FileSystemComponent component) { this.children.add(component); - } + } /** * Removes a child from the component @@ -92,7 +92,7 @@ public void remove(FileSystemComponent component) { * * @param index the position of the child */ - + public FileSystemComponent getChild(int index) { return (FileSystemComponent) children.get(index); } @@ -102,19 +102,18 @@ public FileSystemComponent getChild(int index) { * * @returns the number of children of this Directory */ - + public int getChildCount() { return children.size(); } - + /** * Returns the size of this Directory. For simplicity, we define that only * files have a tangible size, so this method returns 0. - * + * * @return the size of the component (on disk) */ public int getSize() { return 0; } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/File.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/File.java index 1f71cf9416..fff5621d46 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/File.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/File.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,20 +15,20 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Implements a Leaf. Leafs have no children. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 - * + * * @see Directory */ @@ -39,7 +39,7 @@ public class File implements FileSystemComponent { */ protected String name; - + /** * stores the size for this File */ @@ -56,7 +56,7 @@ public File(String name, int size) { this.name = name; this.size = size; } - + /** * Overwrites the toString() method from Object * to print information about this object @@ -65,8 +65,8 @@ public File(String name, int size) { public String toString() { return ("File: "+name+" ("+size+" KB)"); } - - + + /** * Adds a child to the Component. Since Files have no * children, this method does nothing. @@ -92,26 +92,26 @@ public void remove(FileSystemComponent component) {} * @param index the position of the child * @return always null, since Files do not have children */ - + public FileSystemComponent getChild(int index) { return null; } /** - * Returns the number of chilren this Component has. Since Files - * are Leafs, they don't have any children. Thus, this method + * Returns the number of chilren this Component has. Since Files + * are Leafs, they don't have any children. Thus, this method * returns 0. * * @returns always 0, since Files do not have children */ - + public int getChildCount() { return 0; } - + /** * Returns the size of this File - * + * * @return the size of this File (on disk) */ public int getSize() { diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/FileSystemComponent.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/FileSystemComponent.java index 1d70078a3d..48a74ebc51 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/FileSystemComponent.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/FileSystemComponent.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Defines the Component interface for the composite design pattern.

      * The implementation is anologuous to the one presented in GoF. Contemporary @@ -33,19 +33,19 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 - * - * @see Directory + * + * @see Directory * @see File */ - -public interface FileSystemComponent { - + +public interface FileSystemComponent { + /** * Adds a child to the component * * @param component the child to add */ - + public void add(FileSystemComponent component); /** @@ -53,7 +53,7 @@ public interface FileSystemComponent { * * @param component the child to remove */ - + public void remove(FileSystemComponent component); /** @@ -61,7 +61,7 @@ public interface FileSystemComponent { * * @param index the position of the child */ - + public FileSystemComponent getChild(int index); /** @@ -69,12 +69,12 @@ public interface FileSystemComponent { * * @returns the number of children of this component */ - + public int getChildCount(); - + /** * Returns the size of this FileSystemComponent - * + * * @return the size of the component (on disk) */ public int getSize(); diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/Main.java index c36597e5f4..e5536fd0d2 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/composite/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,71 +15,71 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements the driver for the Composite design pattern example.

      + * Implements the driver for the Composite design pattern example.

      * - * Intent: Compose objects into tree structures to represent part-whole - * hierarchies. Composite lets clients treat individual objects and + * Intent: Compose objects into tree structures to represent part-whole + * hierarchies. Composite lets clients treat individual objects and * compositions of objects uniformly.

      * * Participating classes are Directorys as Composites, - * and Files as Leafs. Both implement the + * and Files as Leafs. Both implement the * Component interface.

      * - * This example creates a simple structure as follows: Composite directory1 - * has three children: file1, directory2, and file3. directory2 has file2 + * This example creates a simple structure as follows: Composite directory1 + * has three children: file1, directory2, and file3. directory2 has file2 * as a child. - * + * * Compact notation: directory1(file1, directory2(file2), file3) * - *

      This is the Java version.

      + *

      This is the Java version.

      * - * Every Component and every Leaf needs to know about the + * Every Component and every Leaf needs to know about the * pattern and their in the pattern. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/06/04 - * + * * @see Component - * @see Directory + * @see Directory * @see File */ - -public class Main { + +public class Main { /** * helper variable to store recursion depth for pretty printing */ - - private static int indent = 0; + + private static int indent = 0; /** * Prints a number of spaces according to the current recursion depth */ - + private static void indent() { for (int i=0; i>>\n"); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/BracketDecorator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/BracketDecorator.java index 1f60876f96..820cef7be2 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/BracketDecorator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/BracketDecorator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Adds brackets ("[", "]") before and after the string to decorate. * Acts as a ConcreteDecorator @@ -29,22 +29,22 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - */ - + */ + public aspect BracketDecorator { - + /** - * Identifies the execution points of interest: all calls to + * Identifies the execution points of interest: all calls to * ConcreteOutput.print(String). */ - protected pointcut printCall(String s): + protected pointcut printCall(String s): call(public void ConcreteOutput.print(String)) && args(s); /** * Adds brackets before and after the argument string before passing - * the call on to the component this decorator aspect decorates. + * the call on to the component this decorator aspect decorates. * * @param s the string to be decorated. */ @@ -53,4 +53,4 @@ void around(String s): printCall(s) { s = "[" + s + "]"; // Decorates the string proceed(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/ConcreteOutput.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/ConcreteOutput.java index 8518306471..661a8fdac5 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/ConcreteOutput.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/ConcreteOutput.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,24 +15,24 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements a simple class that provides a print(String) - * method. In this AspectJ implementation, there is no need for a - * Component interface; this class is autonomous and does not need + * Implements a simple class that provides a print(String) + * method. In this AspectJ implementation, there is no need for a + * Component interface; this class is autonomous and does not need * to have pattern-related code. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - */ - + */ + public class ConcreteOutput { /** @@ -44,4 +44,4 @@ public class ConcreteOutput { public void print(String s) { System.out.print(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/Main.java index 0cec41d93c..768bc52c92 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,22 +15,22 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements the driver for the Decorator design pattern example.

      + * Implements the driver for the Decorator design pattern example.

      * - * Intent: Attach additional responsibilities to an object dynamically. - * Decorators provide a flexible alternative to subclassing for extending + * Intent: Attach additional responsibilities to an object dynamically. + * Decorators provide a flexible alternative to subclassing for extending * functionality.

      * * Participating classes are Outputs as Components, - * ConcreteOutput as ConcreteComponent. The decorators + * ConcreteOutput as ConcreteComponent. The decorators * are OutputDecorator as Decorator, and * StarDecorator and BracketDecorator as * ConcreteDecorators.

      @@ -39,40 +39,40 @@ * string, Decorators (StarDecorator and BracketDecorator) wrap other * output around it. Output should be: "[ *** *** ]" * - *

      This is the AspectJ version.

      + *

      This is the AspectJ version.

      * - * This version does not allow for dynamic composition of decorators. - * However, this version decouples ConcreteComponents, clients + * This version does not allow for dynamic composition of decorators. + * However, this version decouples ConcreteComponents, clients * and Decorators. Neither clients nor ConcreteComponents * need to have pattern code in them. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see ConcreteOutput - * @see StarDecorator + * @see StarDecorator * @see BracketDecorator */ - + public class Main { /** - * Implements the driver for the Decorator design pattern example.

      + * Implements the driver for the Decorator design pattern example.

      * * Experimental setup: Concrete decorator (ConcreteOutput) prints a * string, Decorators (StarDecorator and BracketDecorator) wrap other - * output around it. Output should be: "[ *** *** ]" + * output around it. Output should be: "[ *** *** ]" * * @param args command line paramters, unused */ - + public static void main(String[] args) { - + ConcreteOutput original = new ConcreteOutput(); - - original.print(""); - + + original.print(""); + System.out.println(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/StarDecorator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/StarDecorator.java index f7c85a768b..b477123387 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/StarDecorator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/aspectj/StarDecorator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -58,4 +58,4 @@ void around(String s): printCall(s) { proceed(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/BracketDecorator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/BracketDecorator.java index 4b381865ec..a1e6eda1d3 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/BracketDecorator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/BracketDecorator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Implements a decorator that adds brackets ("[", "]") before and after the * string to decorate. @@ -29,13 +29,13 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - */ - + */ + public class BracketDecorator extends OutputDecorator { - + /** * Adds brackets before and after the argument string before passing - * the call on to the component this decorator decorates. + * the call on to the component this decorator decorates. * * @param s the string to be decorated. */ @@ -53,4 +53,4 @@ public void print(String s) { public BracketDecorator(Output output) { super(output); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/ConcreteOutput.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/ConcreteOutput.java index 90d82b5be2..4cf7d37637 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/ConcreteOutput.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/ConcreteOutput.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Implements the Component interface to print strings to * System.out. @@ -29,8 +29,8 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - */ - + */ + public class ConcreteOutput implements Output { /** @@ -42,4 +42,4 @@ public class ConcreteOutput implements Output { public void print(String s) { System.out.print(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/Main.java index fd06015999..c5266ef3dc 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,22 +15,22 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements the driver for the Decorator design pattern example.

      + * Implements the driver for the Decorator design pattern example.

      * - * Intent: Attach additional responsibilities to an object dynamically. - * Decorators provide a flexible alternative to subclassing for extending + * Intent: Attach additional responsibilities to an object dynamically. + * Decorators provide a flexible alternative to subclassing for extending * functionality.

      * * Participating classes are Outputs as Components, - * ConcreteOutput as ConcreteComponent. The decorators + * ConcreteOutput as ConcreteComponent. The decorators * are OutputDecorator as Decorator, and * StarDecorator and BracketDecorator as * ConcreteDecorators.

      @@ -39,35 +39,35 @@ * string, Decorators (StarDecorator and BracketDecorator) wrap other * output around it. Output should be: "[ *** *** ]" * - *

      This is the Java version.

      + *

      This is the Java version.

      * - * This version allows for dynamic composition of decorators. + * This version allows for dynamic composition of decorators. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 */ - + public class Main { /** - * Implements the driver for the Decorator design pattern example.

      + * Implements the driver for the Decorator design pattern example.

      * * Experimental setup: Concrete decorator (ConcreteOutput) prints a * string, Decorators (StarDecorator and BracketDecorator) wrap other - * output around it. Output should be: "[ *** *** ]" + * output around it. Output should be: "[ *** *** ]" * * @param args command line paramters, unused */ - + public static void main(String[] args) { - + Output original = new ConcreteOutput(); Output bracketed= new BracketDecorator(original); Output stared = new StarDecorator(bracketed); - - stared.print(""); - + + stared.print(""); + System.out.println(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/Output.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/Output.java index 49df113d45..a111d48021 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/Output.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/Output.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,23 +15,23 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Defines an interface for printing Strings. Acts as Component. + * Defines an interface for printing Strings. Acts as Component. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - */ - -public interface Output { - + */ + +public interface Output { + /** * Prints the argument string to System.out. * @@ -40,4 +40,3 @@ public interface Output { public void print(String s); } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/OutputDecorator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/OutputDecorator.java index 2966d1f201..3021cb8440 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/OutputDecorator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/OutputDecorator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,31 +15,31 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Defines the Decorator interface. This is realized as an abstract - * class to allow for default implementations (set varible "output", + * Defines the Decorator interface. This is realized as an abstract + * class to allow for default implementations (set varible "output", * provide default implementation for print(String)). * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - */ - + */ + public abstract class OutputDecorator implements Output { /** * the Component to decorate - */ + */ protected Output outputComponent; - + /** * Prints the argument string to System.out. This method is * overwritten by concrete decorators. The default implementation @@ -47,22 +47,22 @@ public abstract class OutputDecorator implements Output { * * @param s the string to be printed. */ - - public void print(String s) { + + public void print(String s) { outputComponent.print(s); } - + /** - * Defines the constructor signature. Also provides a default - * implementation so that concrete decorators don't have to - * re-implement it. Subclasses (ConcreteDecorators) can just + * Defines the constructor signature. Also provides a default + * implementation so that concrete decorators don't have to + * re-implement it. Subclasses (ConcreteDecorators) can just * call super(..) and don't have * to deal with setting the variable themselves. * * @param output the Component to decorate. */ - + public OutputDecorator(Output output) { this.outputComponent = output; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/StarDecorator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/StarDecorator.java index 1e7cb393b6..b501eac081 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/StarDecorator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/decorator/java/StarDecorator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Implements a decorator that adds stars (" *** ") before and after the * string to decorate. @@ -29,14 +29,14 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - */ - + */ + public class StarDecorator extends OutputDecorator { /** * Adds three stars before and after the argument string before passing - * the call on to the component this decorator decorates. + * the call on to the component this decorator decorates. * * @param s the string to be decorated. */ @@ -56,4 +56,4 @@ public StarDecorator(Output output) { } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/Decoration.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/Decoration.java index c6d59e6579..eaf19ea9b9 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/Decoration.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/Decoration.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,16 +29,16 @@ * @author Gregor Kiczales * @version 1.11, 03/29/04 */ - + public class Decoration { /** * Provides a decorator string consisting of stars ("*"). * - * @returns a decorator string made up of stars + * @returns a decorator string made up of stars */ public static String getDecoration() { return "*******************************************"; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/FacadePolicyEnforcement.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/FacadePolicyEnforcement.java index 815793fd5b..1499b4c622 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/FacadePolicyEnforcement.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/FacadePolicyEnforcement.java @@ -5,7 +5,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -13,11 +13,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ package ca.ubc.cs.spl.aspectPatterns.examples.facade.aspectj; @@ -27,9 +27,9 @@ * warning if the subsystem is accessed from any other class but the * facade. We use declare warning here, but declare error * can also be used. - * - * Instead of protecting the encapsulated subsystem against (only) mehod - * calls, other pointcut types (or combinations) could be used to achieve + * + * Instead of protecting the encapsulated subsystem against (only) mehod + * calls, other pointcut types (or combinations) could be used to achieve * different effects. * * @author Jan Hannemann @@ -38,26 +38,26 @@ */ public aspect FacadePolicyEnforcement { - + /** - * Enumerates all calls to encapsulated methods. It is of course easier + * Enumerates all calls to encapsulated methods. It is of course easier * to define this pointcut if the encapsulated subsystem is in a separate * package, and the protected classes do not have to be enumerated. */ - - pointcut callsToEncapsulatedMethods(): + + pointcut callsToEncapsulatedMethods(): call(* (Decoration || RegularScreen || StringTransformer).*(..)); - + /** * Defines what constitutes legal accesses to the protected subsystem. */ - + pointcut facade(): within(OutputFacade); - + /** * Whenever a method in the encapsulated susbsystem is called, a compile * time warning gets created - except if the method call comes from the - * Facade + * Facade */ declare warning: callsToEncapsulatedMethods() && !facade(): diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/Main.java index 06e5ce34cf..d2ed78c432 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,18 +15,18 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Facade design pattern example.

      + * Implements the driver for the Facade design pattern example.

      * - * Intent: Provide a unified interface to a set of interfaces in a - * subsystem. Facade defines a higher-level interface that makes the + * Intent: Provide a unified interface to a set of interfaces in a + * subsystem. Facade defines a higher-level interface that makes the * subsystem easier to use.

      * * The subsystem consists of three classes that provide low-level @@ -35,42 +35,42 @@ * class OutputFacade procides a higher-level interface * to output strings. This class calls methods on that higer-level interface. * - * *

      This is the AspectJ version.

      + * *

      This is the AspectJ version.

      * * For this pattern, both Java and AspectJ implementations are identical. * The pattern introduces no crosscutting and is not abstractable. However, * this example illustrates that AspectJ can be used to enforce the facade's * encapsulation of the subsystem in question. Both declare warning - * and declare error can be used to that effect. + * and declare error can be used to that effect. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.11, 03/29/04 */ - + public class Main { /** * Tests the higher-level interface of OutputFacade. - * + * * @param args Command-line parameters, ignored here - */ - + */ + public static void main(String[] args) { OutputFacade facade = new OutputFacade(); - + System.out.println("Testing regular Facade access..."); facade.printDecoration(); - + facade.printNormal("Facade: this is normal printing"); facade.printFancy ("Facade: this is fancy printing"); System.out.println("\nCircumventing Facade encapsulation..."); - - // Note that the compiler warning caused by the next line is + + // Note that the compiler warning caused by the next line is // intentional. See FacadePolicyEnforcement for details. RegularScreen.print("It works, but should create a compiler warning"); System.out.println(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/OutputFacade.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/OutputFacade.java index 676e9e27b1..33aeb51049 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/OutputFacade.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/OutputFacade.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,42 +15,42 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the Facade role in the pattern by providing a - * higher-level interface to the operations provided by - * RegularScreen, Decoration, + * Implements the Facade role in the pattern by providing a + * higher-level interface to the operations provided by + * RegularScreen, Decoration, * and StringTransformer. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.11, 03/29/04 */ - + public class OutputFacade { /** * Prints a string using RegularScreen. * - * @param s the string to print + * @param s the string to print */ public void printNormal(String s) { RegularScreen.print(s); RegularScreen.newline(); } - + /** - * Prints a two versions of string with decorations + * Prints a two versions of string with decorations * using RegularScreen and Decoration. * - * @param s the string to print + * @param s the string to print */ public void printFancy(String s) { @@ -63,7 +63,7 @@ public void printFancy(String s) { RegularScreen.print(StringTransformer.transformToLower(s+" (lowercase)")); RegularScreen.newline(); - + printDecoration(); } @@ -76,4 +76,4 @@ public void printDecoration() { RegularScreen.newline(); RegularScreen.newline(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/RegularScreen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/RegularScreen.java index bbd623afe1..4ad393b314 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/RegularScreen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/RegularScreen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,19 +29,19 @@ * @author Gregor Kiczales * @version 1.11, 03/29/04 */ - + public class RegularScreen { /** * Prints a string to System.out. * - * @param s the string to print + * @param s the string to print */ public static void print(String s) { System.out.print(s); } - + /** * Prints a newline to System.out. */ @@ -49,4 +49,4 @@ public static void print(String s) { public static void newline() { System.out.println(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/StringTransformer.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/StringTransformer.java index a1f5eafba6..a6d2d53d12 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/StringTransformer.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/aspectj/StringTransformer.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,7 +29,7 @@ * @author Gregor Kiczales * @version 1.11, 03/29/04 */ - + public class StringTransformer { /** @@ -42,7 +42,7 @@ public class StringTransformer { public static String transformToUpper(String s) { return s.toUpperCase(); } - + /** * Transforms a string to lower case * @@ -53,4 +53,4 @@ public static String transformToUpper(String s) { public static String transformToLower(String s) { return s.toLowerCase(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/Decoration.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/Decoration.java index 8425bc7629..c6b552acf2 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/Decoration.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/Decoration.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -41,4 +41,4 @@ public class Decoration { public static String getDecoration() { return "*******************************************"; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/Main.java index 36d7c0b4c3..b93d0c102e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,18 +15,18 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Facade design pattern example.

      + * Implements the driver for the Facade design pattern example.

      * - * Intent: Provide a unified interface to a set of interfaces in a - * subsystem. Facade defines a higher-level interface that makes the + * Intent: Provide a unified interface to a set of interfaces in a + * subsystem. Facade defines a higher-level interface that makes the * subsystem easier to use.

      * * The subsystem consists of three classes that provide low-level @@ -35,29 +35,29 @@ * class OutputFacade procides a higher-level interface * to output strings. This class calls methods on that higer-level interface. * - *

      This is the Java version.

      + *

      This is the Java version.

      * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.11, 04/29/04 */ - + public class Main { - + /** * Tests the higher-level interface of OutputFacade. - * + * * @param args Command-line parameters, ignored here - */ - + */ + public static void main(String[] args) { OutputFacade facade = new OutputFacade(); - + System.out.println("Testing Facade..."); facade.printDecoration(); - + facade.printNormal("Facade: this is normal printing"); facade.printFancy ("Facade: this is fancy printing"); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/OutputFacade.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/OutputFacade.java index 30c1bd8b5b..bc280dfc9e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/OutputFacade.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/OutputFacade.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,42 +15,42 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the Facade role in the pattern by providing a - * higher-level interface to the operations provided by - * RegularScreen, Decoration, + * Implements the Facade role in the pattern by providing a + * higher-level interface to the operations provided by + * RegularScreen, Decoration, * and StringTransformer. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 */ - + public class OutputFacade { /** * Prints a string using RegularScreen. * - * @param s the string to print + * @param s the string to print */ public void printNormal(String s) { RegularScreen.print(s); RegularScreen.newline(); } - + /** - * Prints a two versions of string with decorations + * Prints a two versions of string with decorations * using RegularScreen and Decoration. * - * @param s the string to print + * @param s the string to print */ public void printFancy(String s) { @@ -63,7 +63,7 @@ public void printFancy(String s) { RegularScreen.print(StringTransformer.transformToLower(s+" (lowercase)")); RegularScreen.newline(); - + printDecoration(); } @@ -76,4 +76,4 @@ public void printDecoration() { RegularScreen.newline(); RegularScreen.newline(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/RegularScreen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/RegularScreen.java index acd7535986..42267bb22b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/RegularScreen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/RegularScreen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,19 +29,19 @@ * @author Gregor Kiczales * @version 1.1, 02/11/04 */ - + public class RegularScreen { /** * Prints a string to System.out. * - * @param s the string to print + * @param s the string to print */ public static void print(String s) { System.out.print(s); } - + /** * Prints a newline to System.out. */ @@ -49,4 +49,4 @@ public static void print(String s) { public static void newline() { System.out.println(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/StringTransformer.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/StringTransformer.java index 1353cfaa40..0ed6221472 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/StringTransformer.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/facade/java/StringTransformer.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,7 +29,7 @@ * @author Gregor Kiczales * @version 1.1, 02/11/04 */ - + public class StringTransformer { /** @@ -42,7 +42,7 @@ public class StringTransformer { public static String transformToUpper(String s) { return s.toUpperCase(); } - + /** * Transforms a string to lower case * @@ -53,4 +53,4 @@ public static String transformToUpper(String s) { public static String transformToLower(String s) { return s.toLowerCase(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/AlternateLabelCreatorImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/AlternateLabelCreatorImplementation.java index d8966e882c..dd5f622ac6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/AlternateLabelCreatorImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/AlternateLabelCreatorImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,48 +15,48 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JLabel; import javax.swing.JComponent; /** - * This aspect changes the behavior of a Factory Method using - * around advice. With this approach it is possible to - * have the factories create different products depending on the + * This aspect changes the behavior of a Factory Method using + * around advice. With this approach it is possible to + * have the factories create different products depending on the * aspects woven into the project. For example, this could be used * as a very basic approach to software configuration management. - * - * In this case, two slightly different label products are produced, + * + * In this case, two slightly different label products are produced, * depending on whether this aspect is woven into the system or not. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.11, 04/01/04 - */ + */ public aspect AlternateLabelCreatorImplementation { - - /** - * Describes the factory method for which we want to + + /** + * Describes the factory method for which we want to * modify the product */ - - pointcut labelCreation(): + + pointcut labelCreation(): execution(JComponent LabelCreator.createComponent()); - + /** - * Creates the product, modifies it and passes the + * Creates the product, modifies it and passes the * modified product on. */ - + JComponent around(): labelCreation() { JLabel label = (JLabel) proceed(); label.setText("This is an alternate JLabel"); return label; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/ButtonCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/ButtonCreator.java index 6730238318..2fd6476947 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/ButtonCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/ButtonCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JButton; @@ -33,10 +33,10 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see LabelCreator - */ - + */ + public class ButtonCreator implements GUIComponentCreator { /** @@ -53,9 +53,9 @@ public void actionPerformed(ActionEvent e) { button.setText("Thank you!"); } }); - return button; + return button; } - + /** * Returns a title explaining this example. * @@ -65,4 +65,4 @@ public void actionPerformed(ActionEvent e) { public String getTitle() { return "Example 1: A JButton"; } -} +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/CreatorImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/CreatorImplementation.java index 0b8669cfc0..126e2eede7 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/CreatorImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/CreatorImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,63 +15,63 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.JComponent; +import javax.swing.JComponent; import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; +import java.awt.event.WindowEvent; import java.awt.Point; /** * Provides a default implementation for the anOperation() - * method showFrame(). The implementation is attached to the - * GUIComponentCreator interface. With this approach, + * method showFrame(). The implementation is attached to the + * GUIComponentCreator interface. With this approach, * GUIComponentCreator does not have to be an abstract class. - * + * * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see GUIComponentCreator - */ + */ public aspect CreatorImplementation { - - /** + + /** * the position for the next frame to be created (on the screen) */ - + private static Point lastFrameLocation = new Point(0, 0); - /** + /** * Creates a JFrame, puts the JComponent that * is created by the factory method into it and displays the frame. This - * Method also provides a WindowListener. + * Method also provides a WindowListener. */ - + public final void GUIComponentCreator.showFrame() { JFrame frame = new JFrame(getTitle()); - + frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} }); - + JPanel panel = new JPanel(); - + panel.add(createComponent()); - + frame.getContentPane().add(panel); - frame.pack(); + frame.pack(); frame.setLocation(lastFrameLocation); lastFrameLocation.translate(75, 75); - frame.setVisible(true); - } -} \ No newline at end of file + frame.setVisible(true); + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/GUIComponentCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/GUIComponentCreator.java index a2287ef6a2..128c923a85 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/GUIComponentCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/GUIComponentCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,19 +15,19 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -import javax.swing.JComponent; +import javax.swing.JComponent; /** - * Defines the GUIComponentCreator interface with the - * factoryMethod() method signature and the anOperation() - * method that uses it. For details, see GoF, page 108.

      + * Defines the GUIComponentCreator interface with the + * factoryMethod() method signature and the anOperation() + * method that uses it. For details, see GoF, page 108.

      * * The factory method is createComponent and it creates * A JComponent (a button and a label, repsectively). The anOperation() @@ -37,30 +37,28 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see ButtonCreator * @see LabelCreator - */ - + */ + public interface GUIComponentCreator { - + /** - * The factory method to create JComponents, to be + * The factory method to create JComponents, to be * concretized by subclasses. * * @returns the created product */ - public JComponent createComponent(); - + public JComponent createComponent(); + /** * Another factory method to create a title that explains the created * component * * @returns the title for the GUI frame */ - - public String getTitle(); -} - \ No newline at end of file + public String getTitle(); +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/LabelCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/LabelCreator.java index 200ec456d7..0acf2632fd 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/LabelCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/LabelCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JLabel; @@ -31,10 +31,10 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see ButtonCreator - */ - + */ + public class LabelCreator implements GUIComponentCreator { /** @@ -45,9 +45,9 @@ public class LabelCreator implements GUIComponentCreator { public JComponent createComponent() { JLabel label = new JLabel("This is a JLabel."); - return label; + return label; } - + /** * Returns a title explaining this example. * @@ -57,4 +57,4 @@ public JComponent createComponent() { public String getTitle() { return "Example 2: A JLabel"; } -} +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/Main.java index 8ae2a2f3ab..a9156bfc45 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,21 +15,21 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the FactoryMethod design pattern example.

      + * Implements the driver for the FactoryMethod design pattern example.

      * - * Intent: Define an interface for creating an object, but let subclasses - * decide which class to instantiate. Factory Method lets a class defer + * Intent: Define an interface for creating an object, but let subclasses + * decide which class to instantiate. Factory Method lets a class defer * instantiation to subclasses.

      * - * Participating objects are ButtonCreator and + * Participating objects are ButtonCreator and * LabelCreator as ConcreteCreators. Both implement * the GUIComponentCreator interface.

      * @@ -42,15 +42,15 @@ *

      This is the AspectJ version.

      * * Since the implementation of the anOperation() method - * showFrame() is now realized by an aspect, - * GUIComponentCreator can now be an interface, allowing - * the ConcreteCreators to be part of a different inheritance + * showFrame() is now realized by an aspect, + * GUIComponentCreator can now be an interface, allowing + * the ConcreteCreators to be part of a different inheritance * hierarchy. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see GUIComponentCreator * @see ButtonCreator * @see LabelCreator @@ -59,21 +59,21 @@ public class Main { /** - * Implements the driver for the FactoryMethod design pattern example.

      + * Implements the driver for the FactoryMethod design pattern example.

      * - * In this example, the factory method createComponent - * creates a JComponent (a button and a label, repsectively). The - * anOperation() method showFrame() uses the factory - * methods to show a little GUI. In one case, the created frame contains + * In this example, the factory method createComponent + * creates a JComponent (a button and a label, repsectively). The + * anOperation() method showFrame() uses the factory + * methods to show a little GUI. In one case, the created frame contains * a button, in the other a simple label. - */ + */ public static void main(String[] args) { - + GUIComponentCreator creator1 = new ButtonCreator(); GUIComponentCreator creator2 = new LabelCreator(); - + creator1.showFrame(); creator2.showFrame(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/ButtonCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/ButtonCreator.java index 7346fdb09f..ea558a1eda 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/ButtonCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/ButtonCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JButton; @@ -33,10 +33,10 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see LabelCreator - */ - + */ + public class ButtonCreator extends GUIComponentCreator { /** @@ -53,9 +53,9 @@ public void actionPerformed(ActionEvent e) { button.setText("Thank you!"); } }); - return button; + return button; } - + /** * Returns a title explaining this example. * @@ -65,4 +65,4 @@ public void actionPerformed(ActionEvent e) { public String getTitle() { return "Example 1: A JButton"; } -} +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/GUIComponentCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/GUIComponentCreator.java index 9a4b0101d7..a3037c3e59 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/GUIComponentCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/GUIComponentCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,88 +15,86 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.JComponent; +import javax.swing.JComponent; import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; +import java.awt.event.WindowEvent; import java.awt.Point; /** - * Defines the GUIComponentCreator interface with the - * factoryMethod() method signature and the anOperation() - * method that uses it. For details, see GoF, page 108.

      + * Defines the GUIComponentCreator interface with the + * factoryMethod() method signature and the anOperation() + * method that uses it. For details, see GoF, page 108.

      * * The factory method is createComponent and it creates * A JComponent (a button or a label, in this case). The anOperation() * method showFrame() uses the factory method to show a small - * GUI. + * GUI. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see ButtonCreator * @see LabelCreator - */ - + */ + public abstract class GUIComponentCreator { - + /** * The factory method to be concretized by subclasses. * * @returns the created ConcreteProduct */ - public abstract JComponent createComponent(); - + public abstract JComponent createComponent(); + /** * Another factory method to create a title for the GUI frame created * by this class. * * @returns the title for the GUI frame */ - - public abstract String getTitle(); - /** + public abstract String getTitle(); + + /** * the position for the next frame to be created (on the screen). This - * variable is used to make sure new frames appear staggered and don't + * variable is used to make sure new frames appear staggered and don't * entirely overlap with existing frames. */ - + private static Point lastFrameLocation = new Point(0, 0); - /** + /** * Creates a JFrame, puts the JComponent that * is created by the factory method into it and displays the frame. This - * Method also provides a WindowListener. + * Method also provides a WindowListener. */ - + public final void showFrame() { JFrame frame = new JFrame(getTitle()); - + frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} }); - + JPanel panel = new JPanel(); - + panel.add(createComponent()); - + frame.getContentPane().add(panel); - frame.pack(); + frame.pack(); frame.setLocation(lastFrameLocation); lastFrameLocation.translate(75, 75); - frame.setVisible(true); + frame.setVisible(true); } -} - - \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/LabelCreator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/LabelCreator.java index 40bbd8b8c7..c102bb9a7b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/LabelCreator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/LabelCreator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JLabel; @@ -31,10 +31,10 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see ButtonCreator - */ - + */ + public class LabelCreator extends GUIComponentCreator { /** @@ -45,9 +45,9 @@ public class LabelCreator extends GUIComponentCreator { public JComponent createComponent() { JLabel label = new JLabel("This is a JLabel."); - return label; + return label; } - + /** * Returns a title explaining this example. * @@ -57,4 +57,4 @@ public JComponent createComponent() { public String getTitle() { return "Example 2: A JLabel"; } -} +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/Main.java index a068f8f7d2..0c70d8171d 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/factoryMethod/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,21 +15,21 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the FactoryMethod design pattern example.

      + * Implements the driver for the FactoryMethod design pattern example.

      * - * Intent: Define an interface for creating an object, but let subclasses - * decide which class to instantiate. Factory Method lets a class defer + * Intent: Define an interface for creating an object, but let subclasses + * decide which class to instantiate. Factory Method lets a class defer * instantiation to subclasses.

      * - * Participating objects are ButtonCreator and + * Participating objects are ButtonCreator and * LabelCreator as ConcreteCreators. Both implement * the GUIComponentCreator interface.

      * @@ -42,15 +42,15 @@ *

      This is the Java version.

      * * Since the anOperation() method requires an implementation, - * GUIComponentCreator has to be an abstract class (as opposed to an - * interface). Consequently, all ConcreteCreators have to be - * subclasses of that class and cannot belong to a different inheritance + * GUIComponentCreator has to be an abstract class (as opposed to an + * interface). Consequently, all ConcreteCreators have to be + * subclasses of that class and cannot belong to a different inheritance * hierarchy. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see GUIComponentCreator * @see ButtonCreator * @see LabelCreator @@ -59,21 +59,21 @@ public class Main { /** - * Implements the driver for the FactoryMethod design pattern example.

      + * Implements the driver for the FactoryMethod design pattern example.

      * - * In this example, the factory method createComponent - * creates a JComponent (a button and a label, repsectively). The - * anOperation() method showFrame() uses the factory - * methods to show a little GUI. In one case, the created frame contains + * In this example, the factory method createComponent + * creates a JComponent (a button and a label, repsectively). The + * anOperation() method showFrame() uses the factory + * methods to show a little GUI. In one case, the created frame contains * a button, in the other a simple label. - */ - + */ + public static void main(String[] args) { - + GUIComponentCreator creator1 = new ButtonCreator(); GUIComponentCreator creator2 = new LabelCreator(); - + creator1.showFrame(); creator2.showFrame(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/CharacterFlyweight.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/CharacterFlyweight.java index 7e024edf8d..3a92e2f245 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/CharacterFlyweight.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/CharacterFlyweight.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** /** * A ConcreteFlyweight storing a single regular character @@ -36,29 +36,29 @@ public class CharacterFlyweight implements PrintableFlyweight { /** * The character this ConcreteFlyweight represents */ - + private char c; - - /** - * Creates a new ConcreteFlyweight and sets it to represent a + + /** + * Creates a new ConcreteFlyweight and sets it to represent a * particular regular character - * + * * @param c the character to represent */ - + public CharacterFlyweight(char c) { this.c = c; } - - /** + + /** * Prints the stored character * * @param uppercase whether the character should be printed in * uppercase - */ - + */ + public void print(boolean uppercase) { System.out.print(uppercase ? Character.toUpperCase(c) : c); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/FlyweightImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/FlyweightImplementation.java index f3ecc43a0f..51a5dda8cd 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/FlyweightImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/FlyweightImplementation.java @@ -1,4 +1,4 @@ -package ca.ubc.cs.spl.aspectPatterns.examples.flyweight.aspectj; +package ca.ubc.cs.spl.aspectPatterns.examples.flyweight.aspectj; /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,23 +15,23 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import ca.ubc.cs.spl.aspectPatterns.patternLibrary.FlyweightProtocol; /** - * Implements a concrete instance of the flyweight pattern using the + * Implements a concrete instance of the flyweight pattern using the * abstract implementation found in FlyweightProtocol. - * - * It assigns the Flyweight pattern role to the participants and + * + * It assigns the Flyweight pattern role to the participants and * provides the implementation for creating Flyweights. - * - * A concenience method is provided to utilize the abstract aspect's + * + * A concenience method is provided to utilize the abstract aspect's * getFlyweight(...) implementation with an appropriate return type. * * @author Jan Hannemann @@ -41,22 +41,22 @@ public aspect FlyweightImplementation extends FlyweightProtocol { - - /** + + /** * Assigns the Flyweight role to CharacterFlyweight. */ declare parents: CharacterFlyweight implements Flyweight; - /** + /** * Assigns the Flyweight role to WhitespaceFlyweight. */ declare parents: WhitespaceFlyweight implements Flyweight; /** - * Actually creates the Flyweight for a given Key. This - * method is called by getFlyweight(Object) if the + * Actually creates the Flyweight for a given Key. This + * method is called by getFlyweight(Object) if the * flyweight does not already exist. * * @param key the key identifying the particular Flyweight @@ -64,19 +64,19 @@ */ protected Flyweight createFlyweight(Object key) { - char c = ((Character) key).charValue(); + char c = ((Character) key).charValue(); Flyweight flyweight = null; if (Character.isWhitespace(c)) { flyweight = new WhitespaceFlyweight(c); - } else { + } else { flyweight = new CharacterFlyweight(c); } - return flyweight; - } - + return flyweight; + } + /** - * Provides a custom interface to access the Flyweights. - * Refers to the general getFlyweight(Object) method + * Provides a custom interface to access the Flyweights. + * Refers to the general getFlyweight(Object) method * defined on the abstract aspect. * * @param c the character identifying the particular flyweight @@ -86,4 +86,4 @@ protected Flyweight createFlyweight(Object key) { public PrintableFlyweight getPrintableFlyweight(char c) { return (PrintableFlyweight) getFlyweight(new Character(c)); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/Main.java index dce3cd0dd0..c7e4687d0e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,31 +15,31 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements the driver for the Flyweight design pattern example.

      + * Implements the driver for the Flyweight design pattern example.

      * - * Intent: Use sharing to support large numbers of fine-grained objects + * Intent: Use sharing to support large numbers of fine-grained objects * efficiently.

      * * Participating Flyweight classes are CharacterFlyweight * and WhitespaceFlyweight. Both implement the - * PrintableFlyweight interface. Flyweights are generated via the + * PrintableFlyweight interface. Flyweights are generated via the * PrintableFlyweightFactory.

      - * - * Intrinsic state: The character to print, + * + * Intrinsic state: The character to print, * Extrinsic state: Whether the char is upper case or lower case * * This example creates a sentence out of PrintableFlyweights * (characters and whitespaces). * - *

      This is the AspectJ version.

      + *

      This is the AspectJ version.

      * * The creation-on-demand functionality is performed by the abstract * pattern aspect. @@ -47,21 +47,21 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see PrintableFlyweight */ public class Main { /** - * Implements the driver for the Flyweight design pattern example.

      + * Implements the driver for the Flyweight design pattern example.

      * * This example creates a sentence out of PrintableFlyweights - * (characters and whitespaces). + * (characters and whitespaces). */ public static void main(String[] args) { - + System.out.println("This is a test for the AspectJ version of the " + "Flyweight pattern implementation."); System.out.println("The client will use char flyweights to print " @@ -69,46 +69,46 @@ public static void main(String[] args) { System.out.println("\"This Is A Test\".\n"); System.out.println("Testing Pattern: Flyweight - STARTING\n"); - PrintableFlyweight T = + PrintableFlyweight T = FlyweightImplementation.aspectOf().getPrintableFlyweight('t'); - PrintableFlyweight H = + PrintableFlyweight H = FlyweightImplementation.aspectOf().getPrintableFlyweight('h'); - PrintableFlyweight I = + PrintableFlyweight I = FlyweightImplementation.aspectOf().getPrintableFlyweight('i'); - PrintableFlyweight S = + PrintableFlyweight S = FlyweightImplementation.aspectOf().getPrintableFlyweight('s'); - PrintableFlyweight A = + PrintableFlyweight A = FlyweightImplementation.aspectOf().getPrintableFlyweight('a'); - PrintableFlyweight E = + PrintableFlyweight E = FlyweightImplementation.aspectOf().getPrintableFlyweight('e'); - PrintableFlyweight Empty = - FlyweightImplementation.aspectOf().getPrintableFlyweight(' '); - + PrintableFlyweight Empty = + FlyweightImplementation.aspectOf().getPrintableFlyweight(' '); + // Printing: "This Is A Test" - + T.print(true); H.print(false); I.print(false); S.print(false); - + Empty.print(true); - + I.print(true); S.print(false); - + Empty.print(true); - + A.print(true); - + Empty.print(true); - + T.print(true); E.print(false); S.print(false); - T.print(false); - + T.print(false); + System.out.println(); - + System.out.println("\nTesting Pattern: State - FINISHED"); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/PrintableFlyweight.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/PrintableFlyweight.java index 35aba15e1e..c1008bf0f0 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/PrintableFlyweight.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/PrintableFlyweight.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,30 +15,30 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Defines the Flyweight interface. Here, the flyweights are + * Defines the Flyweight interface. Here, the flyweights are * characters that offer a single method: print(boolean). * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 */ - -public interface PrintableFlyweight { + +public interface PrintableFlyweight { /** - * Defines the method signature for Flyweights' + * Defines the method signature for Flyweights' * print() method * * @param uppercase whether the character is to be printed as uppercase */ - + public void print(boolean uppercase); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/WhitespaceFlyweight.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/WhitespaceFlyweight.java index 0c4066223f..891895d14c 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/WhitespaceFlyweight.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/aspectj/WhitespaceFlyweight.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,21 +15,21 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * A ConcreteFlyweight storing a single whitespace + * A ConcreteFlyweight storing a single whitespace * character * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see PrintableFlyweightFactory */ @@ -39,28 +39,28 @@ public class WhitespaceFlyweight implements PrintableFlyweight { /** * The character this flyweight represents */ - + private char c; - - /** - * Creates a new flyweight and sets it to represent a particular + + /** + * Creates a new flyweight and sets it to represent a particular * whitespace character - * + * * @param c the character to represent */ public WhitespaceFlyweight(char c) { this.c = c; } - - /** + + /** * Prints the stored character * * @param uppercase whether the character should be printed in * uppercase - */ - + */ + public void print(boolean uppercase) { System.out.print(uppercase ? Character.toUpperCase(c) : c); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/CharacterFlyweight.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/CharacterFlyweight.java index 6c61d4fd60..46216f10bc 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/CharacterFlyweight.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/CharacterFlyweight.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -62,4 +62,4 @@ public CharacterFlyweight(char c) { public void print(boolean uppercase) { System.out.print(uppercase ? Character.toUpperCase(c) : c); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/Main.java index 23be7e85e0..d23e78e077 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,40 +15,40 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements the driver for the Flyweight design pattern example.

      + * Implements the driver for the Flyweight design pattern example.

      * - * Intent: Use sharing to support large numbers of fine-grained objects + * Intent: Use sharing to support large numbers of fine-grained objects * efficiently.

      * * Participating Flyweight classes are CharacterFlyweight * and WhitespaceFlyweight. Both implement the - * PrintableFlyweight interface. Flyweights are generated via the + * PrintableFlyweight interface. Flyweights are generated via the * PrintableFlyweightFactory.

      - * + * * These are the pattern roles:

        * *
      • CharacterFlyweightFactory: FlyweightFactory *
      • PritableFlyweight: Flyweight *
      • CharacterFlyweight: ConcreteFlyweight *
      • WhitespaceFlyweight: ConcreteFlyweight - *
      • Main: Client - *
      + *
    • Main: Client + *
    * - * Intrinsic state: The character to print, + * Intrinsic state: The character to print, * Extrinsic state: Whether the char is upper case or lower case * * This example creates a sentence out of PrintableFlyweights * (characters and whitespaces). * - *

    This is the Java version.

    + *

    This is the Java version.

    * * This implementation is analoguous to the GoF book's description. * For this version, we only use two classes for the flyweights, @@ -59,7 +59,7 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see PrintableFlyweight * @see PrintableFlyweightFactory */ @@ -67,14 +67,14 @@ public class Main { /** - * Implements the driver for the Flyweight design pattern example.

    + * Implements the driver for the Flyweight design pattern example.

    * * This example creates a sentence out of PrintableFlyweights - * (characters and whitespaces). + * (characters and whitespaces). */ public static void main(String[] args) { - + System.out.println("This is a test for the java Flyweight pattern " + "implementation."); System.out.println("The client will use char flyweights to print the " @@ -83,40 +83,40 @@ public static void main(String[] args) { System.out.println("Testing Pattern: Flyweight - STARTING\n"); PrintableFlyweightFactory pff = new PrintableFlyweightFactory(); - + PrintableFlyweight T = pff.getPrintableFlyweight('t'); PrintableFlyweight H = pff.getPrintableFlyweight('h'); PrintableFlyweight I = pff.getPrintableFlyweight('i'); PrintableFlyweight S = pff.getPrintableFlyweight('s'); PrintableFlyweight A = pff.getPrintableFlyweight('a'); PrintableFlyweight E = pff.getPrintableFlyweight('e'); - PrintableFlyweight Empty = pff.getPrintableFlyweight(' '); - + PrintableFlyweight Empty = pff.getPrintableFlyweight(' '); + // Printing: "This Is A Test" - + T.print(true); H.print(false); I.print(false); S.print(false); - + Empty.print(true); - + I.print(true); S.print(false); - + Empty.print(true); - + A.print(true); - + Empty.print(true); - + T.print(true); E.print(false); S.print(false); - T.print(false); - + T.print(false); + System.out.println(); - + System.out.println("\nTesting Pattern: State - FINISHED"); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/PrintableFlyweight.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/PrintableFlyweight.java index 89e8b8e8c9..230843dabc 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/PrintableFlyweight.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/PrintableFlyweight.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,32 +15,32 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Defines the Flyweight interface. Here, the flyweights are + * Defines the Flyweight interface. Here, the flyweights are * characters that offer a single method: print(boolean). * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see PrintableFlyweightFactory */ - -public interface PrintableFlyweight { - + +public interface PrintableFlyweight { + /** - * Defines the method signature for Flyweights' + * Defines the method signature for Flyweights' * print() method * * @param uppercase whether the character is to be printed as uppercase */ - + public void print(boolean uppercase); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/PrintableFlyweightFactory.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/PrintableFlyweightFactory.java index 56bfe74cc7..3411ddfd14 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/PrintableFlyweightFactory.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/PrintableFlyweightFactory.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,29 +15,29 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import java.util.Hashtable; /** - * Implements a FlyweightFactory that employs a creation-on-demand + * Implements a FlyweightFactory that employs a creation-on-demand * policy. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see PrintableFlyweight */ -public class PrintableFlyweightFactory { - - /** +public class PrintableFlyweightFactory { + + /** * stores the existing flyweights by character they represent */ @@ -45,7 +45,7 @@ public class PrintableFlyweightFactory { /** * Returns the flyweight representing the argument character. - * If the appropriate flyweight does not yet exist, it is created + * If the appropriate flyweight does not yet exist, it is created * on demand. * * @param c the character for which the the flyweight is returned @@ -54,19 +54,19 @@ public class PrintableFlyweightFactory { public PrintableFlyweight getPrintableFlyweight(char c) { - Character ch = new Character(c); - + Character ch = new Character(c); + if (printables.containsKey(ch)) { - return (PrintableFlyweight) printables.get(ch); + return (PrintableFlyweight) printables.get(ch); } else { PrintableFlyweight flyweight = null; if (Character.isWhitespace(c)) { flyweight = new WhitespaceFlyweight(c); - } else { + } else { flyweight = new CharacterFlyweight(c); } printables.put(ch, flyweight); - return flyweight; - } + return flyweight; + } } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/WhitespaceFlyweight.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/WhitespaceFlyweight.java index dfc1d4484e..6946170261 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/WhitespaceFlyweight.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/flyweight/java/WhitespaceFlyweight.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,21 +15,21 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * A ConcreteFlyweight storing a single whitespace + * A ConcreteFlyweight storing a single whitespace * character * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see PrintableFlyweightFactory */ @@ -39,28 +39,28 @@ public class WhitespaceFlyweight implements PrintableFlyweight { /** * The character this flyweight represents */ - + private char c; - - /** - * Creates a new flyweight and sets it to represent a particular + + /** + * Creates a new flyweight and sets it to represent a particular * whitespace character - * + * * @param c the character to represent */ public WhitespaceFlyweight(char c) { this.c = c; } - - /** + + /** * Prints the stored character. * * @param uppercase whether the character should be printed in * uppercase - */ - + */ + public void print(boolean uppercase) { System.out.print(uppercase ? Character.toUpperCase(c) : c); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/AndExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/AndExpression.java index 5ddb4fcf2a..a3831f872a 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/AndExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/AndExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanConstant.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanConstant.java index 685595dba9..2faec984e0 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanConstant.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanConstant.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -30,20 +30,20 @@ * @version 1.1, 02/11/04 */ -public class BooleanConstant implements BooleanExpression { +public class BooleanConstant implements BooleanExpression { /** * the value of this constant */ - + protected boolean value; - /** - * Creates a new constant with the given value + /** + * Creates a new constant with the given value * * @param value the value this constant should represent - */ - + */ + public BooleanConstant(boolean value) { this.value = value; } @@ -58,6 +58,6 @@ public BooleanConstant(boolean value) { public boolean evaluate(VariableContext c) { return value; } - -} \ No newline at end of file + +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanExpression.java index 3ec0fbf54a..7c3704ca63 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -31,14 +31,14 @@ */ public abstract interface BooleanExpression { - + /** * Evaluates this expression in the given VariableContext * * @param c the context to evaluate the Expression in * @return the boolean value of the Expression */ - + public boolean evaluate(VariableContext c); /** @@ -48,7 +48,7 @@ public abstract interface BooleanExpression { * @param exp the Expression to replace the variable * @return a copy of this Expression with the variable replaced */ - + public BooleanExpression replace(String name, BooleanExpression exp); /** @@ -56,6 +56,6 @@ public abstract interface BooleanExpression { * * @return the copied Expression */ - + public BooleanExpression copy(); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanInterpretation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanInterpretation.java index a3e5b809e7..527d449cd5 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanInterpretation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/BooleanInterpretation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,51 +15,51 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * Implements replace(String, BooleanExpression) and * copy() methods for all concrete - * BooleanExpressions. + * BooleanExpressions. * * The very nature of the interpreter pattern introduces coupling between all - * participants. Unfortunately, removing the pattern code from the + * participants. Unfortunately, removing the pattern code from the * participants does not work as nicely here as with other patterns. The - * reason is that the roles are defining, i.e., each participant's + * reason is that the roles are defining, i.e., each participant's * functionality is determined (only) by its role. If aspects were used - * to implement the entire pattern functionality, it would leave - * the Expressions etc. empty and would make the aspect a + * to implement the entire pattern functionality, it would leave + * the Expressions etc. empty and would make the aspect a * monolithic module.

    * * However, it is still possible to augment or change the behaviour of the - * system without changing all participant classes. To show this, we + * system without changing all participant classes. To show this, we * assumed that BooleanExpression.replace(String, BooleanExpression) - * and BooleanExpression.copy() were added later. - * An aspect is used to implement those methods, so that other - * classes do not have to change (we only changed the interface, but + * and BooleanExpression.copy() were added later. + * An aspect is used to implement those methods, so that other + * classes do not have to change (we only changed the interface, but * even that was not necessary).

    * - * In general, however, this pattern does not lend itself nicely to + * In general, however, this pattern does not lend itself nicely to * aspectification.

    * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see BooleanExpression */ public aspect BooleanInterpretation { - + // AndExpressionression /** - * Replaces a variable with an Expression. + * Replaces a variable with an Expression. * * @param name the name of the variable * @param exp the Expression to replace the variable @@ -69,21 +69,21 @@ public BooleanExpression AndExpression.replace(String name, BooleanExpression exp) { return new AndExpression(expression1.replace(name, exp), expression2.replace(name,exp)); } - + /** * Copies this Expression * * @return the copied Expression */ - + public BooleanExpression AndExpression.copy() { return new AndExpression(expression1.copy(), expression2.copy()); - } + } // BooleanConstant /** - * Replaces a variable with an Expression. + * Replaces a variable with an Expression. * Has no effect on constants. * * @param name the name of the variable @@ -92,23 +92,23 @@ */ public BooleanExpression BooleanConstant.replace(String name, BooleanExpression exp) { - return this; + return this; } - + /** * Copies this Expression * * @return the copied Expression */ - + public BooleanExpression BooleanConstant.copy() { return new BooleanConstant(value); } // OrExpression - + /** - * Replaces a variable with an Expression. + * Replaces a variable with an Expression. * * @param name the name of the variable * @param exp the Expression to replace the variable @@ -118,21 +118,21 @@ public BooleanExpression OrExpression.replace(String name, BooleanExpression exp) { return new OrExpression(expression1.replace(name, exp), expression2.replace(name,exp)); } - + /** * Copies this Expression * * @return the copied Expression */ - + public BooleanExpression OrExpression.copy() { return new OrExpression(expression1.copy(), expression2.copy()); } - + // VariableExpression /** - * Replaces a variable with an Expression. + * Replaces a variable with an Expression. * * @param name the name of the variable * @param exp the Expression to replace the variable @@ -146,22 +146,22 @@ return new VariableExpression(this.name); } } - + /** * Copies this Expression * * @return the copied Expression */ - + public BooleanExpression VariableExpression.copy() { return new VariableExpression(name); } // NotExpressionressionressionression - + /** - * Replaces a variable with an Expression. + * Replaces a variable with an Expression. * * @param name the name of the variable * @param exp the Expression to replace the variable @@ -171,15 +171,14 @@ public BooleanExpression NotExpression.replace(String name, BooleanExpression exp) { return new NotExpression(this.exp.replace(name, exp)); } - + /** * Copies this Expression * * @return the copied Expression */ - + public BooleanExpression NotExpression.copy() { return new NotExpression(exp.copy()); - } + } } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/ExpressionException.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/ExpressionException.java index 61cda48ad0..da72797e58 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/ExpressionException.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/ExpressionException.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -32,14 +32,14 @@ */ public class ExpressionException extends RuntimeException { - + /** * Creates a new ExpressionException with the given message * * @param s the exception message */ - + public ExpressionException(String s) { super(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/Main.java index 3a0c6f2321..09fc081611 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements the driver for the Intepreter design pattern example.

    + * Implements the driver for the Intepreter design pattern example.

    * * Intent: Given a language, defeine a representation fro its grammar along * with an interpreter that uses the representation to interpret sentences @@ -31,44 +31,44 @@ * * Participating objects are BooleanContant, VariableExpression * , OrExpression, AndExpression, and NotExpression - * as Expressions. The AbstractExpression interface is defined + * as Expressions. The AbstractExpression interface is defined * in BooelanExp.

    * - * This example implements an interpreter for a language of boolean + * This example implements an interpreter for a language of boolean * expressions. As a sample expression, "((true & x) | (y & !x))" is - * interpreted for all possible boolean values for x and y. After that, + * interpreted for all possible boolean values for x and y. After that, * y is replaced by another expression and the whole expression is - * evaluated again. + * evaluated again. * *

    This is the AspectJ version.

    * - * The very nature of this pattern introduces coupling between all - * participants. Unfortunately, removing the pattern code from the + * The very nature of this pattern introduces coupling between all + * participants. Unfortunately, removing the pattern code from the * participants does not work as nicely here as with other patterns. The - * reason is that the roles are defining, i.e., each participant's + * reason is that the roles are defining, i.e., each participant's * functionality is determined (only) by its role. Removing pattern * specific code into an aspect would leave the Expressions etc. * empty and would make the aspect a monolithic module.

    * * However, it is still possible to augment or change the behaviour of the - * system without changing all participant classes. To show this, we + * system without changing all participant classes. To show this, we * assumed that BooleanExpression.replace(String, BooleanExpression) and * BooleanExpression.copy() were added later. The methods are * defined in an aspect, so that other classes did not have to change.

    * - * In general, however, this pattern does not lend itself nicely to + * In general, however, this pattern does not lend itself nicely to * aspectification.

    * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see BooleanExpression */ public class Main { - /** + /** * Assigns boolean values to two VariableExpressions and evaluates * an expression in the given context. * @@ -90,13 +90,13 @@ private static void assignAndEvaluate( VariableExpression x, boolean xValue, } /** - * Implements the driver for the Intepreter design pattern example.

    + * Implements the driver for the Intepreter design pattern example.

    * - * This example implements an interpreter for a language of boolean + * This example implements an interpreter for a language of boolean * expressions. As a sample expression, "((true & x) | (y & !x))" is - * interpreted for all possible boolean values for x and y. After that, + * interpreted for all possible boolean values for x and y. After that, * y is replaced by another expression and the whole expression is - * evaluated again. + * evaluated again. * * @args command-line parameters, unused. */ @@ -104,23 +104,23 @@ private static void assignAndEvaluate( VariableExpression x, boolean xValue, public static void main(String[] args) { BooleanExpression exp = null; VariableContext context = new VariableContext(); - + VariableExpression x = new VariableExpression("X"); - VariableExpression y = new VariableExpression("Y"); - - exp = new OrExpression(new AndExpression(new BooleanConstant(true), x), + VariableExpression y = new VariableExpression("Y"); + + exp = new OrExpression(new AndExpression(new BooleanConstant(true), x), new AndExpression(y, new NotExpression(x))); - - System.out.println("Testing Expr: ((true & x) | (y & !x))"); + + System.out.println("Testing Expr: ((true & x) | (y & !x))"); assignAndEvaluate(x, false, y, false, context, exp); assignAndEvaluate(x, false, y, true, context, exp); assignAndEvaluate(x, true, y, false, context, exp); assignAndEvaluate(x, true, y, true, context, exp); - + VariableExpression z = new VariableExpression("Z"); NotExpression notZ = new NotExpression(z); - + BooleanExpression replacement = exp.replace("Y", notZ); context.assign(z, false); boolean result = replacement.evaluate(context); @@ -128,4 +128,3 @@ public static void main(String[] args) { System.out.println("The result for the replacement is: "+result); } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/NotExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/NotExpression.java index 817fd85f72..f1a077d1e4 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/NotExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/NotExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Implements negation for booleans expressions. This is a concrete boolean * NonterminalExpression @@ -33,24 +33,24 @@ public class NotExpression implements BooleanExpression { - /** + /** * the Expression this Expression negates */ - + protected BooleanExpression exp = null; - + /** - * Creates a new NOT Expression negating the argument expression + * Creates a new NOT Expression negating the argument expression * - * @param exp the Expression to negate + * @param exp the Expression to negate */ public NotExpression(BooleanExpression exp) { this.exp = exp; } - + /** - * Evaluates this Expression in the given + * Evaluates this Expression in the given * Context * * @param c the context to evaluate the Expression in @@ -58,6 +58,6 @@ public NotExpression(BooleanExpression exp) { */ public boolean evaluate(VariableContext c) { - return (! exp.evaluate(c)); + return (! exp.evaluate(c)); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/OrExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/OrExpression.java index e8b7b6e0a8..f7791db02f 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/OrExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/OrExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements an OR Expression for booleans. + * Implements an OR Expression for booleans. * This is a concrete boolean NonterminalExpression * * @author Jan Hannemann @@ -36,27 +36,27 @@ public class OrExpression implements BooleanExpression { /** * stores the first part of this OR Expression */ - + protected BooleanExpression expression1; /** * stores the second part of this OR Expression */ - protected BooleanExpression expression2; + protected BooleanExpression expression2; - /** + /** * Creates a new OR Expression with the given parts * * @param op1 the first Expression * @param op1 the second Expression - */ - + */ + public OrExpression(BooleanExpression op1, BooleanExpression op2) { this.expression1 = op1; this.expression2 = op2; } - + /** * Evaluates this Expression in the given Context * @@ -65,6 +65,6 @@ public OrExpression(BooleanExpression op1, BooleanExpression op2) { */ public boolean evaluate(VariableContext c) { - return (expression1.evaluate(c) || expression2.evaluate(c)); + return (expression1.evaluate(c) || expression2.evaluate(c)); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/VariableContext.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/VariableContext.java index 51c2a3f54f..ed4e80c870 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/VariableContext.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/VariableContext.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -68,4 +68,4 @@ public boolean lookup(String name) { public void assign(VariableExpression varExp, boolean bool) { assignments.put(varExp.getName(), new Boolean(bool)); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/VariableExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/VariableExpression.java index 48668bb6b0..36c622b5d2 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/VariableExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/aspectj/VariableExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a variable expression for booleans. This is a concrete + * Implements a variable expression for booleans. This is a concrete * boolean NonterminalExpression * expression * @@ -33,29 +33,29 @@ */ public class VariableExpression implements BooleanExpression { - - /** + + /** * the name of the variable this object represents */ - - protected String name = null; - + + protected String name = null; + /** - * Creates a new variable Expression with a given name + * Creates a new variable Expression with a given name * - * @param name the name of the new variable + * @param name the name of the new variable */ public VariableExpression(String name) { this.name = name; - } - + } + /** * Accessor for the variable's name * * @return the name of the variable */ - + public String getName() { return name; } @@ -70,4 +70,4 @@ public String getName() { public boolean evaluate(VariableContext c) { return c.lookup(name); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/AndExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/AndExpression.java index 89b5243e61..f39f00dec9 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/AndExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/AndExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements AND expressions for booleans. This is a concrete boolean + * Implements AND expressions for booleans. This is a concrete boolean * NonterminalExpression * * @author Jan Hannemann @@ -36,39 +36,39 @@ public class AndExpression implements BooleanExpression { /** * stores the first part of this AND Expression */ - + protected BooleanExpression expression1; /** * stores the second part of this AND Expression */ - protected BooleanExpression expression2; + protected BooleanExpression expression2; - /** + /** * Creates a new AND Expression with the given parts * * @param expression1 the first Expression * @param expression1 the second Expression - */ - + */ + public AndExpression(BooleanExpression op1, BooleanExpression op2) { this.expression1 = op1; this.expression2 = op2; } - + /** - * Evaluates this Expression in the given + * Evaluates this Expression in the given * VariableContext * * @param c the Context to evaluate the Expression in * @return the boolean value of this AND Expression */ - + public boolean evaluate(VariableContext c) { - return (expression1.evaluate(c) && expression2.evaluate(c)); + return (expression1.evaluate(c) && expression2.evaluate(c)); } - + /** * Replaces a variable with an Expression * @@ -80,14 +80,14 @@ public boolean evaluate(VariableContext c) { public BooleanExpression replace(String name, BooleanExpression exp) { return new AndExpression(expression1.replace(name, exp), expression2.replace(name,exp)); } - + /** * Copies this Expression * * @returns the copied Expression */ - + public BooleanExpression copy() { return new AndExpression(expression1.copy(), expression2.copy()); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/BooleanConstant.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/BooleanConstant.java index 8d6c13ab01..e5c60c52a6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/BooleanConstant.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/BooleanConstant.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -30,20 +30,20 @@ * @version 1.1, 02/11/04 */ -public class BooleanConstant implements BooleanExpression { +public class BooleanConstant implements BooleanExpression { /** * the value of this constant */ - + protected boolean value; - /** - * Creates a new constant with the given value + /** + * Creates a new constant with the given value * * @param value the value this constant should represent - */ - + */ + public BooleanConstant(boolean value) { this.value = value; } @@ -58,27 +58,27 @@ public BooleanConstant(boolean value) { public boolean evaluate(VariableContext c) { return value; } - + /** - * Replaces a variable with an Expression. + * Replaces a variable with an Expression. * Has no effect on constants. * * @param name the name of the variable * @param exp the Expression to replace the variable * @return the unchanged constant */ - + public BooleanExpression replace(String name, BooleanExpression exp) { - return this; + return this; } - + /** * Copies this Expression * * @return the copied Expression */ - + public BooleanExpression copy() { return new BooleanConstant(value); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/BooleanExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/BooleanExpression.java index 502be4c75b..7ccc2752d6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/BooleanExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/BooleanExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -31,14 +31,14 @@ */ public interface BooleanExpression { - + /** * Evaluates this Expression in the given VariableContext * * @param c the Context to evaluate the Expression in * @return the boolean value of the Expression */ - + public boolean evaluate(VariableContext c); /** @@ -48,7 +48,7 @@ public interface BooleanExpression { * @param exp the Expression to replace the variable * @return a copy of this Expression with the variable replaced */ - + public BooleanExpression replace(String name, BooleanExpression exp); /** @@ -56,6 +56,6 @@ public interface BooleanExpression { * * @return the copied Expression */ - + public BooleanExpression copy(); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/ExpressionException.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/ExpressionException.java index faeeb984ca..b697295537 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/ExpressionException.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/ExpressionException.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -32,14 +32,14 @@ */ public class ExpressionException extends RuntimeException { - + /** * Creates a new ExpressionException with the given message * * @param s the exception message */ - + public ExpressionException(String s) { super(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/Main.java index 5cc7909672..8daeac1ec3 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,47 +15,47 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Intepreter design pattern example.

    + * Implements the driver for the Intepreter design pattern example.

    * * Intent: Given a language, define a representation for its grammar along * with an interpreter that uses the representation to interpret sentences * in the language.

    * - * Participating objects are: BooleanContant as - * TerminalExpression; VariableExpression, - * OrExpression, AndExpression, and - * NotExpression as NonterminalExpressions. - * - * The AbstractExpression interface is defined + * Participating objects are: BooleanContant as + * TerminalExpression; VariableExpression, + * OrExpression, AndExpression, and + * NotExpression as NonterminalExpressions. + * + * The AbstractExpression interface is defined * in BooelanExp.

    * - * This example implements an interpreter for a language of boolean + * This example implements an interpreter for a language of boolean * expressions. As a sample expression, "((true & x) | (y & !x))" is - * interpreted for all possible boolean values for x and y. After that, + * interpreted for all possible boolean values for x and y. After that, * y is replaced by another expression and the whole expression is - * evaluated again. + * evaluated again. * *

    This is the Java version.

    * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 - * + * * @see BooleanExpression */ -public class Main { - - /** - * Assigns boolean values to two VariableExpressions +public class Main { + + /** + * Assigns boolean values to two VariableExpressions * and evaluates an expression in the given context. * * @param x a boolean variable expression @@ -66,12 +66,12 @@ public class Main { * @param exp the expression to evaluate */ - private static void assignAndEvaluate( - VariableExpression x, + private static void assignAndEvaluate( + VariableExpression x, boolean xValue, - VariableExpression y, + VariableExpression y, boolean yValue, - VariableContext context, + VariableContext context, BooleanExpression exp) { context.assign(x, xValue); context.assign(y, yValue); @@ -80,7 +80,7 @@ private static void assignAndEvaluate( } /** - * Implements the driver for the Intepreter design pattern example.

    + * Implements the driver for the Intepreter design pattern example.

    * * @param command-line parameters, unused. */ @@ -88,23 +88,23 @@ private static void assignAndEvaluate( public static void main(String[] args) { BooleanExpression exp = null; VariableContext context = new VariableContext(); - + VariableExpression x = new VariableExpression("X"); - VariableExpression y = new VariableExpression("Y"); - - exp = new OrExpression(new AndExpression(new BooleanConstant(true), x), + VariableExpression y = new VariableExpression("Y"); + + exp = new OrExpression(new AndExpression(new BooleanConstant(true), x), new AndExpression(y, new NotExpression(x))); - - System.out.println("Testing Expression: ((true & x) | (y & !x))"); + + System.out.println("Testing Expression: ((true & x) | (y & !x))"); assignAndEvaluate(x, false, y, false, context, exp); assignAndEvaluate(x, false, y, true, context, exp); assignAndEvaluate(x, true, y, false, context, exp); assignAndEvaluate(x, true, y, true, context, exp); - + VariableExpression z = new VariableExpression("Z"); NotExpression notZ = new NotExpression(z); - + BooleanExpression replacement = exp.replace("Y", notZ); context.assign(z, false); boolean result = replacement.evaluate(context); @@ -112,4 +112,3 @@ public static void main(String[] args) { System.out.println("The result for the replacement is: "+result); } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/NotExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/NotExpression.java index 298d4e2ee7..ac09825e9b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/NotExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/NotExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -82,4 +82,4 @@ public BooleanExpression replace(String name, BooleanExpression exp) { public BooleanExpression copy() { return new NotExpression(exp.copy()); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/OrExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/OrExpression.java index c2a3f24855..0da3745e60 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/OrExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/OrExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -89,4 +89,4 @@ public BooleanExpression replace(String name, BooleanExpression exp) { public BooleanExpression copy() { return new OrExpression(expression1.copy(), expression2.copy()); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/VariableContext.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/VariableContext.java index c9f59d0e47..20e8d2f75c 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/VariableContext.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/VariableContext.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.Hashtable; /** - * Implements a Context for the interpretation of boolean + * Implements a Context for the interpretation of boolean * expressions

    * * @author Jan Hannemann @@ -33,8 +33,8 @@ * @version 1.1, 02/11/04 */ -public class VariableContext { - +public class VariableContext { + /** * stores the mapping between variable names and values */ @@ -47,23 +47,23 @@ public class VariableContext { * @param name the name of the variable * @return the value of the variable */ - + public boolean lookup(String name) { Boolean value = (Boolean) assignments.get(name); if (value == null) { throw new ExpressionException("No variable \""+name+"\" known."); } return value.booleanValue(); - } - + } + /** * Assigns a boolean value to a VariableExpression * * @param varExp the varaible Expression to assign a value to - * @param bool the boolean value to assign + * @param bool the boolean value to assign */ - + public void assign(VariableExpression varExp, boolean bool) { assignments.put(varExp.getName(), new Boolean(bool)); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/VariableExpression.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/VariableExpression.java index caa429898f..bbdffdfc4a 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/VariableExpression.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/interpreter/java/VariableExpression.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a variable expression for booleans. This is a concrete + * Implements a variable expression for booleans. This is a concrete * boolean NonterminalExpression * expression * @@ -33,29 +33,29 @@ */ public class VariableExpression implements BooleanExpression { - - /** + + /** * the name of the variable this object represents */ - - protected String name = null; - + + protected String name = null; + /** - * Creates a new VariableExpression with the given name + * Creates a new VariableExpression with the given name * - * @param name the name of the new variable + * @param name the name of the new variable */ public VariableExpression(String name) { this.name = name; - } - + } + /** * Accessor for the variable's name * * @return the name of the variable */ - + public String getName() { return name; } @@ -70,7 +70,7 @@ public String getName() { public boolean evaluate(VariableContext c) { return c.lookup(name); } - + /** * Replaces a variable with an Expression * @@ -86,14 +86,14 @@ public BooleanExpression replace(String name, BooleanExpression exp) { return new VariableExpression(this.name); } } - + /** * Copies this Expression * * @return the copied Expression */ - + public BooleanExpression copy() { return new VariableExpression(name); - } -} \ No newline at end of file + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/Main.java index 5afe1bc77b..6d7ceb34b7 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.Iterator; - + /** - * Implements the driver for the Iterator design pattern example.

    + * Implements the driver for the Iterator design pattern example.

    * * Intent: Provide a way to access the elements of an aggregate object * sequentially without exposing its underlying representation.

    @@ -35,8 +35,8 @@ * java.util.Iterator as Iterator, and ReverseIterator * as ConcreteIterator. * - * In this example, the concrete aggregate is a list that gets filled with - * five integer objects (1 to 5). The, the ReverseIterator is + * In this example, the concrete aggregate is a list that gets filled with + * five integer objects (1 to 5). The, the ReverseIterator is * created and used to print all elements in reverse order. * *

    This is the AspectJ version.

    @@ -45,7 +45,7 @@ * @author Gregor Kiczales * @version 1.1, 02/12/04 * - * @see SimpleList + * @see SimpleList * @see OpenList * @see java.util.Iterator * @see OpenListIteration @@ -53,46 +53,46 @@ public class Main { - + /** * Prints all elements in the iterator to System.out. * * @param iter the iterator which elements are to be printed - */ - - private static void print(Iterator iter) { + */ + + private static void print(Iterator iter) { while(iter.hasNext()) { System.out.println(iter.next()); } } - + /** - * Implements the driver for the Iterator design pattern example.

    + * Implements the driver for the Iterator design pattern example.

    * - * In this example, the concrete aggregate is a list that gets filled with - * five integer objects (1 to 5). The, the ReverseIterator is - * created and used to print all elements in reverse order. + * In this example, the concrete aggregate is a list that gets filled with + * five integer objects (1 to 5). The, the ReverseIterator is + * created and used to print all elements in reverse order. * * @param args command line paramters, unused */ - + public static void main(String[] args) { - + OpenList openList = new OpenList(); openList.append(new Integer(1)); - openList.append(new Integer(2)); + openList.append(new Integer(2)); openList.append(new Integer(3)); openList.append(new Integer(4)); - openList.append(new Integer(5)); - + openList.append(new Integer(5)); + System.out.println("List created, containing int objects 1, 2, 3, 4, 5."); - + Iterator iter = OpenListIteration.aspectOf().createIteratorFor(openList); - + System.out.println("Using ReverseIterator to print list elements in reverse order..."); print(iter); System.out.println("done."); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/OpenList.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/OpenList.java index 7eb5d04a18..f3351b0609 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/OpenList.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/OpenList.java @@ -1,4 +1,4 @@ -package ca.ubc.cs.spl.aspectPatterns.examples.iterator.aspectj; +package ca.ubc.cs.spl.aspectPatterns.examples.iterator.aspectj; /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,18 +15,18 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.Iterator; /** - * Implements a basic open list. This implementation is based on - * java.util.LinkedList. In essence, this class acts as an + * Implements a basic open list. This implementation is based on + * java.util.LinkedList. In essence, this class acts as an * adapter for the Java class.

    * * In this version, it is no longer necessary to implement the factory @@ -38,51 +38,51 @@ */ public class OpenList implements SimpleList { - + java.util.LinkedList list = new java.util.LinkedList(); - - /** + + /** * Returns the number of elements in the list * * @return the number of elements in the list */ - + public int count() { return list.size(); } - + /** - * Appends an object to the list. Since this is an open list, inserting + * Appends an object to the list. Since this is an open list, inserting * elements is assumed to succeed. * * @param o the object to append * @return true if successful, false otherwise */ - + public boolean append(Object o) { list.addLast(o); return true; } - + /** * Removes an object from the list * * @param o the object to remove * @return true if successful, false otherwise */ - + public boolean remove(Object o) { - return list.remove(o); - } - + return list.remove(o); + } + /** * Returns an object from the list * * @param index the position of the object * @return the object at position index */ - + public Object get(int index) { return list.get(index); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/OpenListIteration.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/OpenListIteration.java index 0fc2b17244..9b4a76ad12 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/OpenListIteration.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/OpenListIteration.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.NoSuchElementException; @@ -34,12 +34,12 @@ * @author Gregor Kiczales * @version 1.1, 02/12/04 * - * @see SimpleList + * @see SimpleList * @see OpenList */ -public aspect OpenListIteration { - +public aspect OpenListIteration { + /** * Implements the factory method to create the reverse iterator for the * OpenList class using the open classes mechanism. @@ -63,68 +63,67 @@ Iterator createIteratorFor(OpenList list) { /** * Provides the implementation of the reverse iterator. Instead - * of defining an inner class, one could also instantiate + * of defining an inner class, one could also instantiate * java.util.Iterator as an anonymous class and overwrite * the appropriate methods. */ static class ReverseIterator implements Iterator { - + /** * the positition of the current element */ - - protected int current; - + + protected int current; + /** * the list this iterator operates on */ - - protected SimpleList list; - + + protected SimpleList list; + /** * Returns true if the iteration has more elements. * * @return true if the iteration has more elements */ - + public boolean hasNext() { return (current > 0); } - + /** * This opional method is not implemented for this iterator. - */ - + */ + public void remove() { throw new UnsupportedOperationException("remove() not supported"); - } - + } + /** * Returns the next element in the iteration. * - * @return the next element in the iteration. + * @return the next element in the iteration. */ - + public Object next() { if (!hasNext()) { - throw new ArrayIndexOutOfBoundsException("Iterator out of Bounds"); + throw new ArrayIndexOutOfBoundsException("Iterator out of Bounds"); } else { return list.get(--current); } } - + /** * Creates a new ReverseIterator from the given list. * * @param list the list to generate an iterator from */ - + public ReverseIterator(SimpleList list) { - super(); + super(); this.list = list; current = list.count(); } } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/SimpleList.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/SimpleList.java index c8b7384c8c..6b212d4fe2 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/SimpleList.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/aspectj/SimpleList.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,40 +15,40 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Defines an interface for a basic list. + * Defines an interface for a basic list. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/12/04 - * + * * @see OpenList */ -public interface SimpleList { - - /** +public interface SimpleList { + + /** * Returns the number of elements in the list * * @return the number of elements in the list */ - - public int count(); - + + public int count(); + /** * Appends an object to the list * * @param o the object to append * @return true if successful, false otherwise */ - + public boolean append(Object o); /** @@ -57,8 +57,8 @@ public interface SimpleList { * @param o the object to remove * @return true if successful, false otherwise */ - - public boolean remove(Object o); + + public boolean remove(Object o); /** * Returns an object from the list @@ -66,7 +66,6 @@ public interface SimpleList { * @param index the position of the object * @return the object at position index */ - + public Object get(int index); -} - \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/Main.java index 03d378c916..84ccde10c1 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -94,4 +94,4 @@ public static void main(String[] args) { System.out.println("done."); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/OpenList.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/OpenList.java index 31fcf7b6d1..a3457d36ec 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/OpenList.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/OpenList.java @@ -1,4 +1,4 @@ -package ca.ubc.cs.spl.aspectPatterns.examples.iterator.java; +package ca.ubc.cs.spl.aspectPatterns.examples.iterator.java; /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,18 +15,18 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.Iterator; /** - * Implements a basic open list. This implementation is based on - * java.util.LinkedList. In essence, this class acts as an + * Implements a basic open list. This implementation is based on + * java.util.LinkedList. In essence, this class acts as an * adapter for the Java class. * * @author Jan Hannemann @@ -35,61 +35,61 @@ */ public class OpenList implements SimpleList { - + java.util.LinkedList list = new java.util.LinkedList(); - - /** + + /** * Returns the number of elements in the list * * @return the number of elements in the list */ - + public int count() { return list.size(); } - + /** - * Appends an object to the list. Since this is an open list, inserting + * Appends an object to the list. Since this is an open list, inserting * elements is assumed to succeed. * * @param o the object to append * @return true if successful, false otherwise */ - + public boolean append(Object o) { list.addLast(o); return true; } - + /** * Removes an object from the list * * @param o the object to remove * @return true if successful, false otherwise */ - + public boolean remove(Object o) { - return list.remove(o); - } - + return list.remove(o); + } + /** * Returns an object from the list * * @param index the position of the object - * @return the object at the specified index + * @return the object at the specified index */ - + public Object get(int index) { return list.get(index); } - + /** - * Returns a reverse iterator for this list. + * Returns a reverse iterator for this list. * * @return the a reverse iterator for this list */ - + public Iterator createReverseIterator() { return new ReverseIterator(this); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/ReverseIterator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/ReverseIterator.java index 160f8c77b0..34708a4a07 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/ReverseIterator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/ReverseIterator.java @@ -1,4 +1,4 @@ -package ca.ubc.cs.spl.aspectPatterns.examples.iterator.java; +package ca.ubc.cs.spl.aspectPatterns.examples.iterator.java; /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,19 +15,19 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.Iterator; /** - * Implements a reverse iterator. This means that it will return elements in - * reverse order. We chose not to define our own Iterator, but to use - * Java's java.util.Iterator interface. + * Implements a reverse iterator. This means that it will return elements in + * reverse order. We chose not to define our own Iterator, but to use + * Java's java.util.Iterator interface. * * @author Jan Hannemann * @author Gregor Kiczales @@ -35,60 +35,60 @@ */ public class ReverseIterator implements Iterator { - + /** * the positition of the current element */ - protected int current; - + protected int current; + /** * the list this iterator operates on */ - - protected SimpleList list; - + + protected SimpleList list; + /** * Returns true if the iteration has more elements. * * @return true if the iteration has more elements */ - + public boolean hasNext() { return (current > 0); } - + /** * This opional method is not implemented for this iterator. - */ - + */ + public void remove() { throw new UnsupportedOperationException("remove() not supported"); - } - + } + /** * Returns the next element in the iteration. * - * @return the next element in the iteration. + * @return the next element in the iteration. */ public Object next() { if (!hasNext()) { - throw new ArrayIndexOutOfBoundsException("Iterator out of Bounds"); + throw new ArrayIndexOutOfBoundsException("Iterator out of Bounds"); } else { return list.get(--current); } } - + /** * Creates a new ReverseIterator from the given list. * * @param list the list to generate an iterator from */ - + public ReverseIterator(SimpleList list) { - super(); + super(); this.list = list; current = list.count(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/SimpleList.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/SimpleList.java index 9fa5732823..d28f1f6228 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/SimpleList.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/iterator/java/SimpleList.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,40 +15,40 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Defines an interface for a basic list. + * Defines an interface for a basic list. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/12/04 - * + * * @see OpenList */ -public interface SimpleList { - - /** +public interface SimpleList { + + /** * Returns the number of elements in the list * * @return the number of elements in the list */ - - public int count(); - + + public int count(); + /** * Appends an object to the list * * @param o the object to append * @return true if successful, false otherwise */ - + public boolean append(Object o); /** @@ -57,8 +57,8 @@ public interface SimpleList { * @param o the object to remove * @return true if successful, false otherwise */ - - public boolean remove(Object o); + + public boolean remove(Object o); /** * Returns an object from the list at a given index @@ -66,7 +66,6 @@ public interface SimpleList { * @param index the position of the object * @return the object at position index */ - + public Object get(int index); -} - \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Button.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Button.java index 3ba0ee59fd..d649080236 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Button.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Button.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,20 +15,20 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; -/** - * Basically a JButton with an ActionListener. - * The listener calls clicked() when the button gets pressed. +/** + * Basically a JButton with an ActionListener. + * The listener calls clicked() when the button gets pressed. * * @author Jan Hannemann * @author Gregor Kiczales @@ -36,22 +36,22 @@ */ public class Button extends JButton { - + /** * Creates a new Button object with the provided label. * - * @param name the label for the new Button object + * @param name the label for the new Button object */ - + public Button(String name) { super(name); this.setActionCommand(name); this.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - clicked(); + clicked(); } - }); + }); } - - public void clicked() {} -} \ No newline at end of file + + public void clicked() {} +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Label.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Label.java index d19f6bef29..a63b3a88fa 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Label.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Label.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.*; -/** - * Basically a JLabel. Acts as Mediator. +/** + * Basically a JLabel. Acts as Mediator. * * @author Jan Hannemann * @author Gregor Kiczales @@ -33,14 +33,14 @@ */ public class Label extends JLabel { - + /** * Creates a new Label object with the provided name. * - * @param s the tag for the new Label object + * @param s the tag for the new Label object */ - + public Label(String s) { super(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Main.java index 605b6ed3f6..68092abe78 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,21 +15,21 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.*; import java.awt.event.*; /** - * Implements the driver for the mediator design pattern example.

    + * Implements the driver for the mediator design pattern example.

    * * Intent: Define an object that encapsulates how a set of objects - * interact. Mediator promotes loose coupling by keeping objects from + * interact. Mediator promotes loose coupling by keeping objects from * referring to each other explicitly, and it lets you vary their interaction * independently.

    * @@ -44,15 +44,15 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/12/04 - * + * * @see Button * @see Label */ - + public class Main { - - static JFrame frame = new JFrame("Mediator Demo"); + + static JFrame frame = new JFrame("Mediator Demo"); static Button button1 = new Button("Button1"); static Button button2 = new Button("Button2"); static Label label = new Label ("Click a button!"); @@ -60,30 +60,30 @@ public class Main { /** * Implements the driver for the mediator example. It creates a small * GUI with a label and two buttons. The buttons are Colleagues, - * the label is the Mediator. + * the label is the Mediator. * * Each button click causes the mediator to update itself and the * calling button. - */ - + */ + public static void main(String[] args) {; - + frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} }); - + JPanel panel = new JPanel(); - + panel.add(label); panel.add(button1); - panel.add(button2); - + panel.add(button2); + frame.getContentPane().add(panel); frame.pack(); - frame.setVisible(true); - - MediatorImplementation.aspectOf().setMediator(button1, label); - MediatorImplementation.aspectOf().setMediator(button2, label); + frame.setVisible(true); + + MediatorImplementation.aspectOf().setMediator(button1, label); + MediatorImplementation.aspectOf().setMediator(button2, label); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/MediatorImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/MediatorImplementation.java index 8a3a9e31b3..f09a3e90fa 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/MediatorImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/aspectj/MediatorImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,19 +15,19 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import ca.ubc.cs.spl.aspectPatterns.patternLibrary.MediatorProtocol; /** - * Concretizes the mediation relationship for Button - * (as Colleague) and Label (as Mediator). - * Button clicks trigger Label updates. + * Concretizes the mediation relationship for Button + * (as Colleague) and Label (as Mediator). + * Button clicks trigger Label updates. * * @author Jan Hannemann * @author Gregor Kiczales @@ -37,44 +37,44 @@ public aspect MediatorImplementation extends MediatorProtocol { /** - * Assings the Colleague role to the Button + * Assings the Colleague role to the Button * class. Roles are modeled as (empty) interfaces. */ - + declare parents: Button implements Colleague; /** - * Assings the Mediator role to the Label + * Assings the Mediator role to the Label * class. Roles are modeled as (empty) interfaces. */ declare parents: Label implements Mediator; /** - * Defines what changes on Colleagues cause their Mediator to be + * Defines what changes on Colleagues cause their Mediator to be * notified (here: Button clicks) * * @param cs the colleague on which the change occured */ - protected pointcut change(Colleague c): + protected pointcut change(Colleague c): (call(void Button.clicked()) && target(c)); /** * Defines how the Mediator is to be updated when a change - * to a Colleague occurs. Here, the label's text is set - * depending on which button was clicked. The appropriate button's label + * to a Colleague occurs. Here, the label's text is set + * depending on which button was clicked. The appropriate button's label * is also updated. * * @param c the colleague on which a change of interest occured - * @param m the mediator to be notifed of the change + * @param m the mediator to be notifed of the change */ protected void notifyMediator(Colleague c, Mediator m) { Button button = (Button) c; - Label label = (Label) m; + Label label = (Label) m; if (button == Main.button1) { - label.setText("Button1 clicked"); + label.setText("Button1 clicked"); } else if (button == Main.button2) { label.setText("Button2 clicked"); } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Button.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Button.java index 6c6854033e..83f1b2566d 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Button.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Button.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,57 +15,57 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; -/** - * Basically a JButton with an ActionListener. - * The listener calls clicked() when the button gets pressed. +/** + * Basically a JButton with an ActionListener. + * The listener calls clicked() when the button gets pressed. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/12/04 */ -public class Button extends JButton implements GUIColleague { - +public class Button extends JButton implements GUIColleague { + private GUIMediator mediator; - + /** * Creates a new Button object with the provided label. * - * @param name the label for the new Button object + * @param name the label for the new Button object */ - + public Button(String name) { super(name); this.setActionCommand(name); this.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - clicked(); + clicked(); } - }); + }); } - + public void clicked() { mediator.colleagueChanged(this); - } - + } + /** * Allows to set the Mediator for this Colleague * * @param mediator the new mediator */ - + public void setMediator(GUIMediator mediator) { this.mediator = mediator; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/GUIColleague.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/GUIColleague.java index 69c2814322..7202da1f06 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/GUIColleague.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/GUIColleague.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,30 +15,30 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * This interface is implemented by all types that the Mediator * interacts with. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/12/04 */ - + public interface GUIColleague { /** - * Defines the method signature for setting a Colleague's + * Defines the method signature for setting a Colleague's * Mediator. * * @param mediator the new mediator */ - + public void setMediator(GUIMediator mediator); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/GUIMediator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/GUIMediator.java index 61efcfc842..d253af74af 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/GUIMediator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/GUIMediator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,31 +15,31 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * This is the Mediator interface. It defines a method for dealing - * with changes in Colleagues that require updates. + * with changes in Colleagues that require updates. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/12/04 */ - + public interface GUIMediator { - + /** - * Defines the method signature for notifying Mediators of changes - * to Colleagues. This method is called by colleagues who + * Defines the method signature for notifying Mediators of changes + * to Colleagues. This method is called by colleagues who * pass themselves as an argument (push model). * * @param colleague the changing colleage */ - + public void colleagueChanged(GUIColleague colleague); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Label.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Label.java index 2146ff340c..1e80e107d0 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Label.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Label.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.*; -/** - * Basically a JLabel. Acts as Mediator. +/** + * Basically a JLabel. Acts as Mediator. * * @author Jan Hannemann * @author Gregor Kiczales @@ -33,31 +33,31 @@ */ public class Label extends JLabel implements GUIMediator { - + /** * Creates a new Label object with the provided name. * - * @param s the tag for the new Label object + * @param s the tag for the new Label object */ - + public Label(String s) { super(s); } /** - * Handles the event that a colleague chanbged. + * Handles the event that a colleague chanbged. * - * @param colleague the Colleague that caused the notification + * @param colleague the Colleague that caused the notification */ - - public void colleagueChanged(GUIColleague colleague) { + + public void colleagueChanged(GUIColleague colleague) { Button button = (Button) colleague; - + if (button == Main.button1) { - this.setText("Button1 clicked"); + this.setText("Button1 clicked"); } else if (button == Main.button2) { this.setText("Button2 clicked"); } button.setText("(Done)"); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Main.java index 7fcf668f1b..c2b7dcb745 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/mediator/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,21 +15,21 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import javax.swing.*; import java.awt.event.*; /** - * Implements the driver for the Mediator design pattern example.

    + * Implements the driver for the Mediator design pattern example.

    * * Intent: Define an object that encapsulates how a set of objects - * interact. Mediator promotes loose coupling by keeping objects from + * interact. Mediator promotes loose coupling by keeping objects from * referring to each other explicitly, and it lets you vary their interaction * independently.

    * @@ -37,10 +37,10 @@ * and a Label as Mediator. * * Every time an event of interest (a button click) occurs, the mediating - * Label is updated and it in turn updates the respective + * Label is updated and it in turn updates the respective * calling button. * - *

    This is the Java version.

    + *

    This is the Java version.

    * * Both Mediator and Colleagues have to be aware of their role * within the pattern. @@ -48,15 +48,15 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/12/04 - * + * * @see Button * @see Label */ - + public class Main { - - static JFrame frame = new JFrame("Mediator Demo"); + + static JFrame frame = new JFrame("Mediator Demo"); static Button button1 = new Button("Button1"); static Button button2 = new Button("Button2"); static Label label = new Label ("Click a button!"); @@ -64,30 +64,30 @@ public class Main { /** * Implements the driver for the mediator example. It creates a small * GUI with a label and two buttons. The buttons are Colleagues, - * the label is the Mediator. + * the label is the Mediator. * * Each button click causes the mediator to update itself and the * calling button. - */ - + */ + public static void main(String[] args) {; - + frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {System.exit(0);} }); - + JPanel panel = new JPanel(); - + panel.add(label); panel.add(button1); - panel.add(button2); - + panel.add(button2); + frame.getContentPane().add(panel); frame.pack(); - frame.setVisible(true); - - button1.setMediator(label); - button2.setMediator(label); + frame.setVisible(true); + + button1.setMediator(label); + button2.setMediator(label); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/Counter.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/Counter.java index f3f395338d..8bbc7a1980 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/Counter.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/Counter.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a sample Originator class. Objects of this particular - * Originator have state, an int representing the number of time + * Implements a sample Originator class. Objects of this particular + * Originator have state, an int representing the number of time * the increment() method was called. * * @author Jan Hannemann @@ -33,26 +33,26 @@ */ public class Counter { - + /** * the number of times increment() was called on this object */ protected int currentValue = 0; - + /** * increments the counter (this Originator's state) by one */ - public void increment() { - currentValue++; + public void increment() { + currentValue++; } - + /** * Displays the state of this Originator */ - public void show() { - System.out.println("Originator value is " + currentValue); + public void show() { + System.out.println("Originator value is " + currentValue); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/CounterMemento.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/CounterMemento.java index 48fd6aa3bb..54efe99345 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/CounterMemento.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/CounterMemento.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -89,4 +89,4 @@ public void setMemento(Originator o, Memento m) { throw new MementoException("Invalid originator"); } } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/Main.java index ee2e2a85df..64baea31d2 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,19 +15,19 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -import ca.ubc.cs.spl.aspectPatterns.patternLibrary.Memento; +import ca.ubc.cs.spl.aspectPatterns.patternLibrary.Memento; /** - * Implements the driver for the Memento design pattern example.

    + * Implements the driver for the Memento design pattern example.

    * - * Intent: Without violating encapsulation, capture and externalize an + * Intent: Without violating encapsulation, capture and externalize an * object's internal state so that the object can be restored to this state * later

    * @@ -39,14 +39,14 @@ * are done, the Memento is used to restore the Originator's * state. * - *

    This is the AspectJ version.

    + *

    This is the AspectJ version.

    * * Memento and Originator are decoupled. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/12/04 - * + * * @see StateMemento * @see MyOriginator */ @@ -54,32 +54,32 @@ public class Main { - + /** * This example changes the state of the Originator five times, but - * creates a Memento of it after the third change. After the 5 - * changes are done, the Memento is used to restore the - * Originator's state. - * + * creates a Memento of it after the third change. After the 5 + * changes are done, the Memento is used to restore the + * Originator's state. + * * @param args command line parameters, unused. */ - - public static void main(String[] args) { - - Memento storedState = null; - Counter counter = new Counter(); - + + public static void main(String[] args) { + + Memento storedState = null; + Counter counter = new Counter(); + for (int i=1; i<=5; i++) { counter.increment(); - counter.show(); - if (i==3) { - storedState = - CounterMemento.aspectOf().createMementoFor(counter); + counter.show(); + if (i==3) { + storedState = + CounterMemento.aspectOf().createMementoFor(counter); } } - + System.out.println("\nTrying to reinstate state (3)..."); CounterMemento.aspectOf().setMemento(counter, storedState); - counter.show(); + counter.show(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/Counter.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/Counter.java index 83aca53fe1..2a3d3a8aa6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/Counter.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/Counter.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a sample Originator class. Objects of this particular - * Originator have state, an int representing the number of time + * Implements a sample Originator class. Objects of this particular + * Originator have state, an int representing the number of time * the increment() method was called. * * @author Jan Hannemann @@ -33,46 +33,46 @@ */ public class Counter { - + /** * the number of times increment() was called on this object */ protected int currentValue = 0; - + /** * increments the counter (this Originator's state) by one */ - public void increment() { - currentValue++; + public void increment() { + currentValue++; } - + /** * Displays the state of this Originator */ - public void show() { - System.out.println("Originator value is " + currentValue); - } - + public void show() { + System.out.println("Originator value is " + currentValue); + } + /** - * Creates a Memento from this Originator, storing the + * Creates a Memento from this Originator, storing the * current state */ - public CounterMemento createMemento() { - return new CounterMemento(currentValue); + public CounterMemento createMemento() { + return new CounterMemento(currentValue); } - + /** - * Restores this Originator to former state stored by the + * Restores this Originator to former state stored by the * memento passed * * @param memento the Memento that stores the prior state */ - public void setMemento(CounterMemento memento) { - currentValue = memento.getState(); + public void setMemento(CounterMemento memento) { + currentValue = memento.getState(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/CounterMemento.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/CounterMemento.java index f2b6dba231..2cedc373fd 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/CounterMemento.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/CounterMemento.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -71,4 +71,4 @@ public int getState() { public CounterMemento(int init) { state = init; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/Main.java index 0827c6972a..02b1316106 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/memento/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the memento design pattern example.

    + * Implements the driver for the memento design pattern example.

    * - * Intent: Without violating encapsulation, capture and externalize an + * Intent: Without violating encapsulation, capture and externalize an * object's internal state so that the object can be restored to this state * later

    * @@ -37,7 +37,7 @@ * are done, the Memento is used to restore the Originator's * state. * - *

    This is the Java version.

    + *

    This is the Java version.

    * * Memento and Originator are tightly coupled. * @@ -47,29 +47,29 @@ */ public class Main { - + /** * This example changes the state of the Originator five times, but - * creates a Memento of it after the third change. After the 5 - * changes are done, the Memento is used to restore the - * Originator's state. + * creates a Memento of it after the third change. After the 5 + * changes are done, the Memento is used to restore the + * Originator's state. */ - - public static void main(String[] args) { - + + public static void main(String[] args) { + CounterMemento storedState = null; - Counter counter = new Counter(); - + Counter counter = new Counter(); + for (int i=1; i<=5; i++) { counter.increment(); - counter.show(); - if (i==3) { - storedState = counter.createMemento(); + counter.show(); + if (i==3) { + storedState = counter.createMemento(); } } - + System.out.println("\nTrying to reinstate state (3)..."); counter.setMemento(storedState); - counter.show(); + counter.show(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/ColorObserver.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/ColorObserver.java index 44af56c27f..40c5bc1378 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/ColorObserver.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/ColorObserver.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/CoordinateObserver.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/CoordinateObserver.java index ea5c9635cc..202d5dca69 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/CoordinateObserver.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/CoordinateObserver.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,18 +15,18 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.ObserverProtocol; /** - * Concretizes the observing relationship for Point (subject) - * and Screen (observer). Coordinate changes trigger updates. + * Concretizes the observing relationship for Point (subject) + * and Screen (observer). Coordinate changes trigger updates. * * @author Jan Hannemann * @author Gregor Kiczales @@ -40,33 +40,33 @@ * Assings the Subject role to the Point class. * Roles are modeled as (empty) interfaces. */ - + declare parents: Point implements Subject; /** * Assings the Observer role to the Screen class. * Roles are modeled as (empty) interfaces. */ - + declare parents: Screen implements Observer; /** * Specifies the join points that represent a change to the * Subject. Captures calls to Point.setX(int) - * and Point.setY(int). + * and Point.setY(int). * @param subject the Point acting as Subject */ - protected pointcut subjectChange(Subject subject): + protected pointcut subjectChange(Subject subject): (call(void Point.setX(int)) || call(void Point.setY(int)) ) && target(subject); /** * Defines how Observers are to be updated when a change - * to a Subject occurs. + * to a Subject occurs. * * @param subject the Subject on which a change of interest occured - * @param observer the bserver to be notifed of the change + * @param observer the bserver to be notifed of the change */ protected void updateObserver(Subject subject, Observer observer) { diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Main.java index 1e57db1728..8ddd2f478b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,20 +15,20 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -import java.awt.Color; +import java.awt.Color; /** * Implements the driver for the Observer design pattern example.

    * * Intent: Define a one-to-many dependency between objects so that when one - * object changes state, all its dependents are notified and updated + * object changes state, all its dependents are notified and updated * automatically

    * * Participating objects are Point p and Screen @@ -39,7 +39,7 @@ * p. *

  • Screen s3 and s4 observe coordinate changes of * Point p. - *
  • Screen s5 observes the display(String) + *
  • Screen s5 observes the display(String) * methods of Screen s2 and s4. * * @@ -52,61 +52,61 @@ * @author Gregor Kiczales * @version 1.11, 04/01/04 */ - -public class Main { - + +public class Main { + /** - * Implements the driver for the Observer example. It creates five + * Implements the driver for the Observer example. It creates five * Screen objects and one Point object - * and sets the appropriate observing relationships (see above). - * After the setup, the color of the point is changed, then it's + * and sets the appropriate observing relationships (see above). + * After the setup, the color of the point is changed, then it's * x-coordinate.

    * The following results should be expected:

      - *
    1. The color change should trigger s1 and s2 to each print an + *
    2. The color change should trigger s1 and s2 to each print an * appropriate message. *
    3. s2's message should trigger it's observer s5 to print * a message. *
    4. The coordinate change should trigger s3 and s4. - *
    5. s4's message should trigger it's observer s5 again. + *
    6. s4's message should trigger it's observer s5 again. *
    - */ + */ public static void main(String argv[]) { - + Point p = new Point(5, 5, Color.blue); - + System.out.println("Creating Screen s1,s2,s3,s4,s5 and Point p"); - + Screen s1 = new Screen("s1"); Screen s2 = new Screen("s2"); - + Screen s3 = new Screen("s3"); Screen s4 = new Screen("s4"); - + Screen s5 = new Screen("s5"); - System.out.println("Creating observing relationships:"); - System.out.println("- s1 and s2 observe color changes to p"); + System.out.println("Creating observing relationships:"); + System.out.println("- s1 and s2 observe color changes to p"); System.out.println("- s3 and s4 observe coordinate changes to p"); System.out.println("- s5 observes s2's and s4's display() method"); - - ColorObserver.aspectOf().addObserver(p, s1); + + ColorObserver.aspectOf().addObserver(p, s1); ColorObserver.aspectOf().addObserver(p, s2); - - CoordinateObserver.aspectOf().addObserver(p, s3); + + CoordinateObserver.aspectOf().addObserver(p, s3); CoordinateObserver.aspectOf().addObserver(p, s4); - + ScreenObserver.aspectOf().addObserver(s2, s5); ScreenObserver.aspectOf().addObserver(s4, s5); - System.out.println("Changing p's color:"); + System.out.println("Changing p's color:"); p.setColor(Color.red); - System.out.println("Changing p's x-coordinate:"); + System.out.println("Changing p's x-coordinate:"); + + p.setX(4); - p.setX(4); - - System.out.println("done."); + System.out.println("done."); } } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Point.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Point.java index 0709e59e5b..8240ddcf53 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Point.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Point.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.awt.Color; @@ -31,45 +31,45 @@ * @author Gregor Kiczales * @version 1.11, 04/01/04 */ - + public class Point { /** * the point's x-coordinate */ - + private int x; - + /** * the point's y-coordinate */ - + private int y; - - /** + + /** * the point's current color */ - + private Color color; - + /** * Creates a new point object based on x and y coordinates and color. */ - + public Point(int x, int y, Color color) { this.x=x; this.y=y; this.color=color; } - + /** * Returns the point's current x-coordinate. * * @return the current x-coordinate */ - public int getX() { - return x; + public int getX() { + return x; } /** @@ -78,18 +78,18 @@ public int getX() { * @return the current y-coordinate */ - public int getY() { - return y; + public int getY() { + return y; } - + /** * Sets the current x-coordinate. * * @param x the new x-coordinate */ - public void setX(int x) { - this.x = x; + public void setX(int x) { + this.x = x; } /** @@ -98,7 +98,7 @@ public void setX(int x) { * @param y the new y-coordinate */ - public void setY(int y) { + public void setY(int y) { this.y = y; } @@ -108,8 +108,8 @@ public void setY(int y) { * @return the current color */ - public Color getColor() { - return color; + public Color getColor() { + return color; } /** @@ -118,7 +118,7 @@ public Color getColor() { * @param color the new color */ - public void setColor(Color color) { - this.color=color; + public void setColor(Color color) { + this.color=color; } } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Screen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Screen.java index 13c1bd9bcb..5690ea3d91 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Screen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/Screen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,48 +15,48 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - -/** + +/** * Provides a means to output messages. Objects of this class act as - * output devices. + * output devices. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.11, 04/01/04 */ - + public class Screen { - + /** * the individual name of this screen object */ private String name; - + /** * creates a new Screen object with the provided name. * - * @param name the name for the new Screen object + * @param name the name for the new Screen object */ - + public Screen(String s) { this.name = s; } /** - * Prints the name of the Screen object and the argument + * Prints the name of the Screen object and the argument * string to stdout. * * @param s the string to print */ - + public void display (String s) { System.out.println(name + ": " + s); } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/ScreenObserver.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/ScreenObserver.java index 1ee3619288..c4d64a7955 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/ScreenObserver.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/aspectj/ScreenObserver.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.ObserverProtocol; /** - * Concretizes the observing relationship for Screen (subject) + * Concretizes the observing relationship for Screen (subject) * and Screen (observer). Calls of Screen.display(String) * trigger updates. * @@ -40,38 +40,37 @@ * Assings the Subject role to the Screen class. * Roles are modeled as (empty) interfaces. */ - + declare parents: Screen implements Subject; /** * Assings the Observer role to the Screen class. * Roles are modeled as (empty) interfaces. */ - + declare parents: Screen implements Observer; /** * Specifies the join points that represent a change to the * Subject. Captures calls to Screen.display(String) - * . - * + * . + * * @param subject the Point acting as Subject */ - protected pointcut subjectChange(Subject subject): + protected pointcut subjectChange(Subject subject): call(void Screen.display(String)) && target(subject); /** * Defines how Observers are to be updated when a change - * to a Subject occurs. + * to a Subject occurs. * * @param subject the Subject on which a change of interest occured - * @param observer the bserver to be notifed of the change + * @param observer the bserver to be notifed of the change */ - + protected void updateObserver(Subject subject, Observer observer) { ((Screen)observer).display("Screen updated " + "(screen subject displayed message)."); - } + } } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/ChangeObserver.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/ChangeObserver.java index 21a7d58ffa..1768d1d346 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/ChangeObserver.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/ChangeObserver.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Declares the method used to update Observers. * @@ -29,15 +29,15 @@ * @author Gregor Kiczales * @version 1.11, 04/01/04 */ - + public interface ChangeObserver { - + /** * Updates an Observer. Uses the push strategy (i.e. the * subject triggering the update passes itself as an argument). * * @param s the Subject triggering the update */ - + public void refresh(ChangeSubject s); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/ChangeSubject.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/ChangeSubject.java index 221cb53a0f..e28bef501e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/ChangeSubject.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/ChangeSubject.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,43 +15,43 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Declares methods to attach and detach Observers to/from + * Declares methods to attach and detach Observers to/from * Subjects, and the notifyObservers() method. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.11, 04/01/04 */ - + public interface ChangeSubject { - + /** * Attaches an Observer to this Subject. - * + * * @param o the Observer to add */ - + public void addObserver(ChangeObserver o); /** * Detaches an Observer from this Subject. - * + * * @param o the Observer to remove */ - + public void removeObserver(ChangeObserver o); /** * Notifies all Observers. */ - + public void notifyObservers(); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Main.java index 8cfac7b4b4..8e1df22dd6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,20 +15,20 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -import java.awt.Color; +import java.awt.Color; /** * Implements the driver for the Observer design pattern example.

    * * Intent: Define a one-to-many dependency between objects so that when one - * object changes state, all its dependents are notified and updated + * object changes state, all its dependents are notified and updated * automatically

    * * Participating objects are Point p and Screen @@ -39,18 +39,18 @@ * p. *

  • Screen s3 and s4 observe coordinate changes of * Point p. - *
  • Screen s5 observes the display(String) + *
  • Screen s5 observes the display(String) * methods of Screen s2 and s4. * * * Every time an event of interest occurs, the observing Screen * prints an appropriate message to stdout.

    * - *

    This is the Java version.

    + *

    This is the Java version.

    * * The example illustrates that it is hard to * cleanly modularize the different observing relationships. The following - * implementation issues have to be considered for the Java version: + * implementation issues have to be considered for the Java version: *

      *
    • Observer and Subject can only be interfaces (as opposed to abstract * classes) if we do not want to restrict inhertance and thus code @@ -58,79 +58,79 @@ *
    • As interfaces, we cannot attach default implementations for methods * like attach(Observer), notify(), etc. Note that * these two problems only apply because Java does not offer multiple - * inheritance. + * inheritance. *
    • Some implementation constraints are made implicit and are thus not - * enforced: I.e., each Subject needs a field to store its + * enforced: I.e., each Subject needs a field to store its * Observers - *
    • The classes that become Subject and Observer in the - * pattern context need to be modified. In particular, Subjects - * need to store the mapping, implement the appropriate procedures. + *
    • The classes that become Subject and Observer in the + * pattern context need to be modified. In particular, Subjects + * need to store the mapping, implement the appropriate procedures. * Observers need to * implement update() *
    • If a particular class takes part in more than one observing * relationship (as in this example), it is difficult to have both - * notify/update mechanisms go through the same interface and yet - * separate them cleanly. + * notify/update mechanisms go through the same interface and yet + * separate them cleanly. *
    * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.11, 04/01/04 */ - -public class Main { - + +public class Main { + /** - * Implements the driver for the Observer example. It creates five + * Implements the driver for the Observer example. It creates five * Screen objects and one Point object - * and sets the appropriate observing relationships (see above). - * After the setup, the color of the point is changed, then it's + * and sets the appropriate observing relationships (see above). + * After the setup, the color of the point is changed, then it's * x-coordinate.

    * The following results should be expected:

      - *
    1. The color change should trigger s1 and s2 to each print an + *
    2. The color change should trigger s1 and s2 to each print an * appropriate message. *
    3. s2's message should trigger it's observer s5 to print * a message. *
    4. The coordinate change should trigger s3 and s4. *
    5. s4's message should trigger it's observer s5 again. - */ + */ public static void main(String argv[]) { - + Point p = new Point(5, 5, Color.blue); - + System.out.println("Creating Screen s1,s2,s3,s4,s5 and Point p"); - + Screen s1 = new Screen("s1"); Screen s2 = new Screen("s2"); - + Screen s3 = new Screen("s3"); Screen s4 = new Screen("s4"); - + Screen s5 = new Screen("s5"); - System.out.println("Creating observing relationships:"); - System.out.println("- s1 and s2 observe color changes to p"); + System.out.println("Creating observing relationships:"); + System.out.println("- s1 and s2 observe color changes to p"); System.out.println("- s3 and s4 observe coordinate changes to p"); System.out.println("- s5 observes s2's and s4's display() method"); - - p.addObserver(s1); + + p.addObserver(s1); p.addObserver(s2); - - p.addObserver(s3); + + p.addObserver(s3); p.addObserver(s4); - + s2.addObserver(s5); s4.addObserver(s5); - - System.out.println("Changing p's color:"); + + System.out.println("Changing p's color:"); p.setColor(Color.red); - System.out.println("Changing p's x-coordinate:"); + System.out.println("Changing p's x-coordinate:"); + + p.setX(4); - p.setX(4); - - System.out.println("done."); + System.out.println("done."); } } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Point.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Point.java index 2a4322bb3b..5413c80df4 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Point.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Point.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,14 +15,14 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -import java.awt.Color; +import java.awt.Color; import java.util.HashSet; import java.util.Iterator; @@ -33,52 +33,52 @@ * @author Gregor Kiczales * @version 1.11, 04/01/04 */ - -public class Point implements ChangeSubject { - + +public class Point implements ChangeSubject { + /** * stores the Observers for this point (Subject) */ - + private HashSet observers; /** * the point's x-coordinate */ - + private int x; - + /** * the point's y-coordinate */ - + private int y; - - /** + + /** * the point's current color */ - + private Color color; - + /** * Creates a new point object based on x and y coordinates and color. */ - + public Point(int x, int y, Color color) { this.x = x; this.y = y; - this.color=color; + this.color=color; this.observers = new HashSet(); } - + /** * Returns the point's current x-coordinate. * * @return the current x-coordinate */ - public int getX() { - return x; + public int getX() { + return x; } /** @@ -87,18 +87,18 @@ public int getX() { * @return the current y-coordinate */ - public int getY() { - return y; + public int getY() { + return y; } - + /** * Sets the current x-coordinate. * * @param x the new x-coordinate */ - public void setX(int x) { - this.x = x; + public void setX(int x) { + this.x = x; notifyObservers(); } @@ -108,8 +108,8 @@ public void setX(int x) { * @param y the new y-coordinate */ - public void setY(int y) { - this.y = y; + public void setY(int y) { + this.y = y; notifyObservers(); } @@ -127,36 +127,36 @@ public void setY(int y) { * @param color the new color */ - public void setColor(Color color) { - this.color = color; + public void setColor(Color color) { + this.color = color; notifyObservers(); - } - - + } + + /** * Attaches an Observer to this Subject. - * + * * @param o the Observer to attach */ - + public void addObserver(ChangeObserver o) { this.observers.add(o); } - + /** * Detaches an Observer from this Subject. - * + * * @param o the Observer to detach */ - + public void removeObserver(ChangeObserver o) { this.observers.remove(o); } - + /** * Notifies all Observers. */ - + public void notifyObservers() { for (Iterator e = observers.iterator() ; e.hasNext() ;) { ((ChangeObserver)e.next()).refresh(this); diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Screen.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Screen.java index 1860b477b6..85442a0bb7 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Screen.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/observer/java/Screen.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,88 +15,88 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.HashSet; import java.util.Iterator; - -/** + +/** * Provides a means to output messages. Objects of this class act as - * output devices. + * output devices. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.11, 04/01/04 */ - + public class Screen implements ChangeSubject, ChangeObserver { /** * stores the Observers for this screen (Subject) */ - + private HashSet observers; - + /** * the individual name of this screen object */ private String name; - + /** * creates a new Screen object with the provided name. * - * @param name the name for the new Screen object + * @param name the name for the new Screen object */ - + public Screen(String s) { - this.name = s; + this.name = s; observers = new HashSet(); } /** - * Prints the name of the Screen object and the argument + * Prints the name of the Screen object and the argument * string to stdout. * * @param s the string to print */ - + public void display (String s) { System.out.println(name + ": " + s); notifyObservers(); - } + } /** * Attaches an Observer to this Subject. - * + * * @param o the Observer to attach */ public void addObserver(ChangeObserver o) { this.observers.add(o); } - + /** * Detaches an Observer from this Subject. - * + * * @param o the Observer to detach */ public void removeObserver(ChangeObserver o) { this.observers.remove(o); } - + /** * Notifies all Observers. */ - + public void notifyObservers() { for (Iterator e = observers.iterator() ; e.hasNext() ;) { ((ChangeObserver)e.next()).refresh(this); @@ -106,18 +106,18 @@ public void notifyObservers() { /** * Updates an Observer. Uses the push strategy (i.e. the * subject triggering the update passes itself as an argument). - * + * * This particular method prints a message showing what object caused - * the update + * the update * * @param s the Subject triggering the update */ - public void refresh(ChangeSubject s) { + public void refresh(ChangeSubject s) { String subjectTypeName = s.getClass().getName(); subjectTypeName = subjectTypeName.substring( subjectTypeName.lastIndexOf(".")+1, subjectTypeName.length()); display("update received from a "+subjectTypeName+" object"); } - + } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/Main.java index 81c4584a94..0b236da020 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,91 +15,91 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Prototype design pattern example.

      + * Implements the driver for the Prototype design pattern example.

      * - * Intent: Specify the kinds of objects to create using a prototypical + * Intent: Specify the kinds of objects to create using a prototypical * instance, and create new objects by copying this prototype.

      * - * Participatng objects are StringPrototypeA and + * Participatng objects are StringPrototypeA and * StringPrototypeB as Prototypes.

      * * In this example, both StringPrototypeA and StringPrototypeB implement cloneable - * classes emulating limited String behavior. This driver creates an + * classes emulating limited String behavior. This driver creates an * object of each class and clones it. Both originals and clones are - * manipulated to show that they are different objects. + * manipulated to show that they are different objects. * - *

      This is the AspectJ version.

      + *

      This is the AspectJ version.

      * * Java's Cloneable interface is used internally. In this * version, a standard implementation for createClone() is * provided by the abstract pattern aspect. Each concrete pattern instance - * aspect can define special behavior by overwriting the appropriate + * aspect can define special behavior by overwriting the appropriate * methods. Consequently, the participants are freed of the pattern. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/13/04 - * + * * @see StringPrototypeA * @see StringPrototypeB - */ + */ public class Main { /** - * Implements the driver for the Prototype design pattern example.

      + * Implements the driver for the Prototype design pattern example.

      * * In this example, both StringPrototypeA and StringPrototypeB implement cloneable - * classes emulating limited String behavior. This driver creates an + * classes emulating limited String behavior. This driver creates an * object of each class and clones it. Both originals and clones are - * manipulated to show that they are different objects. + * manipulated to show that they are different objects. * * @param args the command line parameters, unused. */ public static void main(String[] args) { - + System.out.println("Testing the Prototype design pattern implementation..."); - + StringPrototypeA originalA; StringPrototypeB originalB; StringPrototypeA copyA1, copyA2; StringPrototypeB copyB1; - + originalA = new StringPrototypeA(" This is Prototype 1"); - originalB = new StringPrototypeB(" This is Prototype 2"); - + originalB = new StringPrototypeB(" This is Prototype 2"); + System.out.println("These are the two prototypes:"); System.out.println(originalA); System.out.println(originalB); - + copyA1 = (StringPrototypeA) StringPrototypes.aspectOf().cloneObject(originalA); copyB1 = (StringPrototypeB) StringPrototypes.aspectOf().cloneObject(originalB); - + System.out.println("These are copies of the prototypes:"); System.out.println(copyA1); System.out.println(copyB1); - + System.out.println("Now prototype 1 is changed. Here are prototype 1 and its former copy:"); originalA.setText(" This is Prototype 1 (changed)"); System.out.println(originalA); System.out.println(copyA1); - + System.out.println("This is a clone of the changed prototype 1 and a changed copy of prototype 2:"); copyA2 = (StringPrototypeA) StringPrototypes.aspectOf().cloneObject(originalA); copyB1.setText(" This is a changed copy of prototype 2"); System.out.println(copyA2); System.out.println(copyB1); - - - System.out.println("... done."); + + + System.out.println("... done."); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypeA.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypeA.java index a0ac669f1d..9aa1acf85b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypeA.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypeA.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -71,4 +71,3 @@ public String toString() { return "MyString: "+ text; } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypeB.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypeB.java index 600d0b901d..374dcbe3e3 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypeB.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypeB.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -70,4 +70,4 @@ public void setText(String newText) { public String toString() { return "AnotherString: " + text; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypes.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypes.java index 00bbe30f4d..9de544be2b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypes.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/aspectj/StringPrototypes.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,29 +15,29 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.PrototypeProtocol; /** - * Concretizes the abstract Prototype design pattern. + * Concretizes the abstract Prototype design pattern. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/13/04 - */ - -public aspect StringPrototypes extends PrototypeProtocol { + */ + +public aspect StringPrototypes extends PrototypeProtocol { /** * Assigns the Prototype role to StringPrototypeA */ - + declare parents: StringPrototypeA implements Prototype; /** @@ -49,7 +49,7 @@ /** * Provides an alternative method for cases when the default * clone() method fails: Clones objects "by hand". - * + * * @param object the prototype object to clone * @return a copy of the object */ @@ -60,6 +60,6 @@ protected Object createCloneFor(Prototype object) { } else { return null; } - } + } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/Main.java index 3552ac567e..7f60e0c482 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,94 +15,94 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Prototype design pattern example.

      + * Implements the driver for the Prototype design pattern example.

      * - * Intent: Specify the kinds of objects to create using a prototypical + * Intent: Specify the kinds of objects to create using a prototypical * instance, and create new objects by copying this prototype.

      * - * Participating objects are StringPrototypeA and + * Participating objects are StringPrototypeA and * StringPrototypeB as Prototypes.

      * - * In this example, both StringPrototypeA and StringPrototypeB - * implement cloneable classes emulating limited String behavior. - * This driver creates an object of each class and clones it. - * Both originals and clones are manipulated to show that they are - * different objects. + * In this example, both StringPrototypeA and StringPrototypeB + * implement cloneable classes emulating limited String behavior. + * This driver creates an object of each class and clones it. + * Both originals and clones are manipulated to show that they are + * different objects. * - *

      This is the Java version.

      + *

      This is the Java version.

      * * Java's Cloneable interface is used. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/13/04 - * + * * @see StringPrototypeA * @see StringPrototypeB - */ - + */ + public class Main { /** - * Implements the driver for the Prototype design pattern example.

      + * Implements the driver for the Prototype design pattern example.

      * * In this example, both StringPrototypeA and StringPrototypeB implement cloneable - * classes emulating limited String behavior. This driver creates an + * classes emulating limited String behavior. This driver creates an * object of each class and clones it. Both originals and clones are - * manipulated to show that they are different objects. + * manipulated to show that they are different objects. * * @param args the command line parameters, unused. - */ + */ public static void main(String[] args) { - + try { - + System.out.println("Testing the Prototype design pattern implementation..."); - + StringPrototypeA originalA; StringPrototypeB originalB; StringPrototypeA copyA1, copyA2; StringPrototypeB copyB1; - + originalA = new StringPrototypeA(" This is Prototype 1"); - originalB = new StringPrototypeB(" This is Prototype 2"); - + originalB = new StringPrototypeB(" This is Prototype 2"); + System.out.println("These are the two prototypes:"); System.out.println(originalA); System.out.println(originalB); - + copyA1 = (StringPrototypeA) originalA.clone(); copyB1 = (StringPrototypeB) originalB.clone(); - + System.out.println("These are copies of the prototypes:"); System.out.println(copyA1); System.out.println(copyB1); - + System.out.println("Now prototype 1 is changed. Here are prototype 1 and its former copy:"); originalA.setText(" This is Prototype 1 (changed)"); System.out.println(originalA); System.out.println(copyA1); - + System.out.println("This is a clone of the changed prototype 1 and a changed copy of prototype 2:"); copyA2 = (StringPrototypeA) originalA.clone(); copyB1.setText(" This is a changed copy of prototype 2"); System.out.println(copyA2); System.out.println(copyB1); - - - System.out.println("... done."); - + + + System.out.println("... done."); + } catch (CloneNotSupportedException ex) { System.err.println("Can't clone prototype objects"+ex); } } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/StringPrototypeA.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/StringPrototypeA.java index 6019d416d4..b2373c399f 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/StringPrototypeA.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/StringPrototypeA.java @@ -1,4 +1,4 @@ -package ca.ubc.cs.spl.aspectPatterns.examples.prototype.java; +package ca.ubc.cs.spl.aspectPatterns.examples.prototype.java; /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,18 +29,18 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/13/04 - * + * * @see StringPrototypeB - */ + */ public class StringPrototypeA implements Cloneable { /** * the string that this object encapsulates */ - + protected String text; - + /** * Creates a new StringPrototypeA object with the given string * @@ -50,34 +50,33 @@ public class StringPrototypeA implements Cloneable { public StringPrototypeA(String init) { text = init; } - + /** * Changes the string this object encapsulates * * @param newText the new text for this object. - */ - + */ + public void setText(String newText) { text = newText; } - + /** * Returns a string representation of this object. * * @returns a string representation of this object. */ - + public String toString() { return "StringPrototypeA: "+ text; - } - - /** + } + + /** * Returns a copy of this object. Does only work this way if the * superclass implements clone(). */ - + public Object clone() throws CloneNotSupportedException { return super.clone(); } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/StringPrototypeB.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/StringPrototypeB.java index 2c6f239542..ce0033010e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/StringPrototypeB.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/prototype/java/StringPrototypeB.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,18 +29,18 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/13/04 - * + * * @see StringPrototypeA - */ + */ public class StringPrototypeB implements Cloneable { - + /** * the string that this object encapsulates */ - + protected String text; - + /** * Creates a new StringPrototypeA object with the given string * @@ -50,33 +50,33 @@ public class StringPrototypeB implements Cloneable { public StringPrototypeB(String init) { text = init; } - + /** * Changes the string this object encapsulates * * @param newText the new text for this object. - */ - + */ + public void setText(String newText) { text = newText; } - + /** * Returns a string representation of this object. * * @return a string representation of this object. */ - + public String toString() { return "StringPrototypeB: " + text; - } - - /** + } + + /** * Returns a copy of this object. Does only work this way if the * superclass implements clone(). */ - + public Object clone() throws CloneNotSupportedException { return super.clone(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/AlternateOutputImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/AlternateOutputImplementation.java index 89ecd27d8d..87605bb67b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/AlternateOutputImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/AlternateOutputImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,33 +15,33 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * This class will serve as a Delegate for OutputImplementation. Note that no + * This class will serve as a Delegate for OutputImplementation. Note that no * interfaces need to be implemented. This is not a Subject and does in * fact play no role in the pattern. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ + */ -public class AlternateOutputImplementation { +public class AlternateOutputImplementation { /** - * Prints the argument string to + * Prints the argument string to * System.out * * @param s the string to print */ - + public void alternateRequest(String s) { System.out.println("[AlternateSubject.safeRequest()]: "+s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/Main.java index 3081d8b01e..f5b3697b8d 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,42 +15,42 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Proxy design pattern example.

      + * Implements the driver for the Proxy design pattern example.

      * * Intent: Provide a surrogate or placeholder for another object to control * access to it.

      * - * Participating objects are OutputImplementations and - * AlternateOutputImplementation. - * + * Participating objects are OutputImplementations and + * AlternateOutputImplementation. + * * The former acts as a RealSubject. * * Experimental setup: * Main issues three different kinds of requests to - * the RealSubject (OutputImplementation) twice. + * the RealSubject (OutputImplementation) twice. *

        - *
      • SAFE requests are delegated to a different object + *
      • SAFE requests are delegated to a different object * (delegation proxy) *
      • REGULAR request are counted *
      • UNSAFE requests are blocked entirely. *
      * - *

      This is the AspectJ version.

      - * + *

      This is the AspectJ version.

      + * * Each concrete aspect defines exactly what requests it is interested * in. For those requests, it declares how to deal with the request. - * + * * The proxy implementation is localized. Even clients need not set - * or remove proxies. - * + * or remove proxies. + * * Please note that the AspectJ version includes an additional proxy * that delegates safe request to a different object. An OO implementation * would be similar to the other OO proxies. @@ -61,39 +61,39 @@ */ public class Main { - - /** + + /** * Creates a new Main object and runs the test suite. - */ - - public Main() { + */ + + public Main() { /** * The RealSubject that the client sends all requests to */ - - OutputImplementation real = new OutputImplementation(); - System.out.println("\n===> Issuing SAFE request..."); + OutputImplementation real = new OutputImplementation(); + + System.out.println("\n===> Issuing SAFE request..."); real.safeRequest ("Safe Reqeust"); - System.out.println("\n===> Issuing REGULAR request..."); + System.out.println("\n===> Issuing REGULAR request..."); real.regularRequest("Normal Request"); - System.out.println("\n===> Issuing UNSAFE request..."); + System.out.println("\n===> Issuing UNSAFE request..."); real.unsafeRequest ("Unsafe Request"); - System.out.println("\n===> Issuing SAFE request..."); + System.out.println("\n===> Issuing SAFE request..."); real.safeRequest ("Safe Reqeust"); - System.out.println("\n===> Issuing REGULAR request..."); + System.out.println("\n===> Issuing REGULAR request..."); real.regularRequest("Normal Request"); - System.out.println("\n===> Issuing UNSAFE request..."); + System.out.println("\n===> Issuing UNSAFE request..."); real.unsafeRequest ("Unsafe Request"); - } + } - /** + /** * Implements the driver for the proxy design pattern example. */ - public static void main (String[] args) { + public static void main (String[] args) { Main main = new Main(); } } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/OutputImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/OutputImplementation.java index 2023025d0a..f067e8afa0 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/OutputImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/OutputImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,32 +15,32 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Represents a RealSubject according to GoF. - * Note that it does not have to implement any interface in the AspectJ + * Represents a RealSubject according to GoF. + * Note that it does not have to implement any interface in the AspectJ * version. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ + */ public class OutputImplementation { /** - * A type of request(..). Prints the argument string to + * A type of request(..). Prints the argument string to * System.out * * @param s the string to print */ - + public void safeRequest(String s) { System.out.println("[OutputImplementation.safeRequest()]: "+s); } @@ -55,7 +55,7 @@ public void safeRequest(String s) { public void regularRequest(String s) { System.out.println("[OutputImplementation.regularRequest()]: "+s); } - + /** * A type of request(..). * @@ -65,4 +65,4 @@ public void regularRequest(String s) { public void unsafeRequest(String s) { System.out.println("[OutputImplementation.unsafeRequest()]: "+s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestBlocking.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestBlocking.java index d157d44eb2..e17aa2ef8e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestBlocking.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestBlocking.java @@ -1,4 +1,4 @@ -package ca.ubc.cs.spl.aspectPatterns.examples.proxy.aspectj; +package ca.ubc.cs.spl.aspectPatterns.examples.proxy.aspectj; /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,32 +15,32 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.ProxyProtocol; import org.aspectj.lang.JoinPoint; /** - * Implements a concrete Proxy pattern instance. Here, all unsafe requests - * from Main OutputImplementation - * are blocked.

      + * Implements a concrete Proxy pattern instance. Here, all unsafe requests + * from Main OutputImplementation + * are blocked.

      * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ + */ + +public aspect RequestBlocking extends ProxyProtocol { -public aspect RequestBlocking extends ProxyProtocol { - - /** + /** * Assigns the Subject role to OutputImplementation. */ - + declare parents: OutputImplementation implements Subject; /** @@ -49,7 +49,7 @@ * OutputImplementation.unsafeRequest(..). */ - protected pointcut requests(): + protected pointcut requests(): call(* OutputImplementation.unsafeRequest(..)); /** @@ -58,15 +58,15 @@ protected pointcut requests(): * denied. * * @param caller the object responsible for the protected access - * @param subject the subject receiving the call + * @param subject the subject receiving the call * @param joinPoint the joinpoint associated with the protected access * * @return true if the access is from a Main object, false otherwise */ - protected boolean isProxyProtected(Object caller, - Subject subject, - JoinPoint joinPoint) { + protected boolean isProxyProtected(Object caller, + Subject subject, + JoinPoint joinPoint) { if (joinPoint.getThis() instanceof Main) { System.out.println("[RequestBlocking] intercepting unsafe " + "requests from Main"); diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestCounting.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestCounting.java index da91e003a8..aa4c236b8b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestCounting.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestCounting.java @@ -1,4 +1,4 @@ -package ca.ubc.cs.spl.aspectPatterns.examples.proxy.aspectj; +package ca.ubc.cs.spl.aspectPatterns.examples.proxy.aspectj; /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,48 +15,48 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.ProxyProtocol; import org.aspectj.lang.JoinPoint; /** - * Implements a concrete proxy pattern instance. Here, all method calls from - * Main to OutputImplementation.print(String) are blocked.

      + * Implements a concrete proxy pattern instance. Here, all method calls from + * Main to OutputImplementation.print(String) are blocked.

      * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ + */ + +public aspect RequestCounting extends ProxyProtocol { -public aspect RequestCounting extends ProxyProtocol { - /** * An internal counter for the number of calls to * print(String). */ - + private int regularRequests = 0; - - /** + + /** * Assigns the OutputSubject role to OutputImplementation. */ - + declare parents: OutputImplementation implements Subject; /** - * Captures all accesses to the subject that should be protected by + * Captures all accesses to the subject that should be protected by * this pattern instance. Here: All calls to * OutputImplementation.print(..). */ - protected pointcut requests(): + protected pointcut requests(): call(* OutputImplementation.regularRequest(..)); /** @@ -64,20 +64,20 @@ protected pointcut requests(): * that come from Main objects are denied. * * @param caller the object responsible for the protected access - * @param subject the subject receiving the call + * @param subject the subject receiving the call * @param joinPoint the joinpoint associated with the protected access * * @return true if the access is from a Main object, false otherwise */ - protected boolean isProxyProtected(Object caller, - Subject subject, - JoinPoint joinPoint) { + protected boolean isProxyProtected(Object caller, + Subject subject, + JoinPoint joinPoint) { if (joinPoint.getThis() instanceof Main) { regularRequests++; System.out.println("[RequestCounter:] That was regular request nr. " + regularRequests); - } - return false; + } + return false; } } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestDelegation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestDelegation.java index 053c5564ae..6f8cbf1b3a 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestDelegation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/aspectj/RequestDelegation.java @@ -1,4 +1,4 @@ -package ca.ubc.cs.spl.aspectPatterns.examples.proxy.aspectj; +package ca.ubc.cs.spl.aspectPatterns.examples.proxy.aspectj; /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,84 +15,84 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.ProxyProtocol; import org.aspectj.lang.JoinPoint; /** - * Implements a concrete proxy pattern instance. Here, all method calls from - * Main to OutputImplementation.print(String) are blocked.

      + * Implements a concrete proxy pattern instance. Here, all method calls from + * Main to OutputImplementation.print(String) are blocked.

      * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ - -public aspect RequestDelegation extends ProxyProtocol { - - /** + */ + +public aspect RequestDelegation extends ProxyProtocol { + + /** * Assigns the Subject role to OutputImplementation * . */ - + declare parents: OutputImplementation implements Subject; - - private AlternateOutputImplementation alternateSubject = + + private AlternateOutputImplementation alternateSubject = new AlternateOutputImplementation(); /** - * Captures all accesses to the subject that should be protected by + * Captures all accesses to the subject that should be protected by * this pattern instance. Here: All calls to * OutputImplementation.safeRequest(..). */ - protected pointcut requests(): + protected pointcut requests(): call(* OutputImplementation.safeRequest(..)); /** * Checks whether the request should be handled by the Proxy or not. - * Here: All accesses matched by the protectedAccesses() + * Here: All accesses matched by the protectedAccesses() * joinpoint. * * @param caller the object responsible for the protected access - * @param subject the subject receiving the call + * @param subject the subject receiving the call * @param joinPoint the joinpoint associated with the protected access * * @return true if the access is covered by the proxy, false otherwise */ - protected boolean isProxyProtected(Object caller, - Subject subject, + protected boolean isProxyProtected(Object caller, + Subject subject, JoinPoint joinPoint) { System.out.println("[RequestDelegation] delegating a safe request " + - "to a different type of object"); + "to a different type of object"); return true; } /** - * For delegation: Provides an alternative return value if access - * is proxy protected. A default implementation is supplied so that + * For delegation: Provides an alternative return value if access + * is proxy protected. A default implementation is supplied so that * concrete subaspects are not forced to implement the method. - * Here, it also calls an appropriate method on a delegate + * Here, it also calls an appropriate method on a delegate * (to illustrate how delegation would work). * * @param caller the object responsible for the proxy protected access - * @param subject the subject receiving the call - * @param joinPoint the joinpoint associated with the proxy protected + * @param subject the subject receiving the call + * @param joinPoint the joinpoint associated with the proxy protected * access * * @return an alternative return value */ - protected Object handleProxyProtection(Object caller, - Subject subject, + protected Object handleProxyProtection(Object caller, + Subject subject, JoinPoint joinPoint) { Object[] args = joinPoint.getArgs(); if (args != null) { diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/Main.java index e4e91283b2..21e0a32946 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,39 +15,39 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the RequestCounter design pattern example.

      + * Implements the driver for the RequestCounter design pattern example.

      * * Intent: Provide a surrogate or placeholder for another object to control * access to it.

      * - * Participating objects are OutputImplementation and - * RequestCounter as RealSubject and Proxy, + * Participating objects are OutputImplementation and + * RequestCounter as RealSubject and Proxy, * respectively. - * + * * Both implement the OutputSubject interface, which represents * the Subject interface. * * Experimental setup: * Main issues three different kinds of requests to - * the RealSubject (OutputImplementation) twice. + * the RealSubject (OutputImplementation) twice. *

        *
      • SAFE requests are not affected *
      • REGULAR request are counted *
      • UNSAFE requests are blocked entirely. *
      * - *

      This is the Java version.

      + *

      This is the Java version.

      * - * Proxys needs to implement all methods of - * OutputSubject, even those it is not interested in. + * Proxys needs to implement all methods of + * OutputSubject, even those it is not interested in. * They need to be aware of their role in the pattern. * * @author Jan Hannemann @@ -55,29 +55,29 @@ * @version 1.1, 02/17/04 */ -public class Main { +public class Main { /** * Implements the driver for the proxy design pattern.

      */ - public static void main (String[] args) { + public static void main (String[] args) { OutputSubject real = new OutputImplementation(); OutputSubject countingProxy = new RequestCounter(real); OutputSubject blockingProxy = new RequestBlocker(countingProxy); - - System.out.println("\n===> Issuing SAFE request..."); + + System.out.println("\n===> Issuing SAFE request..."); blockingProxy.safeRequest ("Safe Reqeust"); - System.out.println("\n===> Issuing REGULAR request..."); + System.out.println("\n===> Issuing REGULAR request..."); blockingProxy.regularRequest("Normal Request"); - System.out.println("\n===> Issuing UNSAFE request..."); + System.out.println("\n===> Issuing UNSAFE request..."); blockingProxy.unsafeRequest ("Unsafe Request"); - System.out.println("\n===> Issuing SAFE request..."); + System.out.println("\n===> Issuing SAFE request..."); blockingProxy.safeRequest ("Safe Reqeust"); - System.out.println("\n===> Issuing REGULAR request..."); + System.out.println("\n===> Issuing REGULAR request..."); blockingProxy.regularRequest("Normal Request"); - System.out.println("\n===> Issuing UNSAFE request..."); + System.out.println("\n===> Issuing UNSAFE request..."); blockingProxy.unsafeRequest ("Unsafe Request"); } } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/OutputImplementation.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/OutputImplementation.java index dab1bedd1c..c161a7223c 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/OutputImplementation.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/OutputImplementation.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,17 +29,17 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ + */ public class OutputImplementation implements OutputSubject { /** - * A type of request(..). Prints the argument string to + * A type of request(..). Prints the argument string to * System.out * * @param s the string to print */ - + public void safeRequest(String s) { System.out.println("[RealSubject.safeRequest()]: "+s); } @@ -54,7 +54,7 @@ public void safeRequest(String s) { public void regularRequest(String s) { System.out.println("[RealSubject.regularRequest()]: "+s); } - + /** * A type of request(..). * @@ -64,4 +64,4 @@ public void regularRequest(String s) { public void unsafeRequest(String s) { System.out.println("[RealSubject.unsafeRequest()]: "+s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/OutputSubject.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/OutputSubject.java index a6f9cf3627..b1585912ab 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/OutputSubject.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/OutputSubject.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,30 +15,30 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Defines the Subject interface that is implemented by both + * Defines the Subject interface that is implemented by both * RequestCounter and OutputImplementation. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ - -public interface OutputSubject { - + */ + +public interface OutputSubject { + /** * A type of request(..). * * @param s the string to print */ - + public void safeRequest(String s); /** @@ -48,7 +48,7 @@ public interface OutputSubject { */ public void regularRequest(String s); - + /** * A type of request(..). * @@ -57,4 +57,4 @@ public interface OutputSubject { public void unsafeRequest(String s); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/RequestBlocker.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/RequestBlocker.java index be562498f6..0b50b3bd94 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/RequestBlocker.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/RequestBlocker.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,18 +29,18 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ + */ + +public class RequestBlocker implements OutputSubject { -public class RequestBlocker implements OutputSubject { - /** * a reference to the Subject (used to forward requests to) */ - - private OutputSubject realSubject; - + + private OutputSubject realSubject; + /** - * Creates a new RequestBlocker with the given + * Creates a new RequestBlocker with the given * Subject. * * @param subject The Subject to forward method calls to @@ -49,35 +49,35 @@ public class RequestBlocker implements OutputSubject { public RequestBlocker(OutputSubject subject) { this.realSubject = subject; } - + /** * Forwards the request to its subject. We are not interested in - * this kind of request, but must implement the method (and the - * request forwarding) anyway since the method is part of the + * this kind of request, but must implement the method (and the + * request forwarding) anyway since the method is part of the * RequestBlocker interface. * * @param s the string to print */ - + public void safeRequest(String s) { - realSubject.safeRequest(s); + realSubject.safeRequest(s); System.out.println("[RequestBlocker:] Not interested in safe requests," + - " but must implement anyway"); + " but must implement anyway"); } - + /** * Forwards the request to its subject. We are not interested in - * this kind of request, but must implement the method (and the - * request forwarding) anyway since the method is part of the + * this kind of request, but must implement the method (and the + * request forwarding) anyway since the method is part of the * RequestBlocker interface. * * @param s the string to print */ public void regularRequest(String s) { - realSubject.regularRequest(s); + realSubject.regularRequest(s); System.out.println("[RequestBlocker:] Not interested in regular requests," + - " but must implement anyway"); + " but must implement anyway"); } /** @@ -87,8 +87,8 @@ public void regularRequest(String s) { */ public void unsafeRequest(String s) { - realSubject.unsafeRequest(s); - System.out.println("[RequestBlocker:] " + s + " blocked."); + realSubject.unsafeRequest(s); + System.out.println("[RequestBlocker:] " + s + " blocked."); } - -} \ No newline at end of file + +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/RequestCounter.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/RequestCounter.java index ba55bc0eac..ebbe2fff42 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/RequestCounter.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/proxy/java/RequestCounter.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -29,25 +29,25 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ + */ + +public class RequestCounter implements OutputSubject { -public class RequestCounter implements OutputSubject { - /** * a reference to the Subject (used to forward requests to) */ - - private OutputSubject realSubject; - + + private OutputSubject realSubject; + /** * An internal counter for the number of calls to * print(String). */ - + private int regularRequests = 0; - + /** - * Creates a new RequestCounter with the given + * Creates a new RequestCounter with the given * Subject. * * @param subject The Subject to forward method calls to @@ -56,49 +56,49 @@ public class RequestCounter implements OutputSubject { public RequestCounter(OutputSubject subject) { this.realSubject = subject; } - + /** * Forwards the request to its subject. We are not interested in - * this kind of request, but must implement the method (and the - * request forwarding) anyway since the method is part of the + * this kind of request, but must implement the method (and the + * request forwarding) anyway since the method is part of the * RequestBlocker interface. * * @param s the string to print */ - + public void safeRequest(String s) { - realSubject.safeRequest(s); + realSubject.safeRequest(s); System.out.println("[RequestCounter:] Not interested in safe " + - "requests, but must implement anyway"); + "requests, but must implement anyway"); } - + /** - * Forwards the request to its subject and prints - * out how many times the request() has been called so far. + * Forwards the request to its subject and prints + * out how many times the request() has been called so far. * * @param s the string to print */ public void regularRequest(String s) { regularRequests++; - realSubject.regularRequest(s); + realSubject.regularRequest(s); System.out.println("[RequestCounter:] That was regular request nr. " + - regularRequests); + regularRequests); } /** * Forwards the request to its subject. We are not interested in - * this kind of request, but must implement the method (and the - * request forwarding) anyway since the method is part of the + * this kind of request, but must implement the method (and the + * request forwarding) anyway since the method is part of the * RequestBlocker interface. * * @param s the string to print */ public void unsafeRequest(String s) { - realSubject.unsafeRequest(s); + realSubject.unsafeRequest(s); System.out.println("[RequestCounter:] Not interested in unsafe requests," + - " but must implement anyway"); + " but must implement anyway"); } - -} \ No newline at end of file + +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/Main.java index 18c258e660..194f893b43 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,26 +15,26 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Singleton design pattern example.

      + * Implements the driver for the Singleton design pattern example.

      * * Intent: Ensure that a class has only one instance and provide a global * point of access to it.

      * - * Participating objects are Printer printer1, printer2, printer3 and + * Participating objects are Printer printer1, printer2, printer3 and * PrinterSubclass ps1, ps2, ps3.

      * * Three different objects of both Printer and PrinterSubclass are - * instantiated and compared. + * instantiated and compared. * - * This Implementation treats the singleton property as a non-inherited + * This Implementation treats the singleton property as a non-inherited * property. This meant that Singleton classes can still be subclassed * and these subclasses can access the Singleton constructor normally. * @@ -43,7 +43,7 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/18/04 - * + * * @see Printer * @see PrinterSubclass */ @@ -55,12 +55,12 @@ public class Main { */ private static Printer printer1, printer2, printer3; - + // Experimental setup: Main creates three Printer objects. // The Printer implementation gives each object a unique ID // which is printed when print() is called. If the Singleton // implementation works, all three objects should be the same. - // + // // Implementation: AOP5 - One (concrete) aspect defines the behavior // of the pattern, creating a generic getInstance() method that // is attached to the Singleton interface. Another aspect assigns @@ -72,69 +72,69 @@ public class Main { // // Clients don't have to type-cast, they just use new(..) // - // Subclasses are automatically Singletons, too, unless + // Subclasses are automatically Singletons, too, unless // explicitly declared as non-singletons - - + + /** - * Implements the first test case. Creates 3 references to the + * Implements the first test case. Creates 3 references to the * Singleton by using the regular constructor. That should * create three identical objects. - */ - + */ + private static void test1() { System.out.println("\nTest 1: All three printers should have the " + "same ID"); - + printer1 = new Printer(); printer2 = new Printer(); - printer3 = new Printer(); - + printer3 = new Printer(); + printer1.print(); printer2.print(); - printer3.print(); + printer3.print(); } - + /** * Implements the second test case. Tests if the 3 objects from test 1 are * in fact identical - */ + */ private static void test2() { System.out.println("\nTest 2: All three objects should be identical"); - + System.out.print("\tThey are "); if ((printer1 == printer2) && (printer1 == printer3)) { System.out.println("identical"); } else { - System.out.println("not identical"); + System.out.println("not identical"); } } - + /** * Implements the third test case. Creates 3 instances of the Singleton * 's subclass. These objects should be different. - */ + */ private static void test3() { - System.out.println("\nTest 3: Ensuring that subclasses can access the" + System.out.println("\nTest 3: Ensuring that subclasses can access the" + "constructor"); System.out.println(" (All three outputs should be different)"); - + printer1 = new PrinterSubclass(); printer2 = new PrinterSubclass(); - printer3 = new PrinterSubclass(); - + printer3 = new PrinterSubclass(); + printer1.print(); printer2.print(); - printer3.print(); + printer3.print(); } - - + + /** * This is the driver for the Singleton case. It performes * three tests: @@ -147,7 +147,7 @@ private static void test3() { * objects should be different. *

    */ - + public static void main (String[] args) { System.out.println("Testing SINGLETON pattern (aspectj) ..."); test1(); @@ -155,4 +155,4 @@ public static void main (String[] args) { test3(); System.out.println("\n... done."); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/Printer.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/Printer.java index 867b34b737..516b335bfd 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/Printer.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/Printer.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,22 +15,22 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * Implements a sample class that will be assigned the Singleton role * in this example. The class's functionality * is to store an instance-specific ID and provide a print() - * method that shows an object's ID. + * method that shows an object's ID. * * Note that in this implementation the class does not have to know * that it is a Singleton (i.e. has no pattern code in it). - * + * * Note further that instead of assigning the Singleton property * via the declare parents construct in the aspect, it is * possible to just add a implements Singleton here. However, @@ -41,35 +41,34 @@ * @version 1.1, 02/18/04 */ -public class Printer { +public class Printer { /** * counts the instances of this class */ - + protected static int objectsSoFar = 0; /** * each instance has an ID to distinguish them. */ - + protected int id; /** * Creates a Printer object. Note that the constructor * is not protected; the protection is realized by the aspect. */ - + public Printer() { id = ++ objectsSoFar; } - + /** * Prints the instance's ID to System.out. */ - + public void print() { System.out.println("\tMy ID is "+id); } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/PrinterSubclass.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/PrinterSubclass.java index 8ec000bc5a..01c9ce439a 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/PrinterSubclass.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/PrinterSubclass.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,32 +15,32 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements a sample subclass of the Singleton class. This class is + * Implements a sample subclass of the Singleton class. This class is * to test whether subclasses can still access the Singleton's constructor. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/18/04 - * + * * @see PrinterSingleton */ -public class PrinterSubclass extends Printer { +public class PrinterSubclass extends Printer { /** * Creates an instance of this class by calling super(). */ - + public PrinterSubclass() { super(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/SingletonInstance.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/SingletonInstance.java index d87e6373c9..47dcfd95c2 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/SingletonInstance.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/aspectj/SingletonInstance.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.SingletonProtocol; @@ -33,28 +33,28 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/18/04 - * + * * @see Printer * @see PrinterSubclass */ -public aspect SingletonInstance extends SingletonProtocol { - +public aspect SingletonInstance extends SingletonProtocol { + /** - * Assigns the Singleton to Printer. This is all that is + * Assigns the Singleton to Printer. This is all that is * necessary to provide Printer's constructor with the * Singleton protection. */ - - declare parents: Printer implements Singleton; - + + declare parents: Printer implements Singleton; + /** * This declaration allows PrinterSubclass (and all its * subclasses) to access Printer's constructor within * its constructor (to allow for super(..) calls). */ - - protected pointcut protectionExclusions(): - call((PrinterSubclass+).new(..)); -} \ No newline at end of file + + protected pointcut protectionExclusions(): + call((PrinterSubclass+).new(..)); +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/Main.java index a037076660..3e681ec4ee 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,124 +15,124 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Singleton design pattern example.

    + * Implements the driver for the Singleton design pattern example.

    * * Intent: Ensure that a class has only one instance and provide a global * point of access to it.

    * - * Participating objects are PrinterSingleton printer1, printer2, printer3 and + * Participating objects are PrinterSingleton printer1, printer2, printer3 and * PrinterSubclass ps1, ps2, ps3.

    * * Three different objects of both PrinterSingleton and PrinterSubclass are - * instantiated and compared. + * instantiated and compared. * - * This Implementation treats the singleton property as a non-inherited + * This Implementation treats the singleton property as a non-inherited * property. This meant that Singleton classes can still be subclassed * and these subclasses can access the Singleton constructor normally. * *

    This is the Java version.

    - * - * Making the singleton property non-inherited requires to make the + * + * Making the singleton property non-inherited requires to make the * constructor of the Singleton protected (so subtypes can still * invoke super(..) in their constructor). * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/18/04 - * + * * @see PrinterSingleton * @see PrinterSubclass */ -class Main { - +class Main { + /** * the three object references to instances of the Singleton class. */ - + private static PrinterSingleton printer1, printer2, printer3; /** - * Implements the first test case. Creates 3 references to the - * Singleton by (a) using the regular constructor and then by (b) + * Implements the first test case. Creates 3 references to the + * Singleton by (a) using the regular constructor and then by (b) * using a factory method. (a) should fail (but does not, since this * Main class is in the same package and can access the * protected constructor), (b) should create three identical objects. - */ - + */ + private static void test1() { System.out.println("\nTest 1a: Try to call regular constructor. " + "This should fail."); - + printer1 = new PrinterSingleton(); printer2 = new PrinterSingleton(); printer3 = new PrinterSingleton(); - + printer1.print(); printer2.print(); - printer3.print(); - + printer3.print(); + System.out.println("\t=> OO Problem: Classes in the same package can " + "access the protected constructor."); - + System.out.println("\nTest 1b: Using instance() instead. This hould " + "create three identical objects."); - + printer1 = PrinterSingleton.instance(); printer2 = PrinterSingleton.instance(); - printer3 = PrinterSingleton.instance(); - + printer3 = PrinterSingleton.instance(); + printer1.print(); printer2.print(); - printer3.print(); + printer3.print(); } - + /** * Implements the second test case. Tests if the 3 objects from test 1 are * in fact identical - */ + */ private static void test2() { System.out.println("\nTest 2: All three objects should be identical"); System.out.print("\tThey are "); - if ((printer1 == printer2) && (printer1 == printer3)) { - System.out.println("identical"); + if ((printer1 == printer2) && (printer1 == printer3)) { + System.out.println("identical"); } else { - System.out.println("not identical"); + System.out.println("not identical"); } } - + /** * Implements the third test case. Creates 3 instances of the Singleton * 's subclass. These objects should be different. - */ + */ private static void test3() { - System.out.println("\nTest 3: Ensuring that subclasses can access the" + System.out.println("\nTest 3: Ensuring that subclasses can access the" + " constructor"); System.out.println(" (All three outputs should be different)"); - + printer1 = new PrinterSubclass(); printer2 = new PrinterSubclass(); - printer3 = new PrinterSubclass(); - + printer3 = new PrinterSubclass(); + printer1.print(); printer2.print(); - printer3.print(); + printer3.print(); } - + /** * This is the driver for the Singleton case. It performes * three tests: @@ -146,12 +146,12 @@ private static void test3() { * objects should be different. * */ - - public static void main (String[] args) { + + public static void main (String[] args) { System.out.println("Testing SINGLETON pattern (java) ..."); test1(); test2(); test3(); System.out.println("\n... done."); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/PrinterSingleton.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/PrinterSingleton.java index ee3d090e35..1341749d3c 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/PrinterSingleton.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/PrinterSingleton.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -97,4 +97,3 @@ public void print() { System.out.println("\tMy ID is "+id); } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/PrinterSubclass.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/PrinterSubclass.java index 218f992060..b0c7a36e4c 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/PrinterSubclass.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/singleton/java/PrinterSubclass.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements a sample subclass of the Singleton class. This class is + * Implements a sample subclass of the Singleton class. This class is * to test whether subclasses can still access the Singleton's constructor. * * @author Jan Hannemann @@ -31,13 +31,13 @@ * @version 1.1, 02/18/04 */ -public class PrinterSubclass extends PrinterSingleton { - +public class PrinterSubclass extends PrinterSingleton { + /** * Creates an instance of this class by calling super(). */ - + public PrinterSubclass() { super(); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/Main.java index 4009e32912..ca2bdbb03e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,29 +15,29 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the State design pattern example.

    + * Implements the driver for the State design pattern example.

    * * Intent: Allow an object to alter its behavior when its internal state * changes. The object will appear to change its class

    * - * Participating objects are Queue as Context, and + * Participating objects are Queue as Context, and * QueueNormal, QueueEmpty, and QueueFull * as ConcreteStates. The State interface is defined in - * QueueState. - *

    + * QueueState. + *

    * * This example of the State design pattern models a Queue ADT with - * a limited capacity that has three different states: + * a limited capacity that has three different states: *

      - *
    • Empty: The queue is empty + *
    • Empty: The queue is empty *
    • Normal: The queue is neither empty nor full *
    • Full: The queue is full (# of elements = capacity) *
    @@ -53,19 +53,19 @@ *
  • QueueState: State interface *
  • QueueEmpty: ConcreteState1 *
  • QueueNormal: ConcreteState2 - *
  • QueueFull: ConcreteState3 + *
  • QueueFull: ConcreteState3 * *

    This is the AspectJ version.

    * - * This implementation uses a concrete aspect to take care of all the state + * This implementation uses a concrete aspect to take care of all the state * transitions in the system. States are no longer tangled with each other - * as they do not have to know about their successor states. All state + * as they do not have to know about their successor states. All state * transitions are localized in the aspect. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * * @see Queue * @see QueueState * @see QueueEmpty @@ -74,20 +74,20 @@ * @see QueueStateAspect */ -public class Main { +public class Main { /** * Implements insertion into a queue. Prints out status messages. * * @param queue the queue to insert into * @param s the string to insert into the queue - */ + */ public static void testInsert(Queue queue, String s) { System.out.print(" Trying to insert ["+s+"] into the queue ... "); boolean status = queue.insert(s); if (status == true) { - System.out.println("successful"); + System.out.println("successful"); } else { System.out.println("NOT successful, queue probably full"); } @@ -97,21 +97,21 @@ public static void testInsert(Queue queue, String s) { * Implements deletion from a queue. Prints out status messages. * * @param queue the queue to delete items from - */ + */ public static void testRemove(Queue queue) { System.out.print(" Trying to remove 1st element of the queue ... "); - String item = (String) queue.getFirst(); + String item = (String) queue.getFirst(); boolean status = queue.removeFirst(); if (status == true) { - System.out.println("successful: "+item); + System.out.println("successful: "+item); } else { System.out.println("NOT successful: "+item); } } /** - * Implements the driver for the State design pattern example.

    + * Implements the driver for the State design pattern example.

    * * @param args the command line paramters, unused */ @@ -119,12 +119,12 @@ public static void testRemove(Queue queue) { public static void main(String[] args) { System.out.println("Testing Pattern: State - STARTING\n"); - + Queue queue = new Queue(); testInsert(queue, "This "); - testInsert(queue, "is "); + testInsert(queue, "is "); testInsert(queue, "a "); - testInsert(queue, "test"); + testInsert(queue, "test"); System.out.println(); testRemove(queue); testRemove(queue); @@ -135,4 +135,3 @@ public static void main(String[] args) { } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/Queue.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/Queue.java index c5709666d1..07ff2a7566 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/Queue.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/Queue.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * Implements the context of the queue example. This is effectively * a queue with limited capacity. Requests are forwarded to the current state - * object. + * object. * * @author Jan Hannemann * @author Gregor Kiczales @@ -33,53 +33,53 @@ */ public class Queue { - + /** * the current state of this context - */ + */ + + protected QueueState state = new QueueEmpty(); - protected QueueState state = new QueueEmpty(); - /** - * Tries to insert an object into the queue. Returns true if successful, + * Tries to insert an object into the queue. Returns true if successful, * false otherwiese. * * @param arg the object to be inserted into the queue * @return true if insertion was successful, false otherwise. - */ + */ - public boolean insert(Object arg) { + public boolean insert(Object arg) { return state.insert(arg); } - + /** * Returns the first item in the queue * * @return the first item in the queue - */ + */ - public Object getFirst() { + public Object getFirst() { return state.getFirst(); } - + /** * Tries to remove an object from the queue. Returns true if successful, * false otherwiese. * * @return true if deletion was successful, false otherwise. - */ + */ - public boolean removeFirst() { + public boolean removeFirst() { return state.removeFirst(); - } - + } + /** * Sets the state of the context to the arguments state. * * @param state the new state for the context object. */ - + public void setState(QueueState state) { this.state = state; - } -} \ No newline at end of file + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueEmpty.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueEmpty.java index 579bea67e3..57212fe6ad 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueEmpty.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueEmpty.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,27 +15,27 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the ConcreteState "empty" for the queue example. - * Removing items is impossible if the queue is empty. + * Implements the ConcreteState "empty" for the queue example. + * Removing items is impossible if the queue is empty. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * * @see QueueNormal * @see QueueFull */ public class QueueEmpty implements QueueState { - + /** * Tries to insert an object into the queue. Returns true since it is * always possible to insert items into an empty queue. The appropriate @@ -43,34 +43,34 @@ public class QueueEmpty implements QueueState { * * @param arg the object to be inserted into the queue * @return true. - */ + */ - public boolean insert(Object arg) { - return true; + public boolean insert(Object arg) { + return true; } /** - * Returns the first item in the queue. Returns null since the queue is + * Returns the first item in the queue. Returns null since the queue is * empty. * * @return null. - */ + */ public Object getFirst() { return null; } /** - * Tries to remove an object from the queue. Returns false (queue is + * Tries to remove an object from the queue. Returns false (queue is * empty). * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @return false. - */ + */ public boolean removeFirst(){ return false; - } + } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueFull.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueFull.java index bf9b4e8b35..c1447194eb 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueFull.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueFull.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the ConcreteState "full" for the queue example. - * Inserting items is impossible if the queue is full. + * Implements the ConcreteState "full" for the queue example. + * Inserting items is impossible if the queue is full. * * @author Jan Hannemann * @author Gregor Kiczales @@ -39,13 +39,13 @@ public class QueueFull implements QueueState { /** * stores the items in the queue */ - + protected Object[] items; - + /** * stores the index of the first item in the queue. - */ - + */ + protected int first; /** @@ -54,32 +54,32 @@ public class QueueFull implements QueueState { * * @param arg the object to be inserted into the queue * @return false. - */ - - public boolean insert(Object arg) { + */ + + public boolean insert(Object arg) { return false; } /** - * Returns the first item in the queue. + * Returns the first item in the queue. * * @return the first item in the queue. - */ + */ - public Object getFirst() { + public Object getFirst() { return items[first]; } /** * Tries to remove an object from the queue. Returns true if successful, - * false otherwiese. The state transition to "normal" is implemented by + * false otherwiese. The state transition to "normal" is implemented by * the aspect. * - * @return true since it is always possible to delete an item from a + * @return true since it is always possible to delete an item from a * full queue - */ + */ - public boolean removeFirst(){ + public boolean removeFirst(){ return true; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueNormal.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueNormal.java index f719d8f6ae..2342b9fba4 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueNormal.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueNormal.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the ConcreteState "normal" for the queue example. + * Implements the ConcreteState "normal" for the queue example. * Inserting and deleting items is possible in this state. * * @author Jan Hannemann @@ -31,64 +31,64 @@ * @version 1.1, 02/17/04 * * @see QueueEmpty - * @see QueueFull + * @see QueueFull */ public class QueueNormal implements QueueState { - + /** * stores the items in the queue */ - + protected Object[] items = new Object[3]; /** * stores the index of the first item in the queue */ - - protected int first = 0; + + protected int first = 0; /** * stores the index of the last item in the queue */ - + protected int last = 0; /** - * Tries to insert an object into the queue. Returns true if successful, - * false otherwiese. Potential state changes to "full" are facilitated + * Tries to insert an object into the queue. Returns true if successful, + * false otherwiese. Potential state changes to "full" are facilitated * by the aspect. * * @param arg the object to be inserted into the queue * @return true if insertion was successful, false otherwise. - */ - + */ + public boolean insert(Object arg) { // Inserts a new Object into the queue - items[(last)%items.length] = arg; - last = (last+1) % items.length; + items[(last)%items.length] = arg; + last = (last+1) % items.length; return true; } /** - * Returns the first item in the queue. + * Returns the first item in the queue. * * @returns null. - */ + */ - public Object getFirst() { // Returns the first element in the queue + public Object getFirst() { // Returns the first element in the queue return items[first]; } /** * Tries to remove an object from the queue. Returns true if successful, - * false otherwiese. Potential state changes to "empty" are facilitated + * false otherwiese. Potential state changes to "empty" are facilitated * by the aspect. * * @return true if deletion was successful, false otherwise. - */ + */ - public boolean removeFirst(){ // Removes the first element from the queue - first = (first + 1) % items.length; + public boolean removeFirst(){ // Removes the first element from the queue + first = (first + 1) % items.length; return true; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueState.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueState.java index 32de7a10c7..bf65a924e1 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueState.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueState.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -62,4 +62,4 @@ public interface QueueState { public boolean removeFirst(); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueStateAspect.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueStateAspect.java index bfdcae8e4f..aa5ef22dae 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueStateAspect.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/aspectj/QueueStateAspect.java @@ -1,4 +1,4 @@ -package ca.ubc.cs.spl.aspectPatterns.examples.state.aspectj; +package ca.ubc.cs.spl.aspectPatterns.examples.state.aspectj; /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,62 +15,62 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the state transitions for this state design pattern example. - * State transitions are realizied as after advice. The + * Implements the state transitions for this state design pattern example. + * State transitions are realizied as after advice. The * joinpoints are the calls from the context to its state object.

    * - * Exisiting states are reused without a employing a flyweight mechanism or + * Exisiting states are reused without a employing a flyweight mechanism or * (inflexibly) modularizing the transitions in the context. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * */ public aspect QueueStateAspect { - - /** + + /** * the queue's "empty" state - */ - + */ + protected QueueEmpty empty = new QueueEmpty(); - /** + /** * the queue's "normal" state - */ + */ protected QueueNormal normal = new QueueNormal(); - /** + /** * the queue's "full" state - */ + */ - protected QueueFull full = new QueueFull(); + protected QueueFull full = new QueueFull(); - /** - * Sets the initial state of the queue to empty. + /** + * Sets the initial state of the queue to empty. * * @param queue the queue context that is initialized. */ - + after(Queue queue): initialization(new()) && target(queue) { queue.setState(empty); } - /** - * Updates the queue context's state after each call from it to the + /** + * Updates the queue context's state after each call from it to the * insert(Object) method if its current state. * * @param queue the queue context that makes the call. @@ -79,20 +79,20 @@ */ after(Queue queue, QueueState qs, Object arg): call(boolean QueueState+.insert(Object)) && target(qs) && args(arg) && this(queue) { - if (qs == empty) { + if (qs == empty) { normal.insert(arg); queue.setState(normal); - } else if (qs == normal) { + } else if (qs == normal) { if (normal.first == normal.last) { full.items = normal.items; full.first = normal.first; queue.setState(full); } } - } - - /** - * Updates the queue context's state after each call from it to the + } + + /** + * Updates the queue context's state after each call from it to the * removeFirst() method if its current state. * * @param queue the queue context that makes the call. @@ -110,5 +110,5 @@ queue.setState(empty); } } - } -} \ No newline at end of file + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/Main.java index 423feb3025..63bd00f7e5 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,33 +15,33 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the State design pattern example.

    + * Implements the driver for the State design pattern example.

    * * Intent: Allow an object to alter its behavior when its internal state * changes. The object will appear to change its class

    * - * Participating objects are Queue as Context, and + * Participating objects are Queue as Context, and * QueueNormal, QueueEmpty, and QueueFull * as ConcreteStates. The State interface is defined in * QueueState. This version implements an update-on-demand * logic (see GoF, implementation 1, page 308). The logic requires passing * the context to calls to methods defined on the state interface, and an - * interface for context objects. The interface is defined in + * interface for context objects. The interface is defined in * QueueContext. - *

    + *

    * * This example of the State design pattern models a Queue ADT with - * a limited capacity that has three different states: + * a limited capacity that has three different states: *

      - *
    • Empty: The queue is empty + *
    • Empty: The queue is empty *
    • Normal: The queue is neither empty nor full *
    • Full: The queue is full (# of elements = capacity) *
    @@ -57,14 +57,14 @@ *
  • QueueState: State interface *
  • QueueEmpty: ConcreteState1 *
  • QueueNormal: ConcreteState2 - *
  • QueueFull: ConcreteState3 + *
  • QueueFull: ConcreteState3 * - * This implementation passes the context as an argument to its method + * This implementation passes the context as an argument to its method * calls to state objects, thus allowing for update on demand and removing * the constraint that Queue has to ask the states for the successor state * after each call. * - * According to GoF, this implementation is generally more flexible than + * According to GoF, this implementation is generally more flexible than * having the state transitions fixed in the context object. Note however * that this approach results in a tight coupling of ConcreteStates * and Context objects. @@ -74,7 +74,7 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * * @see QueueContext * @see Queue * @see QueueState @@ -84,20 +84,20 @@ */ -public class Main { - +public class Main { + /** * Implements insertion into a queue. Prints out status messages. * * @param queue the queue to insert into * @param s the string to insert into the queue - */ + */ private static void testInsert(Queue queue, String s) { System.out.print(" Trying to insert ["+s+"] into the queue ... "); boolean status = queue.insert(s); if (status == true) { - System.out.println("successful"); + System.out.println("successful"); } else { System.out.println("NOT successful, queue probably full"); } @@ -107,21 +107,21 @@ private static void testInsert(Queue queue, String s) { * Implements deletion from a queue. Prints out status messages. * * @param queue the queue to delete items from - */ + */ private static void testRemove(Queue queue) { System.out.print(" Trying to remove 1st element of the queue ... "); - String item = (String) queue.getFirst(); + String item = (String) queue.getFirst(); boolean status = queue.removeFirst(); if (status == true) { - System.out.println("successful: "+item); + System.out.println("successful: "+item); } else { System.out.println("NOT successful: "+item); } } /** - * Implements the driver for the State design pattern example.

    + * Implements the driver for the State design pattern example.

    * * @param args the command line paramters, unused */ @@ -129,12 +129,12 @@ private static void testRemove(Queue queue) { public static void main(String[] args) { System.out.println("Testing Pattern: State - STARTING\n"); - + Queue queue = new Queue(); testInsert(queue, "This "); - testInsert(queue, "is "); + testInsert(queue, "is "); testInsert(queue, "a "); - testInsert(queue, "test"); + testInsert(queue, "test"); System.out.println(); testRemove(queue); testRemove(queue); @@ -144,4 +144,3 @@ public static void main(String[] args) { System.out.println("\nTesting Pattern: State - FINISHED"); } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/Queue.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/Queue.java index 141a765603..229d8b538e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/Queue.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/Queue.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,71 +15,71 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * Implements the context of the queue example. This is effectively * a queue with limited capacity. Requests are forwarded to the current state - * object. + * object. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 */ -public class Queue implements QueueContext { - +public class Queue implements QueueContext { + /** * the current State of this Context - */ - - protected QueueState state = new QueueEmpty(); - + */ + + protected QueueState state = new QueueEmpty(); + /** - * Tries to insert an object into the queue. Returns true if successful, + * Tries to insert an object into the queue. Returns true if successful, * false otherwiese. * * @param arg the object to be inserted into the queue * @return true if insertion was successful, false otherwise. - */ - - public boolean insert(Object arg) { + */ + + public boolean insert(Object arg) { return state.insert(this, arg); } - + /** * Returns the first item in the queue * * @return the first item in the queue - */ + */ - public Object getFirst() { + public Object getFirst() { return state.getFirst(this); } - + /** * Tries to remove an object from the queue. Returns true if successful, * false otherwise. * * @return true if deletion was successful, false otherwise. - */ + */ public boolean removeFirst() { // Removes the first element from the queue return state.removeFirst(this); - } - + } + /** * Sets the state of the context to the arguments state. * * @param state the new state for the context object. */ - + public void setState(QueueState state) { this.state = state; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueContext.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueContext.java index 09ce140cb8..6d7e34ff28 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueContext.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueContext.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,16 +15,16 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Defines the interface for Contexts within this queue example. The - * operation provided is setState(QueueState). + * Defines the interface for Contexts within this queue example. The + * operation provided is setState(QueueState). * * @author Jan Hannemann * @author Gregor Kiczales @@ -38,6 +38,6 @@ public interface QueueContext { * * @param state the new state for the context object. */ - + public void setState(QueueState state); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueEmpty.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueEmpty.java index a914dffd55..b681005c8c 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueEmpty.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueEmpty.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,69 +15,69 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the ConcreteState "empty" for the queue example. + * Implements the ConcreteState "empty" for the queue example. * Removing items is impossible if the queue is empty. Inserting items will * trigger a state change to "normal". * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * * @see QueueNormal * @see QueueFull */ public class QueueEmpty implements QueueState { - + /** - * Tries to insert an object into the queue. Returns true if successful, + * Tries to insert an object into the queue. Returns true if successful, * false otherwiese. The state of the context * is changed to "normal" (queue is no longer empty). * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @param arg the object to be inserted into the queue * @return true if insertion was successful, false otherwise. - */ - + */ + public boolean insert(QueueContext context, Object arg) { - QueueNormal nextState = new QueueNormal(); + QueueNormal nextState = new QueueNormal(); context.setState(nextState); - return nextState.insert(context, arg); + return nextState.insert(context, arg); } /** - * Returns the first item in the queue. Returns null since the queue is + * Returns the first item in the queue. Returns null since the queue is * empty. * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @return null. - */ + */ public Object getFirst(QueueContext context) { return null; } /** - * Tries to remove an object from the queue. Returns false (queue is + * Tries to remove an object from the queue. Returns false (queue is * empty). * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @return false. - */ + */ public boolean removeFirst(QueueContext context){ return false; - } + } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueFull.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueFull.java index 1e5f677d4f..4659f8def6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueFull.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueFull.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the ConcreteState "full" for the queue example. + * Implements the ConcreteState "full" for the queue example. * Inserting items is impossible if the queue is full. Removing items will * trigger a state change to "normal". * @@ -40,18 +40,18 @@ public class QueueFull implements QueueState { /** * stores the items in the queue */ - + protected Object[] items; - + /** - * stores the index of the first item in the queue. - */ - + * stores the index of the first item in the queue. + */ + protected int first; /** * Creates a new QueueFull state object with the given set of elements - * and the given index. + * and the given index. * * @param items the content of the full queue * @param first the index of the first item in the queue @@ -66,25 +66,25 @@ public QueueFull(Object[] items, int first) { * Tries to insert an object into the queue. Returns false since the * queue is full. * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @param arg the object to be inserted into the queue * @return false. - */ - - public boolean insert(QueueContext context, Object arg) { + */ + + public boolean insert(QueueContext context, Object arg) { return false; } /** - * Returns the first item in the queue. + * Returns the first item in the queue. * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @return the first item in the queue. - */ + */ - public Object getFirst(QueueContext context) { + public Object getFirst(QueueContext context) { return items[first]; } @@ -92,14 +92,14 @@ public Object getFirst(QueueContext context) { * Tries to remove an object from the queue. Returns true if successful, * false otherwiese. The state of the context is changed to "normal". * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @return true if deletion was successful, false otherwise. - */ + */ - public boolean removeFirst(QueueContext context){ - QueueState nextState = new QueueNormal(items, first, first); + public boolean removeFirst(QueueContext context){ + QueueState nextState = new QueueNormal(items, first, first); context.setState(nextState); return nextState.removeFirst(context); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueNormal.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueNormal.java index cb006cf407..bcb6981a2d 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueNormal.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueNormal.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the ConcreteState "normal" for the queue example. + * Implements the ConcreteState "normal" for the queue example. * Inserting and deleting items is possible in this state. * * @author Jan Hannemann @@ -31,32 +31,32 @@ * @version 1.1, 02/17/04 * * @see QueueEmpty - * @see QueueFull + * @see QueueFull */ public class QueueNormal implements QueueState { - + /** * stores the items in the queue */ - + protected Object[] items = new Object[3]; /** * stores the index of the first item in the queue */ - - protected int first = 0; + + protected int first = 0; /** * stores the index of the last item in the queue */ - + protected int last = 0; /** * Creates a new QueueNormal state object with the given set of elements - * and the given indices for first and last object. + * and the given indices for first and last object. * * @param items the content of the full queue * @param first the index of the first item in the queue @@ -68,28 +68,28 @@ public QueueNormal(Object[] items, int first, int last) { this.first = first; this.last = last; } - - /** + + /** * Alternate constructor that uses preset values for object variables. */ - + public QueueNormal() { } /** - * Tries to insert an object into the queue. Returns true if successful, + * Tries to insert an object into the queue. Returns true if successful, * false otherwiese. If the queue is full * after the insertion, the state of the context is changed to "full". * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @param arg the object to be inserted into the queue * @return true if insertion was successful, false otherwise. - */ - + */ + public boolean insert(QueueContext context, Object arg) { - items[(last)%items.length] = arg; - last = (last+1) % items.length; + items[(last)%items.length] = arg; + last = (last+1) % items.length; if (first == last) { context.setState(new QueueFull(items, first)); } @@ -97,14 +97,14 @@ public boolean insert(QueueContext context, Object arg) { } /** - * Returns the first item in the queue. + * Returns the first item in the queue. * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @return the first item in the queue. - */ + */ - public Object getFirst(QueueContext context) { + public Object getFirst(QueueContext context) { return items[first]; } @@ -114,16 +114,16 @@ public Object getFirst(QueueContext context) { * the last one in the queue, the state of the context is changed to * "empty". * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @return true if deletion was successful, false otherwise. - */ + */ - public boolean removeFirst(QueueContext context){ - first = (first + 1) % items.length; + public boolean removeFirst(QueueContext context){ + first = (first + 1) % items.length; if (first == last) { context.setState(new QueueEmpty()); } return true; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueState.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueState.java index 7be872fc16..705ad923fe 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueState.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/state/java/QueueState.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,56 +15,56 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Defines the interface for States within this queue example. The + * Defines the interface for States within this queue example. The * operations provided are insert(..), getFirst(..), - * and removeFirst(..). + * and removeFirst(..). * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 */ -public interface QueueState { - +public interface QueueState { + /** - * Tries to insert an object into the queue. Returns true if successful, + * Tries to insert an object into the queue. Returns true if successful, * false otherwiese. * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @param arg the object to be inserted into the queue * @return true if insertion was successful, false otherwise. - */ - + */ + public boolean insert(QueueContext context, Object arg); /** * Returns the first item in the queue * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @return the first item in the queue - */ + */ - public Object getFirst(QueueContext context); + public Object getFirst(QueueContext context); /** * Tries to remove an object from the queue. Returns true if successful, * false otherwiese. * - * @param context the Context for this design pattern (for update + * @param context the Context for this design pattern (for update * on demand) * @return true if deletion was successful, false otherwise. - */ + */ - public boolean removeFirst(QueueContext context); + public boolean removeFirst(QueueContext context); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/BubbleSort.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/BubbleSort.java index be404119f5..18276668ae 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/BubbleSort.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/BubbleSort.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Implements the bubblesort sorting strategy for int arrays. * @@ -34,7 +34,7 @@ public class BubbleSort { /** * Helper method that exchanges two values in an int array - * + * * @param numbers the int array * @param pos1 the position of the first element * @param pos2 the position of the second element @@ -48,12 +48,12 @@ private void exchange(int[] numbers, int pos1, int pos2) { /** * Sorts an int array using basic bubblesort - * + * * @param numbers the int array to sort */ public void sort(int[] numbers) { - System.out.print("Sorting by BubbleSort..."); + System.out.print("Sorting by BubbleSort..."); for (int end = numbers.length; end > 1; end --) { for (int current = 0; current < end - 1; current ++) { if (numbers[current] > numbers[current+1]) { @@ -64,4 +64,3 @@ public void sort(int[] numbers) { System.out.println("done."); } } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/LinearSort.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/LinearSort.java index fa7d5f4d60..6eae6e3968 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/LinearSort.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/LinearSort.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,13 +15,13 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Implements the linear sort sorting strategy for int arrays. * @@ -31,10 +31,10 @@ */ public class LinearSort { - + /** * Helper method that exchanges two values in an int array - * + * * @param numbers the int array * @param pos1 the position of the first element * @param pos2 the position of the second element @@ -49,17 +49,17 @@ private void exchange(int[] numbers, int pos1, int pos2) { /** * Sorts an int array - * + * * @param numbers the int array to sort */ public void sort(int[] numbers) { System.out.print("Sorting by LinearSort..."); - int lowest = 0; - + int lowest = 0; + for (int start = 0; start < numbers.length; start ++) { lowest = start; - + for (int current = start; current < numbers.length; current ++) { if (numbers[current] < numbers[lowest]) { lowest = current; @@ -69,4 +69,4 @@ public void sort(int[] numbers) { } System.out.println("done."); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/Main.java index c219af7fec..5b9920f567 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,25 +15,25 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** - * Implements the driver for the strategy design pattern example.

    + * Implements the driver for the strategy design pattern example.

    * * Intent: Define a family of algorithms, encapsulate each one, and make - * them interchangeable. Strategy lets the algorithm vary independently from + * them interchangeable. Strategy lets the algorithm vary independently from * clients that use it.

    * * Participating objects are LinearSort and BubbleSort * as Strategies, and Sorter as Context. * * In this example, an array of 10 numbers is to be sorted. Depending on the - * number of arguments of the call to Main, linear sort or + * number of arguments of the call to Main, linear sort or * bubblesort are used as sorting algorithms. The interface for the strategies * is defined in SortingStrategy. * @@ -42,16 +42,16 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * * @see LinearSort * @see BubbleSort */ -public class Main { +public class Main { /** * Returns the content of the int array in a string - * + * * @param numbers the int array to display * @returns a string with all the ints from the array */ @@ -60,37 +60,35 @@ private static String show(int[] numbers) { String out = ""; for (int i=0; i + * Implements the driver for the Strategy design pattern example.

    * * Intent: Define a family of algorithms, encapsulate each one, and make - * them interchangeable. Strategy lets the algorithm vary independently from + * them interchangeable. Strategy lets the algorithm vary independently from * clients that use it.

    * * Participating objects are LinearSort and BubbleSort @@ -34,7 +34,7 @@ * * In this example, an array of 10 numbers is to be sorted. Depending on the * number of arguments of the call to Main.main(..), linear sort - * or bubblesort are used as sorting algorithms. The interface for the + * or bubblesort are used as sorting algorithms. The interface for the * strategies is defined in SortingStrategy. * *

    This is the Java version.

    @@ -42,34 +42,32 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * * @see LinearSort * @see BubbleSort */ - -public class Main { - + +public class Main { + /** * Implements the driver for the strategy example. If called with more * than zero arguments, bubblesort is used to sort the array of ten - * numbers; otherwise linear sort is used. - */ - + * numbers; otherwise linear sort is used. + */ + public static void main(String[] args) { int[] numbers = {3, 2, 9, 8, 1, 5, 6, 4, 7, 0}; - + SortingStrategy sort1 = new LinearSort(); SortingStrategy sort2 = new BubbleSort(); - + Sorter sorter; - + if (args.length == 0) { sorter = new Sorter(sort1, numbers); - } + } else { sorter = new Sorter(sort2, numbers); } } -} - - +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/java/Sorter.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/java/Sorter.java index 4a53ffc39a..6356430490 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/java/Sorter.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/strategy/java/Sorter.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,45 +15,45 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * Sorts an int array with a provided sorting strategy. * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * * @see LinearSort * @see BubbleSort */ -public class Sorter { - +public class Sorter { + /** * Shows the original (unsorted) array, sorts it and shows the new * (sorted) array. - * + * * @param sort the sorting strategy * @param numbers the array of int to sort */ public Sorter(SortingStrategy sort, int[] numbers) { System.out.println("\nPreparing sort..."); - System.out.println("original: "+show(numbers)); + System.out.println("original: "+show(numbers)); sort.sort(numbers); - System.out.println("sorted: "+show(numbers)); + System.out.println("sorted: "+show(numbers)); System.out.println("Done sorting."); } /** * Returns the content of the int array in a string - * + * * @param numbers the int array to display * @returns a string with all the ints from the array */ @@ -63,7 +63,7 @@ private static String show(int[] numbers) { for (int i=0; iAbstractClass, thereby allowing it to be an interface. * * @author Jan Hannemann @@ -33,11 +33,11 @@ */ public aspect Generating { - + /** * Defines the implementation of the TemplateMethod(). * Generates a string with certain decorations. - * + * * @param s the string to be used to generate a decorated string from */ @@ -48,4 +48,3 @@ return s; } } - \ No newline at end of file diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/aspectj/Main.java index fa4d447f21..7d98cf3311 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,34 +15,34 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * Implements the driver for the Template Method design pattern example.

    * - * Intent: Define the skeleton of an algorithm in an operation, deferring + * Intent: Define the skeleton of an algorithm in an operation, deferring * some steps to subclasses. Template Method lets subclasses redefine certain * steps of an algorithm without changing the algorithm's structure

    * - * Participating objects are SimpleGenerator and - * FancyGenerator as ConcreteClasses. The + * Participating objects are SimpleGenerator and + * FancyGenerator as ConcreteClasses. The * AbstractClass is DecoratedStringGenerator. *

    * * In this example, the template method generate(String) - * modifies a string in three steps and returns the result. While the + * modifies a string in three steps and returns the result. While the * SimpleGenerator does not change the string much, the - * FancyGenerator turns the string to lowercase, then capitalizes all + * FancyGenerator turns the string to lowercase, then capitalizes all * consonants and adds an explanantion to it. * *

    This is the AspectJ version.

    * - * Note that AbstractClass is an interface. The implementation of the + * Note that AbstractClass is an interface. The implementation of the * template method is provided by the aspect. * * @author Jan Hannemann @@ -51,9 +51,9 @@ */ public class Main { - + /** - * Implements the driver for the Template Method design + * Implements the driver for the Template Method design * pattern example.

    * * @param args the command line parameters, unused @@ -61,10 +61,10 @@ public class Main { public static void main(String[] args) { String original = "This Is The Original String To Be Processed"; - + DecoratedStringGenerator c1 = new SimpleGenerator(); DecoratedStringGenerator c2 = new FancyGenerator(); - + System.out.println(""); System.out.println(original); System.out.println(""); @@ -72,4 +72,4 @@ public static void main(String[] args) { System.out.println(""); System.out.println(c2.generate(original)); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/aspectj/SimpleGenerator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/aspectj/SimpleGenerator.java index c63a93ad9f..c355c70464 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/aspectj/SimpleGenerator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/aspectj/SimpleGenerator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a ConcreteClass that decorates strings by adding a + * Implements a ConcreteClass that decorates strings by adding a * period at the end of them. * * @author Jan Hannemann @@ -43,7 +43,7 @@ public class SimpleGenerator implements DecoratedStringGenerator { public String prepare (String s) { return s; } - + /** * Filters a string. Does nothing. * @@ -65,4 +65,4 @@ public String filter (String s) { public String finalize (String s) { return s+"."; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/DecoratedStringGenerator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/DecoratedStringGenerator.java index 55a520687b..b2c82d959d 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/DecoratedStringGenerator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/DecoratedStringGenerator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Defines the interface for generating decorated strings. - * In this example, it acts as the AbstractClass. - * + * Defines the interface for generating decorated strings. + * In this example, it acts as the AbstractClass. + * * The template method is generate(String), * which uses all other methods defined in this abstract class. * @@ -34,8 +34,8 @@ * @version 1.1, 02/17/04 */ -public abstract class DecoratedStringGenerator { - +public abstract class DecoratedStringGenerator { + /** * Decorates a string. This is the TemplateMethod(). * @@ -49,7 +49,7 @@ public String generate(String s) { s = finalize(s); return s; } - + /** * Prepares a string for decoration. * @@ -60,7 +60,7 @@ public String generate(String s) { public abstract String prepare (String s); /** - * Filters a string. + * Filters a string. * * @param s the string to filter * @return the filtered string @@ -74,6 +74,6 @@ public String generate(String s) { * @param s the string to finalize * @return the finalized string */ - + public abstract String finalize (String s); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/FancyGenerator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/FancyGenerator.java index d55129bee0..00f6e3f329 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/FancyGenerator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/FancyGenerator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -33,18 +33,18 @@ */ public class FancyGenerator extends DecoratedStringGenerator { - + /** * Prepares a string for decoration. Turns the string into lowercase. * * @param s the string to filter * @return the prepared string */ - + public String prepare (String s) { return s.toLowerCase(); } - + /** * Filters a string. Capitalizes all consonants. * @@ -53,22 +53,22 @@ public String prepare (String s) { */ public String filter (String s) { - s = s.replace('a', 'A'); + s = s.replace('a', 'A'); s = s.replace('e', 'E'); - s = s.replace('i', 'I'); + s = s.replace('i', 'I'); s = s.replace('o', 'O'); s = s.replace('u', 'U'); - return s; + return s; } - + /** * Finalizes a string by adding an explanation to it. * * @param s the string to finalize * @return the finalized string */ - + public String finalize (String s) { return (s+".\n(all consonants capitalized)"); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/Main.java index a9245b69bb..bf04d66047 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,35 +15,35 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * Implements the driver for the Template Method design pattern example.

    * - * Intent: Define the skeleton of an algorithm in an operation, deferring + * Intent: Define the skeleton of an algorithm in an operation, deferring * some steps to subclasses. Template Method lets subclasses redefine certain * steps of an algorithm without changing the algorithm's structure

    * - * Participating objects are SimpleGenerator and - * FancyGenerator as ConcreteClasses. The + * Participating objects are SimpleGenerator and + * FancyGenerator as ConcreteClasses. The * AbstractClass is DecoratedStringGenerator. *

    * * In this example, the template method generate(String) - * modifies a string in three steps and returns the result. While the + * modifies a string in three steps and returns the result. While the * SimpleGenerator does not change the string much, the - * FancyGenerator turns the string to lowercase, then capitalizes all + * FancyGenerator turns the string to lowercase, then capitalizes all * consonants and adds an explanantion to it. * *

    This is the Java version.

    * * Note that AbstractClass does in fact have to be an abstract - * class (as opposed to an interface), to make it possible to define + * class (as opposed to an interface), to make it possible to define * a default implementation for the template method. * * @author Jan Hannemann @@ -54,18 +54,18 @@ public class Main { /** - * Implements the driver for the Template Method design + * Implements the driver for the Template Method design * pattern example.

    * * @param args the command line parameters, unused */ - + public static void main(String[] args) { String original = "This Is The Original String To Be Processed"; - + DecoratedStringGenerator c1 = new SimpleGenerator(); DecoratedStringGenerator c2 = new FancyGenerator(); - + System.out.println(""); System.out.println(original); System.out.println(""); @@ -73,4 +73,4 @@ public static void main(String[] args) { System.out.println(""); System.out.println(c2.generate(original)); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/SimpleGenerator.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/SimpleGenerator.java index 425dcc9cdf..1e82b7ba87 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/SimpleGenerator.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/templateMethod/java/SimpleGenerator.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a ConcreteClass that decorates strings by adding a + * Implements a ConcreteClass that decorates strings by adding a * period at the end of them. * * @author Jan Hannemann @@ -43,7 +43,7 @@ public class SimpleGenerator extends DecoratedStringGenerator { public String prepare (String s) { return s; } - + /** * Filters a string. Does nothing. * @@ -54,7 +54,7 @@ public String prepare (String s) { public String filter (String s) { return s; } - + /** * Finalizes a string by adding a period to it. * @@ -65,4 +65,4 @@ public String filter (String s) { public String finalize (String s) { return s+"."; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/BinaryTreeLeaf.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/BinaryTreeLeaf.java index 24dad0e390..0bb20cfb54 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/BinaryTreeLeaf.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/BinaryTreeLeaf.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a ConcreteElement of the aggregate strcuture. This is a + * Implements a ConcreteElement of the aggregate strcuture. This is a * terminal binary tree element (leaf). * * @author Jan Hannemann @@ -38,24 +38,24 @@ public class BinaryTreeLeaf implements Visitable { */ protected int value; - + /** * Creates a new Leaf with the given value. * * @param value the value of the leaf */ - + public BinaryTreeLeaf(int value) { this.value = value; - } - - /** + } + + /** * Accessor for the leaf's value * * @return the leaf's value */ - + public int getValue() { return value; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/BinaryTreeNode.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/BinaryTreeNode.java index 84b87122c9..f6871a6ba1 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/BinaryTreeNode.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/BinaryTreeNode.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -76,4 +76,4 @@ public BinaryTreeNode(Visitable left, Visitable right) { this.left = left; this.right = right; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Main.java index 938f50f039..5966dc7c0e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,41 +15,41 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the driver for the Visitor design pattern example.

    + * Implements the driver for the Visitor design pattern example.

    * - * Intent: Represents an operation to be performed on the elements of an + * Intent: Represents an operation to be performed on the elements of an * object structure. Visitor lets you define a new operation without changing * the classes of the elements on which it operates

    * - * Participating classes are SummationVisitor and - * TraversalVisitor as ConcreteVisitors, implementing the + * Participating classes are SummationVisitor and + * TraversalVisitor as ConcreteVisitors, implementing the * VisitorProtocol.Visitor interface.
    - * - * BinaryTreeNode and BinaryTreeLeaf are + * + * BinaryTreeNode and BinaryTreeLeaf are * ConcreteElements, implementing the Visitable interface. *

    * - * In this example, a binary tree that has int values as leafs is built. - * SummationVisitor is a Visitor that collects the sum of - * elements in the leafs (should be 6). - * - * TraversalVisitor is a Visitor that + * In this example, a binary tree that has int values as leafs is built. + * SummationVisitor is a Visitor that collects the sum of + * elements in the leafs (should be 6). + * + * TraversalVisitor is a Visitor that * collects a description of the tree like {{1,2},3} * *

    This is the AspectJ version.

    * * Note that

      - *
    • Every visitor (even the inteface) has to know of each possible element - * type in the object structure. - *
    • Nodes need not to know of the visitor interface; + *
    • Every visitor (even the inteface) has to know of each possible element + * type in the object structure. + *
    • Nodes need not to know of the visitor interface; *
    * * @author Jan Hannemann @@ -57,47 +57,47 @@ * @version 1.1, 02/17/04 */ -public class Main { - +public class Main { + /** - * Implements the driver for the Visitor design pattern example.

    + * Implements the driver for the Visitor design pattern example.

    * * @param args the command-line parameters, unused */ - public static void main(String[] args) { - + public static void main(String[] args) { + System.out.println("Building the tree (1): leaves"); - + BinaryTreeLeaf one = new BinaryTreeLeaf(1); BinaryTreeLeaf two = new BinaryTreeLeaf(2); BinaryTreeLeaf three = new BinaryTreeLeaf(3); - + System.out.println("Building the tree (1): regular nodes"); - + BinaryTreeNode regN = new BinaryTreeNode(one, two); BinaryTreeNode root = new BinaryTreeNode(regN, three); - + System.out.println("The tree now looks like this: "); System.out.println(" regN "); System.out.println(" / \\ "); System.out.println(" regN 3 "); System.out.println(" / \\ "); System.out.println(" 1 2 "); - + System.out.println("Visitor 1: SumVisitor, collects the sum of leaf"); System.out.println("values. Result should be 6."); - - SummationVisitor sumVisitor = new SummationVisitor(); + + SummationVisitor sumVisitor = new SummationVisitor(); root.accept(sumVisitor); - System.out.println(sumVisitor.report()); - + System.out.println(sumVisitor.report()); + System.out.println("Visitor 2: TraversalVisitor, collects a tree"); System.out.println("representation. Result should be {{1,2},3}."); - - TraversalVisitor traversalVisitor = new TraversalVisitor(); + + TraversalVisitor traversalVisitor = new TraversalVisitor(); root.accept(traversalVisitor); - System.out.println(traversalVisitor.report()); + System.out.println(traversalVisitor.report()); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/SummationVisitor.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/SummationVisitor.java index 928cbd90aa..4aa0f7dfbf 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/SummationVisitor.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/SummationVisitor.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.VisitorProtocol; /** - * Implements a ConcreteVisitor that collects the sum of all leaf + * Implements a ConcreteVisitor that collects the sum of all leaf * values in the tree. * * @author Jan Hannemann @@ -38,43 +38,43 @@ public class SummationVisitor implements VisitorProtocol.Visitor { /** * the colleced sum of leaf values */ - + protected int sum = 0; - + /** * Visits a non-terminal binary tree node. * * @param node the regular node */ - public void visitNode(VisitorProtocol.VisitableNode node) { + public void visitNode(VisitorProtocol.VisitableNode node) { if (node instanceof BinaryTreeNode) { - BinaryTreeNode rnode = (BinaryTreeNode) node; + BinaryTreeNode rnode = (BinaryTreeNode) node; rnode.left.accept(this); rnode.right.accept(this); } } - + /** * Visits a terminal tree node. * * @param node the leaf */ - public void visitLeaf(VisitorProtocol.VisitableNode node) { + public void visitLeaf(VisitorProtocol.VisitableNode node) { if (node instanceof BinaryTreeLeaf) { BinaryTreeLeaf leaf = (BinaryTreeLeaf) node; sum += leaf.getValue(); } } - - /** + + /** * Returns the result of the visitor's operation * * @return a string representing the sum of elemnent in the tree's leaves */ - + public String report() { return ">>> SumVisitor collected a sum of "+sum; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/TraversalVisitor.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/TraversalVisitor.java index 2143cad723..eac9ecec3f 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/TraversalVisitor.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/TraversalVisitor.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -80,4 +80,4 @@ public void visitLeaf(VisitorProtocol.VisitableNode node) { public String report() { return ">>> TraversalVisitor traversed the tree to: "+result; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Visitable.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Visitable.java index cbf4e52b20..a43a6a0e43 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Visitable.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Visitable.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -31,4 +31,3 @@ */ public interface Visitable {} - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Visiting.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Visiting.java index 17bae11fdd..223c51d7bd 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Visiting.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/aspectj/Visiting.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import ca.ubc.cs.spl.aspectPatterns.patternLibrary.VisitorProtocol; @@ -33,21 +33,21 @@ * @version 1.1, 02/17/04 */ -public aspect Visiting extends VisitorProtocol { - - /** +public aspect Visiting extends VisitorProtocol { + + /** * Assigns the VisitableNote role to Visitable */ declare parents: Visitable implements VisitableNode; - /** + /** * Assigns the Node role to BinaryTreeNode */ declare parents: BinaryTreeNode implements Node; - /** + /** * Assigns the Leaf role to BinaryTreeLeaf */ diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeLeaf.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeLeaf.java index 38102d325b..f73508769c 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeLeaf.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeLeaf.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a ConcreteElement of the aggregate strcuture. This is a + * Implements a ConcreteElement of the aggregate strcuture. This is a * terminal binary tree element (leaf). * * @author Jan Hannemann @@ -31,41 +31,41 @@ * @version 1.1, 02/17/04 */ -public class BinaryTreeLeaf implements Visitable { - +public class BinaryTreeLeaf implements Visitable { + /** * the value stored in this leaf */ protected int value; - + /** * Accepts a visitor and calls visitLeaf(Node) on it. * * @param visitor the NodeVisitor that is to be accepted. */ - + public void accept(BinaryTreeVisitor visitor) { visitor.visitLeaf(this); } - + /** * Creates a new BinaryTreeLeaf with the given value. * * @param value the value of the leaf */ - + public BinaryTreeLeaf(int value) { this.value = value; - } - - /** + } + + /** * Accessor for the leaf's value * * @return the leaf's value */ - + public int getValue() { return value; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeNode.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeNode.java index 6047497176..ed9768d7a0 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeNode.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeNode.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -86,4 +86,4 @@ public BinaryTreeNode(Visitable left, Visitable right) { this.left = left; this.right = right; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeVisitor.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeVisitor.java index 5ed0d22daf..bd8e977a6a 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeVisitor.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/BinaryTreeVisitor.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -30,30 +30,30 @@ * @author Gregor Kiczales * @version 1.1, 02/17/04 */ - -public interface BinaryTreeVisitor { - + +public interface BinaryTreeVisitor { + /** * Visits a non-terminal binary tree node. * * @param node the node to visit */ - - public void visitNode(Visitable node); + + public void visitNode(Visitable node); /** * Visits a leaf, which is a terminal tree node. * * @param node the leaf */ - + public void visitLeaf(Visitable node); - - /** + + /** * Returns the result of the visitor's operation * * @return a string describing the result of this visitor's operation. */ - + public String report(); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/Main.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/Main.java index 0f336e61e8..1a97fe4827 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/Main.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/Main.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -101,4 +101,4 @@ public static void main(String[] args) { root.accept(traversalVisitor); System.out.println(traversalVisitor.report()); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/SummationVisitor.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/SummationVisitor.java index 326775c1e2..39b43c8a80 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/SummationVisitor.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/SummationVisitor.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements a ConcreteVisitor that collects the sum of all leaf + * Implements a ConcreteVisitor that collects the sum of all leaf * values in the tree. * * @author Jan Hannemann @@ -32,43 +32,43 @@ */ public class SummationVisitor implements BinaryTreeVisitor { - + /** * the colleced sum of leaf values */ - + protected int sum = 0; - + /** * Visits a non-terminal binary tree node. * * @param node the regular node */ - + public void visitNode(Visitable node) { - BinaryTreeNode rnode = (BinaryTreeNode) node; + BinaryTreeNode rnode = (BinaryTreeNode) node; rnode.left.accept(this); rnode.right.accept(this); } - + /** * Visits a terminal tree node. * * @param node the leaf */ - + public void visitLeaf(Visitable node) { BinaryTreeLeaf leaf = (BinaryTreeLeaf) node; sum += leaf.getValue(); } - - /** + + /** * Returns the result of the visitor's operation * * @return a string representation of the sum of leaf values */ - + public String report() { return ">>> SummationVisitor collected a sum of: "+sum; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/TraversalVisitor.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/TraversalVisitor.java index 24dbffb58d..6f78c50b63 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/TraversalVisitor.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/TraversalVisitor.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -32,40 +32,40 @@ */ public class TraversalVisitor implements BinaryTreeVisitor { - - /** + + /** * contains the accumulated result */ - + protected String result = ""; - + /** * Visits a non-terminal binary tree node. * * @param node the regular node */ - + public void visitNode(Visitable node) { BinaryTreeNode rnode = (BinaryTreeNode) node; - result += "{"; + result += "{"; rnode.getLeft().accept(this); result += ","; rnode.getRight().accept(this); result += "}"; } - + /** * Visits a terminal tree node. * * @param node the leaf */ - + public void visitLeaf(Visitable node) { BinaryTreeLeaf leaf = (BinaryTreeLeaf) node; result += leaf.getValue(); } - - /** + + /** * Returns the result of the visitor's operation * * @return a string representing a traversal of the tree @@ -74,4 +74,4 @@ public void visitLeaf(Visitable node) { public String report() { return ">>> TraversalVisitor traversed the tree to: "+result; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/Visitable.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/Visitable.java index 4db9b475dc..bb6bda8125 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/Visitable.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/examples/visitor/java/Visitable.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** @@ -30,14 +30,13 @@ * @version 1.1, 02/17/04 */ -public interface Visitable { - +public interface Visitable { + /** * Accepts a Visitor. * * @param visitor the NodeVisitor that is to be accepted. */ - + public void accept(BinaryTreeVisitor visitor); } - diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ChainOfResponsibilityException.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ChainOfResponsibilityException.java index 752e67fb83..14dee45db6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ChainOfResponsibilityException.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ChainOfResponsibilityException.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -44,4 +44,4 @@ public class ChainOfResponsibilityException extends RuntimeException { public ChainOfResponsibilityException(String s) { super(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ChainOfResponsibilityProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ChainOfResponsibilityProtocol.java index f21e0b883c..a47b67faed 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ChainOfResponsibilityProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ChainOfResponsibilityProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -173,4 +173,4 @@ public void setSuccessor(Handler handler, Handler successor) { public Handler getSuccessor(Handler handler) { return ((Handler) successors.get(handler)); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/Command.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/Command.java index 03867b6891..87abdcfd2e 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/Command.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/Command.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,34 +15,34 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * This interface is implemented by Command objects. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 */ - -public interface Command { + +public interface Command { /** * Executes the command. * * @param receiver the object this command is manipulating. */ - + public void executeCommand(CommandReceiver receiver); /** * Queries the command's executable status. This interface method is - * optional (default: all commands are excutable); a default + * optional (default: all commands are excutable); a default * implementation is provided by the abstract CommandProtocol aspect. * * @returns a boolean indicating whether the command is excutable. diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandInvoker.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandInvoker.java index 0933fa84cb..f73a8785bc 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandInvoker.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandInvoker.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,24 +15,24 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * This interface is used by extending aspects to say what types * can be Invokers (i.e. senders of an executeCommand() call). * This role is assigned by concrete sub-aspects of the CommandProtocol * pattern aspect. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * * @see CommandProtocol */ - -public interface CommandInvoker { } \ No newline at end of file + +public interface CommandInvoker { } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandProtocol.java index 11951abba1..ef6258be2c 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import java.util.WeakHashMap; import java.util.Collection; import java.util.LinkedList; -import java.util.Iterator; +import java.util.Iterator; import ca.ubc.cs.spl.aspectPatterns.patternLibrary.Command; import ca.ubc.cs.spl.aspectPatterns.patternLibrary.CommandInvoker; @@ -33,23 +33,23 @@ /** * This is the abstract Command protocol. - * + * * Note that this implementation allows only for exactly one command per * invoker. That is usually sufficient, but alternate implementations - * could account for multiple commands by using composite + * could account for multiple commands by using composite * (macro) commands (either with or without defined order). - * - * To allow for some flexibility, commands can either be explicitly + * + * To allow for some flexibility, commands can either be explicitly * set or removed by Clients, or this can be done via - * pointcuts. - * + * pointcuts. + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 */ -public abstract aspect CommandProtocol { - +public abstract aspect CommandProtocol { + //////////////////////////////// // Invoker -> Command mapping // //////////////////////////////// @@ -57,43 +57,43 @@ /** * stores the mapping between CommandInvokers and Commands */ - + private WeakHashMap mappingInvokerToCommand = new WeakHashMap(); - + /** * Sets a new command for an invoker * * @param invoker the object which will invoke the command * @param command the command to be set * @return the former command - */ - - public Object setCommand(CommandInvoker invoker, Command command) { - return mappingInvokerToCommand.put(invoker, command); + */ + + public Object setCommand(CommandInvoker invoker, Command command) { + return mappingInvokerToCommand.put(invoker, command); } - + /** * Removes a command from an invoker * * @param invoker the object which will no longer invoke the command * @param command the command to be removed * @return the former command - */ - - public Object removeCommand(CommandInvoker invoker) { - return setCommand(invoker, null); + */ + + public Object removeCommand(CommandInvoker invoker) { + return setCommand(invoker, null); } /** * Returns the command for an invoker * - * @param invoker the object for which to return the command + * @param invoker the object for which to return the command * @return the current command for the invoker - */ - - public Command getCommand(CommandInvoker invoker) { - return (Command) mappingInvokerToCommand.get(invoker); + */ + + public Command getCommand(CommandInvoker invoker) { + return (Command) mappingInvokerToCommand.get(invoker); } @@ -104,31 +104,31 @@ public Command getCommand(CommandInvoker invoker) { /** * stores the mapping between Coammnds and Receivers */ - + private WeakHashMap mappingCommandToReceiver = new WeakHashMap(); - + /** * Sets a new receiver for a command * * @param command the command to be set - * @param receiver the object to be manipulated by the command's + * @param receiver the object to be manipulated by the command's * execute() method * @return the former receiver - */ - - public Object setReceiver(Command command, CommandReceiver receiver) { - return mappingCommandToReceiver.put(command, receiver); + */ + + public Object setReceiver(Command command, CommandReceiver receiver) { + return mappingCommandToReceiver.put(command, receiver); } - + /** * Returns the receiver for a particular command * - * @param invoker the object for which to return the command + * @param invoker the object for which to return the command * @returns the current command for the invoker - */ - - public CommandReceiver getReceiver(Command command) { - return (CommandReceiver) mappingCommandToReceiver.get(command); + */ + + public CommandReceiver getReceiver(Command command) { + return (CommandReceiver) mappingCommandToReceiver.get(command); } @@ -148,12 +148,12 @@ public CommandReceiver getReceiver(Command command) { /** - * Calls executeCommand() when the command is triggered. + * Calls executeCommand() when the command is triggered. * * @param invoker the object invoking the command - */ - - after(CommandInvoker invoker): commandTrigger(invoker) { + */ + + after(CommandInvoker invoker): commandTrigger(invoker) { Command command = getCommand(invoker); if (command != null) { CommandReceiver receiver = getReceiver(command); @@ -162,7 +162,7 @@ public CommandReceiver getReceiver(Command command) { // Do nothing: This Invoker has no associated command } } - + ////////////////////////////////// // setCommand() via PC & advice // @@ -172,7 +172,7 @@ public CommandReceiver getReceiver(Command command) { * The join points after which to set a command for an invoker. * This replaces the normally scattered Invoker.add(Command) calls. * The pointcut is provided in addition to the setCommand() method above, - * to allow all pattern code to be removed from concrete invokers. + * to allow all pattern code to be removed from concrete invokers. * * This PC is non-abstract, to make it optional for sub-aspcects to define * it. @@ -181,23 +181,23 @@ public CommandReceiver getReceiver(Command command) { * @param command the command to be attached to the invoker */ - protected pointcut setCommandTrigger(CommandInvoker invoker, Command command); + protected pointcut setCommandTrigger(CommandInvoker invoker, Command command); /** - * Calls addCommand() when a command should be set. + * Calls addCommand() when a command should be set. * * @param invoker the invoker to attach the command to * @param command the command to be attached to the invoker - */ - - after (CommandInvoker invoker, Command command): - setCommandTrigger(invoker, command) { + */ + + after (CommandInvoker invoker, Command command): + setCommandTrigger(invoker, command) { if (invoker != null) { setCommand(invoker, command); } else { - // If the invoker is null, the command cannot be set. - // Either ignore this case or throw an exception + // If the invoker is null, the command cannot be set. + // Either ignore this case or throw an exception } } @@ -209,9 +209,9 @@ public CommandReceiver getReceiver(Command command) { * The join points after which to remove a command from an invoker. * This replaces the normally scattered Invoker.remove(Command) * calls. - * + * * The pointcut is provided in addition to the removeCommand() - * method above, to allow all pattern code to be removed from + * method above, to allow all pattern code to be removed from * concrete invokers. * * This PC is non-abstract, to make it optional for sub-aspcects to define @@ -220,20 +220,20 @@ public CommandReceiver getReceiver(Command command) { * @param invoker the invoker to remove the command from */ - protected pointcut removeCommandTrigger(CommandInvoker invoker); - + protected pointcut removeCommandTrigger(CommandInvoker invoker); + /** - * Calls removeCommand() when a command should be removed. + * Calls removeCommand() when a command should be removed. * * @param invoker the invoker to remove the command from - */ - - after(CommandInvoker invoker): removeCommandTrigger(invoker) { + */ + + after(CommandInvoker invoker): removeCommandTrigger(invoker) { if (invoker != null) { removeCommand(invoker); } else { - // If the invoker is null, the command cannot be removed. - // Either ignore this case or throw an exception + // If the invoker is null, the command cannot be removed. + // Either ignore this case or throw an exception } } @@ -243,13 +243,13 @@ public CommandReceiver getReceiver(Command command) { /** * Provides a deault implementation for the isExecutable method defined - * in the Command interface. + * in the Command interface. * * @return true (default implementation). Can be overwritten by concrete * aspects or even concrete commands. - */ + */ public boolean Command.isExecutable() { return true; - } + } } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandReceiver.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandReceiver.java index 0a7f8e458e..1de2006afd 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandReceiver.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CommandReceiver.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,25 +15,25 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + /** * This interface is used by extending aspects to say what types * can be Receivers (i.e. manipulated by a command object receiving an * executeCommand() call). * This role is assigned by concrete sub-aspects of the CommandProtocol * pattern aspect. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - * + * * @see CommandProtocol */ - -public interface CommandReceiver { } \ No newline at end of file + +public interface CommandReceiver { } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CompositeProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CompositeProtocol.java index bab9e74dcc..490abb9378 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CompositeProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/CompositeProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,25 +15,25 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import java.util.Enumeration; import java.util.WeakHashMap; -import java.util.Vector; +import java.util.Vector; /** - * Defines the abstract Composite design pattern.

    - * + * Defines the abstract Composite design pattern.

    + * * It maintains the mapping between composites and their children, defines the * Component, Composite, and Leaf roles, and implements facilities to * implements methods that work on the whole aggregate structure. * - *

    This is the AspectJ version.

    + *

    This is the AspectJ version.

    * * Each concrete subaspect does the following things:

      *
    • Defines which classes are Components and Leafs @@ -46,14 +46,14 @@ * @version 1.1, 02/06/04 */ -public abstract aspect CompositeProtocol { - +public abstract aspect CompositeProtocol { + /** - * Defines the Component role. The role is public to allow clients to + * Defines the Component role. The role is public to allow clients to * handle objects of that type. */ - - public interface Component {} + + public interface Component {} /** * Defines the Composite role. Composites are Components that can have @@ -62,7 +62,7 @@ public interface Component {} */ protected interface Composite extends Component {} - + /** * Defines the Leaf role. Leafs are Components that can not have * children. This role is only used within the pattern context, thus it @@ -70,14 +70,14 @@ protected interface Composite extends Component {} */ protected interface Leaf extends Component {} - + /** * stores the mapping between components and their children - */ + */ private WeakHashMap perComponentChildren = new WeakHashMap(); - /** + /** * Returns a vector of the children of the argument component */ @@ -89,16 +89,16 @@ private Vector getChildren(Component s) { } return children; } - + /** * Client-accessible method to add a new child to a composite * * @param composite the composite to add a new child to * @param component the new child to add */ - - public void addChild(Composite composite, Component component) { - getChildren(composite).add(component); + + public void addChild(Composite composite, Component component) { + getChildren(composite).add(component); } /** @@ -108,63 +108,63 @@ public void addChild(Composite composite, Component component) { * @param component the child to remove */ - public void removeChild(Composite composite, Component component) { - getChildren(composite).remove(component); + public void removeChild(Composite composite, Component component) { + getChildren(composite).remove(component); } - + /** - * Client-accessible method to get an Enumeration of all children of + * Client-accessible method to get an Enumeration of all children of * a composite * * @param composite the composite to add a new child to * @param component the new child to add */ - public Enumeration getAllChildren(Component c) { - return getChildren(c).elements(); + public Enumeration getAllChildren(Component c) { + return getChildren(c).elements(); } - /** - * Defines an interface for visitors that operate on the composite + /** + * Defines an interface for visitors that operate on the composite * structure. These visitors are implemented by concrete sub-aspects * and used in the recurseOperation(Component, Visitor) * method. This construct is needed to allow for method forwarding: * A composite that receives a method forwards the request to all its * children. */ - - protected interface Visitor { - + + protected interface Visitor { + /** * Generic method that performs an unspecified operation on compoennts * * @param c the component to perform the operation on */ - + public void doOperation(Component c); } - /** - * Implements the method-forwarding logic: If a method is to be applied + /** + * Implements the method-forwarding logic: If a method is to be applied * to the aggregate structure, each composite forwards it to its children * * @param c the current component * @param v the visitor representing the operation to be performed */ - public void recurseOperation(Component c, Visitor v) { // This implements the logic that Composites forward + public void recurseOperation(Component c, Visitor v) { // This implements the logic that Composites forward for (Enumeration enum = getAllChildren(c); enum.hasMoreElements(); ) { // method calls to their children Component child = (Component) enum.nextElement(); v.doOperation(child); } } - - - - /** - * Defines an interface for visitors that operate on the composite + + + + /** + * Defines an interface for visitors that operate on the composite * structure. These visitors are implemented by comcrete sub-aspects * and used in the recurseOperation(Component, Visitor)<>/code> * method. This construct is needed to allow for method forwarding: @@ -173,22 +173,22 @@ public void recurseOperation(Component c, Visitor v) { // Thi * * This version allows for a return value of Object type. For some odd * reason AJDT complains if this type is declared protected (as it should - * be). Note that Visitor above works fine as protected. + * be). Note that Visitor above works fine as protected. */ public interface FunctionVisitor { - + /** * Generic method that performs an unspecified operation on components * * @param c the component to perform the operation on */ - + public Object doFunction(Component c); } - - /** - * Implements the method-forwarding logic: If a method is to be applied + + /** + * Implements the method-forwarding logic: If a method is to be applied * to the aggregate structure, each composite forwards it to its children. * This version allows for a return value of Object type, effectively * enableing collecting aggregate results on the composite structure. @@ -204,6 +204,5 @@ public Enumeration recurseFunction(Component c, FunctionVisitor fv) { results.add(fv.doFunction(child)); } return results.elements(); - } -} - + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/FlyweightProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/FlyweightProtocol.java index 9092d96755..d482e95ee8 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/FlyweightProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/FlyweightProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,42 +15,42 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ - + import java.util.Hashtable; /** - * Implements a the abstracted Flyweight design pattern. Included is the + * Implements a the abstracted Flyweight design pattern. Included is the * general creation-on-demand logic. Concrete subaspects are used to * defines the actual FlyweightFactories. * * Concrete subaspects need only to assign the flyweight roles and to * overwrite the createFlyweight(Object) method. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/11/04 */ public abstract aspect FlyweightProtocol { - - /** + + /** * stores the existing Flyweight by key */ private Hashtable flyweights = new Hashtable(); - /** + /** * defines the Flyweight role. */ protected interface Flyweight{}; - + /** * Creates a Flyweight for a given key. This method is called by * getFlyweight(Object) if the flyweight does not already @@ -61,10 +61,10 @@ protected interface Flyweight{}; */ protected abstract Flyweight createFlyweight(Object key); - + /** * Returns the Flyweight for a particular key. - * If the appropriate Flyweight does not yet exist, it is created + * If the appropriate Flyweight does not yet exist, it is created * on demand. * * @param key the key identifying the particular Flyweight @@ -76,8 +76,8 @@ public Flyweight getFlyweight(Object key) { return (Flyweight) flyweights.get(key); } else { Flyweight flyweight = createFlyweight(key); - flyweights.put(key, flyweight); + flyweights.put(key, flyweight); return flyweight; } } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MediatorProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MediatorProtocol.java index b676ed98b7..831e26d559 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MediatorProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MediatorProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.WeakHashMap; @@ -41,19 +41,19 @@ * *
    • what operations on the Colleague trigger Mediator * updates.
      - * This is done by concretizing the change(Colleague) + * This is done by concretizing the change(Colleague) * pointcut * *
    • how to mediate
      * this is done by concretizing - * notifyMediator(Colleague, Mediator) + * notifyMediator(Colleague, Mediator) * * * Note that in this implementation, the work of updating is a method * on the sub-aspect, not a method introduced on the Mediator. This * allows one class of object to be the Mediator in different kinds of * mediation relationships, each of which has a different updating - * behavior. + * behavior. * * @author Jan Hannemann * @author Gregor Kiczales @@ -62,19 +62,19 @@ public abstract aspect MediatorProtocol { - + /** * Declares the Colleague role. * Roles are modeled as (empty) interfaces. */ - - protected interface Colleague { } + + protected interface Colleague { } /** * Declares the Mediator role. * Roles are modeled as (empty) interfaces. */ - + protected interface Mediator { } /** @@ -82,12 +82,12 @@ protected interface Mediator { } * Mediator
      s. For each Colleague, its Mediator * is stored. */ - + private WeakHashMap mappingColleagueToMediator = new WeakHashMap(); /** - * Returns the Mediator of + * Returns the Mediator of * a particular Colleague. Used internally. * * @param colleague the Colleague for which to return the mediator @@ -95,21 +95,21 @@ protected interface Mediator { } */ private Mediator getMediator(Colleague colleague) { - Mediator mediator = + Mediator mediator = (Mediator) mappingColleagueToMediator.get(colleague); return mediator; } - + /** - * Sets the Mediator for a Colleague. This is a method - * on the pattern aspect, not on any of the participants. + * Sets the Mediator for a Colleague. This is a method + * on the pattern aspect, not on any of the participants. * * @param colleague the Colleague to set a new Mediator for * @param mediator the new Mediator to set - */ - - public void setMediator(Colleague colleague, Mediator mediator) { - mappingColleagueToMediator.put(colleague, mediator); + */ + + public void setMediator(Colleague colleague, Mediator mediator) { + mappingColleagueToMediator.put(colleague, mediator); } @@ -125,8 +125,8 @@ public void setMediator(Colleague colleague, Mediator mediator) { /** * Call updateObserver to update each observer. - */ - + */ + after(Colleague c): change(c) { notifyMediator(c, getMediator(c)); } @@ -136,7 +136,7 @@ public void setMediator(Colleague colleague, Mediator mediator) { * to a Colleague occurs. To be concretized by sub-aspects. * * @param c the Colleague on which a change of interest occured - * @param m the Mediator to be notifed of the change + * @param m the Mediator to be notifed of the change */ protected abstract void notifyMediator(Colleague c, Mediator m); diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/Memento.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/Memento.java index 0acf0b5e5f..3703610b90 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/Memento.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/Memento.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,37 +15,37 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * Declares the methods for setting and getting the state for Mementos. - * + * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/12/04 */ -public interface Memento { +public interface Memento { /** * Sets the state of this Memento give the passed state. - * - * + * + * * @param state the state to store */ - + public void setState(Object state); /** * Returns the state of this Memento give the passed originator. - * + * * @return the state stored by this Memento */ - public Object getState(); + public Object getState(); } diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MementoException.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MementoException.java index 8c361ed81f..582919cfc7 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MementoException.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MementoException.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,15 +15,15 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements an exception that occurs if an incorrect Originator is used + * Implements an exception that occurs if an incorrect Originator is used * * @author Jan Hannemann * @author Gregor Kiczales @@ -32,15 +32,15 @@ * @see MementoProtocol */ -public class MementoException extends RuntimeException { +public class MementoException extends RuntimeException { /** * Creates a MementoException * - * @param s the error message + * @param s the error message */ - + public MementoException(String s) { super(s); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MementoProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MementoProtocol.java index 7697a0f58f..ac328e1e1b 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MementoProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/MementoProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the abstract Memento design pattern. It defines the role of + * Implements the abstract Memento design pattern. It defines the role of * Originator. The Memento role is client-usable and as such - * defined outside this aspect. + * defined outside this aspect. * * Concrete sub-aspects overwrite the two abstract methods to define how * Mementos get generated and how they are used to restore the state @@ -35,14 +35,14 @@ * @author Gregor Kiczales * @version 1.1, 02/12/04 */ - + public abstract aspect MementoProtocol { - + /** * Defines the Originator type. Used only internally. */ - protected interface Originator {} + protected interface Originator {} /** * Creates a Memento object for an Originator @@ -50,11 +50,11 @@ protected interface Originator {} * @param o the Originator to create a Memento for * @return the Memento storing the originator's state */ - + public abstract Memento createMementoFor(Originator o); - + /** - * Restores this Originator to a former state encapsulated in the + * Restores this Originator to a former state encapsulated in the * Memento passed * * @param o the Originator to restore @@ -62,4 +62,4 @@ protected interface Originator {} */ public abstract void setMemento(Originator o, Memento m); -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ObserverProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ObserverProtocol.java index da403022b8..7ad37461ec 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ObserverProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ObserverProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.WeakHashMap; @@ -44,7 +44,7 @@ * *
    • how to update the observers
      * this is done by defining a method on - * updateObserver(Subject, Observer) + * updateObserver(Subject, Observer) * * * Note that in this implementation, the work of updating is a method @@ -59,16 +59,16 @@ * @author Gregor Kiczales * @version 1.1, 02/13/04 */ - -public abstract aspect ObserverProtocol { - - + +public abstract aspect ObserverProtocol { + + /** * This interface is used by extending aspects to say what types * can be Subjects. It models the Subject role. */ - protected interface Subject { } + protected interface Subject { } /** @@ -84,19 +84,19 @@ protected interface Observer { } * Observer
      s. For each Subject, a LinkedList * is of its Observers is stored. */ - + private WeakHashMap perSubjectObservers; /** - * Returns a Collection of the Observers of + * Returns a Collection of the Observers of * a particular subject. Used internally. * * @param subject the subject for which to return the Observers * @return a Collection of s's Observers */ - protected List getObservers(Subject subject) { + protected List getObservers(Subject subject) { if (perSubjectObservers == null) { perSubjectObservers = new WeakHashMap(); } @@ -108,42 +108,42 @@ protected List getObservers(Subject subject) { return observers; } - + /** * Adds an Observer to a Subject. This is the equivalent of - * attach(), but is a method on the pattern aspect, not the - * Subject. + * attach(), but is a method on the pattern aspect, not the + * Subject. * * @param s the Subject to attach a new Observer to * @param o the new Observer to attach - */ - - public void addObserver(Subject subject, Observer observer) { - getObservers(subject).add(observer); + */ + + public void addObserver(Subject subject, Observer observer) { + getObservers(subject).add(observer); } - + /** * Removes an observer from a Subject. This is the equivalent of - * detach(), but is a method on the pattern aspect, not the Subject. + * detach(), but is a method on the pattern aspect, not the Subject. * * @param s the Subject to remove the Observer from * @param o the Observer to remove - */ - - public void removeObserver(Subject subject, Observer observer) { - getObservers(subject).remove(observer); + */ + + public void removeObserver(Subject subject, Observer observer) { + getObservers(subject).remove(observer); } /** * The join points after which to do the update. * It replaces the normally scattered calls to notify(). To be * concretized by sub-aspects. - */ - + */ + protected abstract pointcut subjectChange(Subject s); /** - * Calls updateObserver(..) after a change of interest to + * Calls updateObserver(..) after a change of interest to * update each Observer. * * @param subject the Subject on which the change occured @@ -154,14 +154,14 @@ public void removeObserver(Subject subject, Observer observer) { while ( iter.hasNext() ) { updateObserver(subject, ((Observer)iter.next())); } - } - + } + /** * Defines how each Observer is to be updated when a change * to a Subject occurs. To be concretized by sub-aspects. * * @param subject the Subject on which a change of interest occured - * @param observer the Observer to be notifed of the change + * @param observer the Observer to be notifed of the change */ protected abstract void updateObserver(Subject subject, Observer observer); diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/PrototypeProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/PrototypeProtocol.java index 79ef7cd56f..35dec75976 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/PrototypeProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/PrototypeProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,58 +15,58 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** * Implements the abstract Prototype design pattern. It attaches a default * clone() method on all Prototype participants and * provides a static cloneObject(Prototype) method. The default - * implementation of that method is to try to use the clone() + * implementation of that method is to try to use the clone() * method and, failing that, to call its protected - * createCloneFor(Prototype) method. Concrete subaspects can either + * createCloneFor(Prototype) method. Concrete subaspects can either * overwrite none or one (or both) of the methods to tailor their * particular design pattern instance to its individual needs * * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/13/04 - */ + */ + +public abstract aspect PrototypeProtocol { -public abstract aspect PrototypeProtocol { - /** * Defines the Prototype role. */ - + protected interface Prototype {} - + /** * Attaches a default clone() method to all prototypes. * This makes use of Java's clone() mechanism that creates a deep copy * of the object in question. - * + * * @return a copy of the object */ - public Object Prototype.clone() throws CloneNotSupportedException { + public Object Prototype.clone() throws CloneNotSupportedException { return super.clone(); } - + /** * Provides a static default aspect method for cloning prototypes. * It uses the attached clone() method if possible. If not, it calls the * static createCloneFor(Prototype) method. - * + * * @param object the prototype object to clone * @return a copy of the object */ - - + + public Object cloneObject(Prototype object) { try { return object.clone(); @@ -74,18 +74,18 @@ public Object cloneObject(Prototype object) { return createCloneFor(object); } } - + /** * Provides an alternative method for cases when the default - * clone() method fails. This method can be + * clone() method fails. This method can be * overwritten by concrete subaspects. In this default implementation * it return null. - * + * * @param object the prototype object to clone * @return a copy of the object, but null in this case */ - protected Object createCloneFor(Prototype object) { + protected Object createCloneFor(Prototype object) { return null; } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ProxyProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ProxyProtocol.java index 856a681a99..3d3b87a3fb 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ProxyProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/ProxyProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,17 +15,17 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ -import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.JoinPoint; /** - * Defines the abstracted Proxy design pattern.

      + * Defines the abstracted Proxy design pattern.

      * * Concrete sub-aspects define the following:

        *
      • Which class(es) are RealSubjects @@ -38,78 +38,78 @@ * @author Jan Hannemann * @author Gregor Kiczales * @version 1.1, 02/17/04 - */ - -public abstract aspect ProxyProtocol { - + */ + +public abstract aspect ProxyProtocol { + /** * Defines the Subject role (used for correct typing) */ - - protected interface Subject {} - + + protected interface Subject {} + /** - * Captures all accesses to the subject that should be covered by + * Captures all accesses to the subject that should be covered by * this pattern instance. */ - - protected abstract pointcut requests(); - - /** - * Extends the requests() pointcut to include a + + protected abstract pointcut requests(); + + /** + * Extends the requests() pointcut to include a * field for the joinpoint. Used internally only. */ - - private pointcut requestsByCaller(Object caller): + + private pointcut requestsByCaller(Object caller): requests() && this(caller); /** - * Intercepts accesses to protected parts of the OutputSubject. - * If access is proxy protected, the method + * Intercepts accesses to protected parts of the OutputSubject. + * If access is proxy protected, the method * handleProxyProtection(..) is called instead. * * @param caller the object responsible for the protected access * @param subject the subject receiving the call */ - Object around(Object caller, Subject subject): - requestsByCaller(caller) && target(subject) { - + Object around(Object caller, Subject subject): + requestsByCaller(caller) && target(subject) { + if (! isProxyProtected(caller, subject, thisJoinPoint) ) - return proceed(caller, subject); + return proceed(caller, subject); return handleProxyProtection(caller, subject, thisJoinPoint); - } - + } + /** * Checks whether the request should be handled by the Proxy or not * * @param caller the object responsible for the protected access - * @param subject the subject receiving the call + * @param subject the subject receiving the call * @param joinPoint the joinpoint associated with the protected access * * @return true if the access is covered by the proxy, false otherwise */ - - protected abstract boolean isProxyProtected(Object caller, - Subject subject, + + protected abstract boolean isProxyProtected(Object caller, + Subject subject, JoinPoint joinPoint); /** - * For delegation: Provides an alternative return value if access - * is proxy protected. A default implementation is supplied so that + * For delegation: Provides an alternative return value if access + * is proxy protected. A default implementation is supplied so that * concrete subaspects are not forced to implement the method. * * @param caller the object responsible for the proxy protected access - * @param subject the subject receiving the call - * @param joinPoint the joinpoint associated with the proxy protected + * @param subject the subject receiving the call + * @param joinPoint the joinpoint associated with the proxy protected * access * * @return an alternative return value */ - protected Object handleProxyProtection(Object caller, - Subject subject, + protected Object handleProxyProtection(Object caller, + Subject subject, JoinPoint joinPoint) { - return null; + return null; } -} +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/SingletonProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/SingletonProtocol.java index fddd603da3..e6042669fe 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/SingletonProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/SingletonProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,11 +15,11 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ import java.util.Hashtable; @@ -47,15 +47,15 @@ * @author Gregor Kiczales * @version 1.1, 02/18/04 */ - + public abstract aspect SingletonProtocol { - + /** * stores the Singleton instances */ - - private Hashtable singletons = new Hashtable(); - + + private Hashtable singletons = new Hashtable(); + /** * Defines the Singleton role. It is realized as public * to allow for more flexibility (i.e., alternatively, types @@ -64,30 +64,30 @@ */ public interface Singleton {} - + /** * Placeholder for exceptions to the Singleton's constructor - * protection. For example, non-singleton subclasses may need to + * protection. For example, non-singleton subclasses may need to * access the protected constructor of the Singleton normally. - * + * * An alternative implementation would be to define an interface * for singleton exceptions similar to the one above. */ - + protected pointcut protectionExclusions(); /** * Protects the Singleton's constructor. Creates the unique * instance on demant and returns it instead of a new object. - * - * @return the singleton instance + * + * @return the singleton instance */ - - Object around(): call((Singleton+).new(..)) && !protectionExclusions() { - Class singleton = thisJoinPoint.getSignature().getDeclaringType(); + + Object around(): call((Singleton+).new(..)) && !protectionExclusions() { + Class singleton = thisJoinPoint.getSignature().getDeclaringType(); if (singletons.get(singleton) == null) { // How to access the static instance variable here? - singletons.put(singleton, proceed()); + singletons.put(singleton, proceed()); } return singletons.get(singleton); - } -} \ No newline at end of file + } +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/StrategyProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/StrategyProtocol.java index 0e32914607..53aa7eb4e6 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/StrategyProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/StrategyProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -17,7 +17,7 @@ * The Original Code is ca.ubc.cs.spl.aspectPatterns. * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * * Contributor(s): */ @@ -84,4 +84,4 @@ public void setConcreteStrategy(Context c, Strategy s) { public Strategy getConcreteStrategy(Context c) { return (Strategy) strategyPerContext.get(c); } -} \ No newline at end of file +} diff --git a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/VisitorProtocol.java b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/VisitorProtocol.java index b1c30546c6..c27ae9c3a1 100644 --- a/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/VisitorProtocol.java +++ b/docs/sandbox/ubc-design-patterns/src/ca/ubc/cs/spl/aspectPatterns/patternLibrary/VisitorProtocol.java @@ -7,7 +7,7 @@ * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -15,27 +15,27 @@ * License. * * The Original Code is ca.ubc.cs.spl.aspectPatterns. - * + * * For more details and the latest version of this code, please see: - * http://www.cs.ubc.ca/labs/spl/projects/aodps.html + * https://www.cs.ubc.ca/labs/spl/projects/aodps.html * - * Contributor(s): + * Contributor(s): */ /** - * Implements the abstracted Visitor design pattern.

        + * Implements the abstracted Visitor design pattern.

        * - * Intent: Represents an operation to be performed on the elements of an + * Intent: Represents an operation to be performed on the elements of an * object structure. Visitor lets you define a new operation without changing * the classes of the elements on which it operates

        * * Note that this implementation only deals with two different kind of nodes: - * terminal and non-terminal nodes. In cases where the aggregate structure - * contains more types of nodes, this aspect cannot be used without - * modifications.

        + * terminal and non-terminal nodes. In cases where the aggregate structure + * contains more types of nodes, this aspect cannot be used without + * modifications.

        * * Note further that whenever the aggregate structure is unimportant, the - * additional functionality can be added in a much sipmler using + * additional functionality can be added in a much sipmler using * AspectJ's open classes mechanism (i.e., by using inter-type declarations * to implement the desired functionality). * @@ -50,11 +50,11 @@ * Defines the Element role. The inerface is public so that * ConcreteVisitors can use the type. */ - + public interface VisitableNode {} /** - * Defines a ConcreteElement role for non-terminal nodes in + * Defines a ConcreteElement role for non-terminal nodes in * a binary tree structure. The interface is protected as it is only used * by concrete subaspects. */ @@ -62,25 +62,25 @@ public interface VisitableNode {} protected interface Node extends VisitableNode {} /** - * Defines a ConcreteElement role for terminal nodes in + * Defines a ConcreteElement role for terminal nodes in * a tree structure. The inerface is protected as it is only used * by concrete subaspects. */ - protected interface Leaf extends VisitableNode {} - + protected interface Leaf extends VisitableNode {} + /** - * This interface is implemented by ConcreteVisitors. + * This interface is implemented by ConcreteVisitors. */ - + public interface Visitor { - + /** * Defines a method signature for visiting regular nodes. * * @param node the regular node to visit */ - + public void visitNode(VisitableNode node); /** @@ -99,32 +99,32 @@ public interface Visitor { public String report(); } - + /** - * Declares accept(..) for visitable nodes + * Declares accept(..) for visitable nodes * * @param visitor the visitor that is to be accepted */ - + public void VisitableNode.accept(Visitor visitor) {} - + /** - * Declares accept(..) for regular nodes + * Declares accept(..) for regular nodes * * @param visitor the visitor that is to be accepted */ - - public void Node.accept(Visitor visitor) { - visitor.visitNode(this); + + public void Node.accept(Visitor visitor) { + visitor.visitNode(this); } - + /** - * Declares accept(..) for leaf nodes + * Declares accept(..) for leaf nodes * * @param visitor the visitor that is to be accepted */ - public void Leaf.accept(Visitor visitor) { - visitor.visitLeaf(this); + public void Leaf.accept(Visitor visitor) { + visitor.visitLeaf(this); } -} \ No newline at end of file +} diff --git a/docs/teaching/demos/oopsla2002-script.html b/docs/teaching/demos/oopsla2002-script.html index 310505196d..d0017db72c 100644 --- a/docs/teaching/demos/oopsla2002-script.html +++ b/docs/teaching/demos/oopsla2002-script.html @@ -1,6 +1,6 @@ +xmlns="https://www.w3.org/TR/REC-html40"> diff --git a/docs/teaching/exercises/README.txt b/docs/teaching/exercises/README.txt index 91c8c3e524..90f8995b32 100755 --- a/docs/teaching/exercises/README.txt +++ b/docs/teaching/exercises/README.txt @@ -67,17 +67,17 @@ It is almost certainly a good idea to hope that Java is already installed on the students' systems, but to provide two installers (windows and linux) anyway. - http://java.sun.com + https://java.sun.com You may want to also include the rest of the AspectJ installers as well, but that might be a bit of a distraction - http://aspectj.org/dl + https://aspectj.org/dl These require junit.jar. I've included a copy in with the two zip files, but they might want to be refreshed every now and again. - http://junit.org + https://junit.org ------------------------------ @@ -121,4 +121,3 @@ scripts under CVS. Since the only difference is the answers, just overwrite the extraction directory with answers.zip. - diff --git a/docs/teaching/exercises/figures_classes.svg b/docs/teaching/exercises/figures_classes.svg index 1e2587a828..bac15feda9 100644 --- a/docs/teaching/exercises/figures_classes.svg +++ b/docs/teaching/exercises/figures_classes.svg @@ -1,6 +1,6 @@ - - + + diff --git a/docs/teaching/exercises/index.html b/docs/teaching/exercises/index.html index 5212f6e42b..08f2c9f868 100644 --- a/docs/teaching/exercises/index.html +++ b/docs/teaching/exercises/index.html @@ -1,7 +1,7 @@ - + "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + - + - - - + diff --git a/tests/bugs1612/pr328099/readme b/tests/bugs1612/pr328099/readme index 035feb471c..9a9ac5a1ca 100644 --- a/tests/bugs1612/pr328099/readme +++ b/tests/bugs1612/pr328099/readme @@ -3,7 +3,7 @@ Build the src contents into a jar which will then contain class files and our ma Then sign the jar with jarsigner -keystore ../cert/key.store -storepass foobar code.jar foo -as per: http://introcs.cs.princeton.edu/85application/jar/sign.html +as per: https://introcs.cs.princeton.edu/85application/jar/sign.html then you can run it: java -javaagent:XXX -classpath code.jar foo.bar.Foo diff --git a/tests/bugs181/431976/AbstractDependencyInjectionAspect.aj b/tests/bugs181/431976/AbstractDependencyInjectionAspect.aj index fa8fc6441f..9c15bd88d5 100644 --- a/tests/bugs181/431976/AbstractDependencyInjectionAspect.aj +++ b/tests/bugs181/431976/AbstractDependencyInjectionAspect.aj @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/tests/doc/allclasses-frame.html b/tests/doc/allclasses-frame.html index 24f0431ae5..ebde28a0cc 100644 --- a/tests/doc/allclasses-frame.html +++ b/tests/doc/allclasses-frame.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/allclasses-noframe.html b/tests/doc/allclasses-noframe.html index a6cf2e3f80..a6f0ef4a64 100644 --- a/tests/doc/allclasses-noframe.html +++ b/tests/doc/allclasses-noframe.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/constant-values.html b/tests/doc/constant-values.html index de9f919dd1..4d3e04d770 100644 --- a/tests/doc/constant-values.html +++ b/tests/doc/constant-values.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/deprecated-list.html b/tests/doc/deprecated-list.html index 9b99661734..c6d9dc3144 100644 --- a/tests/doc/deprecated-list.html +++ b/tests/doc/deprecated-list.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/help-doc.html b/tests/doc/help-doc.html index cf0e771392..b385602763 100644 --- a/tests/doc/help-doc.html +++ b/tests/doc/help-doc.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/index-files/index-1.html b/tests/doc/index-files/index-1.html index 1db81a7763..66737c18e5 100644 --- a/tests/doc/index-files/index-1.html +++ b/tests/doc/index-files/index-1.html @@ -1,4 +1,4 @@ - + @@ -75,7 +75,7 @@

        A

        -
        addTest(AjcTest) - +
        addTest(AjcTest) - Method in class org.aspectj.testing.XMLBasedAjcTestCase
        For use by the Digester.
        diff --git a/tests/doc/index-files/index-10.html b/tests/doc/index-files/index-10.html index a778659747..03fb3f3ec5 100644 --- a/tests/doc/index-files/index-10.html +++ b/tests/doc/index-files/index-10.html @@ -1,4 +1,4 @@ - + @@ -76,7 +76,7 @@ X
        XMLBasedAjcTestCase - class org.aspectj.testing.XMLBasedAjcTestCase.
        Root class for all Test suites that are based on an AspectJ XML test suite - file.
        XMLBasedAjcTestCase() - + file.
        XMLBasedAjcTestCase() - Constructor for class org.aspectj.testing.XMLBasedAjcTestCase
         
        diff --git a/tests/doc/index-files/index-2.html b/tests/doc/index-files/index-2.html index 53cab51797..84411bc035 100644 --- a/tests/doc/index-files/index-2.html +++ b/tests/doc/index-files/index-2.html @@ -1,4 +1,4 @@ - + @@ -75,7 +75,7 @@

        C

        -
        CompilationResult - class org.aspectj.tools.ajc.CompilationResult.
        Utility class that makes the results of a compiler run available.
        CompilationResult(String[], String, String, List, List, List, List) - +
        CompilationResult - class org.aspectj.tools.ajc.CompilationResult.
        Utility class that makes the results of a compiler run available.
        CompilationResult(String[], String, String, List, List, List, List) - Constructor for class org.aspectj.tools.ajc.CompilationResult
        Build a compilation result - called by the Ajc.compile and Ajc.doIncrementalCompile methods. diff --git a/tests/doc/index-files/index-3.html b/tests/doc/index-files/index-3.html index 48820dabf3..30d1b0b591 100644 --- a/tests/doc/index-files/index-3.html +++ b/tests/doc/index-files/index-3.html @@ -1,4 +1,4 @@ - + @@ -75,31 +75,31 @@

        G

        -
        getArgs() - +
        getArgs() - Method in class org.aspectj.tools.ajc.CompilationResult
        The arguments that were passed to the compiler. -
        getCurrentTest() - +
        getCurrentTest() - Method in class org.aspectj.testing.XMLBasedAjcTestCase
        Get the currently executing test. -
        getErrorMessages() - +
        getErrorMessages() - Method in class org.aspectj.tools.ajc.CompilationResult
        The error messages produced by the compiler. -
        getFailMessages() - +
        getFailMessages() - Method in class org.aspectj.tools.ajc.CompilationResult
        The fail or abort messages produced by the compiler. -
        getInfoMessages() - +
        getInfoMessages() - Method in class org.aspectj.tools.ajc.CompilationResult
        The informational messages produced by the compiler. -
        getSpecFile() - +
        getSpecFile() - Method in class org.aspectj.testing.XMLBasedAjcTestCase
        The file containing the XML specification for the tests. -
        getStandardError() - +
        getStandardError() - Method in class org.aspectj.tools.ajc.CompilationResult
        The standard error written by the compiler, excluding any messages. -
        getStandardOutput() - +
        getStandardOutput() - Method in class org.aspectj.tools.ajc.CompilationResult
        The standard output written by the compiler, excluding any messages. -
        getWarningMessages() - +
        getWarningMessages() - Method in class org.aspectj.tools.ajc.CompilationResult
        The warning messages produced by the compiler.
        diff --git a/tests/doc/index-files/index-4.html b/tests/doc/index-files/index-4.html index ce61119e48..5780a4fea6 100644 --- a/tests/doc/index-files/index-4.html +++ b/tests/doc/index-files/index-4.html @@ -1,4 +1,4 @@ - + @@ -75,19 +75,19 @@

        H

        -
        hasErrorMessages() - +
        hasErrorMessages() - Method in class org.aspectj.tools.ajc.CompilationResult
        True if the compiler issued one or more error messages. -
        hasFailMessages() - +
        hasFailMessages() - Method in class org.aspectj.tools.ajc.CompilationResult
        True if the compiler issued one or more fail or abort messages. -
        hasInfoMessages() - +
        hasInfoMessages() - Method in class org.aspectj.tools.ajc.CompilationResult
        True if the compiler issued one or more informational messages. -
        hasMessages() - +
        hasMessages() - Method in class org.aspectj.tools.ajc.CompilationResult
        True if the compiler issued any messages of any kind. -
        hasWarningMessages() - +
        hasWarningMessages() - Method in class org.aspectj.tools.ajc.CompilationResult
        True if the compiler issued one or more warning messages.
        diff --git a/tests/doc/index-files/index-5.html b/tests/doc/index-files/index-5.html index 172e8bafbf..c434ad50ab 100644 --- a/tests/doc/index-files/index-5.html +++ b/tests/doc/index-files/index-5.html @@ -1,4 +1,4 @@ - + @@ -75,7 +75,7 @@

        L

        -
        loadSuite(Class) - +
        loadSuite(Class) - Static method in class org.aspectj.testing.XMLBasedAjcTestCase
        You must define a suite() method in subclasses, and return the result of calling this method. diff --git a/tests/doc/index-files/index-6.html b/tests/doc/index-files/index-6.html index 6c4a935bff..dc0da7784b 100644 --- a/tests/doc/index-files/index-6.html +++ b/tests/doc/index-files/index-6.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/index-files/index-7.html b/tests/doc/index-files/index-7.html index 27a33b4342..0bcc667203 100644 --- a/tests/doc/index-files/index-7.html +++ b/tests/doc/index-files/index-7.html @@ -1,4 +1,4 @@ - + @@ -75,7 +75,7 @@

        R

        -
        runTest(String) - +
        runTest(String) - Method in class org.aspectj.testing.XMLBasedAjcTestCase
        This helper method runs the test with the given title in the suite spec file. diff --git a/tests/doc/index-files/index-8.html b/tests/doc/index-files/index-8.html index 870b926cf6..ee915f4e85 100644 --- a/tests/doc/index-files/index-8.html +++ b/tests/doc/index-files/index-8.html @@ -1,4 +1,4 @@ - + @@ -75,7 +75,7 @@

        S

        -
        setUp() - +
        setUp() - Method in class org.aspectj.testing.XMLBasedAjcTestCase
         
        diff --git a/tests/doc/index-files/index-9.html b/tests/doc/index-files/index-9.html index e85a8b75c6..d8a45cad19 100644 --- a/tests/doc/index-files/index-9.html +++ b/tests/doc/index-files/index-9.html @@ -1,4 +1,4 @@ - + @@ -75,7 +75,7 @@

        T

        -
        toString() - +
        toString() - Method in class org.aspectj.tools.ajc.CompilationResult
        Returns string containing message count summary, list of messages by type, and the actual ajc compilation command that was issued. diff --git a/tests/doc/index.html b/tests/doc/index.html index 533347c298..80051ad821 100644 --- a/tests/doc/index.html +++ b/tests/doc/index.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/testing/XMLBasedAjcTestCase.html b/tests/doc/org/aspectj/testing/XMLBasedAjcTestCase.html index 6e87843789..b3394054d3 100644 --- a/tests/doc/org/aspectj/testing/XMLBasedAjcTestCase.html +++ b/tests/doc/org/aspectj/testing/XMLBasedAjcTestCase.html @@ -1,4 +1,4 @@ - + @@ -309,7 +309,7 @@

        -
        Parameters:
        testCaseClass - +
        Parameters:
        testCaseClass -
        Returns:

        @@ -363,7 +363,7 @@

        public void addTest(org.aspectj.testing.AjcTest test)
        For use by the Digester. As the XML document is parsed, it creates instances - of AjcTest objects, which are added to this TestCase by the Digester by + of AjcTest objects, which are added to this TestCase by the Digester by calling this method.

        diff --git a/tests/doc/org/aspectj/testing/class-use/XMLBasedAjcTestCase.html b/tests/doc/org/aspectj/testing/class-use/XMLBasedAjcTestCase.html index 71426868ec..f590805d12 100644 --- a/tests/doc/org/aspectj/testing/class-use/XMLBasedAjcTestCase.html +++ b/tests/doc/org/aspectj/testing/class-use/XMLBasedAjcTestCase.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/testing/package-frame.html b/tests/doc/org/aspectj/testing/package-frame.html index 1851d3c292..24ce83b88b 100644 --- a/tests/doc/org/aspectj/testing/package-frame.html +++ b/tests/doc/org/aspectj/testing/package-frame.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/testing/package-summary.html b/tests/doc/org/aspectj/testing/package-summary.html index 9a4cf01880..9688e92640 100644 --- a/tests/doc/org/aspectj/testing/package-summary.html +++ b/tests/doc/org/aspectj/testing/package-summary.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/testing/package-tree.html b/tests/doc/org/aspectj/testing/package-tree.html index 22965845dd..33db3848cd 100644 --- a/tests/doc/org/aspectj/testing/package-tree.html +++ b/tests/doc/org/aspectj/testing/package-tree.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/testing/package-use.html b/tests/doc/org/aspectj/testing/package-use.html index cdfafd4749..b27ec43fdc 100644 --- a/tests/doc/org/aspectj/testing/package-use.html +++ b/tests/doc/org/aspectj/testing/package-use.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/tools/ajc/CompilationResult.html b/tests/doc/org/aspectj/tools/ajc/CompilationResult.html index e725457f91..81d1ecb07a 100644 --- a/tests/doc/org/aspectj/tools/ajc/CompilationResult.html +++ b/tests/doc/org/aspectj/tools/ajc/CompilationResult.html @@ -1,4 +1,4 @@ - + @@ -96,7 +96,7 @@

        Utility class that makes the results of a compiler run available.

        - Instances of this class are returned by the Ajc.compile() and + Instances of this class are returned by the Ajc.compile() and doIncrementalCompile() methods (and the AjcTestCase.ajc() wrapper).

        diff --git a/tests/doc/org/aspectj/tools/ajc/class-use/CompilationResult.html b/tests/doc/org/aspectj/tools/ajc/class-use/CompilationResult.html index 0918deeaa0..36b7148834 100644 --- a/tests/doc/org/aspectj/tools/ajc/class-use/CompilationResult.html +++ b/tests/doc/org/aspectj/tools/ajc/class-use/CompilationResult.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/tools/ajc/package-frame.html b/tests/doc/org/aspectj/tools/ajc/package-frame.html index 914388486f..7c45efa6a7 100644 --- a/tests/doc/org/aspectj/tools/ajc/package-frame.html +++ b/tests/doc/org/aspectj/tools/ajc/package-frame.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/tools/ajc/package-summary.html b/tests/doc/org/aspectj/tools/ajc/package-summary.html index 5d4f44f59d..1053c53276 100644 --- a/tests/doc/org/aspectj/tools/ajc/package-summary.html +++ b/tests/doc/org/aspectj/tools/ajc/package-summary.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/tools/ajc/package-tree.html b/tests/doc/org/aspectj/tools/ajc/package-tree.html index ee4f11996e..f7039bf33c 100644 --- a/tests/doc/org/aspectj/tools/ajc/package-tree.html +++ b/tests/doc/org/aspectj/tools/ajc/package-tree.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/org/aspectj/tools/ajc/package-use.html b/tests/doc/org/aspectj/tools/ajc/package-use.html index a8ee0acb9e..3609ad52af 100644 --- a/tests/doc/org/aspectj/tools/ajc/package-use.html +++ b/tests/doc/org/aspectj/tools/ajc/package-use.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/overview-frame.html b/tests/doc/overview-frame.html index 009b4a6fbd..b7321b779b 100644 --- a/tests/doc/overview-frame.html +++ b/tests/doc/overview-frame.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/overview-summary.html b/tests/doc/overview-summary.html index ef1d4666d6..8d4ea17ad7 100644 --- a/tests/doc/overview-summary.html +++ b/tests/doc/overview-summary.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/overview-tree.html b/tests/doc/overview-tree.html index b0a0d97c66..2a801bca9e 100644 --- a/tests/doc/overview-tree.html +++ b/tests/doc/overview-tree.html @@ -1,4 +1,4 @@ - + diff --git a/tests/doc/packages.html b/tests/doc/packages.html index fa167eac06..d88eafd587 100644 --- a/tests/doc/packages.html +++ b/tests/doc/packages.html @@ -1,4 +1,4 @@ - + diff --git a/tests/multiIncremental/pr290741/base/src/demo/Converter.java b/tests/multiIncremental/pr290741/base/src/demo/Converter.java index 3eb98695d4..229186784b 100755 --- a/tests/multiIncremental/pr290741/base/src/demo/Converter.java +++ b/tests/multiIncremental/pr290741/base/src/demo/Converter.java @@ -14,7 +14,7 @@ public class Converter { /** * You may get problems using String.getBytes("UTF-8") on a non UTF-8 * environment. Here is an alternative for it from - * http://mindprod.com/jgloss/encoding.html. + * https://mindprod.com/jgloss/encoding.html. * * @param text * @return diff --git a/tests/multiIncremental/pr290741/base/src/demo/ConverterTest.java b/tests/multiIncremental/pr290741/base/src/demo/ConverterTest.java index b7a4c00936..76f8c8cf8d 100755 --- a/tests/multiIncremental/pr290741/base/src/demo/ConverterTest.java +++ b/tests/multiIncremental/pr290741/base/src/demo/ConverterTest.java @@ -4,12 +4,12 @@ import java.io.UnsupportedEncodingException; public class ConverterTest { - + /** * For signature we need an UTF-8 environment - don't ask my why. - * + * * @since 29-Jun-06 - * @see http://mindprod.com/jgloss/encoding.html + * @see https://mindprod.com/jgloss/encoding.html */ /* String encoding = System.getProperty("file.encoding"); @@ -18,11 +18,11 @@ public class ConverterTest { System.out.println("System.out encoding = " + outEncoding); } */ - + public static void run() throws Exception { /** * Do we really get the right bytes here if the encoding is wrong? - * @throws UnsupportedEncodingException + * @throws UnsupportedEncodingException */ //String name = "B\u00f6hm"; // this works String name = "Böhm"; diff --git a/tests/profiling/build.properties b/tests/profiling/build.properties index 2718ca584a..7d855e5861 100644 --- a/tests/profiling/build.properties +++ b/tests/profiling/build.properties @@ -81,7 +81,7 @@ ltw.aop.xml=./ltw-app/META-INF/aop.xml # msa=y|n Solaris micro state accounting n # force=y|n force output to y # verbose=y|n print messages about dumps y -# see http://java.sun.com/developer/technicalArticles/Programming/HPROF.html +# see https://java.sun.com/developer/technicalArticles/Programming/HPROF.html hprof.args=-agentlib:hprof=heap=sites,cpu=samples # for full details on object allocation and reachability use heap=all instead # (v. large files) @@ -91,8 +91,6 @@ hprof.args=-agentlib:hprof=heap=sites,cpu=samples # args to pass to vm for gc run # after a run this file will be copied into results/${target.application.name}/gt..txt -# you can analyze it with JTune (http://www.hp.com/products1/unix/java/java2/hpjtune/index.html) +# you can analyze it with JTune (https://www.hp.com/products1/unix/java/java2/hpjtune/index.html) # Start JTune with java -jar HPTune.jar gc.args=-Xloggc:gc.txt - - diff --git a/tests/profiling/build.properties.shadows b/tests/profiling/build.properties.shadows index 614b0fd0df..3ad4d564db 100644 --- a/tests/profiling/build.properties.shadows +++ b/tests/profiling/build.properties.shadows @@ -81,7 +81,7 @@ ltw.aop.xml= # msa=y|n Solaris micro state accounting n # force=y|n force output to y # verbose=y|n print messages about dumps y -# see http://java.sun.com/developer/technicalArticles/Programming/HPROF.html +# see https://java.sun.com/developer/technicalArticles/Programming/HPROF.html hprof.args=-agentlib:hprof=heap=sites,cpu=samples,depth=3 #hprof.args=-agentlib:hprof=heap=dump,cpu=samples,depth=8 # for full details on object allocation and reachability use heap=all instead @@ -92,8 +92,6 @@ hprof.args=-agentlib:hprof=heap=sites,cpu=samples,depth=3 # args to pass to vm for gc run # after a run this file will be copied into results/${target.application.name}/gt..txt -# you can analyze it with JTune (http://www.hp.com/products1/unix/java/java2/hpjtune/index.html) +# you can analyze it with JTune (https://www.hp.com/products1/unix/java/java2/hpjtune/index.html) # Start JTune with java -jar HPTune.jar gc.args=-Xloggc:gc.txt - - diff --git a/tests/profiling/build.properties.tjp b/tests/profiling/build.properties.tjp index 2882eb8b3a..91e9525204 100644 --- a/tests/profiling/build.properties.tjp +++ b/tests/profiling/build.properties.tjp @@ -81,7 +81,7 @@ ltw.aop.xml= # msa=y|n Solaris micro state accounting n # force=y|n force output to y # verbose=y|n print messages about dumps y -# see http://java.sun.com/developer/technicalArticles/Programming/HPROF.html +# see https://java.sun.com/developer/technicalArticles/Programming/HPROF.html #hprof.args=-agentlib:hprof=heap=sites,cpu=samples,depth=8 hprof.args=-agentlib:hprof=heap=sites,cpu=samples,depth=8 # for full details on object allocation and reachability use heap=all instead @@ -92,8 +92,6 @@ hprof.args=-agentlib:hprof=heap=sites,cpu=samples,depth=8 # args to pass to vm for gc run # after a run this file will be copied into results/${target.application.name}/gt..txt -# you can analyze it with JTune (http://www.hp.com/products1/unix/java/java2/hpjtune/index.html) +# you can analyze it with JTune (https://www.hp.com/products1/unix/java/java2/hpjtune/index.html) # Start JTune with java -jar HPTune.jar gc.args=-Xloggc:gc.txt - - diff --git a/tests/readme-tests-module.html b/tests/readme-tests-module.html index bb47df1170..2e624c3a26 100644 --- a/tests/readme-tests-module.html +++ b/tests/readme-tests-module.html @@ -6,11 +6,11 @@

        AspectJ tests

        Testing and Tests

        Testing on the AspectJ project is fairly straightforward. For compiler issues/bugs, we write harness tests. -For API issues/bugs, we write JUnit tests. +For API issues/bugs, we write JUnit tests. We also have other testware for system testing.

        This module contains test data and scripts, while the testing-drivers -and testing modules contain the harness. +and testing modules contain the harness. Tests differ in the kind of harness they use and their target. (Many tests are unused and date back to earlier times in the project.) @@ -21,7 +21,7 @@

        Testing and Tests

        Driver Sources - + Harness tests compile and run test sources. @@ -36,13 +36,13 @@

        Testing and Tests

        pureJava/, etc. - + -Product tests use a variety of +Product tests use a variety of Ant and Bash scripts to drive the product distributions. - bash, - Ant + bash, + Ant product/.. @@ -50,8 +50,8 @@

        Testing and Tests

        AjcTest is a large taskdef which compiles and runs large Java systems. - AjcTest - Ant + AjcTest + Ant Task in testing module other-systems/.., aspectj-external-lib.jar?/other-systems/ @@ -60,24 +60,24 @@

        Testing and Tests

        Jacks is the Jikes compiler test suite, run for us using a bash script. bash - See the - + See the + Jacks project page JUnit tests normally are run directly - before checking in, + before checking in, but there is an Ant script to run and report on them all. JUnit - Every module has a testsrc/ directory with JUnit tests. + Every module has a testsrc/ directory with JUnit tests.

        Harness

        - +

        Harness tests

        These are compiler test cases, the preferred form for any compiler tests. The XML files are test definitions, @@ -88,24 +88,24 @@

        Harness tests

      • ajcTests.xml: main test suite. After a release, these tests should always run and pass.
      • -
      • ajcTests10.xml: +
      • ajcTests10.xml: Tests for the 1.0 compiler. In some cases, error tests differ between the 1.0 and 1.1 compiler only in the errors expected to be generated.
      • -
      • ajcTestsBroken.xml: - These tests fail, and the tests are broken. +
      • ajcTestsBroken.xml: + These tests fail, and the tests are broken. The tests should be fixed and rolled into ajcTests.xml
      • -
      • ajcTestsFailing.xml: +
      • ajcTestsFailing.xml: These tests fail, and the compiler is broken. When fixed, these tests should be rolled into ajcTests.xml.
      • -
      • ajcTestsAttic.xml: +
      • ajcTestsAttic.xml: These are broken or failing tests not slated to be fixed.
      • -
      • ajcHarnessTests.xml: +
      • ajcHarnessTests.xml: These are tests to exercise the test harness itself.
      @@ -115,10 +115,10 @@

      Harness tests

      To write a new test, evolve an existing example. See the dtd and/or -the javadoc for the testing harness implementation in the +the javadoc for the testing harness implementation in the testing module for more details. -

      To write a test case for a bug, see +

      To write a test case for a bug, see readme-writing-compiler-tests.html. Many bugs that first present in an IDE or the Ant taskdef @@ -130,7 +130,7 @@

      Running the harness

      To run the harness, use org.aspectj.testing.drivers.Harness, in the testing-drivers module. Since that is the main class -for the testing-drivers module, you can build and +for the testing-drivers module, you can build and run the harness as follows:

         cd build/
      @@ -138,24 +138,24 @@ 

      Running the harness

      cd ../tests java -jar ../aj-build/jars/testing-drivers-all.jar ajcTests.xml
      - + The harness enable you to
      • control output, hiding streams and logging messages
      • select tests using keywords, bug ID's, or titles
      • pass compiler arguments on the harness command line
      • use different compiler wrappers - the command-line compiler, - the AJDE IDE support (mostly sans GUI), or + the AJDE IDE support (mostly sans GUI), or the Ant taskdef support.
      • fork java run steps
      -For a listing of harness options, use -help. -For a fuller description of harness options and components, see +For a listing of harness options, use -help. +For a fuller description of harness options and components, see the package documentation for the harness. - +

      Product

      -Product tests target a built distribution or do compiler (argument) +Product tests target a built distribution or do compiler (argument) testing not supported by the harness. Many have been superceded by ant tests. To build aspectj with itself, see @@ -167,15 +167,15 @@

      AjcTest

      is an Ant script that compiles and runs large systems. The scripts tell the AjcTest task from the testing module to drive the sources in other-systems through compile/doc/run cycles. - To set up the tests, the script combines the aspects checked in to + To set up the tests, the script combines the aspects checked in to other-systems/ with the Java source files from various open-source - projects, contained in aspectj-external-lib.zip. + projects, contained in aspectj-external-lib.zip. - - + +

      Jacks

      -Jacks is the Jikes compiler test suite available at the - +Jacks is the Jikes compiler test suite available at the + Jacks project page. We have a bash script to run it using ajc and javac and compare diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java index 006867372a..6d75cfb4f7 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java @@ -62,7 +62,7 @@ public void testAmbigMessage18() throws Exception { runTest("ambiguous message - 18"); } - // http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.6 + // https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.6 public void testInnerClassesAttributeStructure_493554() throws Exception { runTest("pertarget"); diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc190/ModuleTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc190/ModuleTests.java index 419e37aad0..70adf5667d 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc190/ModuleTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc190/ModuleTests.java @@ -20,7 +20,7 @@ /** * Building and weaving with modules in the picture. * - * Module options from http://openjdk.java.net/jeps/261 + * Module options from https://openjdk.java.net/jeps/261 * * @author Andy Clement * diff --git a/tests/src/test/java/org/aspectj/systemtest/apt/AptTests.java b/tests/src/test/java/org/aspectj/systemtest/apt/AptTests.java index fcb9ad5969..24bc32dd1f 100644 --- a/tests/src/test/java/org/aspectj/systemtest/apt/AptTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/apt/AptTests.java @@ -30,7 +30,7 @@ public void testAptWithSpecifiedProcessor() { } /** - * SPI - http://docs.oracle.com/javase/tutorial/sound/SPI-intro.html + * SPI - https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html */ public void testAptUsingSPI() { if (LangUtil.is9VMOrGreater()) { diff --git a/tests/src/test/java/org/aspectj/testing/Harness.java b/tests/src/test/java/org/aspectj/testing/Harness.java index cfa587bbcf..dea50ffc41 100644 --- a/tests/src/test/java/org/aspectj/testing/Harness.java +++ b/tests/src/test/java/org/aspectj/testing/Harness.java @@ -1,12 +1,12 @@ ///* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // * // * This file is part of the compiler and core tools for the AspectJ(tm) -// * programming language; see http://aspectj.org +// * programming language; see https://aspectj.org // * // * The contents of this file are subject to the Mozilla Public License // * Version 1.1 (the "License"); you may not use this file except in // * compliance with the License. You may obtain a copy of the License at -// * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. +// * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. // * // * Software distributed under the License is distributed on an "AS IS" basis, // * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License diff --git a/util/src/main/java/org/aspectj/util/LangUtil.java b/util/src/main/java/org/aspectj/util/LangUtil.java index 43d100165c..2e7af3c397 100644 --- a/util/src/main/java/org/aspectj/util/LangUtil.java +++ b/util/src/main/java/org/aspectj/util/LangUtil.java @@ -55,8 +55,8 @@ public static double getVmVersion() { } static { - // http://www.oracle.com/technetwork/java/javase/versioning-naming-139433.html - // http://openjdk.java.net/jeps/223 "New Version-String Scheme" + // https://www.oracle.com/technetwork/java/javase/versioning-naming-139433.html + // https://openjdk.java.net/jeps/223 "New Version-String Scheme" // TODO: Use java.lang.Runtime class (since Java 9, now AspectJ needs Java 11+ due to JDT Core anyway) final String JAVA_VERSION_NOT_FOUND = "System properties appear damaged, cannot find: java.version/java.runtime.version/java.vm.version"; try { diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java index eddc5bd329..4a48895e6b 100644 --- a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java +++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java @@ -137,17 +137,17 @@ private static Definition saxParsing(URL url) throws SAXException, ParserConfigu xmlReader.setErrorHandler(parser); try { - xmlReader.setFeature("http://xml.org/sax/features/validation", false); + xmlReader.setFeature("https://xml.org/sax/features/validation", false); } catch (SAXException e) { // fine, the parser don't do validation } try { - xmlReader.setFeature("http://xml.org/sax/features/external-general-entities", false); + xmlReader.setFeature("https://xml.org/sax/features/external-general-entities", false); } catch (SAXException e) { // fine, the parser don't do validation } try { - xmlReader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + xmlReader.setFeature("https://xml.org/sax/features/external-parameter-entities", false); } catch (SAXException e) { // fine, the parser don't do validation } diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java index 3a8f58d8be..c62983c244 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java @@ -46,7 +46,7 @@ public void testNonURLClassLoaderScope() throws Exception { } public void testCreateURLClassLoaderScope() throws Exception { - URL testURLA = new URL("http://example.com"); + URL testURLA = new URL("https://example.com"); URL testURLB = new URL("file:///tmp"); URL testURLC = new URL("ftp://ftp.example.com"); URLTestCL A = new URLTestCL(testURLA); diff --git a/weaver/testinputdata/org/aspectj/weaver/test/Aspect.java b/weaver/testinputdata/org/aspectj/weaver/test/Aspect.java index cd44302837..04b4e193b9 100644 --- a/weaver/testinputdata/org/aspectj/weaver/test/Aspect.java +++ b/weaver/testinputdata/org/aspectj/weaver/test/Aspect.java @@ -1,10 +1,10 @@ /* This file is part of the compiler and core tools for the AspectJ(tm) - * programming language; see http://aspectj.org + * programming language; see https://aspectj.org * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at - * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. + * either https://www.mozilla.org/MPL/ or https://aspectj.org/MPL/. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License