all that jazz

james' blog about scala and all that jazz

The method of proposal

To save explaining a hundred times over how I proposed to Beth, I've decided to put it in a blog post, much easier that way. For those of you that aren't aware, I proposed to Beth, my girlfriend of 15 months, on Saturday, and she said yes.

So, about a month ago, my Mum phoned me while I was at Beth's place. I answered the phone and put it on speaker, and Mum told me she wanted to have a late family celebration for my birthday, saying that she and Dad would be in Sydney on the 6th of December. She said she had found a really nice restaurant just out of Lithgow, and that she had to book and pay several weeks in advance. She asked Beth and I if we were free, which we were, and so we put it in our diaries. Little did Beth know, but this was all a ploy so that she wouldn't suspect anything when I drove her up the Blue Mountains.

So, I picked Beth up at 10am from her place in Castle Hill, and we started driving towards Lithgow, taking Bells Line of Road. About 10 minutes past Bilpin, I got a really bad cramp in my leg. You know how annoying that is when you're driving? It was so bad, I had to pull over and stretch. We pulled over at a pretty ordinary place on the side of the road in the middle of nowhere.

After doing some stretches, I said to Beth "Hey, it looks like there's a nice view here, why don't you get out." So she did. As we were walking around, we noticed an unusual small pile of rocks. Being an immature guy, I decided to kick it over. She also decided to kick it, and then we noticed a very old looking piece of paper underneath. We picked it up, and it turned out to be a letter, dated 1851. The writing on it was very old fashioned, I'll scan it in sometime maybe and attach a picture of it to this post, but for now, here's the transcript. The letter was by someone who had "something", and was being pursued for it. This thing was too heavy, and he had to hide it. The letter contained instructions on how to find it.

We weren't sure how the letter got there, but thinking that there was a slight possibility that the letter had never reached its recipient, we decided to search for the treasure. We found the landscape exactly as the letter described, and soon we were at the entrance of a small overhang. There was a cross etched into the wall, and nearby we found a very old rusty shovel. So, I started digging, and before long, the shovel hit something hard. It was a treasure chest. I dug up the treasure chest, and opened it. Inside was a ring and two roses, lying in a bed of sand. As soon as I opened it, I picked up the ring, got down on one knee, and recited a poem that I wrote, which ended in "Will you marry me?". I won't attach the poem here, but if you really want to know what it said, ask me.

Beth burst into tears (this was my aim) and said yes. After that we headed back out of the valley, up to a high rock with a very nice view, where I had a picnic basket and esky with French champagne, cheese, Caesar salad, fruit and chocolate, and we had a picnic lunch.

As one last surprise for Beth, I took her out for dinner that night, telling her it was a dinner for two, but when we got there both sets of parents were there.

If you're interested in the logistics of the day, I'd been planning for about 6 months, though I didn't have a date 6 months ago, I knew that what I wanted to do would take a lot of work, so I started preparing it so that when I did decide to propose, I would already be half ready. I got up at 5:15am on the morning, drove up to the spot and planted the chest with 2 friends. I then went back to Sydney to pick up Beth while they waited up in the area. I phoned them when we were half an hour off and they went and planted the letter, and then waited for us to get there. 5 minutes off I pranked them, and they left.

Here's some more photos:


Close up of the treasure chest.


The ring.


The way down to the treasure chest was very steep and rough.


Where the chest was buried.

Many thanks to Mum, for setting up the decoy event and for writing out the letter, to Aaron and Denise, for helping me set everything up and waiting so patiently for me to pick Beth up, to Beth's parents, for arranging dinner that night and help keeping Beth completely unsuspecting of the event, to Leon Milch, for helping me design and making a beautiful engagement ring, and finally to Beth, for being the most amazing fiancée a guy could ever hope for.

List of SuppressWarnings arguments

I hate compiler warnings showing in my IDE. It's messy, and it usually indicates that something is bad. But not always. Sometimes, when working with third party libraries, you can't avoid warnings like unchecked assignments. These are easy to get around though, by using the @SuppressWarnings annotation. The unchecked assignment warning is a standard Java compiler warning. A quick Google will reveal that the name of the unchecked assignment warning to pass to @SuppressWarnings is "unchecked".

IDE's however tend to flag warnings for much more than what the Java compiler flags warnings for. An example that I encountered today is in unit tests, if you have no assertions in your unit test, IDEA will flag a warning telling you so. In my case however, I was using mockito, and my assertions were in the form of verify calls. IDEA does not yet understand mockito, so I am faced with compiler warnings in my code, which, as I said before, I hate. Surely I can use @SuppressWarnings to suppress this warning, but what's its name? Google didn't help me at all here, so I decided to do a little investigation.

After writing a quick shell script that unpacked IDEAs jar files and grepped for the description of the warning, I found that the code that generates these warnings is an IDEA plugin called InspectionGadgets. I found that each warning was checked for by sub classes of com.siyeh.ig.BaseInspection, and that the name of the warning, and its description, can be obtained by instantiating each sub class, and calling methods on them. In the case of my test method with no assertions warning, the class that flagged this was com.siyeh.ig.junit.TestMethodWithoutAssertionInspection, and the name of the warning was JUnitTestMethodWithNoAssertions. I can now suppress my warning.

All that work was probably too much to do for each time that I want to suppress an IDEA warning. So I decided to find every warning, and store it in a table. Obviously I wasn't going to do this manually, so using this neat utility for finding all the classes on the classpath, with a few modifications to limit where it searched, I was able to generate a table of every warning that IDEA can flag. Here it is, sorted in alphabetical order of the description:

