Skip to content

Commit

Permalink
FinalizeImplementation_195
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkravin authored and daniilyar committed Aug 29, 2014
1 parent a817da2 commit 8e93de4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public final void basicTest() throws Exception
{

final String[] expected = {
"21: " + getCheckMessage(MSG_KEY_MISSED_TRY_FINALLY),
"34: " + getCheckMessage(MSG_KEY_MISSED_TRY_FINALLY),
"47: " + getCheckMessage(MSG_KEY_PUBLIC_FINALIZE),
"61: " + getCheckMessage(MSG_KEY_USELESS_FINALIZE),
"74: " + getCheckMessage(MSG_KEY_MISSED_SUPER_FINALIZE_CALL),
"22: " + getCheckMessage(MSG_KEY_MISSED_TRY_FINALLY),
"35: " + getCheckMessage(MSG_KEY_MISSED_TRY_FINALLY),
"48: " + getCheckMessage(MSG_KEY_PUBLIC_FINALIZE),
"62: " + getCheckMessage(MSG_KEY_USELESS_FINALIZE),
"75: " + getCheckMessage(MSG_KEY_MISSED_SUPER_FINALIZE_CALL),
};

verify(mCheckConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.github.sevntu.checkstyle.checks.coding;
class NormalFinalizer {

public static void doStuff()
{
//This method do some stuff
}
protected void finalize()
protected void finalize() throws Throwable
{
try {
doStuff();
Expand Down Expand Up @@ -44,7 +45,7 @@ public static void doStuff()
{
//This method do some stuff
}
public void finalize()
public void finalize() throws Throwable
{
try {
doStuff();
Expand All @@ -65,13 +66,13 @@ protected void finalize() throws Throwable
}

//public finalizer
class PublicFinalizer {
class PublicFinalizer1 {

public static void doStuff()
{
//This method do some stuff
}
protected void finalize()
protected void finalize() throws Throwable
{
try {
doStuff();
Expand Down

0 comments on commit 8e93de4

Please sign in to comment.