diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/JarFileSystemTest.java b/java/java-tests/testSrc/com/intellij/openapi/vfs/JarFileSystemTest.java
index 053eb932d3eb..d1154eff0bfa 100644
--- a/java/java-tests/testSrc/com/intellij/openapi/vfs/JarFileSystemTest.java
+++ b/java/java-tests/testSrc/com/intellij/openapi/vfs/JarFileSystemTest.java
@@ -68,6 +68,7 @@ public class JarFileSystemTest extends IdeaTestCase {
public void testJarRefresh() throws IOException {
File jar = IoTestUtil.createTestJar();
+ assertTrue(jar.setLastModified(jar.lastModified() - 1000));
VirtualFile vFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(jar);
assertNotNull(vFile);
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlSlashTypedHandler.java b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlSlashTypedHandler.java
index c259054e8ab8..821694de0170 100644
--- a/xml/impl/src/com/intellij/codeInsight/editorActions/XmlSlashTypedHandler.java
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/XmlSlashTypedHandler.java
@@ -85,7 +85,7 @@ public class XmlSlashTypedHandler extends TypedHandlerDelegate implements XmlTok
final String prevLeafText = prevLeaf.getText();
if ("".equals(prevLeafText) && prevLeaf.getElementType() == XML_END_TAG_START) {
XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
- if (tag != null && StringUtil.isNotEmpty(tag.getName())) {
+ if (tag != null && StringUtil.isNotEmpty(tag.getName()) && TreeUtil.findSibling(prevLeaf, XmlTokenType.XML_NAME) == null) {
EditorModificationUtil.insertStringAtCaret(editor, tag.getName() + ">");
return Result.STOP;
}
diff --git a/xml/tests/src/com/intellij/codeInsight/completion/XmlTypedHandlersTest.java b/xml/tests/src/com/intellij/codeInsight/completion/XmlTypedHandlersTest.java
index 6a5edda198d8..bcc1afbe797d 100644
--- a/xml/tests/src/com/intellij/codeInsight/completion/XmlTypedHandlersTest.java
+++ b/xml/tests/src/com/intellij/codeInsight/completion/XmlTypedHandlersTest.java
@@ -29,4 +29,10 @@ public class XmlTypedHandlersTest extends LightPlatformCodeInsightFixtureTestCas
myFixture.type('/');
myFixture.checkResult("");
}
+
+ public void testGreedyClosing() {
+ myFixture.configureByText(XmlFileType.INSTANCE, "<foo>");
+ myFixture.type('/');
+ myFixture.checkResult("");
+ }
}