Warning DescriptionWarning Name
"Magic character"MagicCharacter
"Magic number"MagicNumber
'Comparator.compare()' method does not use parameterComparatorMethodParameterNotUsed
'Connection.prepare*()' call with non-constant stringJDBCPrepareStatementWithNonConstantString
'Iterator.hasNext()' which calls 'next()'IteratorHasNextCallsIteratorNext
'Iterator.next()' which can't throw 'NoSuchElementException'IteratorNextCanNotThrowNoSuchElementException
'Statement.execute()' call with non-constant stringJDBCExecuteWithNonConstantString
'String.equals("")'StringEqualsEmptyString
'StringBuffer' may be 'StringBuilder' (JDK 5.0 only)StringBufferMayBeStringBuilder
'StringBuffer.toString()' in concatenationStringBufferToStringInConcatenation
'assert' statementAssertStatement
'assertEquals()' between objects of inconvertible typesAssertEqualsBetweenInconvertibleTypes
'await()' not in loopAwaitNotInLoop
'await()' without corresponding 'signal()'AwaitWithoutCorrespondingSignal
'break' statementBreakStatement
'break' statement with labelBreakStatementWithLabel
'catch' generic classCatchGenericClass
'clone()' does not call 'super.clone()'CloneDoesntCallSuperClone
'clone()' does not declare 'CloneNotSupportedException'CloneDoesntDeclareCloneNotSupportedException
'clone()' instantiates objects with constructorCloneCallsConstructors
'clone()' method in non-Cloneable classCloneInNonCloneableClass
'compareto()' instead of 'compareTo()'MisspelledCompareTo
'continue' or 'break' inside 'finally' blockContinueOrBreakFromFinallyBlock
'continue' statementContinueStatement
'continue' statement with labelContinueStatementWithLabel
'default' not last case in 'switch'DefaultNotLastCaseInSwitch
'equal()' instead of 'equals()'MisspelledEquals
'equals()' between objects of inconvertible typesEqualsBetweenInconvertibleTypes
'equals()' called on array typeArrayEquals
'equals()' called on java.math.BigDecimalBigDecimalEquals
'equals()' method which does not check class of parameterEqualsWhichDoesntCheckParameterClass
'equals()' or 'hashCode()' called on java.net.URL objectEqualsHashCodeCalledOnUrl
'final' classFinalClass
'final' methodFinalMethod
'final' method in 'final' classFinalMethodInFinalClass
'finalize()' called explicitlyFinalizeCalledExplicitly
'finalize()' declarationFinalizeDeclaration
'finalize()' does not call 'super.finalize()'FinalizeDoesntCallSuperFinalize
'finalize()' not declared 'protected'FinalizeNotProtected
'finally' block which can not complete normallyfinally
'for' loop may be replaced by 'while' loopForLoopReplaceableByWhile
'for' loop replaceable by 'for each'ForLoopReplaceableByForEach
'for' loop where update or condition does not use loop variableForLoopThatDoesntUseLoopVariable
'for' loop with missing componentsForLoopWithMissingComponent
'hashcode()' instead of 'hashCode()'MisspelledHashcode
'if' statement with identical branchesIfStatementWithIdenticalBranches
'if' statement with negated conditionIfStatementWithNegatedCondition
'if' statement with too many branchesIfStatementWithTooManyBranches
'indexOf()' expression is replaceable by 'contains()'ListIndexOfReplaceableByContains
'instanceof' a concrete classInstanceofInterfaces
'instanceof' check for 'this'InstanceofThis
'instanceof' on 'catch' parameterInstanceofCatchParameter
'instanceof' with incompatible interfaceInstanceofIncompatibleInterface
'notify()' or 'notifyAll()' called on java.util.concurrent.locks.Condition objectNotifyCalledOnCondition
'notify()' or 'notifyAll()' while not syncedNotifyNotInSynchronizedContext
'notify()' or 'notifyAll()' without corresponding state changeNakedNotify
'notify()' without corresponding 'wait()'NotifyWithoutCorrespondingWait
'private' method declared 'final'FinalPrivateMethod
'protected' member in 'final' classProtectedMemberInFinalClass
'public' constructor in non-public classPublicConstructorInNonPublicClass
'readObject()' or 'writeObject()' not declared 'private'NonPrivateSerializationMethod
'readResolve()' or 'writeReplace()' not declared 'protected'ReadResolveAndWriteReplaceProtected
'return' inside 'finally' blockReturnInsideFinallyBlock
'serialPersistentFields' field not declared 'private static final ObjectStreamField[]'SerialPersistentFieldsWithWrongSignature
'serialVersionUID' field not declared 'private static final long'SerialVersionUIDWithWrongSignature
'setUp()' does not call 'super.setUp()'SetUpDoesntCallSuperSetUp
'setUp()' with incorrect signatureSetUpWithIncorrectSignature
'setup()' instead of 'setUp()'MisspelledSetUp
'signal()' without corresponding 'await()'SignalWithoutCorrespondingAwait
'size() == 0' replaceable by 'isEmpty()'SizeReplaceableByIsEmpty
'static' method declared 'final'FinalStaticMethod
'static', non-'final' fieldStaticNonFinalField
'suite()' method not declared 'static'SuiteNotDeclaredStatic
'switch' statementSwitchStatement
'switch' statement with too few branchesSwitchStatementWithTooFewBranches
'switch' statement with too low of a branch densitySwitchStatementDensity
'switch' statement with too many branchesSwitchStatementWithTooManyBranches
'switch' statement without 'default' branchSwitchStatementWithoutDefaultBranch
'synchronized' methodSynchronizedMethod
'tearDown()' does not call 'super.tearDown()'TearDownDoesntCallSuperTearDown
'tearDown()' with incorrect signatureTearDownWithIncorrectSignature
'teardown()' instead of 'tearDown()'MisspelledTearDown
'this' reference escaped in object constructionThisEscapedInObjectConstruction
'throw' caught by containing 'try' statementThrowCaughtLocally
'throw' inside 'catch' block which ignores the caught exceptionThrowInsideCatchBlockWhichIgnoresCaughtException
'throw' inside 'finally' blockThrowFromFinallyBlock
'tostring()' instead of 'toString()'MisspelledToString
'wait()' called on java.util.concurrent.locks.Condition objectWaitCalledOnCondition
'wait()' not in loopWaitNotInLoop
'wait()' or 'await()' without timeoutWaitOrAwaitWithoutTimeout
'wait()' while holding two locksWaitWhileHoldingTwoLocks
'wait()' while not syncedWaitWhileNotSynced
'wait()' without corresponding 'notify()'WaitWithoutCorrespondingNotify
'while' loop replaceable by 'for each'WhileLoopReplaceableByForEach
* importOnDemandImport
Abstract class extends concrete classAbstractClassExtendsConcreteClass
Abstract class which has no concrete subclassAbstractClassNeverImplemented
Abstract class which has only one direct inheritorAbstractClassWithOnlyOneDirectInheritor
Abstract class without abstract methodsAbstractClassWithoutAbstractMethods
Abstract method call in constructorAbstractMethodCallInConstructor
Abstract method overrides abstract methodAbstractMethodOverridesAbstractMethod
Abstract method overrides concrete methodAbstractMethodOverridesConcreteMethod
Abstract method with missing implementationsAbstractMethodWithMissingImplementations
Access of system propertiesAccessOfSystemProperties
Access to non thread-safe static field from instanceAccessToNonThreadSafeStaticFieldFromInstance
Access to static field locked on instance dataAccessToStaticFieldLockedOnInstance
Accessing a non-public field of another objectAccessingNonPublicFieldOfAnotherObject
AnnotationAnnotation
Annotation classAnnotationClass
Annotation naming conventionAnnotationNamingConvention
Anonymous class variable hides variable in containing methodAnonymousClassVariableHidesContainingMethodVariable
Anonymous inner classAnonymousInnerClass
Anonymous inner class may be a named static inner classAnonymousInnerClassMayBeStatic
Anonymous inner class with too many methodsAnonymousInnerClassWithTooManyMethods
Arithmetic operation on volatile fieldArithmeticOnVolatileField
Array.length in loop conditionArrayLengthInLoopCondition
Assignment replaceable with operator assignmentAssignmentReplaceableWithOperatorAssignment
Assignment to 'for' loop parameterAssignmentToForLoopParameter
Assignment to 'null'AssignmentToNull
Assignment to Collection or array field from parameterAssignmentToCollectionOrArrayFieldFromParameter
Assignment to Date or Calendar field from parameterAssignmentToDateFieldFromParameter
Assignment to catch block parameterAssignmentToCatchBlockParameter
Assignment to method parameterAssignmentToMethodParameter
Assignment to static field from instance methodAssignmentToStaticFieldFromInstanceMethod
Assignment used as conditionAssignmentUsedAsCondition
Auto-boxingAutoBoxing
Auto-unboxingAutoUnboxing
Boolean constructor callBooleanConstructorCall
Boolean method name must start with question wordBooleanMethodNameMustStartWithQuestion
Busy waitBusyWait
C-style array declarationCStyleArrayDeclaration
Call to 'Collection.toArray()' with zero-length array argumentToArrayCallWithZeroLengthArrayArgument
Call to 'Date.toString()'CallToDateToString
Call to 'Runtime.exec()'CallToRuntimeExecWithNonConstantString
Call to 'String.compareTo()'CallToStringCompareTo
Call to 'String.concat()' can be replaced by '+'CallToStringConcatCanBeReplacedByOperator
Call to 'String.equals()'CallToStringEquals
Call to 'String.equalsIgnoreCase()'CallToStringEqualsIgnoreCase
Call to 'String.toUpperCase()' or 'toLowerCase()' without a LocaleStringToUpperCaseOrToLowerCaseWithoutLocale
Call to 'System.exit()' or related methodsCallToSystemExit
Call to 'System.getenv()'CallToSystemGetenv
Call to 'System.loadLibrary()' with non-constant stringLoadLibraryWithNonConstantString
Call to 'System.runFinalizersOnExit()'CallToSystemRunFinalizersOnExit
Call to 'System.setSecurityManager()'CallToSystemSetSecurityManager
Call to 'Thread.dumpStack()'CallToThreadDumpStack
Call to 'Thread.run()'CallToThreadRun
Call to 'Thread.setPriority()'CallToThreadSetPriority
Call to 'Thread.sleep()' while synchronizedSleepWhileHoldingLock
Call to 'Thread.start()' during object constructionCallToThreadStartDuringObjectConstruction
Call to 'Thread.stop()', 'suspend()' or 'resume()'CallToThreadStopSuspendOrResumeManager
Call to 'Thread.yield()'CallToThreadYield
Call to 'Time.toString()'CallToTimeToString
Call to 'intern()' on String constantConstantStringIntern
Call to 'notify()' instead of 'notifyAll()'CallToNotifyInsteadOfNotifyAll
Call to 'printStackTrace()'CallToPrintStackTrace
Call to 'signal()' instead of 'signalAll()'CallToSignalInsteadOfSignalAll
Call to Numeric 'toString()'CallToNumericToString
Call to String.replaceAll(".", ...)ReplaceAllDot
Call to a native method while lockedCallToNativeMethodWhileLocked
Call to default 'toString()'ObjectToString
Call to simple getter from within classCallToSimpleGetterFromWithinClass
Call to simple setter from within classCallToSimpleSetterFromWithinClass
Calls to 'System.gc()' or 'Runtime.gc()'CallToSystemGC
Cast conflicts with 'instanceof'CastConflictsWithInstanceof
Cast to a concrete classCastToConcreteClass
Casting to incompatible interfaceCastToIncompatibleInterface
Caught exception is immediately rethrownCaughtExceptionImmediatelyRethrown
Chain of 'instanceof' checksChainOfInstanceofChecks
Chained equality comparisonsChainedEqualityComparisons
Chained method callsChainedMethodCall
Channel opened but not safely closedChannelOpenedButNotSafelyClosed
Character comparisonCharacterComparison
Checked exception classCheckedExceptionClass
Class escapes defined scopeClassEscapesDefinedScope
Class explicitly extends a Collection classClassExtendsConcreteCollection
Class explicitly extends java.lang.ObjectClassExplicitlyExtendsObject
Class explicitly extends java.lang.ThreadClassExplicitlyExtendsThread
Class extends annotation interfaceClassExplicitlyAnnotation
Class extends utility classExtendsUtilityClass
Class may be interfaceClassMayBeInterface
Class name differs from file nameClassNameDiffersFromFileName
Class name prefixed with package nameClassNamePrefixedWithPackageName
Class name same as ancestor nameClassNameSameAsAncestorName
Class naming conventionClassNamingConvention
Class references one of its subclassesClassReferencesSubclass
Class too deep in inheritance treeClassTooDeepInInheritanceTree
Class with multiple loggersClassWithMultipleLoggers
Class with too many constructorsClassWithTooManyConstructors
Class with too many fieldsClassWithTooManyFields
Class with too many methodsClassWithTooManyMethods
Class without 'toString()'ClassWithoutToString
Class without constructorClassWithoutConstructor
Class without loggerClassWithoutLogger
Class without no-arg constructorClassWithoutNoArgConstructor
Class without package statementClassWithoutPackageStatement
ClassLoader instantiationClassLoaderInstantiation
Cloneable class in secure contextCloneableClassInSecureContext
Cloneable class without 'clone()'CloneableClassWithoutClone
Collection added to selfCollectionAddedToSelf
Collection declared by class, not interfaceCollectionDeclaredAsConcreteClass
Collection without initial capacityCollectionWithoutInitialCapacity
Comparable implemented but 'equals()' not overriddenComparableImplementedButEqualsNotOverridden
Comparator class not declared SerializableComparatorNotSerializable
Comparison of 'short' and 'char' valuesComparisonOfShortAndChar
Comparison to Double.NaN or Float.NaNComparisonToNaN
Concatenation with empty stringConcatenationWithEmptyString
Conditional expression (?:)ConditionalExpression
Conditional expression with identical branchesConditionalExpressionWithIdenticalBranches
Conditional expression with negated conditionConditionalExpressionWithNegatedCondition
Conditional that can be simplified to && or ||SimplifiableConditionalExpression
Confusing 'else' branchConfusingElseBranch
Confusing 'main()' methodConfusingMainMethod
Confusing 'null' argument to var-arg methodNullArgumentToVariableArgMethod
Confusing floating-point literalConfusingFloatingPointLiteral
Confusing octal escape sequenceConfusingOctalEscapeSequence
Confusing primitive array argument to var-arg methodPrimitiveArrayArgumentToVariableArgMethod
Connection opened but not safely closedConnectionOpenedButNotSafelyClosed
Constant StringBuffer may be StringStringBufferReplaceableByString
Constant call to java.lang.Math or StrictMathConstantMathCall
Constant conditional expressionConstantConditionalExpression
Constant declared in abstract classConstantDeclaredInAbstractClass
Constant declared in interfaceConstantDeclaredInInterface
Constant if statementConstantIfStatement
Constant naming conventionConstantNamingConvention
Constant on left side of comparisonConstantOnLeftSideOfComparison
Constant on right side of comparisonConstantOnRightSideOfComparison
Constructor not 'protected' in 'abstract' classConstructorNotProtectedInAbstractClass
Constructor with too many parametersConstructorWithTooManyParameters
Control flow statement without bracesControlFlowStatementWithoutBraces
Covariant 'compareTo()'CovariantCompareTo
Covariant 'equals()'CovariantEquals
Custom ClassLoaderCustomClassloader
Custom SecurityManagerCustomSecurityManager
Deserializable class in secure contextDeserializableClassInSecureContext
Design for extensionDesignForExtension
Division by zerodivzero
Double negationDoubleNegation
Double-checked lockingDoubleCheckedLocking
Duplicate condition in 'if' statementDuplicateCondition
Duplicate condition on '&&' or '||'DuplicateBooleanBranch
Empty 'catch' blockEmptyCatchBlock
Empty 'finally' blockEmptyFinallyBlock
Empty 'synchronized' statementEmptySynchronizedStatement
Empty 'try' blockEmptyTryBlock
Empty classEmptyClass
Empty class initializerEmptyClassInitializer
Enum 'switch' statement that misses caseEnumSwitchStatementWhichMissesCases
Enumerated classEnumClass
Enumerated class naming conventionEnumeratedClassNamingConvention
Enumerated constant naming conventionEnumeratedConstantNamingConvention
Enumeration can be iterationEnumerationCanBeIteration
Exception class name does not end with 'Exception'ExceptionClassNameDoesntEndWithException
Extended 'for' statementForeachStatement
Externalizable class with 'readObject()' or 'writeObject()'ExternalizableClassWithSerializationMethods
Fallthrough in 'switch' statementfallthrough
Feature envyFeatureEnvy
Field accessed in both synchronized and unsynchronized contextsFieldAccessedSynchronizedAndUnsynchronized
Field has setter but no getterFieldHasSetterButNoGetter
Field may be 'static'FieldMayBeStatic
Field name hides field in superclassFieldNameHidesFieldInSuperclass
Field repeatedly accessed in methodFieldRepeatedlyAccessedInMethod
Floating point equality comparisonFloatingPointEquality
Hardcoded file separatorHardcodedFileSeparator
Hardcoded line separatorHardcodedLineSeparator
Hibernate resource opened but not safely closedHibernateResourceOpenedButNotSafelyClosed
I/O resource opened but not safely closedIOResourceOpenedButNotSafelyClosed
If statement may be replaced by && or || expressionSimplifiableIfStatement
Implicit call to 'super()'ImplicitCallToSuper
Implicit call to array '.toString()'ImplicitArrayToString
Implicit numeric conversionImplicitNumericConversion
Import from same packageSamePackageImport
Incompatible bitwise mask operationIncompatibleBitwiseMaskOperation
Infinite loop statementInfiniteLoopStatement
Infinite recursionInfiniteRecursion
Inner class field hides outer class fieldInnerClassFieldHidesOuterClassField
Inner class may be 'static'InnerClassMayBeStatic
Inner class of interfaceInnerClassOfInterface
Inner class too deeply nestedInnerClassTooDeeplyNested
Insecure random number generationUnsecureRandomNumberGeneration
Inspection suppression annotationSuppressionAnnotation
Instance method naming conventionInstanceMethodNamingConvention
Instance variable may not be initializedInstanceVariableMayNotBeInitialized
Instance variable may not be initialized by 'readObject()'InstanceVariableMayNotBeInitializedByReadObject
Instance variable naming conventionInstanceVariableNamingConvention
Instance variable of concrete classInstanceVariableOfConcreteClass
Instance variable used before initializedInstanceVariableUsedBeforeInitialized
Instantiating a SimpleDateFormat without a LocaleSimpleDateFormatWithoutLocale
Instantiating a Thread with default 'run()' methodInstantiatingAThreadWithDefaultRunMethod
Instantiating object to get Class objectInstantiatingObjectToGetClassObject
Instantiation of utility classInstantiationOfUtilityClass
Integer division in floating point contextIntegerDivisionInFloatingPointContext
Integer multiplication or shift implicitly cast to longIntegerMultiplicationImplicitCastToLong
Interface naming conventionInterfaceNamingConvention
Interface which has no concrete subclassInterfaceNeverImplemented
Interface which has only one direct inheritorInterfaceWithOnlyOneDirectInheritor
JDBC resource opened but not safely closedJDBCResourceOpenedButNotSafelyClosed
JNDI resource opened but not safely closedJNDIResourceOpenedButNotSafelyClosed
JUnit TestCase in product sourceJUnitTestCaseInProductSource
JUnit TestCase with non-trivial constructorsJUnitTestCaseWithNonTrivialConstructors
JUnit abstract test class naming conventionJUnitAbstractTestClassNamingConvention
JUnit test case with no testsJUnitTestCaseWithNoTests
JUnit test class naming conventionJUnitTestClassNamingConvention
JUnit test method in product sourceJUnitTestMethodInProductSource
JUnit test method without any assertionsJUnitTestMethodWithNoAssertions
Labeled statementLabeledStatement
Large array allocation with no OutOfMemoryError checkCheckForOutOfMemoryOnLargeArrayAllocation
Limited-scope inner classLimitedScopeInnerClass
Local variable hides member variableLocalVariableHidesMemberVariable
Local variable naming conventionLocalVariableNamingConvention
Local variable of concrete classLocalVariableOfConcreteClass
Local variable used and declared in different 'switch' branchesLocalVariableUsedAndDeclaredInDifferentSwitchBranches
Lock acquired but not safely unlockedLockAcquiredButNotSafelyReleased
Long literal ending with 'l' instead of 'L'LongLiteralEndingWithLowercaseL
Loop statement that does not loopLoopStatementThatDoesntLoop
Loop variable not updated inside loopLoopConditionNotUpdatedInsideLoop
Loop with implicit termination conditionLoopWithImplicitTerminationCondition
Malformed @Before or @After methodBeforeOrAfterWithIncorrectSignature
Malformed @BeforeClass or @AfterClass methodBeforeOrAfterWithIncorrectSignature
Malformed XPath expressionMalformedXPath
Malformed format stringMalformedFormatString
Malformed regular expressionMalformedRegex
Manual array copyManualArrayCopy
Manual array to collection copyManualArrayToCollectionCopy
Map or Set may contain java.net.URL objectsCollectionContainsUrl
Map replaceable by EnumMapMapReplaceableByEnumMap
Marker interfaceMarkerInterface
Message missing on JUnit assertionMessageMissingOnJUnitAssertion
Method call in loop conditionMethodCallInLoopCondition
Method call violates Law of DemeterLawOfDemeter
Method is identical to its super methodRedundantMethodOverride
Method may be 'static'MethodMayBeStatic
Method name same as class nameMethodNameSameAsClassName
Method name same as parent class nameMethodNameSameAsParentName
Method names differing only by caseMethodNamesDifferingOnlyByCase
Method overloads method of superclassMethodOverloadsMethodOfSuperclass
Method overrides package local method of superclass located in other packageMethodOverridesPrivateMethodOfSuperclass
Method overrides private method of superclassMethodOverridesPrivateMethodOfSuperclass
Method overrides static method of superclassMethodOverridesStaticMethodOfSuperclass
Method parameter naming conventionMethodParameterNamingConvention
Method parameter of concrete classMethodParameterOfConcreteClass
Method return of concrete classMethodReturnOfConcreteClass
Method with more than three negationsMethodWithMoreThanThreeNegations
Method with multiple loopsMethodWithMultipleLoops
Method with multiple return points.MethodWithMultipleReturnPoints
Method with synchronized block could be synchronized methodMethodMayBeSynchronized
Method with too many exceptions declaredMethodWithTooExceptionsDeclared
Method with too many parametersMethodWithTooManyParameters
Mismatched query and update of collectionMismatchedQueryAndUpdateOfCollection
Mismatched read and write of arrayMismatchedReadAndWriteOfArray
Misordered 'assertEquals()' parametersMisorderedAssertEqualsParameters
Missing @Deprecated annotationMissingDeprecatedAnnotation
Missing @Override annotationoverride
Missorted modifersMissortedModifiers
Multiple top level classes in single fileMultipleTopLevelClassesInFile
Multiple variables in one declarationMultipleVariablesInDeclaration
Multiply or divide by power of twoMultiplyOrDivideByPowerOfTwo
Native methodNativeMethod
Nested 'switch' statementNestedSwitchStatement
Nested 'synchronized' statementNestedSynchronizedStatement
Nested 'try' statementNestedTryStatement
Nested assignmentNestedAssignment
Nested conditional expressionNestedConditionalExpression
Nested method callNestedMethodCall
No-op method in abstract classNoopMethodInAbstractClass
Non-boolean method name must not start with question wordNonBooleanMethodNameMayNotStartWithQuestion
Non-constant String should be StringBufferNonConstantStringShouldBeStringBuffer
Non-constant field with upper-case nameNonConstantFieldWithUpperCaseName
Non-constant loggerNonConstantLogger
Non-exception class name ends with 'Exception'NonExceptionNameEndsWithException
Non-final 'clone()' in secure contextNonFinalClone
Non-final field of exception classNonFinalFieldOfException
Non-final field referenced in 'compareTo()'CompareToUsesNonFinalVariable
Non-final field referenced in 'equals()'NonFinalFieldReferenceInEquals
Non-final field referenced in 'hashCode()'NonFinalFieldReferencedInHashCode
Non-final static variable is used during class initializationNonFinalStaticVariableUsedInClassInitialization
Non-private field accessed in synchronized contextNonPrivateFieldAccessedInSynchronizedContext
Non-reproducible call to java.lang.MathNonReproducibleMathCall
Non-serializable class with 'readObject()' or 'writeObject()'NonSerializableClassWithSerializationMethods
Non-serializable class with 'serialVersionUID'NonSerializableClassWithSerialVersionUID
Non-serializable field in a Serializable classNonSerializableFieldInSerializableClass
Non-serializable object bound to HttpSessionNonSerializableObjectBoundToHttpSession
Non-serializable object passed to ObjectOutputStreamNonSerializableObjectPassedToObjectStream
Non-short-circuit boolean expressionNonShortCircuitBooleanExpression
Non-static initializerNonStaticInitializer
Non-static inner class in secure contextNonStaticInnerClassInSecureContext
Non-synchronized method overrides synchronized methodNonSynchronizedMethodOverridesSynchronizedMethod
Number comparison using '==', instead of 'equals()'NumberEquality
Number constructor call with primitive argumentCachedNumberConstructorCall
Numeric cast that loses precisionNumericCastThatLosesPrecision
Object allocation in loopObjectAllocationInLoop
Object comparison using ==, instead of 'equals()'ObjectEquality
Object.equals(null)ObjectEqualsNull
Octal and decimal integers in same arrayOctalAndDecimalIntegersInSameArray
Octal integerOctalInteger
Overloaded methods with same number of parametersOverloadedMethodsWithSameNumberOfParameters
Overloaded variable argument methodOverloadedVarargsMethod
Overly broad 'catch' blockOverlyBroadCatchBlock
Overly complex anonymous inner classOverlyComplexAnonymousInnerClass
Overly complex arithmetic expressionOverlyComplexArithmeticExpression
Overly complex boolean expressionOverlyComplexBooleanExpression
Overly complex classOverlyComplexClass
Overly complex methodOverlyComplexMethod
Overly coupled classOverlyCoupledClass
Overly coupled methodOverlyCoupledMethod
Overly large initializer for array of primitive typeOverlyLargePrimitiveArrayInitializer
Overly long methodOverlyLongMethod
Overly nested methodOverlyNestedMethod
Overly-strong type castOverlyStrongTypeCast
Overridable method call during object constructionOverridableMethodCallDuringObjectConstruction
Overridden method call during object constructionOverriddenMethodCallDuringObjectConstruction
Package-visible fieldPackageVisibleField
Package-visible inner classPackageVisibleInnerClass
Parameter hides member variableParameterHidesMemberVariable
Parameter name differs from parameter in overridden methodParameterNameDiffersFromOverriddenParameter
Pointless 'indexOf()' comparisonPointlessIndexOfComparison
Pointless arithmetic expressionPointlessArithmeticExpression
Pointless bitwise expressionPointlessBitwiseExpression
Pointless boolean expressionPointlessBooleanExpression
Private member access between outer and inner classesPrivateMemberAccessBetweenOuterAndInnerClass
Private method only used from inner classMethodOnlyUsedFromInnerClass
Prohibited exception caughtProhibitedExceptionCaught
Prohibited exception declaredProhibitedExceptionDeclared
Prohibited exception thrownProhibitedExceptionThrown
Protected fieldProtectedField
Protected inner classProtectedInnerClass
Public fieldPublicField
Public inner classPublicInnerClass
Public method not exposed in interfacePublicMethodNotExposedInInterface
Public method without loggingPublicMethodWithoutLogging
Public static array fieldPublicStaticArrayField
Public static collection fieldPublicStaticCollectionField
Questionable nameQuestionableName
Raw use of parameterized classRawUseOfParameterizedType
RecordStore opened but not safely closedRecordStoreOpenedButNotSafelyClosed
Redundant '.substring(0)'SubstringZero
Redundant 'String.toString()'RedundantStringToString
Redundant 'if' statementRedundantIfStatement
Redundant String constructor callRedundantStringConstructorCall
Redundant conditional expressionRedundantConditionalExpression
Redundant field initializationRedundantFieldInitialization
Redundant importRedundantImport
Redundant interface declarationRedundantInterfaceDeclaration
Redundant local variableUnnecessaryLocalVariable
Redundant no-arg constructorRedundantNoArgConstructor
Reflective access to a source-only annotationReflectionForUnavailableAnnotation
Refused bequestRefusedBequest
Result of method call ignoredResultOfMethodCallIgnored
Result of object allocation ignoredResultOfObjectAllocationIgnored
Return of 'null'ReturnOfNull
Return of 'this'ReturnOfThis
Return of Collection or array fieldReturnOfCollectionOrArrayField
Return of Date or Calendar fieldReturnOfDateField
Reuse of local variableReuseOfLocalVariable
Scope of variable is too broadTooBroadScope
Serializable class in secure contextSerializableClassInSecureContext
Serializable class with unconstructable ancestorSerializableClassWithUnconstructableAncestor
Serializable class without 'readObject()' and 'writeObject()'SerializableHasSerializationMethods
Serializable class without 'serialVersionUID'serial
Serializable non-static inner class with non-Serializable outer classSerializableInnerClassWithNonSerializableOuterClass
Serializable non-static inner class without 'serialVersionUID'SerializableNonStaticInnerClassWithoutSerialVersionUID
Set replaceable by EnumSetSetReplaceableByEnumSet
Shift operation by inappropriate constantShiftOutOfRange
Simplifiable JUnit assertionSimplifiableJUnitAssertion
Single character 'startsWith()' or 'endsWith()'SingleCharacterStartsWith
Single character string concatenationSingleCharacterStringConcatenation
Single character string parameter in 'String.indexOf()' callSingleCharacterStringConcatenation
Single class importSingleClassImport
SingletonSingleton
Socket opened but not safely closedSocketOpenedButNotSafelyClosed
Standard variable namesStandardVariableNames
Statement with empty bodyStatementWithEmptyBody
Static collectionStaticCollection
Static field referenced via subclassStaticFieldReferencedViaSubclass
Static importStaticImport
Static inheritanceStaticInheritance
Static method naming conventionStaticMethodNamingConvention
Static method only used from one other classStaticMethodOnlyUsedInOneClass
Static method referenced via subclassStaticMethodReferencedViaSubclass
Static variable may not be initializedStaticVariableMayNotBeInitialized
Static variable naming conventionStaticVariableNamingConvention
Static variable of concrete classStaticVariableOfConcreteClass
Static variable used before initializationStaticVariableUsedBeforeInitialization
String comparison using '==', instead of 'equals()'StringEquality
String concatenationStringConcatenation
String concatenation in loopStringContatenationInLoop
String concatenation inside 'StringBuffer.append()'StringConcatenationInsideStringBufferAppend
StringBuffer constructor call with 'char' argumentNewStringBufferWithCharArgument
StringBuffer fieldStringBufferField
StringBuffer or StringBuilder without initial capacityStringBufferWithoutInitialCapacity
Subtraction in compareTo()SubtractionInCompareTo
Suspicious 'Collections.toArray()' callSuspiciousToArrayCall
Suspicious 'System.arraycopy()' callSuspiciousSystemArraycopy
Suspicious indentation after control statement without bracesSuspiciousIndentAfterControlStatement
Suspicious test for oddnessBadOddness
Synchronization on 'this'SynchronizeOnThis
Synchronization on a Lock objectSynchroniziationOnLockObject
Synchronization on a non-final fieldSynchronizeOnNonFinalField
Synchronization on an object initialized with a literalSynchronizedOnLiteralObject
TODO commentTodoComment
Tail recursionTailRecursion
Test method with incorrect signatureTestMethodWithIncorrectSignature
Text label in 'switch' statementTextLabelInSwitchStatement
Throwable instance not thrownThrowableInstanceNeverThrown
Transient field in non-serializable classTransientFieldInNonSerializableClass
Transient field is not initialized on deserializationTransientFieldNotInitialized
Type may be weakenedTypeMayBeWeakened
Type parameter explicitly extends 'java.lang.Object'TypeParameterExplicitlyExtendsObject
Type parameter extends final classTypeParameterExtendsFinalClass
Type parameter hides visible typeTypeParameterHidesVisibleType
Type parameter naming conventionTypeParameterNamingConvention
Unary plusUnaryPlus
Unchecked exception classUncheckedExceptionClass
Unconditional 'wait()' callUnconditionalWait
Unconstructable JUnit TestCaseUnconstructableJUnitTestCase
Unnecessarily qualified static usageUnnecessarilyQualifiedStaticUsage
Unnecessary 'continue' statementUnnecessaryContinue
Unnecessary 'default' for enum switch statementUnnecessaryDefault
Unnecessary 'final' for local variableUnnecessaryFinalOnLocalVariable
Unnecessary 'final' for method parameterUnnecessaryFinalForMethodParameter
Unnecessary 'return' statementUnnecessaryReturnStatement
Unnecessary 'this' qualifierUnnecessaryThis
Unnecessary boxingUnnecessaryBoxing
Unnecessary call to 'super()'UnnecessaryCallToSuper
Unnecessary code blockUnnecessaryCodeBlock
Unnecessary enum modifierUnnecessaryEnumModifier
Unnecessary fully qualified nameUnnecessaryFullyQualifiedName
Unnecessary interface modifierUnnecessaryInterfaceModifier
Unnecessary label on 'break' statementUnnecessaryLabelOnBreakStatement
Unnecessary label on 'continue' statementUnnecessaryLabelOnContinueStatement
Unnecessary parenthesesUnnecessaryParentheses
Unnecessary qualifier for 'this'UnnecessaryQualifierForThis
Unnecessary semicolonUnnecessarySemicolon
Unnecessary temporary object in conversion from StringUnnecessaryTemporaryOnConversionFromString
Unnecessary temporary object in conversion to StringUnnecessaryTemporaryOnConversionToString
Unnecessary unary minusUnnecessaryUnaryMinus
Unnecessary unboxingUnnecessaryUnboxing
Unpredictable BigDecimal constructor callUnpredictableBigDecimalConstructorCall
Unqualified instance field accessUnqualifiedFieldAccess
Unqualified static usageUnqualifiedStaticUsage
Unsafe lazy initialization of static fieldNonThreadSafeLazyInitialization
Unused 'catch' parameterUnusedCatchParameter
Unused importUnusedImport
Unused labelUnusedLabel
Use of '$' in identifierDollarSignInName
Use of 'assert' as identifierAssertAsIdentifier
Use of 'enum' as identifierEnumAsIdentifier
Use of AWT peer classUseOfAWTPeerClass
Use of DriverManager to get JDBC connectionCallToDriverManagerGetConnection
Use of Properties object as a HashtableUseOfPropertiesAsHashtable
Use of StringTokenizerUseOfStringTokenizer
Use of System.out or System.errUseOfSystemOutOrSystemErr
Use of archaic system property accessorsUseOfArchaicSystemPropertyAccessors
Use of concrete JDBC driver classUseOfJDBCDriverClass
Use of index 0 in JDBC ResultSetUseOfIndexZeroInJDBCResultSet
Use of java.lang.ProcessBuilder classUseOfProcessBuilder
Use of java.lang.reflectJavaLangReflect
Use of obsolete collection typeUseOfObsoleteCollectionType
Use of sun.* classesUseOfSunClasses
Using 'Random.nextDouble()' to get random integerUsingRandomNextDoubleForRandomInteger
Utility classUtilityClass
Utility class with public constructorUtilityClassWithPublicConstructor
Utility class without private constructorUtilityClassWithoutPrivateConstructor
Value of ++ or -- usedValueOfIncrementOrDecrementUsed
Variable argument methodVariableArgumentMethod
Variables of different types in one declarationVariablesOfDifferentTypesInDeclaration
Volatile array fieldVolatileArrayField
Volatile long or double fieldVolatileLongOrDoubleField
While loop spins on fieldWhileLoopSpinsOnField
Zero-length array allocationZeroLengthArrayAllocation
expression.equals("literal") rather than "literal".equals(expression)LiteralAsArgToStringEquals
java.lang importJavaLangImport
java.lang.Error not rethrownErrorNotRethrown
java.lang.ThreadDeath not rethrownThreadDeathNotRethrown

