diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/modifiers/ModifierIntention.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/modifiers/ModifierIntention.java index bb3fdb60124a..974fa3b8c5e8 100644 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/modifiers/ModifierIntention.java +++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/modifiers/ModifierIntention.java @@ -87,7 +87,7 @@ abstract class ModifierIntention extends Intention implements LowPriorityAction final PsiElement sibling = modifierList.getNextSibling(); if (sibling instanceof PsiWhiteSpace) { sibling.replace(whitespace); - CodeStyleManager.getInstance(project).reformatRange(member, modifierList.getTextOffset() + 1, + CodeStyleManager.getInstance(project).reformatRange(member, modifierList.getTextOffset(), modifierList.getNextSibling().getTextOffset()); } } diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/modifiers/make_local/InDefaultPackage.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/modifiers/make_local/InDefaultPackage.java new file mode 100644 index 000000000000..9aa60d875883 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/modifiers/make_local/InDefaultPackage.java @@ -0,0 +1 @@ +public class Test {} \ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/modifiers/make_local/InDefaultPackage_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/modifiers/make_local/InDefaultPackage_after.java new file mode 100644 index 000000000000..183c3f5b3be0 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/modifiers/make_local/InDefaultPackage_after.java @@ -0,0 +1 @@ +class Test {} \ No newline at end of file diff --git a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/modifiers/MakePackageLocalIntentionTest.java b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/modifiers/MakePackageLocalIntentionTest.java new file mode 100644 index 000000000000..5f02fdf02dae --- /dev/null +++ b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/modifiers/MakePackageLocalIntentionTest.java @@ -0,0 +1,34 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.siyeh.ipp.modifiers; + +import com.siyeh.IntentionPowerPackBundle; +import com.siyeh.ipp.IPPTestCase; + +public class MakePackageLocalIntentionTest extends IPPTestCase { + + public void testInDefaultPackage() { doTest(); } + + @Override + protected String getRelativePath() { + return "modifiers/make_local"; + } + + @Override + protected String getIntentionName() { + return IntentionPowerPackBundle.message("make.package.private.intention.name"); + } +}