Chrome - a new rich client platform?

Just when I finally got a mobile device that was (just) powerful enough to use most websites without pain, what does Google do? They bring out a new browser, which raises the bar for the minimum requirements needed to run websites. Ok, sure, there doesn't currently exist any websites that take advantage of Chromes performance. But I think you'll find that Google will start releasing enhanced versions of their apps targeted at Chrome, and, if Google are lucky and play their cards right, people will flock to switch to Chrome in order to use the cool new features of the Chrome version of their apps. And then what use will my the browser on my iPhone be?

But the thing to note about what Google have done here, is that they have created an improved new rich client platform for the web. As a response to the difficulties of using JavaScript and HTML to create rich client interfaces on the web, Adobe released Flex and Sun released JavaFX. These technologies have a chance at success due to the existing widespread availability of Flash and Java, respectively. But what they have against them is that they don't play well with the existing web ecosystem. For example, a search engine can't index a Flex or JavaFX site. However, it can index a well written AJAX site. The back button doesn't work on Flex and JavaFX sites, but again, can work in a well written AJAX site. Copying and pasting URL's is a similar issue.

Google have addressed the exact same problem that Adobe and Sun have tried to address, but Google has taken the opposite approach. Rather than rewrite the protocols and standards used in web based applications, they've beefed up the client to make better use of the existing protocols and standards. If V8 is really up to standard performance wise, who knows, you may find soon when visiting YouTube with Chrome, that you don't need a flash player, the videos are rendered by JavaScript1. You may also find something similar for Google Street View.

1 Maybe this is a little far fetched, but, if they were to write some JavaScript extensions, which they can do now, and everyone would love because then they can ditch Adobe and Flash, it just may be possible.

Google Chrome

When I first heard about Google Chrome, I was very skeptical. Why does this world need another browser to contend with in producing cross browser websites? If open source is what you want, what's wrong with Firefox? So I had to read the Google Chrome comic, and I must admit, it has got me excited. But there is one feature in there that has got me concerned.

Google has suffered a large amount of criticism over the years in relation to privacy. From keeping information on your searches indefinitely, to reading your email, and most recently, getting too close for some with Street View.

One feature that intrigued me in Google Chrome is its location bar searching. It's very cool, it goes above and beyond the recent trend of other browsers to offer past url's based on title searches, it supports full text searching of pages you've visited. But, it also offers suggestions of popular pages that you've never visited. This is cool and convenient, but what does it mean? Everytime you type something into your address bar in Google Chrome, those words get sent to Google. This means that even without using Google's search directly, they can still see what you are typing into your address bar, and most users won't realise it. While that scares me a little, I'm more interested in seeing how the critics will respond to that, are Google up for another onslaught of bad publicity over privacy?

RIP #herring

#herring, the long standing meeting place for many of ANU's 2004 software engineering graduates, has passed away. Born in 2002, on the Australian IRC network oz.org, #herring has been a lively channel for keeping in contact, arguing about meaningless topics, and a nice distraction from a busy days work. #herring, the solid backbone of a friendship group, you will be missed.

About

Hi! My name is James Roper, and I am a software developer with a particular interest in open source development and trying new things. I program in Scala, Java, Go, PHP, Python and Javascript, and I work for Lightbend as the architect of Kalix. I also have a full life outside the world of IT, enjoy playing a variety of musical instruments and sports, and currently I live in Canberra.