From b8af58e87f9ae8de7562c1c670b0294079b4867b Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 15 Dec 2011 18:24:33 +0400 Subject: [PATCH 001/101] fixed width of 'Detection' item in facets tree in Project Structure dialog --- .../FacetStructureConfigurable.java | 29 ++++++++++++++++++- .../projectRoot/FacetsTreeCellRenderer.java | 4 +-- .../filtered/FilteringTreeBuilder.java | 12 +++++--- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/FacetStructureConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/FacetStructureConfigurable.java index f6d27512cb7f..97bfa377a2b3 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/FacetStructureConfigurable.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/FacetStructureConfigurable.java @@ -36,6 +36,7 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStr import com.intellij.openapi.ui.DetailsComponent; import com.intellij.openapi.ui.NamedConfigurable; import com.intellij.openapi.util.IconLoader; +import com.intellij.ui.treeStructure.filtered.FilteringTreeBuilder; import com.intellij.util.ui.tree.TreeUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -43,6 +44,8 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; import java.util.*; import java.util.List; @@ -55,6 +58,7 @@ public class FacetStructureConfigurable extends BaseStructureConfigurable { private final Map, FacetTypeEditor> myFacetTypeEditors = new HashMap, FacetTypeEditor>(); private MultipleFacetSettingsEditor myCurrentMultipleSettingsEditor; @NonNls private static final String NO_FRAMEWORKS_NODE = "No facets are configured"; + private boolean myTreeWasInitialized; public FacetStructureConfigurable(final Project project, ModuleManager moduleManager) { super(project); @@ -77,7 +81,30 @@ public class FacetStructureConfigurable extends BaseStructureConfigurable { @Override protected void initTree() { super.initTree(); - myTree.setCellRenderer(new FacetsTreeCellRenderer()); + if (!myTreeWasInitialized) { + myTreeWasInitialized = true; + myTree.setCellRenderer(new FacetsTreeCellRenderer()); + myTree.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent e) { + revalidateTree(); + } + + @Override + public void componentMoved(ComponentEvent e) { + revalidateTree(); + } + + @Override + public void componentShown(ComponentEvent e) { + revalidateTree(); + } + }); + } + } + + private void revalidateTree() { + FilteringTreeBuilder.revalidateTree(myTree); } protected void loadTree() { diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/FacetsTreeCellRenderer.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/FacetsTreeCellRenderer.java index 2bfd614f8aa1..53ef207663eb 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/FacetsTreeCellRenderer.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/FacetsTreeCellRenderer.java @@ -56,8 +56,8 @@ public class FacetsTreeCellRenderer extends GroupedElementsRenderer.Tree impleme final Icon icon = configurable.getIcon(expanded); final boolean showSeparator = configurable instanceof FrameworkDetectionConfigurable; int width = -1; - if (showSeparator) { - final int treeWidth = tree.getSize().width; + if (showSeparator && tree.isVisible()) { + final int treeWidth = tree.getVisibleRect().width - 4; if (treeWidth > 0) { width = treeWidth; } diff --git a/platform/platform-api/src/com/intellij/ui/treeStructure/filtered/FilteringTreeBuilder.java b/platform/platform-api/src/com/intellij/ui/treeStructure/filtered/FilteringTreeBuilder.java index a8276ef23902..1fd9c7972b3a 100644 --- a/platform/platform-api/src/com/intellij/ui/treeStructure/filtered/FilteringTreeBuilder.java +++ b/platform/platform-api/src/com/intellij/ui/treeStructure/filtered/FilteringTreeBuilder.java @@ -187,10 +187,14 @@ public class FilteringTreeBuilder extends AbstractTreeBuilder { } public void revalidateTree() { - myTree.invalidate(); - myTree.setRowHeight(myTree.getRowHeight() == -1 ? -2 : -1); - myTree.revalidate(); - myTree.repaint(); + revalidateTree(myTree); + } + + public static void revalidateTree(Tree tree) { + tree.invalidate(); + tree.setRowHeight(tree.getRowHeight() == -1 ? -2 : -1); + tree.revalidate(); + tree.repaint(); } From 006b5cd1ab45f53321ff664f46b1335ec018c807 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 15 Dec 2011 14:35:40 +0100 Subject: [PATCH 002/101] IDEA-78863 Live templates are not accessible in read-only file (e.g. versioned in Perforce or TFS) --- .../codeInsight/template/impl/ListTemplatesHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/ListTemplatesHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/ListTemplatesHandler.java index 6831a726575d..7ce8a60063e8 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/ListTemplatesHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/ListTemplatesHandler.java @@ -29,6 +29,7 @@ import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.ex.util.EditorUtil; +import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; @@ -40,7 +41,9 @@ import java.util.Map; public class ListTemplatesHandler implements CodeInsightActionHandler { public void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull PsiFile file) { - if (!file.isWritable()) return; + if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)) { + return; + } EditorUtil.fillVirtualSpaceUntilCaret(editor); PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); From a9f848b35a8c02e5275032a4c58212579b156e5a Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 15 Dec 2011 15:59:15 +0100 Subject: [PATCH 003/101] respect the default tag values in xsd when parsing custom beans (IDEA-77586) --- .../jetbrains/android/dom/AndroidClassTagDescriptor.java | 5 +++++ .../xml/impl/dom/AbstractDomChildrenDescriptor.java | 5 +++++ .../xml/impl/dtd/BaseXmlElementDescriptorImpl.java | 5 +++++ .../intellij/xml/impl/schema/AnyXmlElementDescriptor.java | 5 +++++ .../intellij/xml/impl/schema/NullElementDescriptor.java | 5 +++++ .../intellij/xml/impl/schema/XmlElementDescriptorImpl.java | 7 ++++++- xml/openapi/src/com/intellij/xml/XmlElementDescriptor.java | 3 +++ .../intellij/html/RelaxedHtmlFromRngElementDescriptor.java | 5 +++++ .../relaxNG/model/descriptors/RngElementDescriptor.java | 5 +++++ 9 files changed, 44 insertions(+), 1 deletion(-) diff --git a/plugins/android/src/org/jetbrains/android/dom/AndroidClassTagDescriptor.java b/plugins/android/src/org/jetbrains/android/dom/AndroidClassTagDescriptor.java index 97257b955cb9..61aaee5f4f28 100644 --- a/plugins/android/src/org/jetbrains/android/dom/AndroidClassTagDescriptor.java +++ b/plugins/android/src/org/jetbrains/android/dom/AndroidClassTagDescriptor.java @@ -86,6 +86,11 @@ public class AndroidClassTagDescriptor implements XmlElementDescriptor { return myParentDescriptor.getContentType(); } + @Override + public String getDefaultValue() { + return null; + } + public PsiElement getDeclaration() { return myClass; } diff --git a/xml/dom-impl/src/com/intellij/xml/impl/dom/AbstractDomChildrenDescriptor.java b/xml/dom-impl/src/com/intellij/xml/impl/dom/AbstractDomChildrenDescriptor.java index 116e8ce73829..2d701555987f 100644 --- a/xml/dom-impl/src/com/intellij/xml/impl/dom/AbstractDomChildrenDescriptor.java +++ b/xml/dom-impl/src/com/intellij/xml/impl/dom/AbstractDomChildrenDescriptor.java @@ -212,6 +212,11 @@ public abstract class AbstractDomChildrenDescriptor implements XmlElementDescrip return CONTENT_TYPE_UNKNOWN; } + @Override + public String getDefaultValue() { + return null; + } + public void init(final PsiElement element) { throw new UnsupportedOperationException("Method init not implemented in " + getClass()); } diff --git a/xml/impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java index ef09d3b7ff72..6d01ce8bc65f 100644 --- a/xml/impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java +++ b/xml/impl/src/com/intellij/xml/impl/dtd/BaseXmlElementDescriptorImpl.java @@ -41,6 +41,11 @@ public abstract class BaseXmlElementDescriptorImpl implements XmlElementDescript return null; } + @Override + public String getDefaultValue() { + return null; + } + // Read-only action protected abstract XmlElementDescriptor[] doCollectXmlDescriptors(final XmlTag context); diff --git a/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java index 36d06639dceb..7343adf58a01 100644 --- a/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java +++ b/xml/impl/src/com/intellij/xml/impl/schema/AnyXmlElementDescriptor.java @@ -101,4 +101,9 @@ public class AnyXmlElementDescriptor implements XmlElementDescriptor { public int getContentType() { return CONTENT_TYPE_UNKNOWN; } + + @Override + public String getDefaultValue() { + return null; + } } diff --git a/xml/impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java b/xml/impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java index fe0a58718236..3704042e0aaa 100644 --- a/xml/impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java +++ b/xml/impl/src/com/intellij/xml/impl/schema/NullElementDescriptor.java @@ -80,6 +80,11 @@ public class NullElementDescriptor implements XmlElementDescriptor { return 0; } + @Override + public String getDefaultValue() { + return null; + } + public PsiElement getDeclaration() { return null; } diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java index 3baa1839a0f6..bb81999c963e 100644 --- a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java +++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java @@ -45,7 +45,7 @@ public class XmlElementDescriptorImpl implements XmlElementDescriptor, PsiWritab @NonNls private static final String ELEMENT_FORM_DEFAULT = "elementFormDefault"; - public XmlElementDescriptorImpl(XmlTag descriptorTag) { + public XmlElementDescriptorImpl(@NotNull XmlTag descriptorTag) { myDescriptorTag = descriptorTag; } @@ -358,6 +358,11 @@ public class XmlElementDescriptorImpl implements XmlElementDescriptor, PsiWritab return CONTENT_TYPE_MIXED; } + @Override + public String getDefaultValue() { + return myDescriptorTag.getAttributeValue("default"); + } + @Nullable public XmlElementDescriptor getElementDescriptor(final String name) { final String localName = XmlUtil.findLocalNameByQualifiedName(name); diff --git a/xml/openapi/src/com/intellij/xml/XmlElementDescriptor.java b/xml/openapi/src/com/intellij/xml/XmlElementDescriptor.java index 1b05741cb168..6627ca0e7eea 100644 --- a/xml/openapi/src/com/intellij/xml/XmlElementDescriptor.java +++ b/xml/openapi/src/com/intellij/xml/XmlElementDescriptor.java @@ -68,4 +68,7 @@ public interface XmlElementDescriptor extends PsiMetaData { int CONTENT_TYPE_ANY = 1; int CONTENT_TYPE_CHILDREN = 2; int CONTENT_TYPE_MIXED = 3; + + @Nullable + String getDefaultValue(); } diff --git a/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java index a56ee566e2fc..48fa59d514e4 100644 --- a/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java +++ b/xml/relaxng/src/org/intellij/html/RelaxedHtmlFromRngElementDescriptor.java @@ -84,6 +84,11 @@ public class RelaxedHtmlFromRngElementDescriptor implements XmlElementDescriptor return myDelegate.getContentType(); } + @Override + public String getDefaultValue() { + return null; + } + public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, final XmlTag context) { final XmlAttributeDescriptor descriptor = myDelegate.getAttributeDescriptor(attributeName.toLowerCase(), context); if (descriptor != null) return descriptor; diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngElementDescriptor.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngElementDescriptor.java index 4e8b7a886996..054460f7c38d 100644 --- a/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngElementDescriptor.java +++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/model/descriptors/RngElementDescriptor.java @@ -209,6 +209,11 @@ public class RngElementDescriptor implements XmlElementDescriptor { } } + @Override + public String getDefaultValue() { + return null; + } + public PsiElement getDeclaration() { if (myDeclaration != null) { final PsiElement element = myDeclaration.getElement(); From 1715759b3bf7162e3a7a10c91e70189bdcb18dc5 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Thu, 15 Dec 2011 18:59:18 +0400 Subject: [PATCH 004/101] Animated pinch zoom. --- .../intellij/ui/components/JBViewport.java | 42 ++++-- .../intellij/ui/components/Magnificator.java | 29 ++++ .../ui/components/ZoomableViewport.java | 32 +++++ .../ui/components/ZoomingDelegate.java | 125 ++++++++++++++++++ .../actionSystem/impl/MacGestureAdapter.java | 52 ++++++-- .../impl/MouseGestureManager.java | 37 +----- .../editor/impl/EditorComponentImpl.java | 19 ++- 7 files changed, 281 insertions(+), 55 deletions(-) create mode 100644 platform/platform-api/src/com/intellij/ui/components/Magnificator.java create mode 100644 platform/platform-api/src/com/intellij/ui/components/ZoomableViewport.java create mode 100644 platform/platform-api/src/com/intellij/ui/components/ZoomingDelegate.java diff --git a/platform/platform-api/src/com/intellij/ui/components/JBViewport.java b/platform/platform-api/src/com/intellij/ui/components/JBViewport.java index c1f65c4561f9..0ab304d1ef13 100644 --- a/platform/platform-api/src/com/intellij/ui/components/JBViewport.java +++ b/platform/platform-api/src/com/intellij/ui/components/JBViewport.java @@ -18,14 +18,16 @@ package com.intellij.ui.components; import com.intellij.ui.table.JBTable; import com.intellij.util.ui.ComponentWithEmptyText; import com.intellij.util.ui.StatusText; +import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; import java.awt.event.ContainerEvent; import java.awt.event.ContainerListener; -public class JBViewport extends JViewport { +public class JBViewport extends JViewport implements ZoomableViewport { private StatusText myEmptyText; + private ZoomingDelegate myZoomer; public JBViewport() { addContainerListener(new ContainerListener() { @@ -50,16 +52,40 @@ public class JBViewport extends JViewport { } @Override - public Dimension getPreferredSize() { - return super.getPreferredSize(); //To change body of overridden methods use File | Settings | File Templates. + public void paint(Graphics g) { + if (myZoomer != null && myZoomer.isActive()) { + myZoomer.paint(g); + } + else { + super.paint(g); + + if (myEmptyText != null) { + myEmptyText.paint(this, g); + } + } + } + + @Nullable + @Override + public Magnificator getMagnificator() { + JComponent view = (JComponent)getView(); + return view != null ? (Magnificator)view.getClientProperty(Magnificator.CLIENT_PROPERTY_KEY) : null; } @Override - public void paint(Graphics g) { - super.paint(g); + public void magnificationStarted(Point at) { + myZoomer = new ZoomingDelegate((JComponent)getView(), this); + myZoomer.magnificationStarted(at); + } - if (myEmptyText != null) { - myEmptyText.paint(this, g); - } + @Override + public void magnificationFinished(double magnification) { + myZoomer.magnificationFinished(magnification); + myZoomer = null; + } + + @Override + public void magnify(double magnification) { + myZoomer.magnify(magnification); } } diff --git a/platform/platform-api/src/com/intellij/ui/components/Magnificator.java b/platform/platform-api/src/com/intellij/ui/components/Magnificator.java new file mode 100644 index 000000000000..cc60e7fbf195 --- /dev/null +++ b/platform/platform-api/src/com/intellij/ui/components/Magnificator.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2011 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. + */ + +/* + * @author max + */ +package com.intellij.ui.components; + +import com.intellij.openapi.util.Key; + +import java.awt.*; + +public interface Magnificator { + Key CLIENT_PROPERTY_KEY = Key.create("MagnifiableComponent"); + Point magnify(double scale, Point at); +} diff --git a/platform/platform-api/src/com/intellij/ui/components/ZoomableViewport.java b/platform/platform-api/src/com/intellij/ui/components/ZoomableViewport.java new file mode 100644 index 000000000000..4c40ba03041d --- /dev/null +++ b/platform/platform-api/src/com/intellij/ui/components/ZoomableViewport.java @@ -0,0 +1,32 @@ +/* + * Copyright 2000-2011 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. + */ + +/* + * @author max + */ +package com.intellij.ui.components; + +import org.jetbrains.annotations.Nullable; + +import java.awt.*; + +public interface ZoomableViewport { + @Nullable + Magnificator getMagnificator(); + void magnificationStarted(Point at); + void magnificationFinished(double magnification); + void magnify(double magnification); +} diff --git a/platform/platform-api/src/com/intellij/ui/components/ZoomingDelegate.java b/platform/platform-api/src/com/intellij/ui/components/ZoomingDelegate.java new file mode 100644 index 000000000000..0ddd352b194c --- /dev/null +++ b/platform/platform-api/src/com/intellij/ui/components/ZoomingDelegate.java @@ -0,0 +1,125 @@ +/* + * Copyright 2000-2011 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. + */ + +/* + * @author max + */ +package com.intellij.ui.components; + +import com.intellij.ui.Gray; + +import javax.swing.*; +import java.awt.*; +import java.awt.image.BufferedImage; + +public class ZoomingDelegate { + private final JComponent myContentComponent; + private final JComponent myViewportComponent; + + private BufferedImage myCachedImage; + private Point myMagnificationPoint; + private double myMagnification; + + public ZoomingDelegate(JComponent contentComponent, JComponent viewportComponent) { + myContentComponent = contentComponent; + myViewportComponent = viewportComponent; + } + + public void paint(Graphics g) { + if (myCachedImage != null && myMagnificationPoint != null && myMagnification != 0) { + double scale = magnificationToScale(myMagnification); + int xoffset = (int)(myMagnificationPoint.x - myMagnificationPoint.x * scale); + int yoffset = (int)(myMagnificationPoint.y - myMagnificationPoint.y * scale); + + Rectangle clip = g.getClipBounds(); + + g.setColor(Gray._120); + g.fillRect(clip.x, clip.y, clip.width, clip.height); + + Graphics2D translated = (Graphics2D)g.create(); + translated.translate(xoffset, yoffset); + translated.scale(scale, scale); + + translated.drawImage(myCachedImage, 0, 0, null); + } + } + + public void magnificationStarted(Point at) { + myMagnificationPoint = at; + } + + public void magnificationFinished(double magnification) { + if (myMagnification != 0) { + Magnificator magnificator = ((ZoomableViewport)myViewportComponent).getMagnificator(); + + if (magnificator != null) { + Point inContent = convertToContentCoordinates(myMagnificationPoint); + + final Point inContentScaled = magnificator.magnify(magnificationToScale(magnification), inContent); + + int voffset = inContentScaled.y - myMagnificationPoint.y; + int hoffset = inContentScaled.x - myMagnificationPoint.x; + myViewportComponent.repaint(); + myViewportComponent.validate(); + + scrollTo(voffset, hoffset); + } + } + + myMagnificationPoint = null; + myMagnification = 0; + myCachedImage = null; + } + + protected void scrollTo(int voffset, int hoffset) { + JViewport viewport = (JViewport)myViewportComponent; + JScrollPane pane = (JScrollPane)viewport.getParent(); + JScrollBar vsb = pane.getVerticalScrollBar(); + vsb.setValue(voffset); + JScrollBar hsb = pane.getHorizontalScrollBar(); + hsb.setValue(hoffset); + } + + protected Point convertToContentCoordinates(Point point) { + return SwingUtilities.convertPoint(myViewportComponent, point, myContentComponent); + } + + public boolean isActive() { + return myCachedImage != null; + } + + private static double magnificationToScale(double magnification) { + return magnification < 0 ? 1f / (1 - magnification) : (1 + magnification); + } + + public void magnify(double magnification) { + if (myMagnification != magnification) { + myMagnification = magnification; + + if (myCachedImage == null) { + Rectangle bounds = myViewportComponent.getBounds(); + BufferedImage image = new BufferedImage(bounds.width, bounds.height, BufferedImage.TYPE_INT_RGB); + + Graphics graphics = image.getGraphics(); + graphics.setClip(0, 0, bounds.width, bounds.height); + myViewportComponent.paint(graphics); + + myCachedImage = image; + } + } + myViewportComponent.repaint(); + } +} diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/MacGestureAdapter.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/MacGestureAdapter.java index 32538508f7a0..a0404c9e99d5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/MacGestureAdapter.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/MacGestureAdapter.java @@ -16,9 +16,16 @@ package com.intellij.openapi.actionSystem.impl; import com.apple.eawt.event.*; +import com.intellij.openapi.actionSystem.ActionManager; +import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.wm.IdeFrame; +import com.intellij.ui.components.Magnificator; +import com.intellij.ui.components.ZoomableViewport; import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.MouseEvent; /** * User: anna @@ -28,6 +35,7 @@ class MacGestureAdapter extends GestureAdapter { double magnification; private final IdeFrame myFrame; private MouseGestureManager myManager; + private ZoomableViewport myMagnifyingViewport; public MacGestureAdapter(MouseGestureManager manager, IdeFrame frame) { myFrame = frame; @@ -38,35 +46,63 @@ class MacGestureAdapter extends GestureAdapter { @Override public void gestureBegan(GesturePhaseEvent event) { - myManager.activateTrackpad(); magnification = 0; + + Point mouse = MouseInfo.getPointerInfo().getLocation(); + SwingUtilities.convertPointFromScreen(mouse, myFrame.getComponent()); + Component deepest = SwingUtilities.getDeepestComponentAt(myFrame.getComponent(), mouse.x, mouse.y); + ZoomableViewport viewport = (ZoomableViewport) SwingUtilities.getAncestorOfClass(ZoomableViewport.class, deepest); + if (viewport != null) { + Magnificator magnificator = viewport.getMagnificator(); + + if (magnificator != null) { + Point at = MouseInfo.getPointerInfo().getLocation(); + SwingUtilities.convertPointFromScreen(at, (JComponent)viewport); + viewport.magnificationStarted(at); + myMagnifyingViewport = viewport; + } + } } @Override public void gestureEnded(GesturePhaseEvent event) { - myManager.activateTrackpad(); - if (magnification != 0) { - MouseGestureManager.processMagnification(myFrame, magnification); + if (myMagnifyingViewport != null) { + myMagnifyingViewport.magnificationFinished(magnification); + myMagnifyingViewport = null; magnification = 0; } } @Override public void swipedLeft(SwipeEvent event) { - myManager.activateTrackpad(); - myManager.processLeftSwipe(myFrame); + ActionManager actionManager = ActionManager.getInstance(); + AnAction forward = actionManager.getAction("Forward"); + if (forward == null) return; + + actionManager.tryToExecute(forward, createMouseEventWrapper(myFrame), null, null, false); } @Override public void swipedRight(SwipeEvent event) { - myManager.activateTrackpad(); - myManager.processRightSwipe(myFrame); + ActionManager actionManager = ActionManager.getInstance(); + AnAction back = actionManager.getAction("Back"); + if (back == null) return; + + actionManager.tryToExecute(back, createMouseEventWrapper(myFrame), null, null, false); } + private static MouseEvent createMouseEventWrapper(IdeFrame frame) { + return new MouseEvent(frame.getComponent(), ActionEvent.ACTION_PERFORMED, System.currentTimeMillis(), 0, 0, 0, 0, false, 0); + } + + @Override public void magnify(MagnificationEvent event) { myManager.activateTrackpad(); magnification += event.getMagnification(); + if (myMagnifyingViewport != null) { + myMagnifyingViewport.magnify(magnification); + } } public void remove(JComponent cmp) { diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/MouseGestureManager.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/MouseGestureManager.java index 7e4ae8bb03fd..d644c7120f7e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/MouseGestureManager.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/MouseGestureManager.java @@ -39,14 +39,11 @@ import java.util.Map; public class MouseGestureManager implements ApplicationComponent { private static final Logger LOG = Logger.getInstance("MouseGestureManager"); - private ActionManagerImpl myActionManager; private Map myListeners = new HashMap(); private boolean HAS_TRACKPAD = false; - - public MouseGestureManager(ActionManagerImpl actionManager) { - myActionManager = actionManager; + public MouseGestureManager() { } public void add(final IdeFrame frame) { @@ -76,38 +73,6 @@ public class MouseGestureManager implements ApplicationComponent { return HAS_TRACKPAD; } - protected static void processMagnification(IdeFrame frame, double magnification) { - Point mouse = MouseInfo.getPointerInfo().getLocation(); - SwingUtilities.convertPointFromScreen(mouse, frame.getComponent()); - Component componentAt = SwingUtilities.getDeepestComponentAt(frame.getComponent(), mouse.x, mouse.y); - if (componentAt != null) { - Editor editor = PlatformDataKeys.EDITOR.getData(DataManager.getInstance().getDataContext(componentAt)); - if (editor != null) { - double currentSize = editor.getColorsScheme().getEditorFontSize(); - int defaultFontSize = EditorColorsManager.getInstance().getGlobalScheme().getEditorFontSize(); - ((EditorEx)editor).setFontSize((int)(Math.max(currentSize + magnification * 3, defaultFontSize))); - } - } - } - - protected void processLeftSwipe(IdeFrame frame) { - AnAction forward = myActionManager.getAction("Forward"); - if (forward == null) return; - - myActionManager.tryToExecute(forward, createMouseEventWrapper(frame), null, null, false); - } - - protected void processRightSwipe(IdeFrame frame) { - AnAction back = myActionManager.getAction("Back"); - if (back == null) return; - - myActionManager.tryToExecute(back, createMouseEventWrapper(frame), null, null, false); - } - - private static MouseEvent createMouseEventWrapper(IdeFrame frame) { - return new MouseEvent(frame.getComponent(), ActionEvent.ACTION_PERFORMED, System.currentTimeMillis(), 0, 0, 0, 0, false, 0); - } - public void remove(IdeFrame frame) { if (!Registry.is("actionSystem.mouseGesturesEnabled")) return; diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorComponentImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorComponentImpl.java index deaef127e15c..50a87000b721 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorComponentImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorComponentImpl.java @@ -19,21 +19,21 @@ import com.intellij.ide.IdeEventQueue; import com.intellij.ide.ui.UISettings; import com.intellij.openapi.actionSystem.DataProvider; import com.intellij.openapi.actionSystem.PlatformDataKeys; +import com.intellij.openapi.editor.VisualPosition; +import com.intellij.ui.components.Magnificator; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.impl.ApplicationImpl; +import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.ex.util.EditorUtil; import com.intellij.openapi.ui.Queryable; import com.intellij.openapi.ui.TypingTarget; import com.intellij.openapi.util.ActionCallback; -import com.intellij.util.ReflectionUtil; import com.intellij.util.ui.UIUtil; import javax.swing.*; import java.awt.*; import java.awt.event.ComponentEvent; -import java.awt.event.FocusEvent; import java.awt.event.InputMethodEvent; -import java.awt.im.InputContext; import java.awt.im.InputMethodRequests; import java.util.Map; @@ -46,6 +46,19 @@ public class EditorComponentImpl extends JComponent implements Scrollable, DataP enableInputMethods(true); setFocusCycleRoot(true); setOpaque(true); + + putClientProperty(Magnificator.CLIENT_PROPERTY_KEY, new Magnificator() { + @Override + public Point magnify(double scale, Point at) { + VisualPosition magnificationPosition = myEditor.xyToVisualPosition(at); + + double currentSize = myEditor.getColorsScheme().getEditorFontSize(); + int defaultFontSize = EditorColorsManager.getInstance().getGlobalScheme().getEditorFontSize(); + myEditor.setFontSize((int)(double)(int)(Math.max(currentSize * scale, defaultFontSize))); + + return myEditor.visualPositionToXY(magnificationPosition); + } + }); } public EditorImpl getEditor() { From 3c22117b916ddf0abdae41bec9402626eba542a5 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Thu, 15 Dec 2011 19:41:56 +0400 Subject: [PATCH 005/101] Remove (obviously broken) dependencies from community modules to ultimate one. --- plugins/devkit/devkit.iml | 1 - plugins/tasks/tasks-tests/tasks-tests.iml | 1 - 2 files changed, 2 deletions(-) diff --git a/plugins/devkit/devkit.iml b/plugins/devkit/devkit.iml index 663a7230c0aa..996d0202eb8c 100644 --- a/plugins/devkit/devkit.iml +++ b/plugins/devkit/devkit.iml @@ -24,7 +24,6 @@ - diff --git a/plugins/tasks/tasks-tests/tasks-tests.iml b/plugins/tasks/tasks-tests/tasks-tests.iml index a9e1beff04c1..f59b8dfccb7e 100644 --- a/plugins/tasks/tasks-tests/tasks-tests.iml +++ b/plugins/tasks/tasks-tests/tasks-tests.iml @@ -14,7 +14,6 @@ - From 5f6e684f920a1e6f1849fd9bdaee1dc34ee048bf Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 15 Dec 2011 17:21:02 +0100 Subject: [PATCH 006/101] [yole] Use earlier advertised property as a default value for safe write switch --- .../platform-api/src/com/intellij/ide/GeneralSettings.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/platform-api/src/com/intellij/ide/GeneralSettings.java b/platform/platform-api/src/com/intellij/ide/GeneralSettings.java index 3fb9b07e514e..65fffab3d2d3 100644 --- a/platform/platform-api/src/com/intellij/ide/GeneralSettings.java +++ b/platform/platform-api/src/com/intellij/ide/GeneralSettings.java @@ -222,6 +222,8 @@ public class GeneralSettings implements NamedJDOMExternalizable, ExportableAppli //todo use DefaultExternalizer public void readExternal(Element parentNode) { + boolean safeWriteSettingRead = false; + List children = parentNode.getChildren(ELEMENT_OPTION); for (final Object aChildren : children) { Element element = (Element)aChildren; @@ -295,6 +297,7 @@ public class GeneralSettings implements NamedJDOMExternalizable, ExportableAppli } if (OPTION_USE_SAFE_WRITE.equals(name) && value != null) { myUseSafeWrite = Boolean.valueOf(value).booleanValue(); + safeWriteSettingRead = true; } if (OPTION_CHARSET.equals(name)) { @@ -361,6 +364,10 @@ public class GeneralSettings implements NamedJDOMExternalizable, ExportableAppli } } } + + if (!safeWriteSettingRead && "true".equals(System.getProperty("idea.no.safe.write"))) { + myUseSafeWrite = false; + } } public void writeExternal(Element parentNode) { From 03cf08a966830fe81d75819bcf6b6bd9c60fdd22 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 15 Dec 2011 17:22:15 +0100 Subject: [PATCH 007/101] IDEA-78632 (IDEA 11 REGRESSION: CVS update truncates last line's EOL) --- .../com/intellij/cvsSupport2/javacvsImpl/io/LineReader.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/javacvsImpl/io/LineReader.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/javacvsImpl/io/LineReader.java index f5e640c42d2d..d26b67082ed8 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/javacvsImpl/io/LineReader.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/javacvsImpl/io/LineReader.java @@ -76,6 +76,10 @@ public class LineReader { @Nullable public byte[] readLine() throws IOException { if (myBytesBuffered == -1) { + if (myLastEol != 0) { + myLastEol = 0; + return getLineArray(); + } return null; } else if (myPosition >= myBytesBuffered) { fillBuffer(); From e124dca09dd866a511eef9c73a5efe050b7065ef Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 15 Dec 2011 17:22:20 +0100 Subject: [PATCH 008/101] micro-optimization in ModuleUtil.findModuleForPsiElement() --- .../lang-api/src/com/intellij/openapi/module/ModuleUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java b/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java index e7c99a4b0538..d45baeb40dec 100644 --- a/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java +++ b/platform/lang-api/src/com/intellij/openapi/module/ModuleUtil.java @@ -125,6 +125,9 @@ public class ModuleUtil { if (orderEntries.isEmpty()) { return null; } + if (orderEntries.size() == 1) { + return orderEntries.get(0).getOwnerModule(); + } Set modules = new HashSet(); for (OrderEntry orderEntry : orderEntries) { modules.add(orderEntry.getOwnerModule()); From e83f70b412708b67c9c32137743c9f62a97854c9 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Thu, 15 Dec 2011 17:27:03 +0100 Subject: [PATCH 009/101] SMFramework: test tuned --- .../testframework/sm/OutputLineSplitterTest.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputLineSplitterTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputLineSplitterTest.java index d1d5d385ef47..5e6bf8247d03 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputLineSplitterTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputLineSplitterTest.java @@ -145,7 +145,7 @@ public class OutputLineSplitterTest extends UsefulTestCase { if (i % 10 == 0) { written.release(); try { - if (!read.tryAcquire(1, TimeUnit.SECONDS)) throw new TimeoutException(); + if (!read.tryAcquire(10, TimeUnit.SECONDS)) throw new TimeoutException(); } catch (Exception e) { throw new RuntimeException(e); @@ -179,10 +179,15 @@ public class OutputLineSplitterTest extends UsefulTestCase { assertTrue(hadOutput); } finally { - isFinished.set(true); + try { + isFinished.set(true); - for (Future each : futures) { - each.get(1, TimeUnit.SECONDS); + for (Future each : futures) { + each.get(10, TimeUnit.SECONDS); + } + } + catch (Exception e) { + e.printStackTrace(); } } } From b6ccf2222b2a9785cc86840e4ea1f772cd93d4a2 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Thu, 15 Dec 2011 17:46:51 +0100 Subject: [PATCH 010/101] Open Project: incorrect resource string removed --- platform/platform-resources-en/src/messages/IdeBundle.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index 493a92ec52aa..2ab0524071ab 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -989,7 +989,6 @@ project.import.default.name=ImportedFrom{0} project.import.default.name.dotIdea=Imported From {0} project.import.select.title=Select {0} projects to import project.import.show.settings.after=&Open Project Structure after import -project.import.open.existing=There is {0} in ''{1}''.\nDo you want to proceed with reimporting ''{2}'' or open the existing project? project.import.open.existing=There is {0} in ''{1}''.\nDo you want to open the existing project or delete it and import ''{2}''? project.import.open.existing.openExisting=Open Existing Project project.import.open.existing.reimport=Delete Existing Project and Import From fbe4d9289b85ebe55c1fed41dcbbb4a1eaee6823 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Thu, 15 Dec 2011 18:40:33 +0100 Subject: [PATCH 011/101] IDEA-50910 Add an option for debugger variables view to show a short name instead of FQN (actual class name) --- .../settings/DebuggerDataViewsConfigurable.java | 8 +++++++- .../debugger/ui/impl/watch/FieldDescriptorImpl.java | 2 +- .../ui/impl/watch/LocalVariableDescriptorImpl.java | 2 +- .../debugger/ui/impl/watch/StaticDescriptorImpl.java | 5 ++++- .../ui/impl/watch/UserExpressionDescriptorImpl.java | 8 ++++++-- .../debugger/ui/impl/watch/ValueDescriptorImpl.java | 2 +- .../debugger/ui/tree/render/ClassRenderer.java | 12 ++++++++++++ resources-en/src/messages/DebuggerBundle.properties | 1 + 8 files changed, 33 insertions(+), 7 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerDataViewsConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerDataViewsConfigurable.java index 891d2b3c9135..0cb9987c79e7 100644 --- a/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerDataViewsConfigurable.java +++ b/java/debugger/impl/src/com/intellij/debugger/settings/DebuggerDataViewsConfigurable.java @@ -48,6 +48,7 @@ public class DebuggerDataViewsConfigurable implements SearchableConfigurable { private JCheckBox myCbHideNullArrayElements; private JCheckBox myCbShowStatic; private JCheckBox myCbShowDeclaredType; + private JCheckBox myCbShowFQNames; private JCheckBox myCbShowObjectId; private StateRestoringCheckBox myCbShowStaticFinalFields; @@ -102,6 +103,7 @@ public class DebuggerDataViewsConfigurable implements SearchableConfigurable { } }); myCbShowDeclaredType = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.declared.type")); + myCbShowFQNames = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.fq.names")); myCbShowObjectId = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.object.id")); myCbEnableToString = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.enable.tostring")); @@ -149,7 +151,8 @@ public class DebuggerDataViewsConfigurable implements SearchableConfigurable { showPanel.add(myCbShowObjectId, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 0, 0, 0), 0, 0)); showPanel.add(myCbShowSyntheticFields, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0)); showPanel.add(myCbShowStatic, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 10, 0, 0), 0, 0)); - showPanel.add(myCbShowStaticFinalFields, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 10, 0, 0), 0, 0)); + showPanel.add(myCbShowStaticFinalFields, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 10, 0, 0), 0, 0)); + showPanel.add(myCbShowFQNames, new GridBagConstraints(3, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0)); panel.add(showPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 0), 0, 0)); @@ -193,6 +196,7 @@ public class DebuggerDataViewsConfigurable implements SearchableConfigurable { classRenderer.SHOW_STATIC_FINAL = myCbShowStaticFinalFields.isSelectedWhenSelectable(); classRenderer.SHOW_SYNTHETICS = myCbShowSyntheticFields.isSelected(); classRenderer.SHOW_DECLARED_TYPE = myCbShowDeclaredType.isSelected(); + classRenderer.SHOW_FQ_TYPE_NAMES = myCbShowFQNames.isSelected(); classRenderer.SHOW_OBJECT_ID = myCbShowObjectId.isSelected(); final ToStringRenderer toStringRenderer = rendererSettings.getToStringRenderer(); @@ -226,6 +230,7 @@ public class DebuggerDataViewsConfigurable implements SearchableConfigurable { myCbShowStaticFinalFields.makeUnselectable(false); } myCbShowDeclaredType.setSelected(classRenderer.SHOW_DECLARED_TYPE); + myCbShowFQNames.setSelected(classRenderer.SHOW_FQ_TYPE_NAMES); myCbShowObjectId.setSelected(classRenderer.SHOW_OBJECT_ID); final ToStringRenderer toStringRenderer = rendererSettings.getToStringRenderer(); @@ -275,6 +280,7 @@ public class DebuggerDataViewsConfigurable implements SearchableConfigurable { (classRenderer.SHOW_STATIC_FINAL != myCbShowStaticFinalFields.isSelectedWhenSelectable()) || (classRenderer.SHOW_SYNTHETICS != myCbShowSyntheticFields.isSelected()) || (classRenderer.SHOW_DECLARED_TYPE != myCbShowDeclaredType.isSelected()) || + (classRenderer.SHOW_FQ_TYPE_NAMES != myCbShowFQNames.isSelected()) || (classRenderer.SHOW_OBJECT_ID != myCbShowObjectId.isSelected()); if (isClassRendererModified) { return true; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/FieldDescriptorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/FieldDescriptorImpl.java index 12911d980dbb..ea8fabf23e1d 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/FieldDescriptorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/FieldDescriptorImpl.java @@ -158,7 +158,7 @@ public class FieldDescriptorImpl extends ValueDescriptorImpl implements FieldDes buf.append(getName()); if (classRenderer.SHOW_DECLARED_TYPE) { buf.append(": "); - buf.append(myField.typeName()); + buf.append(classRenderer.renderTypeName(myField.typeName())); } return buf.toString(); } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/LocalVariableDescriptorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/LocalVariableDescriptorImpl.java index 582c15e00181..96f0dc6ff61f 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/LocalVariableDescriptorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/LocalVariableDescriptorImpl.java @@ -121,7 +121,7 @@ public class LocalVariableDescriptorImpl extends ValueDescriptorImpl implements buf.append(getName()); if (classRenderer.SHOW_DECLARED_TYPE) { buf.append(": "); - buf.append(myTypeName); + buf.append(classRenderer.renderTypeName(myTypeName)); } return buf.toString(); } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StaticDescriptorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StaticDescriptorImpl.java index 910c5dd1e7e1..6284de46b724 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StaticDescriptorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StaticDescriptorImpl.java @@ -23,7 +23,9 @@ package com.intellij.debugger.ui.impl.watch; import com.intellij.debugger.engine.DebuggerManagerThreadImpl; import com.intellij.debugger.engine.evaluation.EvaluateException; import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; +import com.intellij.debugger.settings.NodeRendererSettings; import com.intellij.debugger.ui.tree.StaticDescriptor; +import com.intellij.debugger.ui.tree.render.ClassRenderer; import com.intellij.debugger.ui.tree.render.DescriptorLabelListener; import com.sun.jdi.Field; import com.sun.jdi.ReferenceType; @@ -64,6 +66,7 @@ public class StaticDescriptorImpl extends NodeDescriptorImpl implements StaticDe protected String calcRepresentation(EvaluationContextImpl context, DescriptorLabelListener descriptorLabelListener) throws EvaluateException { DebuggerManagerThreadImpl.assertIsManagerThread(); - return getName() + " = " + myType.name(); + final ClassRenderer classRenderer = NodeRendererSettings.getInstance().getClassRenderer(); + return getName() + " = " + classRenderer.renderTypeName(myType.name()); } } \ No newline at end of file diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/UserExpressionDescriptorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/UserExpressionDescriptorImpl.java index 7f844f067aa6..c3dbed6c7fbb 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/UserExpressionDescriptorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/UserExpressionDescriptorImpl.java @@ -27,7 +27,9 @@ import com.intellij.debugger.engine.evaluation.EvaluateExceptionUtil; import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; import com.intellij.debugger.engine.evaluation.TextWithImports; import com.intellij.debugger.impl.DebuggerUtilsEx; +import com.intellij.debugger.settings.NodeRendererSettings; import com.intellij.debugger.ui.tree.UserExpressionDescriptor; +import com.intellij.debugger.ui.tree.render.ClassRenderer; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiCodeFragment; @@ -57,8 +59,10 @@ public class UserExpressionDescriptorImpl extends EvaluationDescriptor implement try { buffer.append(getName()); buffer.append(": "); - if(getValue() != null) { - buffer.append(getValue().type().name()); + final Value value = getValue(); + if(value != null) { + final ClassRenderer classRenderer = NodeRendererSettings.getInstance().getClassRenderer(); + buffer.append(classRenderer.renderTypeName(value.type().name())); } return buffer.toString(); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/ValueDescriptorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/ValueDescriptorImpl.java index 78fea931e6c9..3694dbb7cde7 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/ValueDescriptorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/ValueDescriptorImpl.java @@ -378,7 +378,7 @@ public abstract class ValueDescriptorImpl extends NodeDescriptorImpl implements if (showConcreteType || classRenderer.SHOW_OBJECT_ID) { buf.append('{'); if (showConcreteType) { - buf.append(objRef.type().name()); + buf.append(classRenderer.renderTypeName(objRef.type().name())); } if (classRenderer.SHOW_OBJECT_ID) { buf.append('@'); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java index fcbbbc32b3dd..aecc129a7ac1 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java @@ -63,6 +63,7 @@ public class ClassRenderer extends NodeRendererImpl{ public boolean SHOW_STATIC = false; public boolean SHOW_STATIC_FINAL = false; + public boolean SHOW_FQ_TYPE_NAMES = true; public boolean SHOW_DECLARED_TYPE = false; public boolean SHOW_OBJECT_ID = true; @@ -70,6 +71,17 @@ public class ClassRenderer extends NodeRendererImpl{ myProperties.setEnabled(true); } + public final String renderTypeName(final String typeName) { + if (SHOW_FQ_TYPE_NAMES) { + return typeName; + } + final int dotIndex = typeName.lastIndexOf('.'); + if (dotIndex > 0) { + return typeName.substring(dotIndex + 1); + } + return typeName; + } + public String getUniqueId() { return UNIQUE_ID; } diff --git a/resources-en/src/messages/DebuggerBundle.properties b/resources-en/src/messages/DebuggerBundle.properties index d820b639d363..1e872a490d1e 100644 --- a/resources-en/src/messages/DebuggerBundle.properties +++ b/resources-en/src/messages/DebuggerBundle.properties @@ -181,6 +181,7 @@ label.base.renderer.configurable.hide.null.array.elements=Hide &null array eleme label.base.renderer.configurable.show.static.fields=&Static fields label.base.renderer.configurable.show.static.final.fields=Static &final fields label.base.renderer.configurable.show.declared.type=Declared &type +label.base.renderer.configurable.show.fq.names=Fully &qualified names label.base.renderer.configurable.show.object.id=Object &id label.base.renderer.configurable.alternate.view=Enable alternative view for Coll&ections classes label.base.renderer.configurable.enable.tostring=Enable 't&oString()' object view: From 11f25cfa9e8218d6151bc98c004946a257831836 Mon Sep 17 00:00:00 2001 From: "kirill.safonov" Date: Wed, 14 Dec 2011 15:46:01 +0400 Subject: [PATCH 012/101] slashes --- .../src/com/intellij/openapi/project/impl/ProjectImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java index ee891a1f25d3..8d3c6c24b150 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java @@ -527,7 +527,7 @@ public class ProjectImpl extends ComponentManagerImpl implements ProjectEx { myFileNames = ContainerUtil.map(readOnlyFiles, new Function() { @Override public String fun(VirtualFile file) { - return file.getPath(); + return file.getPresentableUrl(); } }, new String[readOnlyFiles.length]); } From 591c28215d3b55d5527702523bb8beef34b8622a Mon Sep 17 00:00:00 2001 From: "kirill.safonov" Date: Thu, 15 Dec 2011 20:41:37 +0400 Subject: [PATCH 013/101] cosmetics --- .../platform-resources-en/src/messages/IdeBundle.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index 2ab0524071ab..b566ce38f0bb 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -499,11 +499,11 @@ error.list.of.plugins.was.not.loaded=List of plugins was not loaded: {0} action.download.and.install.plugin=Download and Install action.update.plugin=Update Plugin error.plugin.download.failed=Plugin download failed -prompt.download.and.install.plugin=Would you like to download and install plugin \"{0}\"? -prompt.update.plugin=Would you like to update plugin \"{0}\"? +prompt.download.and.install.plugin=Would you like to download and install plugin ''{0}''? +prompt.update.plugin=Would you like to update plugin ''{0}''? prompt.install.several.plugins=Install or update {0} plugins ? action.uninstall.plugin=Uninstall -prompt.uninstall.plugin=Do you really want to uninstall plugin \"{0}\"? +prompt.uninstall.plugin=Do you really want to uninstall plugin ''{0}''? prompt.uninstall.several.plugins=Do you really want to uninstall these {0} plugins ? title.plugin.uninstall=Plugin Uninstall progress.downloading.list.of.plugins=Downloading List of Plugins From e399b113d69727f711ce337a4e95c871c736e935 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 15 Dec 2011 19:46:23 +0100 Subject: [PATCH 014/101] live template contributor shouldn't interfere with the 'unimported classes when nothing found' logic --- .../completion/JavaAutoPopupTest.groovy | 15 +++++++++++++++ plugins/groovy/src/META-INF/plugin.xml | 2 +- resources/src/META-INF/IdeaPlugin.xml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy index d90497451c25..2c4f96beb193 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy @@ -640,6 +640,21 @@ public interface Test { assert !lookup } + public void testTemplatesWithNonImportedClasses() { + CodeInsightSettings.instance.COMPLETION_CASE_SENSITIVE = CodeInsightSettings.NONE + myFixture.addClass("package foo.bar; public class LayoutStore {}") + try { + myFixture.configureByText 'a.java', 'class Foo {{ foo() }}' + type 'lst' + assert lookup + assert 'lst' in myFixture.lookupElementStrings + assert 'LayoutStore' in myFixture.lookupElementStrings + } + finally { + CodeInsightSettings.instance.COMPLETION_CASE_SENSITIVE = CodeInsightSettings.FIRST_LETTER + } + } + public void testTemplateSelectionByComma() { myFixture.configureByText("a.java", """ class Foo { diff --git a/plugins/groovy/src/META-INF/plugin.xml b/plugins/groovy/src/META-INF/plugin.xml index a51cfa089efb..0bf08464e550 100644 --- a/plugins/groovy/src/META-INF/plugin.xml +++ b/plugins/groovy/src/META-INF/plugin.xml @@ -233,7 +233,7 @@ implementationClass="org.jetbrains.plugins.groovy.codeInsight.GroovyLineMarkerProvider"/> - + + order="first, before javaMemberName, after liveTemplates"/> Date: Thu, 15 Dec 2011 19:52:50 +0100 Subject: [PATCH 015/101] @Nullable, sorry --- .../com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java index bb81999c963e..cda043cd5d9b 100644 --- a/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java +++ b/xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java @@ -45,7 +45,7 @@ public class XmlElementDescriptorImpl implements XmlElementDescriptor, PsiWritab @NonNls private static final String ELEMENT_FORM_DEFAULT = "elementFormDefault"; - public XmlElementDescriptorImpl(@NotNull XmlTag descriptorTag) { + public XmlElementDescriptorImpl(@Nullable XmlTag descriptorTag) { myDescriptorTag = descriptorTag; } From f9af2b2245832bac8e85716466ded7ed597c53fa Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 15 Dec 2011 16:00:06 +0100 Subject: [PATCH 016/101] move instance member (IDEA-78519) --- .../MoveInstanceMethodProcessor.java | 3 +-- .../moveInstanceMethod/OverloadingMethods.java | 18 ++++++++++++++++++ .../OverloadingMethods.java.after | 18 ++++++++++++++++++ .../moveMethod/MoveInstanceMethodTest.java | 2 ++ 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 java/java-tests/testData/refactoring/moveInstanceMethod/OverloadingMethods.java create mode 100644 java/java-tests/testData/refactoring/moveInstanceMethod/OverloadingMethods.java.after diff --git a/java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodProcessor.java b/java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodProcessor.java index 6f634bbd9a7e..8e03e5b5976c 100644 --- a/java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodProcessor.java @@ -248,7 +248,7 @@ public class MoveInstanceMethodProcessor extends BaseRefactoringProcessor{ if (!methodExpression.isReferenceTo(myMethod)) return; final PsiExpression oldQualifier = methodExpression.getQualifierExpression(); PsiExpression newQualifier = null; - + final PsiClass classReferencedByThis = MoveInstanceMembersUtil.getClassReferencedByThis(methodExpression); if (myTargetVariable instanceof PsiParameter) { final int index = myMethod.getParameterList().getParameterIndex((PsiParameter)myTargetVariable); final PsiExpression[] arguments = expression.getArgumentList().getExpressions(); @@ -264,7 +264,6 @@ public class MoveInstanceMethodProcessor extends BaseRefactoringProcessor{ PsiExpression newArgument = null; - final PsiClass classReferencedByThis = MoveInstanceMembersUtil.getClassReferencedByThis(methodExpression); if (classReferencedByThis != null) { @NonNls String thisArgumentText = null; if (manager.areElementsEquivalent(myMethod.getContainingClass(), classReferencedByThis)) { diff --git a/java/java-tests/testData/refactoring/moveInstanceMethod/OverloadingMethods.java b/java/java-tests/testData/refactoring/moveInstanceMethod/OverloadingMethods.java new file mode 100644 index 000000000000..08cbe7b33c54 --- /dev/null +++ b/java/java-tests/testData/refactoring/moveInstanceMethod/OverloadingMethods.java @@ -0,0 +1,18 @@ +public class A { + + public void m(B b){ + System.out.println(this); + } + + public void show(B b){ + m(b); + } + + public void m (C c){ + System.out.println(this); + } + +} + +class B{} +class C{} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/moveInstanceMethod/OverloadingMethods.java.after b/java/java-tests/testData/refactoring/moveInstanceMethod/OverloadingMethods.java.after new file mode 100644 index 000000000000..f5aea34bd983 --- /dev/null +++ b/java/java-tests/testData/refactoring/moveInstanceMethod/OverloadingMethods.java.after @@ -0,0 +1,18 @@ +public class A { + + public void show(B b){ + b.m(this); + } + + public void m (C c){ + System.out.println(this); + } + +} + +class B{ + public void m(A a){ + System.out.println(a); + } +} +class C{} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/refactoring/moveMethod/MoveInstanceMethodTest.java b/java/java-tests/testSrc/com/intellij/refactoring/moveMethod/MoveInstanceMethodTest.java index 13a7f43f6095..b30e8798151f 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/moveMethod/MoveInstanceMethodTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/moveMethod/MoveInstanceMethodTest.java @@ -51,6 +51,8 @@ public class MoveInstanceMethodTest extends LightRefactoringTestCase { public void testThisInAnonymous() throws Exception { doTest(true, 0); } + public void testOverloadingMethods() throws Exception { doTest(true, 0); } + public void testEscalateVisibility() throws Exception { doTest(true, 0, VisibilityUtil.ESCALATE_VISIBILITY); } From e7ca3e043e27fc56fbdd7c4488111caafd872869 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 15 Dec 2011 16:41:46 +0100 Subject: [PATCH 017/101] move class to the correct package fix: suggest to choose root when multiple exist (IDEA-12474) --- .../src/com/intellij/codeInspection/MoveToPackageFix.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInspection/MoveToPackageFix.java b/java/java-impl/src/com/intellij/codeInspection/MoveToPackageFix.java index 62ecce517a1c..ae00ea8e45e3 100644 --- a/java/java-impl/src/com/intellij/codeInspection/MoveToPackageFix.java +++ b/java/java-impl/src/com/intellij/codeInspection/MoveToPackageFix.java @@ -18,21 +18,16 @@ package com.intellij.codeInspection; import com.intellij.CommonBundle; import com.intellij.codeInsight.CodeInsightUtilBase; import com.intellij.codeInsight.daemon.QuickFixBundle; -import com.intellij.ide.util.PackageUtil; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; -import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.ui.Messages; -import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; import com.intellij.refactoring.PackageWrapper; -import com.intellij.refactoring.move.moveClassesOrPackages.AutocreatingSingleSourceRootMoveDestination; import com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesProcessor; import com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesUtil; import com.intellij.refactoring.move.moveClassesOrPackages.SingleSourceRootMoveDestination; import com.intellij.refactoring.util.RefactoringMessageUtil; -import com.intellij.refactoring.util.RefactoringUtil; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; @@ -79,7 +74,7 @@ public class MoveToPackageFix implements LocalQuickFix { private void chooseDirectoryAndMove(Project project, PsiFile myFile) { try { - PsiDirectory directory = MoveClassesOrPackagesUtil.chooseDestinationPackage(project, myTargetPackage, null); + PsiDirectory directory = MoveClassesOrPackagesUtil.chooseDestinationPackage(project, myTargetPackage, myFile.getContainingDirectory()); if (directory == null) { return; From 5e78fc69bcc93f35dc7851e6cedeed624e405941 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 15 Dec 2011 17:24:18 +0100 Subject: [PATCH 018/101] generate delegate: allow to choose available containing class members (IDEA-73331) --- .../generation/GenerateDelegateHandler.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java index c5a800c9de6a..06a1c85a69ad 100644 --- a/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/generation/GenerateDelegateHandler.java @@ -322,16 +322,26 @@ public class GenerateDelegateHandler implements LanguageCodeInsightActionHandler int offset = editor.getCaretModel().getOffset(); PsiElement element = file.findElementAt(offset); if (element == null) return null; - final PsiClass aClass = PsiTreeUtil.getParentOfType(element, PsiClass.class); + PsiClass aClass = PsiTreeUtil.getParentOfType(element, PsiClass.class); if (aClass == null) return null; List result = new ArrayList(); + while (aClass != null) { + collectTargetsInClass(element, aClass, result); + if (aClass.hasModifierProperty(PsiModifier.STATIC)) break; + aClass = PsiTreeUtil.getParentOfType(aClass, PsiClass.class, true); + } + + return result.toArray(new PsiElementClassMember[result.size()]); + } + + private static void collectTargetsInClass(PsiElement element, final PsiClass aClass, List result) { final PsiField[] fields = aClass.getAllFields(); PsiResolveHelper helper = JavaPsiFacade.getInstance(aClass.getProject()).getResolveHelper(); for (PsiField field : fields) { final PsiType type = field.getType(); - if (helper.isAccessible(field, aClass, aClass) && type instanceof PsiClassType) { + if (helper.isAccessible(field, aClass, aClass) && type instanceof PsiClassType && !PsiTreeUtil.isAncestor(field, element, false)) { result.add(new PsiFieldMember(field)); } } @@ -341,7 +351,7 @@ public class GenerateDelegateHandler implements LanguageCodeInsightActionHandler if (CommonClassNames.JAVA_LANG_OBJECT.equals(method.getContainingClass().getQualifiedName())) continue; final PsiType returnType = method.getReturnType(); if (returnType != null && PropertyUtil.isSimplePropertyGetter(method) && helper.isAccessible(method, aClass, aClass) && - returnType instanceof PsiClassType) { + returnType instanceof PsiClassType && !PsiTreeUtil.isAncestor(method, element, false)) { result.add(new PsiMethodMember(method)); } } @@ -373,8 +383,5 @@ public class GenerateDelegateHandler implements LanguageCodeInsightActionHandler } } } - - return result.toArray(new PsiElementClassMember[result.size()]); } - } From 52e77034d241f186d8ff8de4f8589fb089374802 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 15 Dec 2011 18:03:31 +0100 Subject: [PATCH 019/101] inline: show number of usages to be inlined when possible (IDEA-73024 ) --- .../refactoring/inline/InlineFieldDialog.java | 8 +++++--- .../inline/InlineMethodDialog.java | 19 ++----------------- .../inline/InlineOptionsDialog.java | 17 ++++++++++++++++- .../rename/inplace/MemberInplaceRenamer.java | 3 +++ .../inplace/VariableInplaceRenamer.java | 8 ++++++++ 5 files changed, 34 insertions(+), 21 deletions(-) diff --git a/java/java-impl/src/com/intellij/refactoring/inline/InlineFieldDialog.java b/java/java-impl/src/com/intellij/refactoring/inline/InlineFieldDialog.java index 4dbbfedebb87..602460f923e5 100644 --- a/java/java-impl/src/com/intellij/refactoring/inline/InlineFieldDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/inline/InlineFieldDialog.java @@ -22,14 +22,15 @@ import com.intellij.psi.PsiReferenceExpression; import com.intellij.psi.PsiSubstitutor; import com.intellij.psi.util.PsiFormatUtil; import com.intellij.refactoring.HelpID; -import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.JavaRefactoringSettings; +import com.intellij.refactoring.RefactoringBundle; public class InlineFieldDialog extends InlineOptionsDialog { public static final String REFACTORING_NAME = RefactoringBundle.message("inline.field.title"); private final PsiReferenceExpression myReferenceExpression; private final PsiField myField; + protected final int myOccurrencesNumber; public InlineFieldDialog(Project project, PsiField field, PsiReferenceExpression ref) { super(project, true, field); @@ -38,7 +39,7 @@ public class InlineFieldDialog extends InlineOptionsDialog { myInvokedOnReference = myReferenceExpression != null; setTitle(REFACTORING_NAME); - + myOccurrencesNumber = initOccurrencesNumber(myField); init(); } @@ -56,7 +57,8 @@ public class InlineFieldDialog extends InlineOptionsDialog { } protected String getInlineAllText() { - return RefactoringBundle.message("all.references.and.remove.the.field"); + final String occurrencesString = myOccurrencesNumber > -1 ? " (" + myOccurrencesNumber + " occurrence" + (myOccurrencesNumber == 1 ? ")" : "s)") : ""; + return RefactoringBundle.message("all.references.and.remove.the.field") + occurrencesString; } protected boolean isInlineThis() { diff --git a/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodDialog.java b/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodDialog.java index 27659f109f87..d93e87f84ac3 100644 --- a/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodDialog.java @@ -17,18 +17,14 @@ package com.intellij.refactoring.inline; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.help.HelpManager; -import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiJavaCodeReferenceElement; import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiSubstitutor; -import com.intellij.psi.search.GlobalSearchScope; -import com.intellij.psi.search.PsiSearchHelper; -import com.intellij.psi.search.searches.ReferencesSearch; import com.intellij.psi.util.PsiFormatUtil; import com.intellij.refactoring.HelpID; -import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.JavaRefactoringSettings; +import com.intellij.refactoring.RefactoringBundle; public class InlineMethodDialog extends InlineOptionsDialog { public static final String REFACTORING_NAME = RefactoringBundle.message("inline.method.title"); @@ -50,21 +46,10 @@ public class InlineMethodDialog extends InlineOptionsDialog { myInvokedOnReference = ref != null; setTitle(REFACTORING_NAME); - initOccurrencesNumber(method); + myOccurrencesNumber = initOccurrencesNumber(method); init(); } - private void initOccurrencesNumber(PsiMethod method) { - final ProgressManager progressManager = ProgressManager.getInstance(); - final PsiSearchHelper searchHelper = PsiSearchHelper.SERVICE.getInstance(method.getProject()); - final GlobalSearchScope scope = GlobalSearchScope.projectScope(method.getProject()); - final boolean isCheapToSearch = - searchHelper.isCheapEnoughToSearch(method.getName(), scope, null, progressManager.getProgressIndicator()) != PsiSearchHelper.SearchCostResult.TOO_MANY_OCCURRENCES; - if (isCheapToSearch) { - myOccurrencesNumber = ReferencesSearch.search(method).findAll().size(); - } - } - protected String getNameLabelText() { String methodText = PsiFormatUtil.formatMethod(myMethod, PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME | PsiFormatUtil.SHOW_PARAMETERS, PsiFormatUtil.SHOW_TYPE); diff --git a/platform/lang-impl/src/com/intellij/refactoring/inline/InlineOptionsDialog.java b/platform/lang-impl/src/com/intellij/refactoring/inline/InlineOptionsDialog.java index 776e506081e0..01d4b942be79 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/inline/InlineOptionsDialog.java +++ b/platform/lang-impl/src/com/intellij/refactoring/inline/InlineOptionsDialog.java @@ -16,11 +16,15 @@ package com.intellij.refactoring.inline; +import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiNameIdentifierOwner; +import com.intellij.psi.search.GlobalSearchScope; +import com.intellij.psi.search.PsiSearchHelper; +import com.intellij.psi.search.searches.ReferencesSearch; import com.intellij.refactoring.ui.RefactoringDialog; import com.intellij.refactoring.util.RadioUpDownListener; -import com.intellij.ui.IdeBorderFactory; import javax.swing.*; import javax.swing.border.EmptyBorder; @@ -117,4 +121,15 @@ public abstract class InlineOptionsDialog extends RefactoringDialog implements I public JComponent getPreferredFocusedComponent() { return myRbInlineThisOnly.isSelected() ? myRbInlineThisOnly : myRbInlineAll; } + + protected static int initOccurrencesNumber(PsiNameIdentifierOwner nameIdentifierOwner) { + final ProgressManager progressManager = ProgressManager.getInstance(); + final PsiSearchHelper searchHelper = PsiSearchHelper.SERVICE.getInstance(nameIdentifierOwner.getProject()); + final GlobalSearchScope scope = GlobalSearchScope.projectScope(nameIdentifierOwner.getProject()); + final String name = nameIdentifierOwner.getName(); + final boolean isCheapToSearch = + name != null && searchHelper.isCheapEnoughToSearch(name, scope, null, progressManager.getProgressIndicator()) != PsiSearchHelper.SearchCostResult.TOO_MANY_OCCURRENCES; + return isCheapToSearch ? ReferencesSearch.search(nameIdentifierOwner).findAll().size() : - 1; + } + } diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/MemberInplaceRenamer.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/MemberInplaceRenamer.java index 95e58024e488..97e5dea66d97 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/MemberInplaceRenamer.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/MemberInplaceRenamer.java @@ -209,6 +209,9 @@ public class MemberInplaceRenamer extends VariableInplaceRenamer { } finally { FinishMarkAction.finish(myProject, myEditor, markAction); + if (myBeforeRevert != null) { + myEditor.getCaretModel().moveToOffset(myBeforeRevert.getEndOffset()); + } } } diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java index 0fb1a7c312a4..8425a19963d4 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java @@ -116,6 +116,7 @@ public class VariableInplaceRenamer { private RangeMarker myRenameOffset; private String myInitialName; protected final String myOldName; + protected RangeMarker myBeforeRevert = null; public void setAdvertisementText(String advertisementText) { myAdvertisementText = advertisementText; @@ -347,6 +348,10 @@ public class VariableInplaceRenamer { }); } } + myBeforeRevert = myRenameOffset != null ? myEditor.getDocument().createRangeMarker(myRenameOffset.getStartOffset(), myEditor.getCaretModel().getOffset()) : null; + if (myBeforeRevert != null) { + myBeforeRevert.setGreedyToRight(true); + } restoreStateBeforeTemplateIsFinished(); } @@ -361,6 +366,9 @@ public class VariableInplaceRenamer { final Runnable runnable = new Runnable() { public void run() { performRefactoringRename(myNewName, context, markAction); + if (myBeforeRevert != null) { + myBeforeRevert.dispose(); + } } }; if (ApplicationManager.getApplication().isUnitTestMode()){ From 44ecd52b978cad545820a1d309f3cd4520c9eb0a Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 15 Dec 2011 19:13:08 +0100 Subject: [PATCH 020/101] change variable type from assignment: change method signature when variable is a parameter (IDEA-71674) --- .../daemon/impl/quickfix/VariableTypeFix.java | 45 +++++++++++++++++++ .../quickFix/variableType/after5.java | 12 +++++ .../quickFix/variableType/before5.java | 12 +++++ 3 files changed, 69 insertions(+) create mode 100644 java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/variableType/after5.java create mode 100644 java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/variableType/before5.java diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/VariableTypeFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/VariableTypeFix.java index 3d52a5766fc8..c3d5651536aa 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/VariableTypeFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/VariableTypeFix.java @@ -18,6 +18,8 @@ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.CodeInsightUtilBase; import com.intellij.codeInsight.daemon.QuickFixBundle; import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement; +import com.intellij.ide.util.SuperMethodWarningUtil; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.undo.UndoUtil; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; @@ -25,10 +27,16 @@ import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.codeStyle.JavaCodeStyleManager; import com.intellij.psi.util.TypeConversionUtil; +import com.intellij.refactoring.RefactoringBundle; +import com.intellij.refactoring.changeSignature.ChangeSignatureProcessor; +import com.intellij.refactoring.changeSignature.JavaChangeSignatureDialog; +import com.intellij.refactoring.changeSignature.ParameterInfoImpl; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; + public class VariableTypeFix extends LocalQuickFixAndIntentionActionOnPsiElement { static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.quickfix.VariableTypeFix"); @@ -76,6 +84,7 @@ public class VariableTypeFix extends LocalQuickFixAndIntentionActionOnPsiElement @NotNull PsiElement startElement, @NotNull PsiElement endElement) { final PsiVariable myVariable = (PsiVariable)startElement; + if (changeMethodSignatureIfNeeded(myVariable)) return; if (!CodeInsightUtilBase.prepareFileForWrite(myVariable.getContainingFile())) return; try { myVariable.normalizeDeclaration(); @@ -88,6 +97,42 @@ public class VariableTypeFix extends LocalQuickFixAndIntentionActionOnPsiElement } } + private boolean changeMethodSignatureIfNeeded(PsiVariable myVariable) { + if (myVariable instanceof PsiParameter) { + final PsiElement scope = ((PsiParameter)myVariable).getDeclarationScope(); + if (scope instanceof PsiMethod) { + final PsiMethod method = (PsiMethod)scope; + final PsiMethod psiMethod = SuperMethodWarningUtil.checkSuperMethod(method, RefactoringBundle.message("to.refactor")); + if (psiMethod == null) return true; + final int parameterIndex = method.getParameterList().getParameterIndex((PsiParameter)myVariable); + if (!CodeInsightUtilBase.prepareFileForWrite(psiMethod.getContainingFile())) return true; + final ArrayList infos = new ArrayList(); + int i = 0; + for (PsiParameter parameter : psiMethod.getParameterList().getParameters()) { + final boolean changeType = i == parameterIndex; + infos.add(new ParameterInfoImpl(i++, parameter.getName(), changeType ? getReturnType() : parameter.getType())); + } + + if (!ApplicationManager.getApplication().isUnitTestMode()) { + final JavaChangeSignatureDialog dialog = new JavaChangeSignatureDialog(psiMethod.getProject(), psiMethod, false, myVariable); + dialog.setParameterInfos(infos); + dialog.show(); + } + else { + ChangeSignatureProcessor processor = new ChangeSignatureProcessor(psiMethod.getProject(), + psiMethod, + false, null, + psiMethod.getName(), + psiMethod.getReturnType(), + infos.toArray(new ParameterInfoImpl[infos.size()])); + processor.run(); + } + return true; + } + } + return false; + } + protected PsiType getReturnType() { return myReturnType; } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/variableType/after5.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/variableType/after5.java new file mode 100644 index 000000000000..6a7f841ed917 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/variableType/after5.java @@ -0,0 +1,12 @@ +// "Change 'i' type to 'java.lang.String'" "true" + +class Base { + void foo(String i) {} +} + +class Ex extends Base { + @Override + void foo(String i) { + i = "abc"; // when I invoke "Change type of 'i' to 'String'", base method is ignored so method overriding is lost + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/variableType/before5.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/variableType/before5.java new file mode 100644 index 000000000000..7ead73836998 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/variableType/before5.java @@ -0,0 +1,12 @@ +// "Change 'i' type to 'java.lang.String'" "true" + +class Base { + void foo(int i) {} +} + +class Ex extends Base { + @Override + void foo(int i) { + i = "abc"; // when I invoke "Change type of 'i' to 'String'", base method is ignored so method overriding is lost + } +} \ No newline at end of file From c8c3007e4a61e56d0527f5c9fdc505060bb9a17f Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 16 Dec 2011 09:35:27 +0100 Subject: [PATCH 021/101] inplace introduce constant: do not search for occurrences out of dedicated class (IDEA-78977) --- .../AbstractInplaceIntroduceFieldPopup.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java/java-impl/src/com/intellij/refactoring/introduceField/AbstractInplaceIntroduceFieldPopup.java b/java/java-impl/src/com/intellij/refactoring/introduceField/AbstractInplaceIntroduceFieldPopup.java index 861f87ed728d..ffcd01b778a9 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceField/AbstractInplaceIntroduceFieldPopup.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceField/AbstractInplaceIntroduceFieldPopup.java @@ -18,7 +18,10 @@ package com.intellij.refactoring.introduceField; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.RangeMarker; import com.intellij.openapi.project.Project; +import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; +import com.intellij.psi.search.LocalSearchScope; +import com.intellij.psi.search.SearchScope; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.refactoring.introduceParameter.AbstractJavaInplaceIntroducer; import com.intellij.refactoring.ui.TypeSelectorManagerImpl; @@ -73,6 +76,11 @@ public abstract class AbstractInplaceIntroduceFieldPopup extends AbstractJavaInp return myParentClass; } + @Override + protected SearchScope getReferencesSearchScope(VirtualFile file) { + return new LocalSearchScope(myParentClass); + } + protected PsiElement getAnchorElement() { if (myAnchorIdx != -1 && myOccurrences[myAnchorIdx] != null) { return myOccurrences[myAnchorIdx].getParent(); From d2bab883bd942548196cbb3ffb91f6dd7e7a517c Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 16 Dec 2011 10:01:03 +0100 Subject: [PATCH 022/101] inline method: do not check for inaccessibility if referenced member would be also inlined (IDEA-78941 ) --- .../inline/InlineMethodProcessor.java | 14 +++++++---- ...AnonymousClassWithPrivateMethodInside.java | 24 +++++++++++++++++++ ...ousClassWithPrivateMethodInside.java.after | 21 ++++++++++++++++ .../refactoring/inline/InlineMethodTest.java | 4 ++++ 4 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 java/java-tests/testData/refactoring/inlineMethod/InlineAnonymousClassWithPrivateMethodInside.java create mode 100644 java/java-tests/testData/refactoring/inlineMethod/InlineAnonymousClassWithPrivateMethodInside.java.after diff --git a/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java b/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java index f2edca2b343b..bdb8eed838cb 100644 --- a/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java +++ b/java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java @@ -195,7 +195,7 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor { final ReferencedElementsCollector collector, final MultiMap conflicts) { element.accept(collector); - final Map> containersToReferenced = getInaccessible(collector.myReferencedMembers, usages); + final Map> containersToReferenced = getInaccessible(collector.myReferencedMembers, usages, element); final Set containers = containersToReferenced.keySet(); for (PsiMember container : containers) { @@ -216,12 +216,17 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor { * * @param referencedElements * @param usages + * @param elementToInline */ - private static Map> getInaccessible(HashSet referencedElements, UsageInfo[] usages) { + private static Map> getInaccessible(HashSet referencedElements, + UsageInfo[] usages, + PsiElement elementToInline) { Map> result = new HashMap>(); for (UsageInfo usage : usages) { - final PsiElement container = ConflictsUtil.getContainer(usage.getElement()); + final PsiElement usageElement = usage.getElement(); + if (usageElement == null) continue; + final PsiElement container = ConflictsUtil.getContainer(usageElement); if (!(container instanceof PsiMember)) continue; // usage in import statement PsiMember memberContainer = (PsiMember)container; Set inaccessibleReferenced = result.get(memberContainer); @@ -229,7 +234,8 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor { inaccessibleReferenced = new HashSet(); result.put(memberContainer, inaccessibleReferenced); for (PsiMember member : referencedElements) { - if (!PsiUtil.isAccessible(member, usage.getElement(), null)) { + if (PsiTreeUtil.isAncestor(elementToInline, member, false)) continue; + if (!PsiUtil.isAccessible(member, usageElement, null)) { inaccessibleReferenced.add(member); } } diff --git a/java/java-tests/testData/refactoring/inlineMethod/InlineAnonymousClassWithPrivateMethodInside.java b/java/java-tests/testData/refactoring/inlineMethod/InlineAnonymousClassWithPrivateMethodInside.java new file mode 100644 index 000000000000..ec4b84b0fde7 --- /dev/null +++ b/java/java-tests/testData/refactoring/inlineMethod/InlineAnonymousClassWithPrivateMethodInside.java @@ -0,0 +1,24 @@ +public class Foo { + public static void foo() { + bar(new Runnable() { + @Override + public void run() { + doRun(); + } + + private void doRun() { + // Woo-hoo + } + }); + } + + public static void bar(final Runnable runnable) { + runnable.run(); + } +} + +class Bar { + public static void main(String[] args) { + Foo.foo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/inlineMethod/InlineAnonymousClassWithPrivateMethodInside.java.after b/java/java-tests/testData/refactoring/inlineMethod/InlineAnonymousClassWithPrivateMethodInside.java.after new file mode 100644 index 000000000000..603055eee088 --- /dev/null +++ b/java/java-tests/testData/refactoring/inlineMethod/InlineAnonymousClassWithPrivateMethodInside.java.after @@ -0,0 +1,21 @@ +public class Foo { + + public static void bar(final Runnable runnable) { + runnable.run(); + } +} + +class Bar { + public static void main(String[] args) { + Foo.bar(new Runnable() { + @Override + public void run() { + doRun(); + } + + private void doRun() { + // Woo-hoo + } + }); + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineMethodTest.java b/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineMethodTest.java index 94e550fd0c74..c3efbc9ec3ee 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineMethodTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/inline/InlineMethodTest.java @@ -170,6 +170,10 @@ public class InlineMethodTest extends LightRefactoringTestCase { public void testSuperMethodInAnonymousClass() throws Exception { doTest(); } + + public void testInlineAnonymousClassWithPrivateMethodInside() throws Exception { + doTest(); + } private void doTest() throws Exception { String name = getTestName(false); From cae80acfb82b27923a48d5db7cba70d7bdf301c5 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 15 Dec 2011 15:58:50 +0400 Subject: [PATCH 023/101] force commit in modal dialogs to run deamon --- .../daemon/impl/DaemonCodeAnalyzerImpl.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java index 08e2b90a61c7..0f67da0a5728 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java @@ -31,6 +31,7 @@ import com.intellij.ide.PowerSaveMode; import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; @@ -695,10 +696,16 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx // we'll restart when write action finish return; } - if (PsiDocumentManager.getInstance(myProject).hasUncommitedDocuments()) { - ((PsiDocumentManagerImpl)PsiDocumentManager.getInstance(myProject)).cancelAndRunWhenAllCommitted( - "restart daemon when all committed", this); - return; + PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject); + if (documentManager.hasUncommitedDocuments()) { + if (ModalityState.current() == ModalityState.NON_MODAL) { + ((PsiDocumentManagerImpl)documentManager).cancelAndRunWhenAllCommitted("restart daemon when all committed", this); + return; + } + else { + // when modal dialog is open, DocumentCommitThread is not able to commit in background, so force commit here + documentManager.commitAllDocuments(); + } } Map passes = new THashMap(activeEditors.size()); From ecadd0ec2bc5716f9c0602f4bd1ee7660b275c26 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 15 Dec 2011 16:29:18 +0400 Subject: [PATCH 024/101] EA-32575 - assert: Alarm._addRequest --- .../src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java index 278ec7b62771..2979a78099c6 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java @@ -319,7 +319,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { } }); } - if (progress != null) { + if (progress != null && progress.isRunning()) { double fraction = (double)counter.incrementAndGet() / size; progress.setFraction(fraction); } From a65480a41eb61caf576b7a3bd35ea57d3df75e09 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 16 Dec 2011 13:09:22 +0400 Subject: [PATCH 025/101] project already disposed --- .../openapi/vcs/changes/CallbackData.java | 40 ++++++++++++------- .../vcs/changes/UpdateRequestsQueue.java | 24 +++++------ 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/CallbackData.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/CallbackData.java index 89b8f4ceb682..8ad034cfee1b 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/CallbackData.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/CallbackData.java @@ -44,8 +44,8 @@ class CallbackData { return myWrapperStarter; } - public static CallbackData create(final Runnable afterUpdate, final String title, final ModalityState state, - final InvokeAfterUpdateMode mode, final Project project) { + public static CallbackData create(@NotNull final Runnable afterUpdate, final String title, final ModalityState state, + final InvokeAfterUpdateMode mode, @NotNull final Project project) { if (mode.isSilently()) { return new CallbackData(new Runnable() { public void run() { @@ -58,15 +58,22 @@ class CallbackData { ChangesViewManager.getInstance(project).scheduleRefresh(); } }); - } else { - ApplicationManager.getApplication().executeOnPooledThread(afterUpdate); + } + else { + ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { + @Override + public void run() { + if (!project.isDisposed()) afterUpdate.run(); + } + }); } } }, null); - } else { + } + else { if (mode.isSynchronous()) { final Waiter waiter = new Waiter(project, afterUpdate, state, - VcsBundle.message("change.list.manager.wait.lists.synchronization", title), mode.isCancellable()); + VcsBundle.message("change.list.manager.wait.lists.synchronization", title), mode.isCancellable()); return new CallbackData( new Runnable() { public void run() { @@ -74,13 +81,15 @@ class CallbackData { waiter.done(); } }, new Runnable() { - public void run() { - ProgressManager.getInstance().run(waiter); - } + public void run() { + ProgressManager.getInstance().run(waiter); } + } ); - } else { - final FictiveBackgroundable fictiveBackgroundable = new FictiveBackgroundable(project, afterUpdate, mode.isCancellable(), title, state); + } + else { + final FictiveBackgroundable fictiveBackgroundable = + new FictiveBackgroundable(project, afterUpdate, mode.isCancellable(), title, state); return new CallbackData( new Runnable() { public void run() { @@ -88,10 +97,11 @@ class CallbackData { fictiveBackgroundable.done(); } }, new Runnable() { - public void run() { - ProgressManager.getInstance().run(fictiveBackgroundable); - } - }); + public void run() { + ProgressManager.getInstance().run(fictiveBackgroundable); + } + } + ); } } } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java index efcc5377532f..9d146c6626f8 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java @@ -16,7 +16,6 @@ package com.intellij.openapi.vcs.changes; import com.intellij.ide.startup.impl.StartupManagerImpl; -import com.intellij.lifecycle.AtomicSectionsAware; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.diagnostic.Logger; @@ -27,7 +26,6 @@ import com.intellij.openapi.util.Getter; import com.intellij.openapi.vcs.ProjectLevelVcsManager; import com.intellij.util.Consumer; import com.intellij.util.io.storage.HeavyProcessLatch; -import org.jetbrains.annotations.NonNls; import javax.swing.*; import java.util.ArrayList; @@ -43,7 +41,7 @@ import java.util.concurrent.TimeUnit; @SomeQueue public class UpdateRequestsQueue { private final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.changes.UpdateRequestsQueue"); - private final static String ourHeavyLatchOptimization = "vcs.local.changes.track.heavy.latch"; + private static final String ourHeavyLatchOptimization = "vcs.local.changes.track.heavy.latch"; private final Project myProject; private final ScheduledExecutorService myExecutor; private final Runnable myDelegate; @@ -57,9 +55,8 @@ public class UpdateRequestsQueue { private final ProjectLevelVcsManager myPlVcsManager; //private final ScheduledSlowlyClosingAlarm mySharedExecutor; private final StartupManager myStartupManager; - @NonNls public static final String LOCAL_CHANGES_UPDATE = "Local changes update"; private final boolean myTrackHeavyLatch; - private Getter myIsStoppedGetter; + private final Getter myIsStoppedGetter; public UpdateRequestsQueue(final Project project, final ScheduledExecutorService executor, final Runnable delegate) { myProject = project; @@ -165,15 +162,16 @@ public class UpdateRequestsQueue { LOG.debug("invokeAfterUpdate: stopped, invoke right now for project: " + myProject.getName()); SwingUtilities.invokeLater(new Runnable() { public void run() { - afterUpdate.run(); + if (!myProject.isDisposed()) { + afterUpdate.run(); + } } }); return; - } else { - // invoke progress if needed - if (data.getWrapperStarter() != null) { - data.getWrapperStarter().run(); - } + } + // invoke progress if needed + if (data.getWrapperStarter() != null) { + data.getWrapperStarter().run(); } LOG.debug("invokeAfterUpdate: exit for project: " + myProject.getName()); } @@ -186,7 +184,7 @@ public class UpdateRequestsQueue { // true = do not execute private boolean checkLifeCycle() { - return (! myStarted) || (! ((StartupManagerImpl) myStartupManager).startupActivityPassed()); + return !myStarted || !((StartupManagerImpl)myStartupManager).startupActivityPassed(); } private class MyRunnable implements Runnable { @@ -223,7 +221,7 @@ public class UpdateRequestsQueue { myWaitingUpdateCompletionQueue.removeAll(copy); } - if ((! myWaitingUpdateCompletionQueue.isEmpty()) && (! myRequestSubmitted)) { + if (! myWaitingUpdateCompletionQueue.isEmpty() && ! myRequestSubmitted) { LOG.error("No update task to handle request(s)"); } } From 5f185df3bae51a0ce0296c657f3e21acb818adb7 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 16 Dec 2011 13:13:18 +0400 Subject: [PATCH 026/101] catch more exceptions --- .../testFramework/PlatformTestCase.java | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java index 46efe526802a..2f9fb23f65f0 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java @@ -385,12 +385,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro injectedLanguageManager = (InjectedLanguageManagerImpl)InjectedLanguageManager.getInstance(getProject()); } - try { - disposeProject(); - } - catch (Throwable e) { - result.add(e); - } + disposeProject(result); if (injectedLanguageManager != null) { try { @@ -450,20 +445,30 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro if (!result.isEmpty()) throw result; } - private void disposeProject() { - UIUtil.dispatchAllInvocationEvents(); - if (myProject != null) { - ApplicationManager.getApplication().runWriteAction(new Runnable() { - public void run() { - Disposer.dispose(myProject); - ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx(); - if (projectManager != null) { - projectManager.setCurrentTestProject(null); + private void disposeProject(@NotNull CompositeException result) /* throws nothing */ { + try { + UIUtil.dispatchAllInvocationEvents(); + } + catch (Exception e) { + result.add(e); + } + try { + if (myProject != null) { + ApplicationManager.getApplication().runWriteAction(new Runnable() { + public void run() { + Disposer.dispose(myProject); + ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx(); + if (projectManager != null) { + projectManager.setCurrentTestProject(null); + } } - } - }); + }); - myProject = null; + myProject = null; + } + } + catch (Exception e) { + result.add(e); } } @@ -569,8 +574,9 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro setUp(); } catch (Throwable e) { - disposeProject(); - throw e; + CompositeException result = new CompositeException(e); + disposeProject(result); + throw result; } try { myAssertionsInTestDetected = true; From a49995500a1df988051c926641516196b445cdf2 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 16 Dec 2011 13:13:59 +0400 Subject: [PATCH 027/101] additional assertion --- .../src/com/intellij/openapi/editor/impl/DocumentImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/core-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java b/platform/core-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java index 023b104585af..715ff4833c70 100644 --- a/platform/core-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java +++ b/platform/core-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java @@ -776,6 +776,7 @@ public class DocumentImpl extends UserDataHolderBase implements DocumentEx { @Override public final void setInBulkUpdate(boolean value) { + ApplicationManager.getApplication().assertIsDispatchThread(); myDoingBulkUpdate = value; myText.setDeferredChangeMode(value); if (value) { From a48d456aa8de150d7ff62eb017ccea43b91de700 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 16 Dec 2011 13:16:25 +0400 Subject: [PATCH 028/101] too many rangemarkers for injected fragment --- .../injected/editor/DocumentWindowImpl.java | 626 +++++++++--------- .../injected/editor/EditorWindow.java | 4 +- .../injected/InjectedFileViewProvider.java | 28 +- .../tree/injected/InjectedLanguageUtil.java | 42 +- .../tree/injected/MultiHostRegistrarImpl.java | 13 +- .../psi/impl/source/tree/injected/Place.java | 6 + .../editor/impl/event/MarkupModelEvent.java | 34 - .../impl/FileDocumentManagerImpl.java | 2 +- 8 files changed, 357 insertions(+), 398 deletions(-) delete mode 100644 platform/platform-impl/src/com/intellij/openapi/editor/impl/event/MarkupModelEvent.java diff --git a/platform/lang-impl/src/com/intellij/injected/editor/DocumentWindowImpl.java b/platform/lang-impl/src/com/intellij/injected/editor/DocumentWindowImpl.java index 1c48f5c96ecc..f5e23813a0d1 100644 --- a/platform/lang-impl/src/com/intellij/injected/editor/DocumentWindowImpl.java +++ b/platform/lang-impl/src/com/intellij/injected/editor/DocumentWindowImpl.java @@ -18,13 +18,15 @@ package com.intellij.injected.editor; import com.intellij.openapi.Disposable; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.editor.*; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.editor.EditorFactory; +import com.intellij.openapi.editor.LogicalPosition; +import com.intellij.openapi.editor.RangeMarker; import com.intellij.openapi.editor.event.DocumentListener; import com.intellij.openapi.editor.ex.DocumentEx; import com.intellij.openapi.editor.ex.EditReadOnlyListener; import com.intellij.openapi.editor.ex.LineIterator; import com.intellij.openapi.editor.ex.RangeMarkerEx; -import com.intellij.openapi.editor.impl.DocumentImpl; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.ProperTextRange; import com.intellij.openapi.util.TextRange; @@ -46,21 +48,24 @@ import java.util.List; * @author Alexey */ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable, DocumentWindow, DocumentEx { - private static final Logger LOG = Logger.getInstance("com.intellij.openapi.editor.impl.injected.DocumentRangee"); + private static final Logger LOG = Logger.getInstance("#com.intellij.injected.editor.DocumentWindowImpl"); private final DocumentEx myDelegate; private final boolean myOneLine; - private Place myShreds; + private Place myShreds; // guarded by myLock private final int myPrefixLineCount; private final int mySuffixLineCount; + private final Object myLock = new Object(); private CachedText myCachedText = null; public DocumentWindowImpl(@NotNull DocumentEx delegate, boolean oneLine, Place shreds) { myDelegate = delegate; myOneLine = oneLine; - myShreds = shreds; - myPrefixLineCount = Math.max(1, 1 + StringUtil.countNewLines(myShreds.get(0).prefix)); - mySuffixLineCount = Math.max(1, 1 + StringUtil.countNewLines(myShreds.get(shreds.size()- 1).suffix)); + synchronized (myLock) { + myShreds = shreds; + } + myPrefixLineCount = Math.max(1, 1 + StringUtil.countNewLines(shreds.get(0).prefix)); + mySuffixLineCount = Math.max(1, 1 + StringUtil.countNewLines(shreds.get(shreds.size()- 1).suffix)); } @Nullable("null means we were unable to calculate") @@ -70,20 +75,22 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable int iLineStartOffset = hostToInjected(hLineStartOffset); int iLine = getLineNumber(iLineStartOffset); - for (int i = myShreds.size() - 1; i >= 0; i--) { - PsiLanguageInjectionHost.Shred shred = myShreds.get(i); - if (!shred.isValid()) continue; - int hShredEndOffset = shred.getHostRangeMarker().getEndOffset(); - int hShredStartOffset = shred.getHostRangeMarker().getStartOffset(); + synchronized (myLock) { + for (int i = myShreds.size() - 1; i >= 0; i--) { + PsiLanguageInjectionHost.Shred shred = myShreds.get(i); + if (!shred.isValid()) continue; + int hShredEndOffset = shred.getHostRangeMarker().getEndOffset(); + int hShredStartOffset = shred.getHostRangeMarker().getStartOffset(); - int hShredStartLine = myDelegate.getLineNumber(hShredStartOffset); - int hShredEndLine = myDelegate.getLineNumber(hShredEndOffset); + int hShredStartLine = myDelegate.getLineNumber(hShredStartOffset); + int hShredEndLine = myDelegate.getLineNumber(hShredEndOffset); - if (hShredStartLine <= hPos.line && hPos.line <= hShredEndLine) { - int hColumnOfShredEnd = hShredEndOffset - hLineStartOffset; - int iColumnOfShredEnd = hostToInjected(hShredEndOffset) - iLineStartOffset; - int iColumn = iColumnOfShredEnd + hPos.column - hColumnOfShredEnd; - return new LogicalPosition(iLine, iColumn); + if (hShredStartLine <= hPos.line && hPos.line <= hShredEndLine) { + int hColumnOfShredEnd = hShredEndOffset - hLineStartOffset; + int iColumnOfShredEnd = hostToInjected(hShredEndOffset) - iLineStartOffset; + int iColumn = iColumnOfShredEnd + hPos.column - hColumnOfShredEnd; + return new LogicalPosition(iLine, iColumn); + } } } @@ -117,13 +124,29 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable @Override public int getLineStartOffset(int line) { - //int oldso = oldso(line); - int newso = newStartOffset(line); - //if (newso != oldso) { - // int i = 0; - //} + LOG.assertTrue(line >= 0, line); + if (line == 0) return 0; + String hostText = myDelegate.getText(); - return newso; + int[] pos = new int[2]; // pos[0] = curLine; pos[1] == offset; + synchronized (myLock) { + for (PsiLanguageInjectionHost.Shred shred : myShreds) { + RangeMarker hostRange = shred.getHostRangeMarker(); + if (!hostRange.isValid()) continue; + + int found = countNewLinesIn(shred.prefix, pos, line); + if (found != -1) return found; + + String text = hostText.substring(hostRange.getStartOffset(), hostRange.getEndOffset()); + found = countNewLinesIn(text, pos, line); + if (found != -1) return found; + + found = countNewLinesIn(shred.suffix, pos, line); + if (found != -1) return found; + } + } + + return pos[1]; } // returns startOffset found, or -1 if need to continue searching @@ -140,35 +163,6 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable return -1; } - private int newStartOffset(int line) { - LOG.assertTrue(line >= 0, line); - if (line == 0) return 0; - String hostText = myDelegate.getText(); - - int[] pos = new int[2]; // pos[0] = curLine; pos[1] == offset; - for (PsiLanguageInjectionHost.Shred shred : myShreds) { - RangeMarker hostRange = shred.getHostRangeMarker(); - if (!hostRange.isValid()) continue; - - int found = countNewLinesIn(shred.prefix, pos, line); - if (found != -1) return found; - - String text = hostText.substring(hostRange.getStartOffset(), hostRange.getEndOffset()); - found = countNewLinesIn(text, pos, line); - if (found != -1) return found; - - found = countNewLinesIn(shred.suffix, pos, line); - if (found != -1) return found; - } - - return pos[1]; - } - - private int oldso(int line) { - assert line >= 0 : line; - return new DocumentImpl(getText()).getLineStartOffset(line); - } - @Override public int getLineEndOffset(int line) { LOG.assertTrue(line >= 0, line); @@ -191,12 +185,14 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable private String calcText() { StringBuilder text = new StringBuilder(); CharSequence hostText = myDelegate.getCharsSequence(); - for (PsiLanguageInjectionHost.Shred shred : myShreds) { - RangeMarker hostRange = shred.getHostRangeMarker(); - if (hostRange.isValid()) { - text.append(shred.prefix); - text.append(hostText, hostRange.getStartOffset(), hostRange.getEndOffset()); - text.append(shred.suffix); + synchronized (myLock) { + for (PsiLanguageInjectionHost.Shred shred : myShreds) { + RangeMarker hostRange = shred.getHostRangeMarker(); + if (hostRange.isValid()) { + text.append(shred.prefix); + text.append(hostText, hostRange.getStartOffset(), hostRange.getEndOffset()); + text.append(shred.suffix); + } } } return text.toString(); @@ -223,11 +219,13 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable @Override public int getTextLength() { int length = 0; - for (PsiLanguageInjectionHost.Shred shred : myShreds) { - RangeMarker hostRange = shred.getHostRangeMarker(); - length += shred.prefix.length(); - length += hostRange.getEndOffset() - hostRange.getStartOffset(); - length += shred.suffix.length(); + synchronized (myLock) { + for (PsiLanguageInjectionHost.Shred shred : myShreds) { + RangeMarker hostRange = shred.getHostRangeMarker(); + length += shred.prefix.length(); + length += hostRange.getEndOffset() - hostRange.getStartOffset(); + length += shred.suffix.length(); + } } return length; } @@ -236,32 +234,34 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable public int getLineNumber(int offset) { int lineNumber = 0; String hostText = myDelegate.getText(); - for (PsiLanguageInjectionHost.Shred shred : myShreds) { - String prefix = shred.prefix; - String suffix = shred.suffix; - lineNumber += StringUtil.getLineBreakCount(prefix.substring(0, Math.min(offset, prefix.length()))); - if (offset < prefix.length()) { - return lineNumber; + synchronized (myLock) { + for (PsiLanguageInjectionHost.Shred shred : myShreds) { + String prefix = shred.prefix; + String suffix = shred.suffix; + lineNumber += StringUtil.getLineBreakCount(prefix.substring(0, Math.min(offset, prefix.length()))); + if (offset < prefix.length()) { + return lineNumber; + } + offset -= prefix.length(); + + RangeMarker currentRange = shred.getHostRangeMarker(); + if (!currentRange.isValid()) continue; + int rangeLength = currentRange.getEndOffset() - currentRange.getStartOffset(); + String rangeText = hostText.substring(currentRange.getStartOffset(), currentRange.getEndOffset()); + + lineNumber += StringUtil.getLineBreakCount(rangeText.substring(0, Math.min(offset, rangeLength))); + if (offset < rangeLength) { + return lineNumber; + } + offset -= rangeLength; + + lineNumber += StringUtil.getLineBreakCount(suffix.substring(0, Math.min(offset, suffix.length()))); + if (offset < suffix.length()) { + return lineNumber; + } + + offset -= suffix.length(); } - offset -= prefix.length(); - - RangeMarker currentRange = shred.getHostRangeMarker(); - if (!currentRange.isValid()) continue; - int rangeLength = currentRange.getEndOffset() - currentRange.getStartOffset(); - String rangeText = hostText.substring(currentRange.getStartOffset(), currentRange.getEndOffset()); - - lineNumber += StringUtil.getLineBreakCount(rangeText.substring(0, Math.min(offset, rangeLength))); - if (offset < rangeLength) { - return lineNumber; - } - offset -= rangeLength; - - lineNumber += StringUtil.getLineBreakCount(suffix.substring(0, Math.min(offset, suffix.length()))); - if (offset < suffix.length()) { - return lineNumber; - } - - offset -= suffix.length(); } lineNumber = getLineCount() - 1; return lineNumber < 0 ? 0 : lineNumber; @@ -269,18 +269,22 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable @Override public TextRange getHostRange(int hostOffset) { - for (PsiLanguageInjectionHost.Shred shred : myShreds) { - RangeMarker currentRange = shred.getHostRangeMarker(); - TextRange textRange = ProperTextRange.create(currentRange); - if (textRange.grown(1).contains(hostOffset)) return textRange; - } + synchronized (myLock) { + for (PsiLanguageInjectionHost.Shred shred : myShreds) { + RangeMarker currentRange = shred.getHostRangeMarker(); + TextRange textRange = ProperTextRange.create(currentRange); + if (textRange.grown(1).contains(hostOffset)) return textRange; + } + } return null; } @Override public void insertString(final int offset, @NotNull CharSequence s) { - LOG.assertTrue(offset >= myShreds.get(0).prefix.length(), myShreds.get(0).prefix); - LOG.assertTrue(offset <= getTextLength() - myShreds.get(myShreds.size() - 1).suffix.length(), myShreds.get(myShreds.size() - 1).suffix); + synchronized (myLock) { + LOG.assertTrue(offset >= myShreds.get(0).prefix.length(), myShreds.get(0).prefix); + LOG.assertTrue(offset <= getTextLength() - myShreds.get(myShreds.size() - 1).suffix.length(), myShreds.get(myShreds.size() - 1).suffix); + } if (isOneLine()) { s = StringUtil.replace(s.toString(), "\n", ""); } @@ -292,25 +296,28 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable assert intersectWithEditable(new TextRange(startOffset, startOffset)) != null; assert intersectWithEditable(new TextRange(endOffset, endOffset)) != null; - List hostRangesToDelete = new ArrayList(myShreds.size()); + List hostRangesToDelete; + synchronized (myLock) { + hostRangesToDelete = new ArrayList(myShreds.size()); - int offset = startOffset; - int curRangeStart = 0; - for (PsiLanguageInjectionHost.Shred shred : myShreds) { - curRangeStart += shred.prefix.length(); - if (offset < curRangeStart) offset = curRangeStart; - if (offset >= endOffset) break; - RangeMarker hostRange = shred.getHostRangeMarker(); - if (!hostRange.isValid()) continue; - int hostRangeLength = hostRange.getEndOffset() - hostRange.getStartOffset(); - TextRange range = TextRange.from(curRangeStart, hostRangeLength); - if (range.contains(offset)) { - TextRange rangeToDelete = new TextRange(offset, Math.min(range.getEndOffset(), endOffset)); - hostRangesToDelete.add(rangeToDelete.shiftRight(hostRange.getStartOffset() - curRangeStart)); - offset = rangeToDelete.getEndOffset(); + int offset = startOffset; + int curRangeStart = 0; + for (PsiLanguageInjectionHost.Shred shred : myShreds) { + curRangeStart += shred.prefix.length(); + if (offset < curRangeStart) offset = curRangeStart; + if (offset >= endOffset) break; + RangeMarker hostRange = shred.getHostRangeMarker(); + if (!hostRange.isValid()) continue; + int hostRangeLength = hostRange.getEndOffset() - hostRange.getStartOffset(); + TextRange range = TextRange.from(curRangeStart, hostRangeLength); + if (range.contains(offset)) { + TextRange rangeToDelete = new TextRange(offset, Math.min(range.getEndOffset(), endOffset)); + hostRangesToDelete.add(rangeToDelete.shiftRight(hostRange.getStartOffset() - curRangeStart)); + offset = rangeToDelete.getEndOffset(); + } + curRangeStart += hostRangeLength; + curRangeStart += shred.suffix.length(); } - curRangeStart += hostRangeLength; - curRangeStart += shred.suffix.length(); } int delta = 0; @@ -342,30 +349,33 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable assert intersectWithEditable(new TextRange(startOffset, startOffset)) != null; assert intersectWithEditable(new TextRange(endOffset, endOffset)) != null; - List> hostRangesToModify = new ArrayList>(myShreds.size()); + List> hostRangesToModify; + synchronized (myLock) { + hostRangesToModify = new ArrayList>(myShreds.size()); - int offset = startOffset; - int curRangeStart = 0; - for (int i = 0; i < myShreds.size(); i++) { - PsiLanguageInjectionHost.Shred shred = myShreds.get(i); - curRangeStart += shred.prefix.length(); - if (offset < curRangeStart) offset = curRangeStart; - RangeMarker hostRange = shred.getHostRangeMarker(); - if (!hostRange.isValid()) continue; - int hostRangeLength = hostRange.getEndOffset() - hostRange.getStartOffset(); - TextRange range = TextRange.from(curRangeStart, hostRangeLength); - if (range.contains(offset) || range.getEndOffset() == offset/* in case of inserting at the end*/) { - TextRange rangeToModify = new TextRange(offset, Math.min(range.getEndOffset(), endOffset)); - TextRange hostRangeToModify = rangeToModify.shiftRight(hostRange.getStartOffset() - curRangeStart); - CharSequence toReplace = i == myShreds.size() - 1 || range.getEndOffset() + shred.suffix.length() >= endOffset - ? s : s.subSequence(0, Math.min(hostRangeToModify.getLength(), s.length())); - s = toReplace == s ? "" : s.subSequence(toReplace.length(), s.length()); - hostRangesToModify.add(Pair.create(hostRangeToModify, toReplace)); - offset = rangeToModify.getEndOffset(); + int offset = startOffset; + int curRangeStart = 0; + for (int i = 0; i < myShreds.size(); i++) { + PsiLanguageInjectionHost.Shred shred = myShreds.get(i); + curRangeStart += shred.prefix.length(); + if (offset < curRangeStart) offset = curRangeStart; + RangeMarker hostRange = shred.getHostRangeMarker(); + if (!hostRange.isValid()) continue; + int hostRangeLength = hostRange.getEndOffset() - hostRange.getStartOffset(); + TextRange range = TextRange.from(curRangeStart, hostRangeLength); + if (range.contains(offset) || range.getEndOffset() == offset/* in case of inserting at the end*/) { + TextRange rangeToModify = new TextRange(offset, Math.min(range.getEndOffset(), endOffset)); + TextRange hostRangeToModify = rangeToModify.shiftRight(hostRange.getStartOffset() - curRangeStart); + CharSequence toReplace = i == myShreds.size() - 1 || range.getEndOffset() + shred.suffix.length() >= endOffset + ? s : s.subSequence(0, Math.min(hostRangeToModify.getLength(), s.length())); + s = toReplace == s ? "" : s.subSequence(toReplace.length(), s.length()); + hostRangesToModify.add(Pair.create(hostRangeToModify, toReplace)); + offset = rangeToModify.getEndOffset(); + } + curRangeStart += hostRangeLength; + curRangeStart += shred.suffix.length(); + if (curRangeStart >= endOffset) break; } - curRangeStart += hostRangeLength; - curRangeStart += shred.suffix.length(); - if (curRangeStart >= endOffset) break; } int delta = 0; @@ -484,18 +494,20 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable @Override public void setText(@NotNull CharSequence text) { - LOG.assertTrue(text.toString().startsWith(myShreds.get(0).prefix)); - LOG.assertTrue(text.toString().endsWith(myShreds.get(myShreds.size() - 1).suffix)); - if (isOneLine()) { - text = StringUtil.replace(text.toString(), "\n", ""); - } - String[] changes = calculateMinEditSequence(text.toString()); - assert changes.length == myShreds.size(); - for (int i = 0; i < changes.length; i++) { - String change = changes[i]; - if (change != null) { - RangeMarker hostRange = myShreds.get(i).getHostRangeMarker(); - myDelegate.replaceString(hostRange.getStartOffset(), hostRange.getEndOffset(), change); + synchronized (myLock) { + LOG.assertTrue(text.toString().startsWith(myShreds.get(0).prefix)); + LOG.assertTrue(text.toString().endsWith(myShreds.get(myShreds.size() - 1).suffix)); + if (isOneLine()) { + text = StringUtil.replace(text.toString(), "\n", ""); + } + String[] changes = calculateMinEditSequence(text.toString()); + assert changes.length == myShreds.size(); + for (int i = 0; i < changes.length; i++) { + String change = changes[i]; + if (change != null) { + RangeMarker hostRange = myShreds.get(i).getHostRangeMarker(); + myDelegate.replaceString(hostRange.getStartOffset(), hostRange.getEndOffset(), change); + } } } } @@ -503,12 +515,14 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable @Override @NotNull public RangeMarker[] getHostRanges() { - RangeMarker[] markers = new RangeMarker[myShreds.size()]; - for (int i = 0; i < myShreds.size(); i++) { - PsiLanguageInjectionHost.Shred shred = myShreds.get(i); - markers[i] = shred.getHostRangeMarker(); + synchronized (myLock) { + RangeMarker[] markers = new RangeMarker[myShreds.size()]; + for (int i = 0; i < myShreds.size(); i++) { + PsiLanguageInjectionHost.Shred shred = myShreds.get(i); + markers[i] = shred.getHostRangeMarker(); + } + return markers; } - return markers; } @Override @@ -603,20 +617,22 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable //todo use escaper? @Override public int hostToInjected(int hostOffset) { - if (hostOffset < myShreds.get(0).getHostRangeMarker().getStartOffset()) return myShreds.get(0).prefix.length(); - int offset = 0; - for (int i = 0; i < myShreds.size(); i++) { - offset += myShreds.get(i).prefix.length(); - RangeMarker currentRange = myShreds.get(i).getHostRangeMarker(); - RangeMarker nextRange = i == myShreds.size() - 1 ? null : myShreds.get(i + 1).getHostRangeMarker(); - if (nextRange == null || hostOffset < nextRange.getStartOffset()) { - if (hostOffset >= currentRange.getEndOffset()) hostOffset = currentRange.getEndOffset(); - return offset + hostOffset - currentRange.getStartOffset(); + synchronized (myLock) { + if (hostOffset < myShreds.get(0).getHostRangeMarker().getStartOffset()) return myShreds.get(0).prefix.length(); + int offset = 0; + for (int i = 0; i < myShreds.size(); i++) { + offset += myShreds.get(i).prefix.length(); + RangeMarker currentRange = myShreds.get(i).getHostRangeMarker(); + RangeMarker nextRange = i == myShreds.size() - 1 ? null : myShreds.get(i + 1).getHostRangeMarker(); + if (nextRange == null || hostOffset < nextRange.getStartOffset()) { + if (hostOffset >= currentRange.getEndOffset()) hostOffset = currentRange.getEndOffset(); + return offset + hostOffset - currentRange.getStartOffset(); + } + offset += currentRange.getEndOffset() - currentRange.getStartOffset(); + offset += myShreds.get(i).suffix.length(); } - offset += currentRange.getEndOffset() - currentRange.getStartOffset(); - offset += myShreds.get(i).suffix.length(); + return getTextLength() - myShreds.get(myShreds.size() - 1).suffix.length(); } - return getTextLength() - myShreds.get(myShreds.size() - 1).suffix.length(); } @Override @@ -627,7 +643,9 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable // heuristics: return offset closest to the caret Editor[] editors = EditorFactory.getInstance().getEditors(getDelegate()); - for (Editor editor : editors) { + Editor editor = editors.length == 0 ? null : editors[0]; + if (editor != null) + { if (editor instanceof EditorWindow) editor = ((EditorWindow)editor).getDelegate(); int caret = editor.getCaretModel().getOffset(); return Math.abs(caret - offsetInLeftFragment) < Math.abs(caret - offsetInRightFragment) ? offsetInLeftFragment : offsetInRightFragment; @@ -636,26 +654,28 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable } private int injectedToHost(int offset, boolean preferLeftFragment) { - if (offset < myShreds.get(0).prefix.length()) return myShreds.get(0).getHostRangeMarker().getStartOffset(); - int prevEnd = 0; - for (int i = 0; i < myShreds.size(); i++) { - RangeMarker currentRange = myShreds.get(i).getHostRangeMarker(); - offset -= myShreds.get(i).prefix.length(); - int length = currentRange.getEndOffset() - currentRange.getStartOffset(); - if (offset < 0) { - return preferLeftFragment ? prevEnd : currentRange.getStartOffset() - 1; + synchronized (myLock) { + if (offset < myShreds.get(0).prefix.length()) return myShreds.get(0).getHostRangeMarker().getStartOffset(); + int prevEnd = 0; + for (int i = 0; i < myShreds.size(); i++) { + RangeMarker currentRange = myShreds.get(i).getHostRangeMarker(); + offset -= myShreds.get(i).prefix.length(); + int length = currentRange.getEndOffset() - currentRange.getStartOffset(); + if (offset < 0) { + return preferLeftFragment ? prevEnd : currentRange.getStartOffset() - 1; + } + if (offset == 0) { + return preferLeftFragment && i != 0 ? prevEnd : currentRange.getStartOffset(); + } + if (offset < length || offset == length && preferLeftFragment) { + return currentRange.getStartOffset() + offset; + } + offset -= length; + offset -= myShreds.get(i).suffix.length(); + prevEnd = currentRange.getEndOffset(); } - if (offset == 0) { - return preferLeftFragment && i != 0 ? prevEnd : currentRange.getStartOffset(); - } - if (offset < length || offset == length && preferLeftFragment) { - return currentRange.getStartOffset() + offset; - } - offset -= length; - offset -= myShreds.get(i).suffix.length(); - prevEnd = currentRange.getEndOffset(); + return myShreds.get(myShreds.size() - 1).getHostRangeMarker().getEndOffset(); } - return myShreds.get(myShreds.size() - 1).getHostRangeMarker().getEndOffset(); } @Override @@ -673,7 +693,9 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable @Override public int injectedToHostLine(int line) { if (line < myPrefixLineCount) { - return myDelegate.getLineNumber(myShreds.get(0).getHostRangeMarker().getStartOffset()); + synchronized (myLock) { + return myDelegate.getLineNumber(myShreds.get(0).getHostRangeMarker().getStartOffset()); + } } int lineCount = getLineCount(); if (line > lineCount - mySuffixLineCount) { @@ -687,145 +709,140 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable @Override public boolean containsRange(int start, int end) { - if (end - start > myShreds.get(0).getHostRangeMarker().getEndOffset() - myShreds.get(0).getHostRangeMarker().getStartOffset()) return false; - for (PsiLanguageInjectionHost.Shred shred : myShreds) { - RangeMarker hostRange = shred.getHostRangeMarker(); - if (!hostRange.isValid()) continue; - TextRange textRange = ProperTextRange.create(hostRange); - if (textRange.contains(new ProperTextRange(start, end))) return true; + synchronized (myLock) { + if (end - start > myShreds.get(0).getHostRangeMarker().getEndOffset() - myShreds.get(0).getHostRangeMarker().getStartOffset()) return false; + for (PsiLanguageInjectionHost.Shred shred : myShreds) { + RangeMarker hostRange = shred.getHostRangeMarker(); + if (!hostRange.isValid()) continue; + TextRange textRange = ProperTextRange.create(hostRange); + if (textRange.contains(new ProperTextRange(start, end))) return true; + } + return false; } - return false; } @Override @Deprecated @Nullable public TextRange intersectWithEditable(@NotNull TextRange rangeToEdit) { - int offset = 0; int startOffset = -1; int endOffset = -1; - for (PsiLanguageInjectionHost.Shred shred : myShreds) { - RangeMarker hostRange = shred.getHostRangeMarker(); - offset += shred.prefix.length(); - int length = hostRange.getEndOffset() - hostRange.getStartOffset(); - TextRange intersection = new ProperTextRange(offset, offset + length).intersection(rangeToEdit); - if (intersection != null) { - if (startOffset == -1) { - startOffset = intersection.getStartOffset(); + synchronized (myLock) { + int offset = 0; + for (PsiLanguageInjectionHost.Shred shred : myShreds) { + RangeMarker hostRange = shred.getHostRangeMarker(); + offset += shred.prefix.length(); + int length = hostRange.getEndOffset() - hostRange.getStartOffset(); + TextRange intersection = new ProperTextRange(offset, offset + length).intersection(rangeToEdit); + if (intersection != null) { + if (startOffset == -1) { + startOffset = intersection.getStartOffset(); + } + endOffset = intersection.getEndOffset(); } - endOffset = intersection.getEndOffset(); + offset += length; + offset += shred.suffix.length(); } - offset += length; - offset += shred.suffix.length(); } if (startOffset == -1) return null; return new ProperTextRange(startOffset, endOffset); } - boolean intersects(DocumentWindowImpl documentWindow) { - int i = 0; - int j = 0; - while (i < myShreds.size() && j < documentWindow.myShreds.size()) { - RangeMarker range = myShreds.get(i).getHostRangeMarker(); - RangeMarker otherRange = documentWindow.myShreds.get(j).getHostRangeMarker(); - if (ProperTextRange.create(range).intersects(ProperTextRange.create(otherRange))) return true; - if (range.getEndOffset() > otherRange.getStartOffset()) i++; - else if (range.getStartOffset() < otherRange.getEndOffset()) j++; - else { - i++; - j++; - } - } - return false; - } - // minimum sequence of text replacement operations for each host range // result[i] == null means no change // result[i] == "" means delete // result[i] == string means replace public String[] calculateMinEditSequence(String newText) { - String[] result = new String[myShreds.size()]; - String hostText = myDelegate.getText(); - calculateMinEditSequence(hostText, newText, result, 0, result.length - 1); - for (int i = 0; i < result.length; i++) { - String change = result[i]; - if (change == null) continue; - String prefix = myShreds.get(i).prefix; - String suffix = myShreds.get(i).suffix; - assert change.startsWith(prefix) : change + "/" + prefix; - assert change.endsWith(suffix) : change + "/" + suffix; - result[i] = StringUtil.trimEnd(StringUtil.trimStart(change, prefix), suffix); + synchronized (myLock) { + String[] result = new String[myShreds.size()]; + String hostText = myDelegate.getText(); + calculateMinEditSequence(hostText, newText, result, 0, result.length - 1); + for (int i = 0; i < result.length; i++) { + String change = result[i]; + if (change == null) continue; + String prefix = myShreds.get(i).prefix; + String suffix = myShreds.get(i).suffix; + assert change.startsWith(prefix) : change + "/" + prefix; + assert change.endsWith(suffix) : change + "/" + suffix; + result[i] = StringUtil.trimEnd(StringUtil.trimStart(change, prefix), suffix); + } + return result; } - return result; } private String getRangeText(String hostText, int hostNum) { - PsiLanguageInjectionHost.Shred shred = myShreds.get(hostNum); - return shred.prefix + - hostText.substring(shred.getHostRangeMarker().getStartOffset(), shred.getHostRangeMarker().getEndOffset()) + - shred.suffix; + synchronized (myLock) { + PsiLanguageInjectionHost.Shred shred = myShreds.get(hostNum); + return shred.prefix + + hostText.substring(shred.getHostRangeMarker().getStartOffset(), shred.getHostRangeMarker().getEndOffset()) + + shred.suffix; + } } private void calculateMinEditSequence(String hostText, String newText, String[] result, int i, int j) { - String rangeText1 = getRangeText(hostText, i); - if (i == j) { - result[i] = rangeText1.equals(newText) ? null : newText; - return; - } - if (StringUtil.startsWith(newText, rangeText1)) { - result[i] = null; //no change - calculateMinEditSequence(hostText, newText.substring(rangeText1.length()), result, i+1, j); - return; - } - String rangeText2 = getRangeText(hostText, j); - if (StringUtil.endsWith(newText, rangeText2)) { - result[j] = null; //no change - calculateMinEditSequence(hostText, newText.substring(0, newText.length() - rangeText2.length()), result, i, j-1); - return; - } - if (i+1 == j) { - String suffix = myShreds.get(i).suffix; - String prefix = myShreds.get(j).prefix; - String separator = suffix + prefix; - if (separator.length() != 0) { - int sep = newText.indexOf(separator); - assert sep != -1; - result[i] = newText.substring(0, sep + suffix.length()); - result[j] = newText.substring(sep + suffix.length() + prefix.length(), newText.length()); + synchronized (myLock) { + String rangeText1 = getRangeText(hostText, i); + if (i == j) { + result[i] = rangeText1.equals(newText) ? null : newText; return; } - String commonPrefix = StringUtil.commonPrefix(rangeText1, newText); - result[i] = commonPrefix; - result[j] = newText.substring(commonPrefix.length()); - return; + if (StringUtil.startsWith(newText, rangeText1)) { + result[i] = null; //no change + calculateMinEditSequence(hostText, newText.substring(rangeText1.length()), result, i+1, j); + return; + } + String rangeText2 = getRangeText(hostText, j); + if (StringUtil.endsWith(newText, rangeText2)) { + result[j] = null; //no change + calculateMinEditSequence(hostText, newText.substring(0, newText.length() - rangeText2.length()), result, i, j-1); + return; + } + if (i+1 == j) { + String suffix = myShreds.get(i).suffix; + String prefix = myShreds.get(j).prefix; + String separator = suffix + prefix; + if (!separator.isEmpty()) { + int sep = newText.indexOf(separator); + assert sep != -1; + result[i] = newText.substring(0, sep + suffix.length()); + result[j] = newText.substring(sep + suffix.length() + prefix.length(), newText.length()); + return; + } + String commonPrefix = StringUtil.commonPrefix(rangeText1, newText); + result[i] = commonPrefix; + result[j] = newText.substring(commonPrefix.length()); + return; + } + String middleText = getRangeText(hostText, i + 1); + int m = newText.indexOf(middleText); + if (m != -1) { + result[i] = newText.substring(0, m); + result[i+1] = null; + calculateMinEditSequence(hostText, newText.substring(m+middleText.length(), newText.length()), result, i+2, j); + return; + } + middleText = getRangeText(hostText, j - 1); + m = newText.lastIndexOf(middleText); + if (m != -1) { + result[j] = newText.substring(m+middleText.length()); + result[j-1] = null; + calculateMinEditSequence(hostText, newText.substring(0, m), result, i, j-2); + return; + } + result[i] = ""; + result[j] = ""; + calculateMinEditSequence(hostText, newText, result, i+1, j-1); } - String middleText = getRangeText(hostText, i + 1); - int m = newText.indexOf(middleText); - if (m != -1) { - result[i] = newText.substring(0, m); - result[i+1] = null; - calculateMinEditSequence(hostText, newText.substring(m+middleText.length(), newText.length()), result, i+2, j); - return; - } - middleText = getRangeText(hostText, j - 1); - m = newText.lastIndexOf(middleText); - if (m != -1) { - result[j] = newText.substring(m+middleText.length()); - result[j-1] = null; - calculateMinEditSequence(hostText, newText.substring(0, m), result, i, j-2); - return; - } - result[i] = ""; - result[j] = ""; - calculateMinEditSequence(hostText, newText, result, i+1, j-1); } @Override public boolean areRangesEqual(@NotNull DocumentWindow otherd) { DocumentWindowImpl window = (DocumentWindowImpl)otherd; - if (myShreds.size() != window.myShreds.size()) return false; - for (int i = 0; i < myShreds.size(); i++) { - PsiLanguageInjectionHost.Shred shred = myShreds.get(i); - PsiLanguageInjectionHost.Shred otherShred = window.myShreds.get(i); + Place shreds = getShreds(); + Place otherShreds = window.getShreds(); + if (shreds.size() != otherShreds.size()) return false; + for (int i = 0; i < shreds.size(); i++) { + PsiLanguageInjectionHost.Shred shred = shreds.get(i); + PsiLanguageInjectionHost.Shred otherShred = otherShreds.get(i); if (!shred.prefix.equals(otherShred.prefix)) return false; if (!shred.suffix.equals(otherShred.suffix)) return false; @@ -839,7 +856,9 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable @Override public boolean isValid() { - return myShreds.isValid(); + synchronized (myLock) { + return myShreds.isValid(); + } } public boolean equals(Object o) { @@ -849,7 +868,9 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable } public int hashCode() { - return myShreds.get(0).getHostRangeMarker().getStartOffset(); + synchronized (myLock) { + return myShreds.get(0).getHostRangeMarker().getStartOffset(); + } } public boolean isOneLine() { @@ -858,14 +879,27 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable @Override public void dispose() { - for (PsiLanguageInjectionHost.Shred shred : myShreds) { - RangeMarker rangeMarker = shred.getHostRangeMarker(); - rangeMarker.dispose(); + synchronized (myLock) { + for (PsiLanguageInjectionHost.Shred shred : myShreds) { + RangeMarker rangeMarker = shred.getHostRangeMarker(); + rangeMarker.dispose(); + } } } - public void setShreds(Place shreds) { - myShreds = shreds; + public void setShreds(@NotNull Place shreds) { + synchronized (myLock) { + if (myShreds != shreds) { + myShreds.dispose(); + myShreds = shreds; + } + } + } + + public Place getShreds() { + synchronized (myLock) { + return myShreds; + } } @Override diff --git a/platform/lang-impl/src/com/intellij/injected/editor/EditorWindow.java b/platform/lang-impl/src/com/intellij/injected/editor/EditorWindow.java index 987abb6104af..d1362c6cc989 100644 --- a/platform/lang-impl/src/com/intellij/injected/editor/EditorWindow.java +++ b/platform/lang-impl/src/com/intellij/injected/editor/EditorWindow.java @@ -39,6 +39,7 @@ import com.intellij.openapi.editor.impl.softwrap.SoftWrapAppliancePlaces; import com.intellij.openapi.editor.markup.MarkupModel; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.UserDataHolderBase; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; @@ -109,7 +110,7 @@ public class EditorWindow extends UserDataHolderBase implements EditorEx { Iterator iterator = allEditors.iterator(); while (iterator.hasNext()) { EditorWindow editorWindow = iterator.next(); - if (!editorWindow.isValid()/* || myDocumentWindow.intersects(editorWindow.myDocumentWindow)*/) { + if (!editorWindow.isValid()) { editorWindow.dispose(); InjectedLanguageUtil.clearCaches(editorWindow.myInjectedFile, editorWindow.getDocument()); @@ -185,6 +186,7 @@ public class EditorWindow extends UserDataHolderBase implements EditorEx { myEditorMouseMotionListeners.clear(); myDisposed = true; + Disposer.dispose(myDocumentWindow); } @Override diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedFileViewProvider.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedFileViewProvider.java index c45d0534f7d8..39d37ae3a8af 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedFileViewProvider.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedFileViewProvider.java @@ -38,10 +38,9 @@ import java.util.List; * @author cdr */ public class InjectedFileViewProvider extends SingleRootFileViewProvider implements FreeThreadedFileViewProvider { - private Place myShreds; private Project myProject; private final Object myLock = new Object(); - private final DocumentWindow myDocumentWindow; + private final DocumentWindowImpl myDocumentWindow; private static final ThreadLocal disabledTemporarily = new ThreadLocal(){ @Override protected Boolean initialValue() { @@ -52,15 +51,11 @@ public class InjectedFileViewProvider extends SingleRootFileViewProvider impleme InjectedFileViewProvider(@NotNull PsiManager psiManager, @NotNull VirtualFileWindow virtualFile, - @NotNull Place shreds, - @NotNull DocumentWindow documentWindow, + @NotNull DocumentWindowImpl documentWindow, @NotNull Language language) { super(psiManager, (VirtualFile)virtualFile, true, language); myDocumentWindow = documentWindow; - synchronized (myLock) { - myShreds = shreds; - myProject = myShreds.get(0).host.getProject(); - } + myProject = documentWindow.getShreds().get(0).host.getProject(); } @Override @@ -69,11 +64,8 @@ public class InjectedFileViewProvider extends SingleRootFileViewProvider impleme if (!isPhysical()) return; // injected PSI change happened inside reparse; ignore if (myPatchingLeaves) return; - List shreds; - synchronized (myLock) { - shreds = myShreds; - } - DocumentWindowImpl documentWindow = (DocumentWindowImpl)myDocumentWindow; + DocumentWindowImpl documentWindow = myDocumentWindow; + List shreds = documentWindow.getShreds(); assert documentWindow.getHostRanges().length == shreds.size(); String[] changes = documentWindow.calculateMinEditSequence(psiFile.getNode().getText()); assert changes.length == shreds.size(); @@ -122,11 +114,10 @@ public class InjectedFileViewProvider extends SingleRootFileViewProvider impleme return file; } - void setShreds(Place shreds) { + void setShreds(@NotNull Place shreds) { synchronized (myLock) { - myShreds = new Place(shreds); myProject = shreds.get(0).host.getProject(); - ((DocumentWindowImpl)myDocumentWindow).setShreds(myShreds); + myDocumentWindow.setShreds(shreds); } } @@ -141,12 +132,11 @@ public class InjectedFileViewProvider extends SingleRootFileViewProvider impleme } Place getShreds() { - synchronized (myLock) { - return myShreds; - } + return myDocumentWindow.getShreds(); } @Override + @NotNull public DocumentWindow getDocument() { return myDocumentWindow; } diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java index 85c522612308..695c9a61b7f6 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java @@ -21,7 +21,6 @@ import com.intellij.lang.Language; import com.intellij.lang.injection.InjectedLanguageManager; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.editor.RangeMarker; import com.intellij.openapi.editor.SelectionModel; import com.intellij.openapi.editor.impl.EditorImpl; import com.intellij.openapi.fileEditor.FileEditorManager; @@ -31,7 +30,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.*; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; -import com.intellij.psi.impl.PsiDocumentManagerImpl; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.psi.impl.PsiParameterizedCachedValue; import com.intellij.psi.impl.source.DummyHolder; @@ -108,7 +106,7 @@ public class InjectedLanguageUtil { public static Place getShreds(@NotNull FileViewProvider viewProvider) { if (!(viewProvider instanceof InjectedFileViewProvider)) return null; InjectedFileViewProvider myFileViewProvider = (InjectedFileViewProvider)viewProvider; - return myFileViewProvider.getShreds(); + return ((DocumentWindowImpl)myFileViewProvider.getDocument()).getShreds(); } public static void enumerate(@NotNull PsiElement host, @NotNull PsiLanguageInjectionHost.InjectedPsiVisitor visitor) { @@ -330,44 +328,6 @@ public class InjectedLanguageUtil { file.putUserData(INJECTED_DOCS_KEY, null); } - public static void commitAllInjectedDocuments(Document hostDocument, Project project) { - PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project); - PsiFile hostPsiFile = documentManager.getPsiFile(hostDocument); - if (hostPsiFile == null) return; - - List injected = getCachedInjectedDocuments(hostPsiFile); - if (injected.isEmpty()) return; - - for (int i = injected.size() - 1; i >= 0; i--) { - DocumentWindow documentWindow = injected.get(i); - ProgressManager.checkCanceled(); - RangeMarker rangeMarker = documentWindow.getHostRanges()[0]; - PsiElement element = rangeMarker.isValid() ? hostPsiFile.findElementAt(rangeMarker.getStartOffset()) : null; - if (element == null) { - injected.remove(i); - continue; - } - final DocumentWindow[] stillInjectedDocument = {null}; - // it is here where the reparse happens and old file contents replaced - enumerate(element, hostPsiFile, true, new PsiLanguageInjectionHost.InjectedPsiVisitor() { - @Override - public void visit(@NotNull PsiFile injectedPsi, @NotNull List places) { - stillInjectedDocument[0] = (DocumentWindow)injectedPsi.getViewProvider().getDocument(); - PsiDocumentManagerImpl.checkConsistency(injectedPsi, stillInjectedDocument[0]); - } - }); - if (stillInjectedDocument[0] == null) { - injected.remove(i); - } - else if (stillInjectedDocument[0] != documentWindow) { - injected.set(i,stillInjectedDocument[0]); - } - } - EditorWindow.disposeInvalidEditors(); // in write action - - PsiDocumentManagerImpl.checkConsistency(hostPsiFile, hostDocument); - } - public static void clearCaches(@NotNull PsiFile injected, @NotNull DocumentWindowImpl documentWindow) { VirtualFileWindowImpl virtualFile = (VirtualFileWindowImpl)injected.getVirtualFile(); PsiManagerEx psiManagerEx = (PsiManagerEx)injected.getManager(); diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/MultiHostRegistrarImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/MultiHostRegistrarImpl.java index e7b15846f6ca..4eeb0d5b2bcb 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/MultiHostRegistrarImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/MultiHostRegistrarImpl.java @@ -220,7 +220,7 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar { } FileDocumentManagerImpl.registerDocument(decodedDocument, virtualFile); - InjectedFileViewProvider viewProvider = new InjectedFileViewProvider(myPsiManager, virtualFile, place, documentWindow, myLanguage); + InjectedFileViewProvider viewProvider = new InjectedFileViewProvider(myPsiManager, virtualFile, documentWindow, myLanguage); ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(myLanguage); assert parserDefinition != null : "Parser definition for language "+myLanguage+" is null"; PsiFile psiFile = parserDefinition.createFile(viewProvider); @@ -295,11 +295,11 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar { } } - private static void cacheEverything(Place place, - DocumentWindowImpl documentWindow, - InjectedFileViewProvider viewProvider, - PsiFile psiFile, - SmartPsiElementPointer pointer) { + private static void cacheEverything(@NotNull Place place, + @NotNull DocumentWindowImpl documentWindow, + @NotNull InjectedFileViewProvider viewProvider, + @NotNull PsiFile psiFile, + @NotNull SmartPsiElementPointer pointer) { FileDocumentManagerImpl.registerDocument(documentWindow, viewProvider.getVirtualFile()); viewProvider.forceCachedPsi(psiFile); @@ -357,6 +357,7 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar { result.add(Pair.create(place, psiFile)); } + @NotNull private static SmartPsiElementPointer createHostSmartPointer(@NotNull T host, @NotNull PsiFile hostPsiFile) { return hostPsiFile.isPhysical() ? SmartPointerManager.getInstance(host.getProject()).createSmartPsiElementPointer(host, hostPsiFile) diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/Place.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/Place.java index 02f139f6be4b..7fe0d5070777 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/Place.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/Place.java @@ -38,4 +38,10 @@ public class Place extends SmartList { } return true; } + + public void dispose() { + for (PsiLanguageInjectionHost.Shred shred : this) { + shred.getHostRangeMarker().dispose(); + } + } } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/event/MarkupModelEvent.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/event/MarkupModelEvent.java deleted file mode 100644 index 5e48c4e3d96d..000000000000 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/event/MarkupModelEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2000-2009 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.intellij.openapi.editor.impl.event; - -import com.intellij.openapi.editor.markup.MarkupModel; -import com.intellij.openapi.editor.markup.RangeHighlighter; - -import java.util.EventObject; - -public class MarkupModelEvent extends EventObject { - private final RangeHighlighter myHighlighter; - - public MarkupModelEvent(MarkupModel source, RangeHighlighter segmentHighlighter) { - super(source); - myHighlighter = segmentHighlighter; - } - - public RangeHighlighter getHighlighter() { - return myHighlighter; - } -} diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java index d1370ef1a519..8bc38a8ffda1 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java @@ -217,7 +217,7 @@ public class FileDocumentManagerImpl extends FileDocumentManager implements Appl return document; } - public static void registerDocument(final Document document, VirtualFile virtualFile) { + public static void registerDocument(@NotNull final Document document, @NotNull VirtualFile virtualFile) { synchronized (lock) { virtualFile.putUserData(DOCUMENT_KEY, new SoftReference(document) { public Document get() { From 5f94592dc8ac9a0e94e6dd6830b08bfa42490c6f Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 16 Dec 2011 10:18:23 +0100 Subject: [PATCH 029/101] equals&hashCode: allow to select fields used in equals but not in hashCode as not null (IDEA-78969) --- .../codeInsight/generation/ui/GenerateEqualsWizard.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/generation/ui/GenerateEqualsWizard.java b/java/java-impl/src/com/intellij/codeInsight/generation/ui/GenerateEqualsWizard.java index 81b939420a18..449ffb02d1e0 100644 --- a/java/java-impl/src/com/intellij/codeInsight/generation/ui/GenerateEqualsWizard.java +++ b/java/java-impl/src/com/intellij/codeInsight/generation/ui/GenerateEqualsWizard.java @@ -176,7 +176,8 @@ public class GenerateEqualsWizard extends AbstractWizard { equalsFieldsSelected(); } else if (getCurrentStep() == myHashcodeStepCode && myHashCodePanel != null) { - Collection selectedMemberInfos = myHashCodePanel.getTable().getSelectedMemberInfos(); + Collection selectedMemberInfos = myEqualsPanel != null ? myEqualsPanel.getTable().getSelectedMemberInfos() + : myHashCodePanel.getTable().getSelectedMemberInfos(); updateNonNullMemberInfos(selectedMemberInfos); } From 2234c5c6892770268c1a4554a88201f66710e672 Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 16 Dec 2011 11:02:42 +0100 Subject: [PATCH 030/101] leak fixed --- .../rename/inplace/VariableInplaceRenamer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java index 8425a19963d4..43f7a295a184 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java @@ -348,7 +348,10 @@ public class VariableInplaceRenamer { }); } } - myBeforeRevert = myRenameOffset != null ? myEditor.getDocument().createRangeMarker(myRenameOffset.getStartOffset(), myEditor.getCaretModel().getOffset()) : null; + final int currentOffset = myEditor.getCaretModel().getOffset(); + myBeforeRevert = myRenameOffset != null && myRenameOffset.getEndOffset() >= currentOffset && myRenameOffset.getStartOffset() <= currentOffset + ? myEditor.getDocument().createRangeMarker(myRenameOffset.getStartOffset(), currentOffset) + : null; if (myBeforeRevert != null) { myBeforeRevert.setGreedyToRight(true); } @@ -381,6 +384,9 @@ public class VariableInplaceRenamer { finally { if (!bind) { FinishMarkAction.finish(myProject, myEditor, markAction); + if (myBeforeRevert != null) { + myBeforeRevert.dispose(); + } } } } From 0b2bd9e90122232b959bc45b5b59cc6e4e445e93 Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 16 Dec 2011 11:05:09 +0100 Subject: [PATCH 031/101] spellchecker: reject selection after rename --- .../src/com/intellij/spellchecker/quickfixes/RenameTo.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java index b700a27957b6..7df80f0edfa8 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java @@ -107,6 +107,7 @@ public class RenameTo extends ShowSuggestions implements SpellCheckerQuickFix { DataContext dataContext = SimpleDataContext.getSimpleContext(map, DataManager.getInstance().getDataContext(editor.getComponent())); AnAction action = new RenameElementAction(); + final boolean hadSelection = editor.getSelectionModel().hasSelection(); final TextRange range = psiElement.getTextRange(); if (range != null) { editor.getSelectionModel().setSelection(range.getStartOffset(), range.getEndOffset()); @@ -116,6 +117,9 @@ public class RenameTo extends ShowSuggestions implements SpellCheckerQuickFix { if (provider != null) { provider.setActive(false); } + if (!hadSelection) { + editor.getSelectionModel().removeSelection(); + } } }; From 43505ca5a4606c14fd6dc3918392dabfb8188a9c Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Fri, 16 Dec 2011 14:40:14 +0400 Subject: [PATCH 032/101] Don't let it stale in the list if release fails (due to double release assertion, for instance) --- .../openapi/editor/impl/EditorFactoryImpl.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java index d66aa92c7f35..00b6e1c44c86 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java @@ -206,14 +206,18 @@ public class EditorFactoryImpl extends EditorFactory { @Override public void releaseEditor(@NotNull Editor editor) { - ((EditorImpl)editor).release(); - editor.putUserData(EDITOR_CREATOR, null); - myEditors.remove(editor); - myEditorFactoryEventDispatcher.getMulticaster().editorReleased(new EditorFactoryEvent(this, editor)); + try { + ((EditorImpl)editor).release(); + } + finally { + editor.putUserData(EDITOR_CREATOR, null); + myEditors.remove(editor); + myEditorFactoryEventDispatcher.getMulticaster().editorReleased(new EditorFactoryEvent(this, editor)); - if (LOG.isDebugEnabled()) { - LOG.debug("number of Editor's:" + myEditors.size()); - //Thread.dumpStack(); + if (LOG.isDebugEnabled()) { + LOG.debug("number of Editor's:" + myEditors.size()); + //Thread.dumpStack(); + } } } From dc71135134a36f1c765be6eca519a848a668929b Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 10:34:50 +0100 Subject: [PATCH 033/101] IDEA-78033 do not sugesst "class" as possible name for variable --- .../JavaMemberNameCompletionContributor.java | 39 ++++++++++--------- .../variables/locals/LocalReserved2.java | 5 +++ .../completion/VariablesCompletionTest.groovy | 6 +++ 3 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 java/java-tests/testData/codeInsight/completion/variables/locals/LocalReserved2.java diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMemberNameCompletionContributor.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMemberNameCompletionContributor.java index bc27784c41bf..c2e1a74a4eac 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMemberNameCompletionContributor.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMemberNameCompletionContributor.java @@ -21,6 +21,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.patterns.ElementPattern; import com.intellij.patterns.PsiJavaPatterns; +import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.*; import com.intellij.psi.codeStyle.CodeStyleManager; import com.intellij.psi.codeStyle.JavaCodeStyleManager; @@ -103,7 +104,8 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor { private static void completeLocalVariableName(Set set, PrefixMatcher matcher, PsiVariable var, boolean includeOverlapped) { FeatureUsageTracker.getInstance().triggerFeatureUsed("editing.completion.variable.name"); - final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(var.getProject()); + Project project = var.getProject(); + final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(project); final VariableKind variableKind = codeStyleManager.getVariableKind(var); String propertyName = null; @@ -119,7 +121,7 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor { SuggestedNameInfo suggestedNameInfo = codeStyleManager.suggestVariableName(variableKind, propertyName, null, type, StringUtil.isEmpty(matcher.getPrefix())); suggestedNameInfo = codeStyleManager.suggestUniqueVariableName(suggestedNameInfo, var, false); final String[] suggestedNames = suggestedNameInfo.names; - addLookupItems(set, suggestedNameInfo, matcher, suggestedNames); + addLookupItems(set, suggestedNameInfo, matcher, project, suggestedNames); if (set.isEmpty()) { if (type.equalsToText(CommonClassNames.JAVA_LANG_OBJECT) && matcher.prefixMatches("object")) { set.add(LookupElementBuilder.create("object")); @@ -130,16 +132,16 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor { } if (set.isEmpty() && includeOverlapped) { - addLookupItems(set, null, matcher, getOverlappedNameVersions(matcher.getPrefix(), suggestedNames, "")); + addLookupItems(set, null, matcher, project, getOverlappedNameVersions(matcher.getPrefix(), suggestedNames, "")); } PsiElement parent = PsiTreeUtil.getParentOfType(var, PsiCodeBlock.class); if(parent == null) parent = PsiTreeUtil.getParentOfType(var, PsiMethod.class); - addLookupItems(set, suggestedNameInfo, matcher, getUnresolvedReferences(parent, false)); + addLookupItems(set, suggestedNameInfo, matcher, project, getUnresolvedReferences(parent, false)); PsiExpression initializer = var.getInitializer(); if (initializer != null) { SuggestedNameInfo initializerSuggestions = IntroduceVariableBase.getSuggestedName(type, initializer); - addLookupItems(set, initializerSuggestions, matcher, initializerSuggestions.names); + addLookupItems(set, initializerSuggestions, matcher, project, initializerSuggestions.names); } } @@ -216,18 +218,19 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor { private static void completeFieldName(Set set, PsiField var, final PrefixMatcher matcher, boolean includeOverlapped) { FeatureUsageTracker.getInstance().triggerFeatureUsed("editing.completion.variable.name"); - JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(var.getProject()); - final VariableKind variableKind = JavaCodeStyleManager.getInstance(var.getProject()).getVariableKind(var); + Project project = var.getProject(); + JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(project); + final VariableKind variableKind = JavaCodeStyleManager.getInstance(project).getVariableKind(var); final String prefix = matcher.getPrefix(); if (PsiType.VOID.equals(var.getType()) || psiField().inClass(psiClass().isInterface()).accepts(var)) { - completeVariableNameForRefactoring(var.getProject(), set, matcher, var.getType(), variableKind, includeOverlapped, true); + completeVariableNameForRefactoring(project, set, matcher, var.getType(), variableKind, includeOverlapped, true); return; } SuggestedNameInfo suggestedNameInfo = codeStyleManager.suggestVariableName(variableKind, null, null, var.getType()); final String[] suggestedNames = suggestedNameInfo.names; - addLookupItems(set, suggestedNameInfo, matcher, suggestedNames); + addLookupItems(set, suggestedNameInfo, matcher, project, suggestedNames); if (set.isEmpty() && includeOverlapped) { // use suggested names as suffixes @@ -238,17 +241,17 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor { } - addLookupItems(set, null, matcher, getOverlappedNameVersions(prefix, suggestedNames, requiredSuffix)); + addLookupItems(set, null, matcher, project, getOverlappedNameVersions(prefix, suggestedNames, requiredSuffix)); } - addLookupItems(set, suggestedNameInfo, matcher, getUnresolvedReferences(var.getParent(), false)); + addLookupItems(set, suggestedNameInfo, matcher, project, getUnresolvedReferences(var.getParent(), false)); PsiExpression initializer = var.getInitializer(); PsiClass containingClass = var.getContainingClass(); if (initializer != null && containingClass != null) { SuggestedNameInfo initializerSuggestions = InplaceIntroduceFieldPopup. suggestFieldName(var.getType(), null, initializer, var.hasModifierProperty(PsiModifier.STATIC), containingClass); - addLookupItems(set, initializerSuggestions, matcher, initializerSuggestions.names); + addLookupItems(set, initializerSuggestions, matcher, project, initializerSuggestions.names); } } @@ -261,7 +264,7 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor { SuggestedNameInfo suggestedNameInfo = codeStyleManager.suggestVariableName(varKind, null, null, varType); final String[] strings = completeVariableNameForRefactoring(codeStyleManager, matcher, varType, varKind, suggestedNameInfo, includeOverlapped, methodPrefix); - addLookupItems(set, suggestedNameInfo, matcher, strings); + addLookupItems(set, suggestedNameInfo, matcher, project, strings); } public static String[] completeVariableNameForRefactoring(JavaCodeStyleManager codeStyleManager, @@ -303,7 +306,7 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor { if (containingClass != null) { final String name = containingClass.getName(); if (StringUtil.isNotEmpty(name)) { - addLookupItems(set, null, matcher, name); + addLookupItems(set, null, matcher, element.getProject(), name); } } return; @@ -312,9 +315,9 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor { PsiClass ourClassParent = PsiTreeUtil.getParentOfType(element, PsiClass.class); if (ourClassParent == null) return; - addLookupItems(set, null, matcher, getUnresolvedReferences(ourClassParent, true)); + addLookupItems(set, null, matcher, element.getProject(), getUnresolvedReferences(ourClassParent, true)); - addLookupItems(set, null, matcher, getPropertiesHandlersNames( + addLookupItems(set, null, matcher, element.getProject(), getPropertiesHandlersNames( ourClassParent, ((PsiModifierListOwner)element).hasModifierProperty(PsiModifier.STATIC), PsiUtil.getTypeByPsiElement(element), element)); @@ -360,11 +363,11 @@ public class JavaMemberNameCompletionContributor extends CompletionContributor { return result.result; } - private static void addLookupItems(Set lookupElements, @Nullable final SuggestedNameInfo callback, PrefixMatcher matcher, String... strings) { + private static void addLookupItems(Set lookupElements, @Nullable final SuggestedNameInfo callback, PrefixMatcher matcher, Project project, String... strings) { outer: for (int i = 0; i < strings.length; i++) { String name = strings[i]; - if (!matcher.prefixMatches(name)) { + if (!matcher.prefixMatches(name) || !JavaPsiFacade.getInstance(project).getNameHelper().isIdentifier(name, LanguageLevel.HIGHEST)) { continue; } diff --git a/java/java-tests/testData/codeInsight/completion/variables/locals/LocalReserved2.java b/java/java-tests/testData/codeInsight/completion/variables/locals/LocalReserved2.java new file mode 100644 index 000000000000..bb410e3d87e6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/variables/locals/LocalReserved2.java @@ -0,0 +1,5 @@ +public class TestSource7 { + public void foo(){ + Class c + } +} diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/VariablesCompletionTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/VariablesCompletionTest.groovy index 436a3bd5251e..48e8a98e049d 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/VariablesCompletionTest.groovy +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/VariablesCompletionTest.groovy @@ -70,6 +70,12 @@ public class VariablesCompletionTest extends LightFixtureCompletionTestCase { doTest("LocalReserved.java", "LocalReserved_after.java"); } + public void testLocalReserved2() throws Exception { + configureByFile(FILE_PREFIX + "locals/" + "LocalReserved2.java") + checkResultByFile(FILE_PREFIX + "locals/" + "LocalReserved2.java"); + assert !myFixture.lookupElementStrings + } + public void testUniqueNameInFor() throws Exception { doTest(getTestName(false) + ".java", getTestName(false) + "_after.java"); } From 2e652dc2f44b9054e4da5f9b44bfe7f698d2f422 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 10:46:29 +0100 Subject: [PATCH 034/101] IDEA-78079 Notifications: sticky balloons disappear immediately after displaying if I edit the code or simply navigate with keyboard --- .../com/intellij/notification/impl/NotificationsManagerImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java b/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java index bdd182ccc2df..c349a82ff8dd 100644 --- a/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java @@ -287,6 +287,7 @@ public class NotificationsManagerImpl extends NotificationsManager implements No final BalloonBuilder builder = JBPopupFactory.getInstance().createBalloonBuilder(content); builder.setFillColor(NotificationsUtil.getBackground(notification)).setCloseButtonEnabled(true).setShowCallout(showCallout) .setHideOnClickOutside(hideOnClickOutside) + .setHideOnAction(hideOnClickOutside) .setHideOnKeyOutside(hideOnClickOutside).setHideOnFrameResize(false); if (fadeOut) { From 79d895e243a2b177eb482d9c89c3bfc85a2507dd Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 16 Dec 2011 12:22:10 +0100 Subject: [PATCH 035/101] rename: ability to force select all --- .../rename/RenameHandlerRegistry.java | 2 ++ .../inplace/VariableInplaceRenamer.java | 8 ++--- .../spellchecker/quickfixes/RenameTo.java | 29 +++++++++---------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameHandlerRegistry.java b/platform/lang-impl/src/com/intellij/refactoring/rename/RenameHandlerRegistry.java index 41456d26e959..f29a9f00186c 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameHandlerRegistry.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/RenameHandlerRegistry.java @@ -24,6 +24,7 @@ import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.util.Key; import com.intellij.openapi.util.text.StringUtil; import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.rename.inplace.MemberInplaceRenameHandler; @@ -44,6 +45,7 @@ import java.util.TreeMap; * @author dsl */ public class RenameHandlerRegistry { + public static final Key SELECT_ALL = Key.create("rename.selectAll"); private final Set myHandlers = new HashSet(); private static final RenameHandlerRegistry INSTANCE = new RenameHandlerRegistry(); private final PsiElementRenameHandler myDefaultElementRenameHandler; diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java index 43f7a295a184..5d19eb3a39eb 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java @@ -72,10 +72,7 @@ import com.intellij.psi.search.searches.ReferencesSearch; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiUtilBase; import com.intellij.refactoring.RefactoringBundle; -import com.intellij.refactoring.rename.AutomaticRenamingDialog; -import com.intellij.refactoring.rename.NameSuggestionProvider; -import com.intellij.refactoring.rename.RenameProcessor; -import com.intellij.refactoring.rename.RenameUtil; +import com.intellij.refactoring.rename.*; import com.intellij.refactoring.rename.naming.AutomaticRenamer; import com.intellij.refactoring.rename.naming.AutomaticRenamerFactory; import com.intellij.refactoring.util.CommonRefactoringUtil; @@ -465,7 +462,8 @@ public class VariableInplaceRenamer { } protected boolean shouldSelectAll() { - return false; + final Boolean selectAll = myEditor.getUserData(RenameHandlerRegistry.SELECT_ALL); + return selectAll != null && selectAll.booleanValue(); } protected void navigateToAlreadyStarted(Document oldDocument, int exitCode) { diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java index 7df80f0edfa8..2bf1a9205d96 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java @@ -25,12 +25,12 @@ import com.intellij.openapi.editor.Editor; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.impl.text.TextEditorPsiDataProvider; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil; import com.intellij.refactoring.actions.RenameElementAction; import com.intellij.refactoring.rename.NameSuggestionProvider; +import com.intellij.refactoring.rename.RenameHandlerRegistry; import com.intellij.spellchecker.util.SpellCheckerBundle; import com.intellij.util.containers.HashMap; import org.jetbrains.annotations.NotNull; @@ -104,21 +104,20 @@ public class RenameTo extends ShowSuggestions implements SpellCheckerQuickFix { ) ); } - - DataContext dataContext = SimpleDataContext.getSimpleContext(map, DataManager.getInstance().getDataContext(editor.getComponent())); - AnAction action = new RenameElementAction(); - final boolean hadSelection = editor.getSelectionModel().hasSelection(); - final TextRange range = psiElement.getTextRange(); - if (range != null) { - editor.getSelectionModel().setSelection(range.getStartOffset(), range.getEndOffset()); + + final Boolean selectAll = editor.getUserData(RenameHandlerRegistry.SELECT_ALL); + try { + editor.putUserData(RenameHandlerRegistry.SELECT_ALL, true); + DataContext dataContext = SimpleDataContext.getSimpleContext(map, DataManager.getInstance().getDataContext(editor.getComponent())); + AnAction action = new RenameElementAction(); + AnActionEvent event = new AnActionEvent(null, dataContext, "", action.getTemplatePresentation(), ActionManager.getInstance(), 0); + action.actionPerformed(event); + if (provider != null) { + provider.setActive(false); + } } - AnActionEvent event = new AnActionEvent(null, dataContext, "", action.getTemplatePresentation(), ActionManager.getInstance(), 0); - action.actionPerformed(event); - if (provider != null) { - provider.setActive(false); - } - if (!hadSelection) { - editor.getSelectionModel().removeSelection(); + finally { + editor.putUserData(RenameHandlerRegistry.SELECT_ALL, selectAll); } } }; From b2d651f9ae8494f4ba03f26a18f2b7c191244d87 Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Thu, 15 Dec 2011 17:53:38 +0400 Subject: [PATCH 036/101] EA-32620 - IAE: VisualPosition. Debug info is added --- .../openapi/editor/LogicalPosition.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/platform/platform-api/src/com/intellij/openapi/editor/LogicalPosition.java b/platform/platform-api/src/com/intellij/openapi/editor/LogicalPosition.java index 3afce0f163f7..84e000db407b 100644 --- a/platform/platform-api/src/com/intellij/openapi/editor/LogicalPosition.java +++ b/platform/platform-api/src/com/intellij/openapi/editor/LogicalPosition.java @@ -87,12 +87,12 @@ public class LogicalPosition implements Comparable { */ public final int foldingColumnDiff; - public LogicalPosition(int line, int column) { + public LogicalPosition(int line, int column) throws IllegalArgumentException { this(line, column, 0, 0, 0, 0, 0, false); } public LogicalPosition(int line, int column, int softWrapLinesBeforeCurrentLogicalLine, int softWrapLinesOnCurrentLogicalLine, - int softWrapColumnDiff, int foldedLines, int foldingColumnDiff) + int softWrapColumnDiff, int foldedLines, int foldingColumnDiff) throws IllegalArgumentException { this( line, column, softWrapLinesBeforeCurrentLogicalLine, softWrapLinesOnCurrentLogicalLine, softWrapColumnDiff, foldedLines, @@ -102,7 +102,16 @@ public class LogicalPosition implements Comparable { private LogicalPosition(int line, int column, int softWrapLinesBeforeCurrentLogicalLine, int softWrapLinesOnCurrentLogicalLine, int softWrapColumnDiff, int foldedLines, int foldingColumnDiff, boolean visualPositionAware) - { + throws IllegalArgumentException { + if (column + softWrapColumnDiff + foldingColumnDiff < 0) { + throw new IllegalArgumentException(String.format( + "Attempt to create %s with invalid arguments - resulting column is negative (%d). Given arguments: line=%d, column=%d, " + + "soft wrap lines before: %d, soft wrap lines current: %d, soft wrap column diff: %d, folded lines: %d, folding column " + + "diff: %d, visual position aware: %b", + getClass().getName(), column + softWrapColumnDiff + foldingColumnDiff, line, column, softWrapLinesBeforeCurrentLogicalLine, + softWrapLinesOnCurrentLogicalLine, softWrapColumnDiff, foldedLines, foldingColumnDiff, visualPositionAware + )); + } this.line = line; this.column = column; this.softWrapLinesBeforeCurrentLogicalLine = softWrapLinesBeforeCurrentLogicalLine; @@ -147,9 +156,9 @@ public class LogicalPosition implements Comparable { ? "" : "; soft wrap: lines=" + (softWrapLinesBeforeCurrentLogicalLine + softWrapLinesOnCurrentLogicalLine) + " (before=" + softWrapLinesBeforeCurrentLogicalLine + "; current=" + softWrapLinesOnCurrentLogicalLine + ")") - + (softWrapColumnDiff == 0 ? "" : "columns diff=" + softWrapColumnDiff + ";" ) - + (foldedLines == 0? "" : " folding: lines = " + foldedLines + ";") - + (foldingColumnDiff == 0 ? "" : " columns diff=" + foldingColumnDiff); + + (softWrapColumnDiff == 0 ? "" : "; columns diff=" + softWrapColumnDiff + ";" ) + + (foldedLines == 0? "" : "; folding: lines = " + foldedLines + ";") + + (foldingColumnDiff == 0 ? "" : "; columns diff=" + foldingColumnDiff); } public int compareTo(LogicalPosition position) { From 02ef56a2259bc9949ed6491e8f50a8f47ec867e9 Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Fri, 16 Dec 2011 16:20:56 +0400 Subject: [PATCH 037/101] EA-29579 - assert: CaretModelImpl.moveToOffset Don't report nested caret move if it changes position at soft wrap-introduced virtual space --- .../openapi/editor/impl/CaretModelImpl.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java index b11b88efc34b..ec7206e3fad2 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java @@ -542,8 +542,26 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener, "Adjusting caret position by moving it before soft wrap. Moving to visual position %s%n", visualPosition )); } - moveToVisualPosition(visualPosition); - return; + final LogicalPosition logicalPosition = myEditor.visualToLogicalPosition(visualPosition); + final int tmpOffset = myEditor.logicalPositionToOffset(logicalPosition); + if (tmpOffset == myOffset) { + boolean restore = myReportCaretMoves; + myReportCaretMoves = false; + try { + moveToVisualPosition(visualPosition); + return; + } + finally { + myReportCaretMoves = restore; + } + } + else { + LogMessageEx.error(LOG, "Invalid editor dimension mapping", String.format( + "Expected to map visual position '%s' to offset %d but got the following: -> logical position '%s'; -> offset %d. " + + "State: %s", visualPosition, myOffset, logicalPosition, tmpOffset, myEditor.dumpState() + )); + } + } } From cf6806b673ddeb2cadd3b56e9bb10d82497bf525 Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 16 Dec 2011 13:42:50 +0100 Subject: [PATCH 038/101] fix tests --- .../intellij/execution/junit/TestPackage.java | 71 ++++++++++--------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/plugins/junit/src/com/intellij/execution/junit/TestPackage.java b/plugins/junit/src/com/intellij/execution/junit/TestPackage.java index 884fe6db8bd9..3c75043754eb 100644 --- a/plugins/junit/src/com/intellij/execution/junit/TestPackage.java +++ b/plugins/junit/src/com/intellij/execution/junit/TestPackage.java @@ -94,39 +94,7 @@ public class TestPackage extends TestObject { @Override public void startNotified(ProcessEvent event) { super.startNotified(event); - final JUnitConfiguration.Data data = myConfiguration.getPersistentData(); - final TestClassFilter filter; - try { - filter = getClassFilter(data); - } - catch (CantRunException e) { - //should not happen - return; - } - tasks[0] = findTestsWithProgress(new FindCallback() { - public void found(@NotNull final Collection classes, final boolean isJunit4) { - try { - addClassesListToJavaParameters(classes, new Function() { - @Nullable - public String fun(PsiElement element) { - if (element instanceof PsiClass) { - return JavaExecutionUtil.getRuntimeQualifiedName((PsiClass)element); - } - else if (element instanceof PsiMethod) { - PsiMethod method = (PsiMethod)element; - return JavaExecutionUtil.getRuntimeQualifiedName(method.getContainingClass()) + "," + method.getName(); - } - else { - return null; - } - } - }, getPackage(data).getQualifiedName(), false, isJunit4); - } - catch (CantRunException e) { - //can't be here - } - } - }, filter); + tasks[0] = (MySearchForTestsTask)findTests(); } @Override @@ -142,6 +110,43 @@ public class TestPackage extends TestObject { return handler; } + public Task findTests() { + final JUnitConfiguration.Data data = myConfiguration.getPersistentData(); + final TestClassFilter filter; + try { + filter = getClassFilter(data); + } + catch (CantRunException e) { + //should not happen + return null; + } + + return findTestsWithProgress(new FindCallback() { + public void found(@NotNull final Collection classes, final boolean isJunit4) { + try { + addClassesListToJavaParameters(classes, new Function() { + @Nullable + public String fun(PsiElement element) { + if (element instanceof PsiClass) { + return JavaExecutionUtil.getRuntimeQualifiedName((PsiClass)element); + } + else if (element instanceof PsiMethod) { + PsiMethod method = (PsiMethod)element; + return JavaExecutionUtil.getRuntimeQualifiedName(method.getContainingClass()) + "," + method.getName(); + } + else { + return null; + } + } + }, getPackage(data).getQualifiedName(), false, isJunit4); + } + catch (CantRunException e) { + //can't be here + } + } + }, filter); + } + protected void initialize() throws ExecutionException { super.initialize(); final JUnitConfiguration.Data data = myConfiguration.getPersistentData(); From 922a4963001d8389e5c0c41dfb970e35aa96ebdc Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 16 Dec 2011 13:55:22 +0100 Subject: [PATCH 039/101] Correct wording for safe write option --- .../src/com/intellij/ide/GeneralSettingsPanel.form | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/GeneralSettingsPanel.form b/platform/platform-impl/src/com/intellij/ide/GeneralSettingsPanel.form index 88a1158b41c5..3bef6a650100 100644 --- a/platform/platform-impl/src/com/intellij/ide/GeneralSettingsPanel.form +++ b/platform/platform-impl/src/com/intellij/ide/GeneralSettingsPanel.form @@ -149,8 +149,8 @@ - - + + From 5ddc6b6ee6815fe2abe1b858f570af4a7df758c2 Mon Sep 17 00:00:00 2001 From: "kirill.safonov" Date: Fri, 16 Dec 2011 18:16:46 +0400 Subject: [PATCH 040/101] Change signature dialog table: correctly add and remove cell editor listeners (IDEA-78550) --- .../ChangeSignatureDialogBase.java | 28 +++++++++++++------ .../ui/CodeFragmentTableCellEditorBase.java | 4 +++ .../refactoring/ui/StringTableCellEditor.java | 4 +++ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java index f8174fc869b2..fa324b0344e2 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java +++ b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialogBase.java @@ -65,10 +65,8 @@ import javax.swing.table.TableCellEditor; import java.awt.*; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; -import java.util.ArrayList; -import java.util.Collections; +import java.util.*; import java.util.List; -import java.util.Set; /** * @author Konstantin Bulenkov @@ -370,16 +368,30 @@ public abstract class ChangeSignatureDialogBase

>(myParametersTableModel) { + + public void removeEditor() { + clearEditorListeners(); + super.removeEditor(); + } + @Override public void editingStopped(ChangeEvent e) { super.editingStopped(e); repaint(); // to update disabled cells background } - @Nullable - @Override - public TableCellEditor getCellEditor(final int row, final int column) { - final TableCellEditor editor = super.getCellEditor(row, column); + private void clearEditorListeners() { + final TableCellEditor editor = getCellEditor(); + if (editor instanceof StringTableCellEditor) { + final StringTableCellEditor ed = (StringTableCellEditor)editor; + ed.clearListeners(); + } + else if (editor instanceof CodeFragmentTableCellEditorBase) { + ((CodeFragmentTableCellEditorBase)editor).clearListeners(); + } + } + + public Component prepareEditor(final TableCellEditor editor, final int row, final int column) { final DocumentAdapter listener = new DocumentAdapter() { @Override public void documentChanged(DocumentEvent e) { @@ -400,7 +412,7 @@ public abstract class ChangeSignatureDialogBase

Date: Fri, 16 Dec 2011 15:26:32 +0100 Subject: [PATCH 041/101] rename: replace the whole expression if lookup is chosen --- .../rename/inplace/VariableInplaceRenamer.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java index 5d19eb3a39eb..3d55f6b6d605 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java @@ -15,6 +15,8 @@ */ package com.intellij.refactoring.rename.inplace; +import com.intellij.codeInsight.completion.InsertHandler; +import com.intellij.codeInsight.completion.InsertionContext; import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl; import com.intellij.codeInsight.highlighting.HighlightManager; @@ -824,7 +826,21 @@ public class VariableInplaceRenamer { myLookupItems = new LookupElement[names.size()]; final Iterator iterator = names.iterator(); for (int i = 0; i < myLookupItems.length; i++) { - myLookupItems[i] = LookupElementBuilder.create(iterator.next()); + final String suggestion = iterator.next(); + myLookupItems[i] = LookupElementBuilder.create(suggestion).setInsertHandler(new InsertHandler() { + @Override + public void handleInsert(InsertionContext context, LookupElement item) { + if (shouldSelectAll()) return; + final Editor topLevelEditor = InjectedLanguageUtil.getTopLevelEditor(myEditor); + final TemplateState templateState = TemplateManagerImpl.getTemplateState(topLevelEditor); + if (templateState != null) { + final TextRange range = templateState.getCurrentVariableRange(); + if (range != null) { + myEditor.getDocument().replaceString(range.getStartOffset(), range.getEndOffset(), suggestion); + } + } + } + }); } } From 8fba9c66bcc81d17d852b404223c6345db3f05bb Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 15:31:33 +0100 Subject: [PATCH 042/101] don't close the quick doc when selecting another lookup element by mouse (IDEA-64008) --- .../codeInsight/documentation/DocumentationManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java index abe3fc8b8f5d..4b5cae8b6ec4 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java @@ -297,7 +297,8 @@ public class DocumentationManager { } }, keyboardShortcut != null ? keyboardShortcut.getFirstKeyStroke() : null)); // Null keyStroke is ok here - final JBPopup hint = JBPopupFactory.getInstance().createComponentPopupBuilder(component, component) + boolean hasLookup = LookupManager.getActiveLookup(myEditor) != null; + final JBPopup hint = JBPopupFactory.getInstance().createComponentPopupBuilder(component, component) .setRequestFocusCondition(project, NotLookupOrSearchCondition.INSTANCE) .setProject(project) .addListener(updateProcessor) @@ -308,6 +309,7 @@ public class DocumentationManager { .setResizable(true) .setMovable(true) .setRequestFocus(requestFocus) + .setCancelOnClickOutside(!hasLookup) // otherwise selecting lookup items by mouse would close the doc .setTitle(getTitle(element, false)) .setCouldPin(pinCallback) .setCancelCallback(new Computable() { From 2b5d768064c211e865b031a9d0dc86b2a4c47766 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 15:56:16 +0100 Subject: [PATCH 043/101] IDEA-78075 Notifications: notifications with 'log=false' should expire when closed or hidden --- .../impl/NotificationsManagerImpl.java | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java b/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java index c349a82ff8dd..9e7841e21960 100644 --- a/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/notification/impl/NotificationsManagerImpl.java @@ -136,11 +136,20 @@ public class NotificationsManagerImpl extends NotificationsManager implements No } final NotificationSettings settings = NotificationsConfigurationImpl.getSettings(notification.getGroupId()); - if (settings.isShouldLog() && settings.getDisplayType() != NotificationDisplayType.NONE) { + boolean shouldLog = settings.isShouldLog(); + boolean displayable = settings.getDisplayType() != NotificationDisplayType.NONE; + if (shouldLog && displayable) { myModel.add(notification, project); } - showWhenVisible(notification, project); + boolean willBeShown = displayable && NotificationsConfigurationImpl.getNotificationsConfigurationImpl().SHOW_BALLOONS; + if (!shouldLog && !willBeShown) { + notification.expire(); + } + + if (NotificationsConfigurationImpl.getNotificationsConfigurationImpl().SHOW_BALLOONS) { + showWhenVisible(notification, project); + } } private static void showWhenVisible(final Notification notification, final Project project) { @@ -187,8 +196,18 @@ public class NotificationsManagerImpl extends NotificationsManager implements No case STICKY_BALLOON: case BALLOON: default: - if (NotificationsConfigurationImpl.getNotificationsConfigurationImpl().SHOW_BALLOONS) { - notifyByBalloon(notification, type, project); + Balloon balloon = notifyByBalloon(notification, type, project); + if (!settings.isShouldLog()) { + if (balloon == null) { + notification.expire(); + } else { + balloon.addListener(new JBPopupAdapter() { + @Override + public void onClosed(LightweightWindowEvent event) { + notification.expire(); + } + }); + } } break; case TOOL_WINDOW: @@ -216,10 +235,11 @@ public class NotificationsManagerImpl extends NotificationsManager implements No } } - private static void notifyByBalloon(final Notification notification, + @Nullable + private static Balloon notifyByBalloon(final Notification notification, final NotificationDisplayType displayType, @Nullable final Project project) { - if (ApplicationManager.getApplication().isUnitTestMode()) return; + if (ApplicationManager.getApplication().isUnitTestMode()) return null; Window window = findWindowForBalloon(project); if (window instanceof IdeFrameImpl) { @@ -240,7 +260,9 @@ public class NotificationsManagerImpl extends NotificationsManager implements No } }); } + return balloon; } + return null; } @Nullable From f10baa830bb733443c6387ae93c53a7e9199dc0e Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 17:13:03 +0100 Subject: [PATCH 044/101] IDEA-69920 Support additional imports added by the Griffon compiler --- plugins/gradle/src/META-INF/plugin.xml | 1 + .../GradleDefaultImportContributor.java | 62 ++++++++++ .../gradle/config/GradleScriptType.java | 31 ----- plugins/groovy/src/META-INF/plugin.xml | 2 + .../GriffonDefaultImportContributor.java | 114 ++++++++++++++++++ .../groovy/lang/psi/impl/GroovyFileImpl.java | 13 +- .../resolve/DefaultImportContributor.java | 35 ++++++ 7 files changed, 222 insertions(+), 36 deletions(-) create mode 100644 plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleDefaultImportContributor.java create mode 100644 plugins/groovy/src/org/jetbrains/plugins/groovy/griffon/GriffonDefaultImportContributor.java create mode 100644 plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/DefaultImportContributor.java diff --git a/plugins/gradle/src/META-INF/plugin.xml b/plugins/gradle/src/META-INF/plugin.xml index 9dea0a91e319..d317fcd0aece 100644 --- a/plugins/gradle/src/META-INF/plugin.xml +++ b/plugins/gradle/src/META-INF/plugin.xml @@ -46,6 +46,7 @@ + diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleDefaultImportContributor.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleDefaultImportContributor.java new file mode 100644 index 000000000000..21da0843bebe --- /dev/null +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleDefaultImportContributor.java @@ -0,0 +1,62 @@ +/* + * Copyright 2000-2011 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 org.jetbrains.plugins.gradle.config; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.plugins.groovy.extensions.GroovyScriptTypeDetector; +import org.jetbrains.plugins.groovy.lang.psi.GroovyFile; +import org.jetbrains.plugins.groovy.lang.resolve.DefaultImportContributor; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * @author peter + */ +public class GradleDefaultImportContributor extends DefaultImportContributor { + + @Override + public List appendImplicitlyImportedPackages(@NotNull GroovyFile file) { + if (file.isScript() && GroovyScriptTypeDetector.getScriptType(file) instanceof GradleScriptType) { + return Arrays.asList( + "org.gradle", + "org.gradle.util", + "org.gradle.api", + "org.gradle.api.artifacts", + "org.gradle.api.artifacts.dsl", + "org.gradle.api.artifacts.specs", + "org.gradle.api.dependencies", + "org.gradle.api.execution", + "org.gradle.api.file", + "org.gradle.api.logging", + "org.gradle.api.initialization", + "org.gradle.api.invocation", + "org.gradle.api.plugins", + "org.gradle.api.plugins.quality", + "org.gradle.api.specs", + "org.gradle.api.tasks", + "org.gradle.api.tasks.bundling", + "org.gradle.api.tasks.compile", + "org.gradle.api.tasks.javadoc", + "org.gradle.api.tasks.testing", + "org.gradle.api.tasks.util", + "org.gradle.api.tasks.wrapper" + ); + } + return Collections.emptyList(); + } +} diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleScriptType.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleScriptType.java index ad65a832013a..1bbe0aeabd1b 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleScriptType.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradleScriptType.java @@ -57,9 +57,7 @@ import org.jetbrains.plugins.groovy.util.GroovyUtils; import javax.swing.*; import java.io.File; import java.io.IOException; -import java.util.Arrays; import java.util.Collection; -import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -279,33 +277,4 @@ public class GradleScriptType extends GroovyScriptType { return result; } - - @Override - public List appendImplicitImports(@NotNull GroovyFile file) { - return Arrays.asList( - "org.gradle", - "org.gradle.util", - "org.gradle.api", - "org.gradle.api.artifacts", - "org.gradle.api.artifacts.dsl", - "org.gradle.api.artifacts.specs", - "org.gradle.api.dependencies", - "org.gradle.api.execution", - "org.gradle.api.file", - "org.gradle.api.logging", - "org.gradle.api.initialization", - "org.gradle.api.invocation", - "org.gradle.api.plugins", - "org.gradle.api.plugins.quality", - "org.gradle.api.specs", - "org.gradle.api.tasks", - "org.gradle.api.tasks.bundling", - "org.gradle.api.tasks.compile", - "org.gradle.api.tasks.javadoc", - "org.gradle.api.tasks.testing", - "org.gradle.api.tasks.util", - "org.gradle.api.tasks.wrapper" - - ); - } } diff --git a/plugins/groovy/src/META-INF/plugin.xml b/plugins/groovy/src/META-INF/plugin.xml index 0bf08464e550..85c4a56a3cc8 100644 --- a/plugins/groovy/src/META-INF/plugin.xml +++ b/plugins/groovy/src/META-INF/plugin.xml @@ -29,6 +29,7 @@ + @@ -117,6 +118,7 @@ + diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/griffon/GriffonDefaultImportContributor.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/griffon/GriffonDefaultImportContributor.java new file mode 100644 index 000000000000..8a2f59d81848 --- /dev/null +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/griffon/GriffonDefaultImportContributor.java @@ -0,0 +1,114 @@ +/* + * Copyright 2000-2011 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 org.jetbrains.plugins.groovy.griffon; + +import com.intellij.lang.properties.IProperty; +import com.intellij.lang.properties.psi.PropertiesFile; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleUtil; +import com.intellij.openapi.util.Pair; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.vfs.VfsUtilCore; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.JavaPsiFacade; +import com.intellij.psi.PsiDirectory; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiPackage; +import com.intellij.psi.search.GlobalSearchScope; +import com.intellij.psi.util.CachedValueProvider; +import com.intellij.psi.util.CachedValuesManager; +import com.intellij.psi.util.PsiModificationTracker; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.plugins.groovy.lang.psi.GroovyFile; +import org.jetbrains.plugins.groovy.lang.resolve.DefaultImportContributor; +import org.jetbrains.plugins.groovy.mvc.MvcFramework; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * @author peter + */ +public class GriffonDefaultImportContributor extends DefaultImportContributor { + + private Pair, List> getDefaultImports(@NotNull final Module module) { + return CachedValuesManager.getManager(module.getProject()).getCachedValue(module, new CachedValueProvider, List>>() { + @Override + public Result, List>> compute() { + PsiPackage aPackage = JavaPsiFacade.getInstance(module.getProject()).findPackage("META-INF"); + if (aPackage != null) { + for (PsiDirectory directory : aPackage.getDirectories(GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module))) { + PsiFile file = directory.findFile("griffon-default-imports.properties"); + if (file instanceof PropertiesFile) { + List modelImports = tokenize(((PropertiesFile)file).findPropertyByKey("models")); + List viewImports = tokenize(((PropertiesFile)file).findPropertyByKey("views")); + return Result.create(Pair.create(modelImports, viewImports), PsiModificationTracker.MODIFICATION_COUNT); + } + } + } + + return Result.create(new Pair, List>(new ArrayList(), new ArrayList()), + PsiModificationTracker.MODIFICATION_COUNT); + } + + private List tokenize(IProperty models) { + List modelImports = new ArrayList(); + if (models != null) { + String value = models.getValue(); + if (value != null) { + String[] split = value.split(", "); + for (String s : split) { + modelImports.add(StringUtil.trimEnd(s, ".")); + } + } + } + return modelImports; + } + }); + } + + @Override + public List appendImplicitlyImportedPackages(@NotNull GroovyFile file) { + Module module = ModuleUtil.findModuleForPsiElement(file); + MvcFramework framework = MvcFramework.getInstance(module); + if (framework instanceof GriffonFramework) { + ArrayList result = new ArrayList(); + result.add("griffon.core"); + result.add("griffon.util"); + + VirtualFile griffonApp = framework.findAppDirectory(file); + if (griffonApp != null) { + VirtualFile models = griffonApp.findChild("models"); + VirtualFile views = griffonApp.findChild("views"); + VirtualFile vFile = file.getOriginalFile().getVirtualFile(); + + assert vFile != null; + assert module != null; + if (models != null && VfsUtilCore.isAncestor(models, vFile, true)) { + result.addAll(getDefaultImports(module).first); + } + else if (views != null && VfsUtilCore.isAncestor(views, vFile, true)) { + result.addAll(getDefaultImports(module).second); + } + } + + return result; + } + + return Collections.emptyList(); + } +} diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileImpl.java index 3dd8327bd876..9c7ac07496bb 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileImpl.java @@ -24,7 +24,6 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; import com.intellij.psi.codeStyle.CodeStyleManager; import com.intellij.psi.impl.ElementBase; -import com.intellij.psi.impl.file.PsiPackageImpl; import com.intellij.psi.scope.DelegatingScopeProcessor; import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.stubs.StubElement; @@ -55,12 +54,14 @@ import org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement; import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrLightParameter; import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GroovyScriptClass; import org.jetbrains.plugins.groovy.lang.psi.stubs.GrFileStub; +import org.jetbrains.plugins.groovy.lang.resolve.DefaultImportContributor; import org.jetbrains.plugins.groovy.lang.resolve.MethodTypeInferencer; import org.jetbrains.plugins.groovy.lang.resolve.ResolveUtil; import org.jetbrains.plugins.groovy.lang.resolve.processors.ClassHint; import javax.swing.*; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; /** @@ -222,12 +223,14 @@ public class GroovyFileImpl extends GroovyFileBaseImpl implements GroovyFile { } - private List getImplicitlyImportedPackages() { - final ArrayList result = new ArrayList(); + private LinkedHashSet getImplicitlyImportedPackages() { + final LinkedHashSet result = new LinkedHashSet(); ContainerUtil.addAll(result, IMPLICITLY_IMPORTED_PACKAGES); - if (isScript()) { - result.addAll(GroovyScriptTypeDetector.getScriptType(this).appendImplicitImports(this)); + + for (DefaultImportContributor contributor : DefaultImportContributor.EP_NAME.getExtensions()) { + result.addAll(contributor.appendImplicitlyImportedPackages(this)); } + return result; } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/DefaultImportContributor.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/DefaultImportContributor.java new file mode 100644 index 000000000000..98710b0888de --- /dev/null +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/DefaultImportContributor.java @@ -0,0 +1,35 @@ +/* + * Copyright 2000-2011 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 org.jetbrains.plugins.groovy.lang.resolve; + +import com.intellij.openapi.extensions.ExtensionPointName; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.plugins.groovy.lang.psi.GroovyFile; + +import java.util.Collections; +import java.util.List; + +/** + * @author peter + */ +public abstract class DefaultImportContributor { + public static final ExtensionPointName EP_NAME = ExtensionPointName.create("org.intellij.groovy.defaultImportContributor"); + + public List appendImplicitlyImportedPackages(@NotNull GroovyFile file) { + return Collections.emptyList(); + } + +} From 962747f12abeefe36c4abc235d8a9a524bf1bfe8 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 17:15:01 +0100 Subject: [PATCH 045/101] capitalization --- .../src/messages/RefactoringBundle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/platform-resources-en/src/messages/RefactoringBundle.properties b/platform/platform-resources-en/src/messages/RefactoringBundle.properties index 7a977b8f4b74..050576ade9bd 100644 --- a/platform/platform-resources-en/src/messages/RefactoringBundle.properties +++ b/platform/platform-resources-en/src/messages/RefactoringBundle.properties @@ -519,7 +519,7 @@ moving.local.classes.is.not.supported=Moving local classes is not supported. there.are.going.to.be.multiple.destination.files.with.the.same.name=There are going to be multiple destination files with the same name. do.you.wish.to.continue=Do you wish to continue? all.these.directories.will.be.moved.and.all.references.to.0.will.be.changed=All these directories will be moved, and all references to {0} \nwill be changed. -select.source.root.chooser.title=Select source root +select.source.root.chooser.title=Select Source Root moving.directories.command=Moving directories 0.uses.a.package.local.1={0} uses a package-local {1}. a.package.local.class.0.will.no.longer.be.accessible.from.1=A package-local class {0} will no longer be accessible from {1} From 6cb0dfee07eadaba81d06f3b6f3cd74ca9034bfd Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 17:33:54 +0100 Subject: [PATCH 046/101] group all platform tests in platform-tests module --- .idea/modules.xml | 1 + platform/lang-impl/lang-impl.iml | 3 --- platform/lvcs-impl/lvcs-impl.iml | 4 ---- platform/platform-api/platform-api.iml | 3 --- platform/platform-impl/platform-impl.iml | 3 --- platform/platform-tests/platform-tests.iml | 19 ++++++++++++++++++ .../options/DocumentChangesCollectorTest.java | 0 .../SelectionQuotingTypedHandlerTest.java | 0 .../EnterAfterJavadocTagHandlerTest.java | 0 .../codeInspection/SuppressionUtilTest.java | 0 .../intellij/execution/EnvPassingTest.java | 0 .../execution/GeneralCommandLineTest.java | 0 .../execution/impl/ConsoleBufferTest.java | 0 .../execution/impl/ConsoleUtilTest.java | 0 .../com/intellij/execution/printArgs.c | 0 .../com/intellij/execution/printArgs.exe | Bin .../formatting/BulkChangesMergerTest.java | 0 .../ConvertingOldDetectionExcludesTest.java | 0 .../DetectionExcludesConfigurationTest.java | 0 .../detection/MockFrameworkType.java | 0 .../history/core/InMemoryChangeList.java | 0 .../core/InMemoryLocalHistoryFacade.java | 0 .../history/core/LocalHistoryTestCase.java | 0 .../history/core/LocalVcsChangeSetsTest.java | 0 .../history/core/LocalVcsLabelsTest.java | 0 .../core/LocalVcsRecentChangesTest.java | 0 .../com/intellij/history/core/PathsTest.java | 0 .../history/core/TempDirTestCase.java | 0 .../ChangeListCollectingChangesTest.java | 0 .../history/core/changes/ChangeListTest.java | 0 .../core/changes/ChangeListTestCase.java | 0 .../history/core/changes/ChangeSetTest.java | 0 .../core/changes/ChangesRevertingTest.java | 0 .../changes/RootEntryDirectoriesTest.java | 0 .../changes/StructuralChangesPurgingTest.java | 0 .../history/core/revisions/RevisionsTest.java | 0 .../history/core/storage/StreamTest.java | 0 .../history/core/storage/TestContent.java | 0 .../history/core/tree/DirectoryEntryTest.java | 0 .../intellij/history/core/tree/EntryTest.java | 0 .../history/core/tree/FileEntryTest.java | 0 .../core/tree/RootEntryFindingTest.java | 0 .../history/core/tree/RootEntryTest.java | 0 .../history/integration/ActionsTest.java | 0 .../history/integration/BasicsTest.java | 0 .../ExternalChangesAndRefreshingTest.java | 0 .../integration/FileListeningTest.java | 0 .../integration/GettingContentAtDateTest.java | 0 .../history/integration/IdeaGatewayTest.java | 0 .../integration/IntegrationTestCase.java | 0 .../integration/LocalHistoryStorageTest.java | 0 .../history/integration/PatchingTestCase.java | 0 .../history/integration/PurgingTest.java | 0 .../integration/RevisionsAndDiffsTest.java | 0 .../history/integration/TestVirtualFile.java | 0 .../history/integration/VisitingTest.java | 0 .../integration/patches/PatchCreatorTest.java | 0 .../revertion/DifferenceReverterTest.java | 0 .../revertion/SelectionReverterTest.java | 0 .../ui/DirectoryChangeModelTest.java | 0 .../ui/DirectoryHistoryDialogModelTest.java | 0 ...rectoryHistoryDialogPatchCreationTest.java | 0 .../ui/DirectoryHistoryDialogTest.java | 0 .../integration/ui/FileHistoryDialogTest.java | 0 .../ui/HistoryDialogModelTest.java | 0 .../ui/LocalHistoryActionsTest.java | 0 .../ui/LocalHistoryUITestCase.java | 0 .../ui/RecentChangeDialogTest.java | 0 .../ui/SelectionHistoryDialogTest.java | 0 .../integration/ui/models/NullProgress.java | 0 .../ui/models/NullRevisionsProgress.java | 0 .../ui/models/SelectionCalculatorTest.java | 0 .../com/intellij/ide/ActivityMonitorTest.java | 0 .../ide/bookmarks/BookmarkManagerTest.java | 0 .../masterKey/MasterKeyPasswordSafeTest.java | 0 .../windows/WindowsCryptUtilTest.java | 0 .../memory/MemoryPasswordSafeTest.java | 0 .../ide/plugins/PluginDescriptorTest.java | 0 .../ide/plugins/VersionCompareTest.java | 0 .../ide/updates/TestUpdateSettings.java | 0 .../ide/updates/UpdateStrategyTest.java | 0 .../ide/updates/UpdatesInfoXppParserTest.java | 0 .../com/intellij/ide/updates/broken.xml | 0 .../com/intellij/ide/updates/current.xml | 0 .../intellij/ide/updates/emptyChannels.xml | 0 .../com/intellij/ide/updates/idea-new9eap.xml | 0 .../intellij/ide/updates/idea-newChannel.xml | 0 .../intellij/ide/updates/idea-newbuild.xml | 0 .../com/intellij/ide/updates/idea-same.xml | 0 .../intellij/ide/updates/oneProductOnly.xml | 0 .../com/intellij/ide/updates/updates.xml | 0 .../AbstractTreeBuilderCrashTest.java | 0 .../treeView/AbstractTreeBuilderTest.java | 0 .../ide/util/treeView/BaseTreeTestCase.java | 0 .../treeView/FilteringTreeBuilderTest.java | 0 .../ide/util/treeView/TreeUiTest.java | 0 .../com/intellij/idea/LockSupportTest.java | 0 .../intellij/lang/PsiBuilderQuickTest.java | 0 .../actionSystem/PresentationTest.java | 0 .../openapi/diff/LineTokenizerTest.java | 0 .../diff/impl/IgnoreWhiteSpaceTest.java | 0 .../openapi/diff/impl/MultiCheck.java | 0 .../diff/impl/external/DiffManagerTest.java | 0 .../impl/highlighting/FragmentEquality.java | 0 .../FragmentStringConvertion.java | 0 .../highlighting/LineBlockDividesTest.java | 0 .../diff/impl/highlighting/UtilTest.java | 0 .../incrementalMerge/MergeBuilderTest.java | 0 .../diff/impl/processing/ByWordTest.java | 0 .../diff/impl/processing/CorrectionTest.java | 0 .../processing/LineBlocksDiffPolicyTest.java | 0 .../impl/processing/NormalizationTest.java | 0 .../impl/processing/PreferWholeLinesTest.java | 0 .../processing/TextCompareProcessorTest.java | 0 .../impl/processing/UniteSameTypeTest.java | 0 .../diff/impl/splitter/LineBlocksTest.java | 0 .../impl/splitter/TransformationTest.java | 0 .../DefaultLineWrapPositionStrategyTest.java | 0 .../intellij/openapi/editor/DocumentTest.java | 0 .../intellij/openapi/editor/FoldingTest.java | 0 .../openapi/editor/RangeMarkerTest.java | 0 .../editor/StripTrailingSpacesTest.java | 0 .../actions/AbstractRegionToKillRingTest.java | 0 .../actions/CutLineBackwardActionTest.java | 0 .../editor/actions/CutLineEndActionsTest.java | 0 .../editor/actions/KillRegionActionTest.java | 0 .../actions/KillRingSaveActionTest.java | 0 .../actions/KillToWordEndActionTest.java | 0 .../actions/KillToWordStartActionTest.java | 0 ...rProcessingOnDocumentModificationTest.java | 0 .../openapi/editor/impl/CharArrayTest.java | 0 ...gProcessingOnDocumentModificationTest.java | 0 .../openapi/editor/impl/GuardBlockTest.java | 0 .../editor/impl/RangeIteratorTest.java | 0 .../editor/impl/TextChangesStorageTest.java | 0 .../MockEditorTextRepresentationHelper.java | 0 .../impl/softwrap/TextChangeImplTest.java | 0 .../mapping/CacheUpdateEventsStorageTest.java | 0 .../CachingSoftWrapDataMapperTest.java | 0 .../mapping/CompositeDataProviderTest.java | 0 .../mapping/DelayedRemovalMapTest.java | 0 .../mapping/FoldingDataProviderTest.java | 0 ...apApplianceOnDocumentModificationTest.java | 0 .../openapi/execution/ParametersListTest.java | 0 .../FileTypeUsagesCollectorTest.java | 0 .../fileTypes/ex/FileTypeChooserTest.java | 0 .../vfs/local/SymLinkHandlingTest.java | 0 ...ymbolWhiteSpaceDefinitionStrategyTest.java | 0 ...cTextWhiteSpaceDefinitionStrategyTest.java | 0 .../rename/naming/NameSuggesterTest.java | 0 .../com/intellij/ui/BasicTreeModel.java | 0 .../intellij/ui/TreeExpandCollapseTest.java | 0 .../usages/impl/UsageNodeTreeBuilderTest.java | 0 .../intellij/usages/impl/UsageViewTest.java | 0 .../intellij/util/IJSwingUtilitiesTest.java | 0 .../util/StringBuilderSpinAllocatorTest.java | 0 .../config/ExternalizablePropertyTest.java | 0 .../intellij/util/graph/ChunkGraphTest.java | 0 .../intellij/util/graph/GraphTestCase.java | 0 .../util/graph/KShortestPathsFinderTest.java | 0 .../intellij/util/graph/SearchCyclesTest.java | 0 .../intellij/util/graph/ShortestPathTest.java | 0 .../intellij/util/ui/tree/TreeUtilTest.java | 0 platform/usageView/usageView.iml | 3 --- 164 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 platform/platform-tests/platform-tests.iml rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/application/options/DocumentChangesCollectorTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/application/options/codeInsight/editor/quotes/SelectionQuotingTypedHandlerTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/codeInsight/editorActions/enter/EnterAfterJavadocTagHandlerTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/codeInspection/SuppressionUtilTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/execution/EnvPassingTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/execution/GeneralCommandLineTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/execution/impl/ConsoleBufferTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/execution/impl/ConsoleUtilTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/execution/printArgs.c (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/execution/printArgs.exe (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/formatting/BulkChangesMergerTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/framework/detection/ConvertingOldDetectionExcludesTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/framework/detection/DetectionExcludesConfigurationTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/framework/detection/MockFrameworkType.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/InMemoryChangeList.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/InMemoryLocalHistoryFacade.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/LocalHistoryTestCase.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/LocalVcsChangeSetsTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/LocalVcsRecentChangesTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/PathsTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/TempDirTestCase.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/changes/ChangeListTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/changes/ChangeListTestCase.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/changes/ChangeSetTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/changes/ChangesRevertingTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/changes/RootEntryDirectoriesTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/changes/StructuralChangesPurgingTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/revisions/RevisionsTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/storage/StreamTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/storage/TestContent.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/tree/DirectoryEntryTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/tree/EntryTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/tree/FileEntryTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/tree/RootEntryFindingTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/core/tree/RootEntryTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ActionsTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/BasicsTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ExternalChangesAndRefreshingTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/FileListeningTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/GettingContentAtDateTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/IdeaGatewayTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/IntegrationTestCase.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/PatchingTestCase.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/PurgingTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/RevisionsAndDiffsTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/TestVirtualFile.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/VisitingTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/patches/PatchCreatorTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/revertion/DifferenceReverterTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/revertion/SelectionReverterTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/DirectoryChangeModelTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogModelTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogPatchCreationTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/HistoryDialogModelTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/LocalHistoryUITestCase.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/RecentChangeDialogTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/models/NullProgress.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/models/NullRevisionsProgress.java (100%) rename platform/{lvcs-impl => platform-tests}/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/ActivityMonitorTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafeTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/windows/WindowsCryptUtilTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/passwordSafe/impl/providers/memory/MemoryPasswordSafeTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/plugins/PluginDescriptorTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/plugins/VersionCompareTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/TestUpdateSettings.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/UpdateStrategyTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/UpdatesInfoXppParserTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/broken.xml (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/current.xml (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/emptyChannels.xml (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/idea-new9eap.xml (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/idea-newChannel.xml (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/idea-newbuild.xml (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/idea-same.xml (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/oneProductOnly.xml (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/updates/updates.xml (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderCrashTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/util/treeView/FilteringTreeBuilderTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/idea/LockSupportTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/lang/PsiBuilderQuickTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/actionSystem/PresentationTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/LineTokenizerTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/IgnoreWhiteSpaceTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/MultiCheck.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/external/DiffManagerTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentEquality.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentStringConvertion.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/highlighting/LineBlockDividesTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/highlighting/UtilTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeBuilderTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/processing/ByWordTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/processing/CorrectionTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/processing/LineBlocksDiffPolicyTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/processing/NormalizationTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/processing/PreferWholeLinesTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/processing/TextCompareProcessorTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/processing/UniteSameTypeTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/splitter/LineBlocksTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/diff/impl/splitter/TransformationTest.java (100%) rename platform/{platform-api => platform-tests}/testSrc/com/intellij/openapi/editor/DefaultLineWrapPositionStrategyTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/DocumentTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/FoldingTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/RangeMarkerTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/StripTrailingSpacesTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/actions/AbstractRegionToKillRingTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/actions/CutLineBackwardActionTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/actions/CutLineEndActionsTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/actions/KillRegionActionTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/actions/KillRingSaveActionTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/actions/KillToWordStartActionTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/AbstractEditorProcessingOnDocumentModificationTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/CharArrayTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/FoldingProcessingOnDocumentModificationTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/GuardBlockTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/RangeIteratorTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/TextChangesStorageTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/softwrap/MockEditorTextRepresentationHelper.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/softwrap/TextChangeImplTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CacheUpdateEventsStorageTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapperTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CompositeDataProviderTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/DelayedRemovalMapTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/FoldingDataProviderTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/execution/ParametersListTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/openapi/fileTypes/FileTypeUsagesCollectorTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/fileTypes/ex/FileTypeChooserTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/psi/formatter/StaticSymbolWhiteSpaceDefinitionStrategyTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/psi/formatter/StaticTextWhiteSpaceDefinitionStrategyTest.java (100%) rename platform/{lang-impl => platform-tests}/testSrc/com/intellij/refactoring/rename/naming/NameSuggesterTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ui/BasicTreeModel.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/ui/TreeExpandCollapseTest.java (100%) rename platform/{usageView => platform-tests}/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java (100%) rename platform/{usageView => platform-tests}/testSrc/com/intellij/usages/impl/UsageViewTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/util/IJSwingUtilitiesTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/util/StringBuilderSpinAllocatorTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/util/config/ExternalizablePropertyTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/util/graph/ChunkGraphTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/util/graph/GraphTestCase.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/util/graph/KShortestPathsFinderTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/util/graph/SearchCyclesTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/util/graph/ShortestPathTest.java (100%) rename platform/{platform-impl => platform-tests}/testSrc/com/intellij/util/ui/tree/TreeUtilTest.java (100%) diff --git a/.idea/modules.xml b/.idea/modules.xml index 968acca3e62d..73a3546daa9b 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -79,6 +79,7 @@ + diff --git a/platform/lang-impl/lang-impl.iml b/platform/lang-impl/lang-impl.iml index 4f57b7574ea2..0bf245f2b51b 100644 --- a/platform/lang-impl/lang-impl.iml +++ b/platform/lang-impl/lang-impl.iml @@ -4,7 +4,6 @@ - @@ -19,11 +18,9 @@ - - diff --git a/platform/lvcs-impl/lvcs-impl.iml b/platform/lvcs-impl/lvcs-impl.iml index 9044be554b58..c717b082bab8 100644 --- a/platform/lvcs-impl/lvcs-impl.iml +++ b/platform/lvcs-impl/lvcs-impl.iml @@ -4,17 +4,13 @@ - - - - diff --git a/platform/platform-api/platform-api.iml b/platform/platform-api/platform-api.iml index 5f7e717d2212..96bc786658ac 100644 --- a/platform/platform-api/platform-api.iml +++ b/platform/platform-api/platform-api.iml @@ -4,7 +4,6 @@ - @@ -19,7 +18,6 @@ - @@ -29,7 +27,6 @@ - diff --git a/platform/platform-impl/platform-impl.iml b/platform/platform-impl/platform-impl.iml index b24f58c1d15f..e505978e2610 100644 --- a/platform/platform-impl/platform-impl.iml +++ b/platform/platform-impl/platform-impl.iml @@ -4,7 +4,6 @@ - @@ -21,9 +20,7 @@ - - diff --git a/platform/platform-tests/platform-tests.iml b/platform/platform-tests/platform-tests.iml new file mode 100644 index 000000000000..689106134d58 --- /dev/null +++ b/platform/platform-tests/platform-tests.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/platform/lang-impl/testSrc/com/intellij/application/options/DocumentChangesCollectorTest.java b/platform/platform-tests/testSrc/com/intellij/application/options/DocumentChangesCollectorTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/application/options/DocumentChangesCollectorTest.java rename to platform/platform-tests/testSrc/com/intellij/application/options/DocumentChangesCollectorTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/application/options/codeInsight/editor/quotes/SelectionQuotingTypedHandlerTest.java b/platform/platform-tests/testSrc/com/intellij/application/options/codeInsight/editor/quotes/SelectionQuotingTypedHandlerTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/application/options/codeInsight/editor/quotes/SelectionQuotingTypedHandlerTest.java rename to platform/platform-tests/testSrc/com/intellij/application/options/codeInsight/editor/quotes/SelectionQuotingTypedHandlerTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/codeInsight/editorActions/enter/EnterAfterJavadocTagHandlerTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/editorActions/enter/EnterAfterJavadocTagHandlerTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/codeInsight/editorActions/enter/EnterAfterJavadocTagHandlerTest.java rename to platform/platform-tests/testSrc/com/intellij/codeInsight/editorActions/enter/EnterAfterJavadocTagHandlerTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/codeInspection/SuppressionUtilTest.java b/platform/platform-tests/testSrc/com/intellij/codeInspection/SuppressionUtilTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/codeInspection/SuppressionUtilTest.java rename to platform/platform-tests/testSrc/com/intellij/codeInspection/SuppressionUtilTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/execution/EnvPassingTest.java b/platform/platform-tests/testSrc/com/intellij/execution/EnvPassingTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/execution/EnvPassingTest.java rename to platform/platform-tests/testSrc/com/intellij/execution/EnvPassingTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/execution/GeneralCommandLineTest.java b/platform/platform-tests/testSrc/com/intellij/execution/GeneralCommandLineTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/execution/GeneralCommandLineTest.java rename to platform/platform-tests/testSrc/com/intellij/execution/GeneralCommandLineTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/execution/impl/ConsoleBufferTest.java b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleBufferTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/execution/impl/ConsoleBufferTest.java rename to platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleBufferTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/execution/impl/ConsoleUtilTest.java b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleUtilTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/execution/impl/ConsoleUtilTest.java rename to platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleUtilTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/execution/printArgs.c b/platform/platform-tests/testSrc/com/intellij/execution/printArgs.c similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/execution/printArgs.c rename to platform/platform-tests/testSrc/com/intellij/execution/printArgs.c diff --git a/platform/platform-impl/testSrc/com/intellij/execution/printArgs.exe b/platform/platform-tests/testSrc/com/intellij/execution/printArgs.exe similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/execution/printArgs.exe rename to platform/platform-tests/testSrc/com/intellij/execution/printArgs.exe diff --git a/platform/lang-impl/testSrc/com/intellij/formatting/BulkChangesMergerTest.java b/platform/platform-tests/testSrc/com/intellij/formatting/BulkChangesMergerTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/formatting/BulkChangesMergerTest.java rename to platform/platform-tests/testSrc/com/intellij/formatting/BulkChangesMergerTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/framework/detection/ConvertingOldDetectionExcludesTest.java b/platform/platform-tests/testSrc/com/intellij/framework/detection/ConvertingOldDetectionExcludesTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/framework/detection/ConvertingOldDetectionExcludesTest.java rename to platform/platform-tests/testSrc/com/intellij/framework/detection/ConvertingOldDetectionExcludesTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/framework/detection/DetectionExcludesConfigurationTest.java b/platform/platform-tests/testSrc/com/intellij/framework/detection/DetectionExcludesConfigurationTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/framework/detection/DetectionExcludesConfigurationTest.java rename to platform/platform-tests/testSrc/com/intellij/framework/detection/DetectionExcludesConfigurationTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/framework/detection/MockFrameworkType.java b/platform/platform-tests/testSrc/com/intellij/framework/detection/MockFrameworkType.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/framework/detection/MockFrameworkType.java rename to platform/platform-tests/testSrc/com/intellij/framework/detection/MockFrameworkType.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/InMemoryChangeList.java b/platform/platform-tests/testSrc/com/intellij/history/core/InMemoryChangeList.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/InMemoryChangeList.java rename to platform/platform-tests/testSrc/com/intellij/history/core/InMemoryChangeList.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/InMemoryLocalHistoryFacade.java b/platform/platform-tests/testSrc/com/intellij/history/core/InMemoryLocalHistoryFacade.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/InMemoryLocalHistoryFacade.java rename to platform/platform-tests/testSrc/com/intellij/history/core/InMemoryLocalHistoryFacade.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/LocalHistoryTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/core/LocalHistoryTestCase.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/LocalHistoryTestCase.java rename to platform/platform-tests/testSrc/com/intellij/history/core/LocalHistoryTestCase.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsChangeSetsTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsChangeSetsTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsChangeSetsTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsChangeSetsTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsRecentChangesTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsRecentChangesTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsRecentChangesTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsRecentChangesTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/PathsTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/PathsTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/PathsTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/PathsTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/TempDirTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/core/TempDirTestCase.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/TempDirTestCase.java rename to platform/platform-tests/testSrc/com/intellij/history/core/TempDirTestCase.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListTestCase.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListTestCase.java rename to platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListTestCase.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeSetTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeSetTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeSetTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeSetTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangesRevertingTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangesRevertingTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangesRevertingTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangesRevertingTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/changes/RootEntryDirectoriesTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/changes/RootEntryDirectoriesTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/changes/RootEntryDirectoriesTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/changes/RootEntryDirectoriesTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/changes/StructuralChangesPurgingTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/changes/StructuralChangesPurgingTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/changes/StructuralChangesPurgingTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/changes/StructuralChangesPurgingTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/revisions/RevisionsTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/revisions/RevisionsTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/revisions/RevisionsTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/revisions/RevisionsTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/storage/StreamTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/storage/StreamTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/storage/StreamTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/storage/StreamTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/storage/TestContent.java b/platform/platform-tests/testSrc/com/intellij/history/core/storage/TestContent.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/storage/TestContent.java rename to platform/platform-tests/testSrc/com/intellij/history/core/storage/TestContent.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/tree/DirectoryEntryTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/tree/DirectoryEntryTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/tree/DirectoryEntryTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/tree/DirectoryEntryTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/tree/EntryTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/tree/EntryTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/tree/EntryTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/tree/EntryTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/tree/FileEntryTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/tree/FileEntryTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/tree/FileEntryTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/tree/FileEntryTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/tree/RootEntryFindingTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/tree/RootEntryFindingTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/tree/RootEntryFindingTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/tree/RootEntryFindingTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/core/tree/RootEntryTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/tree/RootEntryTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/core/tree/RootEntryTest.java rename to platform/platform-tests/testSrc/com/intellij/history/core/tree/RootEntryTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ActionsTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ActionsTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ActionsTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ActionsTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/BasicsTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/BasicsTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/BasicsTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/BasicsTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ExternalChangesAndRefreshingTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ExternalChangesAndRefreshingTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ExternalChangesAndRefreshingTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ExternalChangesAndRefreshingTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/FileListeningTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/FileListeningTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/FileListeningTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/FileListeningTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/GettingContentAtDateTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/GettingContentAtDateTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/GettingContentAtDateTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/GettingContentAtDateTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/IdeaGatewayTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/IdeaGatewayTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/IdeaGatewayTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/IdeaGatewayTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/IntegrationTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/IntegrationTestCase.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/PatchingTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/PatchingTestCase.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/PurgingTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/PurgingTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/PurgingTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/PurgingTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/RevisionsAndDiffsTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/RevisionsAndDiffsTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/RevisionsAndDiffsTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/RevisionsAndDiffsTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/TestVirtualFile.java b/platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/TestVirtualFile.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/VisitingTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/VisitingTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/VisitingTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/VisitingTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/patches/PatchCreatorTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/patches/PatchCreatorTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/patches/PatchCreatorTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/patches/PatchCreatorTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/revertion/DifferenceReverterTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/revertion/DifferenceReverterTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/revertion/DifferenceReverterTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/revertion/DifferenceReverterTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/revertion/SelectionReverterTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/revertion/SelectionReverterTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/revertion/SelectionReverterTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/revertion/SelectionReverterTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/DirectoryChangeModelTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryChangeModelTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/DirectoryChangeModelTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryChangeModelTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogModelTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogModelTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogModelTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogModelTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogPatchCreationTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogPatchCreationTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogPatchCreationTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogPatchCreationTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/HistoryDialogModelTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/HistoryDialogModelTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/HistoryDialogModelTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/HistoryDialogModelTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/LocalHistoryUITestCase.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryUITestCase.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/LocalHistoryUITestCase.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryUITestCase.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/RecentChangeDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/RecentChangeDialogTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/RecentChangeDialogTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/RecentChangeDialogTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/NullProgress.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/NullProgress.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/NullProgress.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/NullProgress.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/NullRevisionsProgress.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/NullRevisionsProgress.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/NullRevisionsProgress.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/NullRevisionsProgress.java diff --git a/platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java similarity index 100% rename from platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java rename to platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/ActivityMonitorTest.java b/platform/platform-tests/testSrc/com/intellij/ide/ActivityMonitorTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/ActivityMonitorTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/ActivityMonitorTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java b/platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafeTest.java b/platform/platform-tests/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafeTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafeTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafeTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/windows/WindowsCryptUtilTest.java b/platform/platform-tests/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/windows/WindowsCryptUtilTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/windows/WindowsCryptUtilTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/passwordSafe/impl/providers/masterKey/windows/WindowsCryptUtilTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/passwordSafe/impl/providers/memory/MemoryPasswordSafeTest.java b/platform/platform-tests/testSrc/com/intellij/ide/passwordSafe/impl/providers/memory/MemoryPasswordSafeTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/passwordSafe/impl/providers/memory/MemoryPasswordSafeTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/passwordSafe/impl/providers/memory/MemoryPasswordSafeTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/plugins/PluginDescriptorTest.java b/platform/platform-tests/testSrc/com/intellij/ide/plugins/PluginDescriptorTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/plugins/PluginDescriptorTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/plugins/PluginDescriptorTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/plugins/VersionCompareTest.java b/platform/platform-tests/testSrc/com/intellij/ide/plugins/VersionCompareTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/plugins/VersionCompareTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/plugins/VersionCompareTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/TestUpdateSettings.java b/platform/platform-tests/testSrc/com/intellij/ide/updates/TestUpdateSettings.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/TestUpdateSettings.java rename to platform/platform-tests/testSrc/com/intellij/ide/updates/TestUpdateSettings.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/UpdateStrategyTest.java b/platform/platform-tests/testSrc/com/intellij/ide/updates/UpdateStrategyTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/UpdateStrategyTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/updates/UpdateStrategyTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/UpdatesInfoXppParserTest.java b/platform/platform-tests/testSrc/com/intellij/ide/updates/UpdatesInfoXppParserTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/UpdatesInfoXppParserTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/updates/UpdatesInfoXppParserTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/broken.xml b/platform/platform-tests/testSrc/com/intellij/ide/updates/broken.xml similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/broken.xml rename to platform/platform-tests/testSrc/com/intellij/ide/updates/broken.xml diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/current.xml b/platform/platform-tests/testSrc/com/intellij/ide/updates/current.xml similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/current.xml rename to platform/platform-tests/testSrc/com/intellij/ide/updates/current.xml diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/emptyChannels.xml b/platform/platform-tests/testSrc/com/intellij/ide/updates/emptyChannels.xml similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/emptyChannels.xml rename to platform/platform-tests/testSrc/com/intellij/ide/updates/emptyChannels.xml diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/idea-new9eap.xml b/platform/platform-tests/testSrc/com/intellij/ide/updates/idea-new9eap.xml similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/idea-new9eap.xml rename to platform/platform-tests/testSrc/com/intellij/ide/updates/idea-new9eap.xml diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/idea-newChannel.xml b/platform/platform-tests/testSrc/com/intellij/ide/updates/idea-newChannel.xml similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/idea-newChannel.xml rename to platform/platform-tests/testSrc/com/intellij/ide/updates/idea-newChannel.xml diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/idea-newbuild.xml b/platform/platform-tests/testSrc/com/intellij/ide/updates/idea-newbuild.xml similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/idea-newbuild.xml rename to platform/platform-tests/testSrc/com/intellij/ide/updates/idea-newbuild.xml diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/idea-same.xml b/platform/platform-tests/testSrc/com/intellij/ide/updates/idea-same.xml similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/idea-same.xml rename to platform/platform-tests/testSrc/com/intellij/ide/updates/idea-same.xml diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/oneProductOnly.xml b/platform/platform-tests/testSrc/com/intellij/ide/updates/oneProductOnly.xml similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/oneProductOnly.xml rename to platform/platform-tests/testSrc/com/intellij/ide/updates/oneProductOnly.xml diff --git a/platform/platform-impl/testSrc/com/intellij/ide/updates/updates.xml b/platform/platform-tests/testSrc/com/intellij/ide/updates/updates.xml similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/updates/updates.xml rename to platform/platform-tests/testSrc/com/intellij/ide/updates/updates.xml diff --git a/platform/platform-impl/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderCrashTest.java b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderCrashTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderCrashTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderCrashTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderTest.java b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/util/treeView/AbstractTreeBuilderTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java rename to platform/platform-tests/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/util/treeView/FilteringTreeBuilderTest.java b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/FilteringTreeBuilderTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/util/treeView/FilteringTreeBuilderTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/util/treeView/FilteringTreeBuilderTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java rename to platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/idea/LockSupportTest.java b/platform/platform-tests/testSrc/com/intellij/idea/LockSupportTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/idea/LockSupportTest.java rename to platform/platform-tests/testSrc/com/intellij/idea/LockSupportTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/lang/PsiBuilderQuickTest.java b/platform/platform-tests/testSrc/com/intellij/lang/PsiBuilderQuickTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/lang/PsiBuilderQuickTest.java rename to platform/platform-tests/testSrc/com/intellij/lang/PsiBuilderQuickTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/actionSystem/PresentationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/actionSystem/PresentationTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/actionSystem/PresentationTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/actionSystem/PresentationTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/LineTokenizerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/LineTokenizerTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/LineTokenizerTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/LineTokenizerTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/IgnoreWhiteSpaceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/IgnoreWhiteSpaceTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/IgnoreWhiteSpaceTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/IgnoreWhiteSpaceTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/MultiCheck.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/MultiCheck.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/MultiCheck.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/MultiCheck.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/external/DiffManagerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/external/DiffManagerTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/external/DiffManagerTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/external/DiffManagerTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentEquality.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentEquality.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentEquality.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentEquality.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentStringConvertion.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentStringConvertion.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentStringConvertion.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/highlighting/FragmentStringConvertion.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/highlighting/LineBlockDividesTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/highlighting/LineBlockDividesTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/highlighting/LineBlockDividesTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/highlighting/LineBlockDividesTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/highlighting/UtilTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/highlighting/UtilTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/highlighting/UtilTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/highlighting/UtilTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeBuilderTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeBuilderTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeBuilderTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeBuilderTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/ByWordTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/ByWordTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/ByWordTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/ByWordTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/CorrectionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/CorrectionTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/CorrectionTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/CorrectionTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/LineBlocksDiffPolicyTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/LineBlocksDiffPolicyTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/LineBlocksDiffPolicyTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/LineBlocksDiffPolicyTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/NormalizationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/NormalizationTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/NormalizationTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/NormalizationTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/PreferWholeLinesTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/PreferWholeLinesTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/PreferWholeLinesTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/PreferWholeLinesTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/TextCompareProcessorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/TextCompareProcessorTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/TextCompareProcessorTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/TextCompareProcessorTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/UniteSameTypeTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/UniteSameTypeTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/processing/UniteSameTypeTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/processing/UniteSameTypeTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/splitter/LineBlocksTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/splitter/LineBlocksTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/splitter/LineBlocksTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/splitter/LineBlocksTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/splitter/TransformationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/splitter/TransformationTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/diff/impl/splitter/TransformationTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/splitter/TransformationTest.java diff --git a/platform/platform-api/testSrc/com/intellij/openapi/editor/DefaultLineWrapPositionStrategyTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/DefaultLineWrapPositionStrategyTest.java similarity index 100% rename from platform/platform-api/testSrc/com/intellij/openapi/editor/DefaultLineWrapPositionStrategyTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/DefaultLineWrapPositionStrategyTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/DocumentTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/DocumentTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/DocumentTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/DocumentTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/FoldingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/FoldingTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/RangeMarkerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/RangeMarkerTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/RangeMarkerTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/RangeMarkerTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/StripTrailingSpacesTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/StripTrailingSpacesTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/StripTrailingSpacesTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/StripTrailingSpacesTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/AbstractRegionToKillRingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/AbstractRegionToKillRingTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/AbstractRegionToKillRingTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/AbstractRegionToKillRingTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/CutLineBackwardActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineBackwardActionTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/CutLineBackwardActionTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineBackwardActionTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/CutLineEndActionsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineEndActionsTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/CutLineEndActionsTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineEndActionsTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/KillRegionActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRegionActionTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/KillRegionActionTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRegionActionTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/KillRingSaveActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRingSaveActionTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/KillRingSaveActionTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRingSaveActionTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/KillToWordStartActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordStartActionTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/actions/KillToWordStartActionTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordStartActionTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/AbstractEditorProcessingOnDocumentModificationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorProcessingOnDocumentModificationTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/AbstractEditorProcessingOnDocumentModificationTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorProcessingOnDocumentModificationTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/CharArrayTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/CharArrayTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/CharArrayTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/CharArrayTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/FoldingProcessingOnDocumentModificationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/FoldingProcessingOnDocumentModificationTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/FoldingProcessingOnDocumentModificationTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/FoldingProcessingOnDocumentModificationTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/GuardBlockTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/GuardBlockTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/GuardBlockTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/GuardBlockTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/RangeIteratorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeIteratorTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/RangeIteratorTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeIteratorTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/TextChangesStorageTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TextChangesStorageTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/TextChangesStorageTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TextChangesStorageTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/MockEditorTextRepresentationHelper.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/MockEditorTextRepresentationHelper.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/MockEditorTextRepresentationHelper.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/MockEditorTextRepresentationHelper.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/TextChangeImplTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/TextChangeImplTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/TextChangeImplTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/TextChangeImplTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CacheUpdateEventsStorageTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CacheUpdateEventsStorageTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CacheUpdateEventsStorageTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CacheUpdateEventsStorageTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapperTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapperTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapperTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapperTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CompositeDataProviderTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CompositeDataProviderTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CompositeDataProviderTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/CompositeDataProviderTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/DelayedRemovalMapTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/DelayedRemovalMapTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/DelayedRemovalMapTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/DelayedRemovalMapTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/FoldingDataProviderTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/FoldingDataProviderTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/FoldingDataProviderTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/FoldingDataProviderTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/execution/ParametersListTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/execution/ParametersListTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/execution/ParametersListTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/execution/ParametersListTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/openapi/fileTypes/FileTypeUsagesCollectorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/FileTypeUsagesCollectorTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/openapi/fileTypes/FileTypeUsagesCollectorTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/FileTypeUsagesCollectorTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/fileTypes/ex/FileTypeChooserTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/ex/FileTypeChooserTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/fileTypes/ex/FileTypeChooserTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/ex/FileTypeChooserTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/psi/formatter/StaticSymbolWhiteSpaceDefinitionStrategyTest.java b/platform/platform-tests/testSrc/com/intellij/psi/formatter/StaticSymbolWhiteSpaceDefinitionStrategyTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/psi/formatter/StaticSymbolWhiteSpaceDefinitionStrategyTest.java rename to platform/platform-tests/testSrc/com/intellij/psi/formatter/StaticSymbolWhiteSpaceDefinitionStrategyTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/psi/formatter/StaticTextWhiteSpaceDefinitionStrategyTest.java b/platform/platform-tests/testSrc/com/intellij/psi/formatter/StaticTextWhiteSpaceDefinitionStrategyTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/psi/formatter/StaticTextWhiteSpaceDefinitionStrategyTest.java rename to platform/platform-tests/testSrc/com/intellij/psi/formatter/StaticTextWhiteSpaceDefinitionStrategyTest.java diff --git a/platform/lang-impl/testSrc/com/intellij/refactoring/rename/naming/NameSuggesterTest.java b/platform/platform-tests/testSrc/com/intellij/refactoring/rename/naming/NameSuggesterTest.java similarity index 100% rename from platform/lang-impl/testSrc/com/intellij/refactoring/rename/naming/NameSuggesterTest.java rename to platform/platform-tests/testSrc/com/intellij/refactoring/rename/naming/NameSuggesterTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/ui/BasicTreeModel.java b/platform/platform-tests/testSrc/com/intellij/ui/BasicTreeModel.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ui/BasicTreeModel.java rename to platform/platform-tests/testSrc/com/intellij/ui/BasicTreeModel.java diff --git a/platform/platform-impl/testSrc/com/intellij/ui/TreeExpandCollapseTest.java b/platform/platform-tests/testSrc/com/intellij/ui/TreeExpandCollapseTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/ui/TreeExpandCollapseTest.java rename to platform/platform-tests/testSrc/com/intellij/ui/TreeExpandCollapseTest.java diff --git a/platform/usageView/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java similarity index 100% rename from platform/usageView/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java rename to platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java diff --git a/platform/usageView/testSrc/com/intellij/usages/impl/UsageViewTest.java b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java similarity index 100% rename from platform/usageView/testSrc/com/intellij/usages/impl/UsageViewTest.java rename to platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/util/IJSwingUtilitiesTest.java b/platform/platform-tests/testSrc/com/intellij/util/IJSwingUtilitiesTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/util/IJSwingUtilitiesTest.java rename to platform/platform-tests/testSrc/com/intellij/util/IJSwingUtilitiesTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/util/StringBuilderSpinAllocatorTest.java b/platform/platform-tests/testSrc/com/intellij/util/StringBuilderSpinAllocatorTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/util/StringBuilderSpinAllocatorTest.java rename to platform/platform-tests/testSrc/com/intellij/util/StringBuilderSpinAllocatorTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/util/config/ExternalizablePropertyTest.java b/platform/platform-tests/testSrc/com/intellij/util/config/ExternalizablePropertyTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/util/config/ExternalizablePropertyTest.java rename to platform/platform-tests/testSrc/com/intellij/util/config/ExternalizablePropertyTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/util/graph/ChunkGraphTest.java b/platform/platform-tests/testSrc/com/intellij/util/graph/ChunkGraphTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/util/graph/ChunkGraphTest.java rename to platform/platform-tests/testSrc/com/intellij/util/graph/ChunkGraphTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/util/graph/GraphTestCase.java b/platform/platform-tests/testSrc/com/intellij/util/graph/GraphTestCase.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/util/graph/GraphTestCase.java rename to platform/platform-tests/testSrc/com/intellij/util/graph/GraphTestCase.java diff --git a/platform/platform-impl/testSrc/com/intellij/util/graph/KShortestPathsFinderTest.java b/platform/platform-tests/testSrc/com/intellij/util/graph/KShortestPathsFinderTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/util/graph/KShortestPathsFinderTest.java rename to platform/platform-tests/testSrc/com/intellij/util/graph/KShortestPathsFinderTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/util/graph/SearchCyclesTest.java b/platform/platform-tests/testSrc/com/intellij/util/graph/SearchCyclesTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/util/graph/SearchCyclesTest.java rename to platform/platform-tests/testSrc/com/intellij/util/graph/SearchCyclesTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/util/graph/ShortestPathTest.java b/platform/platform-tests/testSrc/com/intellij/util/graph/ShortestPathTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/util/graph/ShortestPathTest.java rename to platform/platform-tests/testSrc/com/intellij/util/graph/ShortestPathTest.java diff --git a/platform/platform-impl/testSrc/com/intellij/util/ui/tree/TreeUtilTest.java b/platform/platform-tests/testSrc/com/intellij/util/ui/tree/TreeUtilTest.java similarity index 100% rename from platform/platform-impl/testSrc/com/intellij/util/ui/tree/TreeUtilTest.java rename to platform/platform-tests/testSrc/com/intellij/util/ui/tree/TreeUtilTest.java diff --git a/platform/usageView/usageView.iml b/platform/usageView/usageView.iml index a29a428de6af..fa62559a83b4 100644 --- a/platform/usageView/usageView.iml +++ b/platform/usageView/usageView.iml @@ -4,13 +4,10 @@ - - - From 905b9726dcf220f327f1bbf7145f8b6fda4452ec Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 17:43:21 +0100 Subject: [PATCH 047/101] refactoring-tests is out of dependency cycle --- .../com/intellij/mock/MockPsiDirectory.java | 137 +++++++ .../src/com/intellij/mock/MockPsiElement.java | 378 +++++++++++++++++ .../src/com/intellij/mock/MockPsiFile.java | 382 ++++++++++++++++++ 3 files changed, 897 insertions(+) create mode 100644 java/testFramework/src/com/intellij/mock/MockPsiDirectory.java create mode 100644 platform/testFramework/src/com/intellij/mock/MockPsiElement.java create mode 100644 platform/testFramework/src/com/intellij/mock/MockPsiFile.java diff --git a/java/testFramework/src/com/intellij/mock/MockPsiDirectory.java b/java/testFramework/src/com/intellij/mock/MockPsiDirectory.java new file mode 100644 index 000000000000..b451b291693c --- /dev/null +++ b/java/testFramework/src/com/intellij/mock/MockPsiDirectory.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved. + */ +package com.intellij.mock; + +import com.intellij.navigation.ItemPresentation; +import com.intellij.openapi.Disposable; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.*; +import com.intellij.psi.search.PsiElementProcessor; +import com.intellij.util.IncorrectOperationException; +import com.intellij.lang.Language; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * @author peter + */ +public class MockPsiDirectory extends MockPsiElement implements PsiDirectory { + private final PsiPackage myPackage; + + public MockPsiDirectory(final PsiPackage aPackage, @NotNull Disposable parentDisposable) { + super(parentDisposable); + myPackage = aPackage; + } + + @Override + public boolean isDirectory() { + return true; + } + + @NotNull + @Override + public Language getLanguage() { + return Language.ANY; + } + + @Override + public void checkCreateFile(@NotNull final String name) throws IncorrectOperationException { + throw new IncorrectOperationException("Method checkCreateFile is not yet implemented in " + getClass().getName()); + } + + @Override + public void checkCreateSubdirectory(@NotNull final String name) throws IncorrectOperationException { + throw new IncorrectOperationException("Method checkCreateSubdirectory is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiDirectory getParent() { + return getParentDirectory(); + } + + + @Override + @NotNull + public PsiFile createFile(@NotNull final String name) throws IncorrectOperationException { + throw new IncorrectOperationException("Method createFile is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public PsiFile copyFileFrom(@NotNull final String newName, @NotNull final PsiFile originalFile) throws IncorrectOperationException { + throw new IncorrectOperationException("Method copyFileFrom is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public PsiDirectory createSubdirectory(@NotNull final String name) throws IncorrectOperationException { + throw new IncorrectOperationException("Method createSubdirectory is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public PsiFile findFile(@NotNull @NonNls final String name) { + throw new UnsupportedOperationException("Method findFile is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public PsiDirectory findSubdirectory(@NotNull final String name) { + throw new UnsupportedOperationException("Method findSubdirectory is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public PsiFile[] getFiles() { + throw new UnsupportedOperationException("Method getFiles is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public String getName() { + throw new UnsupportedOperationException("Method getName is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public PsiDirectory getParentDirectory() { + final PsiPackage psiPackage = myPackage.getParentPackage(); + return psiPackage == null ? null : new MockPsiDirectory(psiPackage, getProject()); + } + + @Override + @NotNull + public PsiDirectory[] getSubdirectories() { + throw new UnsupportedOperationException("Method getSubdirectories is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public VirtualFile getVirtualFile() { + throw new UnsupportedOperationException("Method getVirtualFile is not yet implemented in " + getClass().getName()); + } + + @Override + public boolean processChildren(final PsiElementProcessor processor) { + throw new UnsupportedOperationException("Method processChildren is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public PsiElement setName(@NotNull final String name) throws IncorrectOperationException { + throw new IncorrectOperationException("Method setName is not yet implemented in " + getClass().getName()); + } + + @Override + public void checkSetName(final String name) throws IncorrectOperationException { + throw new IncorrectOperationException("Method checkSetName is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public ItemPresentation getPresentation() { + throw new UnsupportedOperationException("Method getPresentation is not yet implemented in " + getClass().getName()); + } +} diff --git a/platform/testFramework/src/com/intellij/mock/MockPsiElement.java b/platform/testFramework/src/com/intellij/mock/MockPsiElement.java new file mode 100644 index 000000000000..44ecb1b85f69 --- /dev/null +++ b/platform/testFramework/src/com/intellij/mock/MockPsiElement.java @@ -0,0 +1,378 @@ +/* + * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved. + */ +package com.intellij.mock; + +import com.intellij.lang.ASTNode; +import com.intellij.lang.Language; +import com.intellij.openapi.Disposable; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Key; +import com.intellij.openapi.util.Ref; +import com.intellij.openapi.util.TextRange; +import com.intellij.openapi.util.UserDataHolderBase; +import com.intellij.pom.Navigatable; +import com.intellij.psi.*; +import com.intellij.psi.scope.PsiScopeProcessor; +import com.intellij.psi.search.GlobalSearchScope; +import com.intellij.psi.search.SearchScope; +import com.intellij.util.IncorrectOperationException; +import com.intellij.util.SmartList; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.swing.*; +import java.util.List; + +/** + * @author peter + */ +public class MockPsiElement extends UserDataHolderBase implements PsiElement, Navigatable { + private final String myText; + private final Project myProject; + private final List myDeclarations = new SmartList(); + private Ref myParent; + private PsiManager myManager; + + public MockPsiElement(@NotNull Disposable parentDisposable) { + this(null, new MockProjectEx(parentDisposable)); + } + + private MockPsiElement(final String text, @NotNull Project project) { + myText = text; + myProject = project; + } + + @Override + public void navigate(boolean requestFocus) { + throw new UnsupportedOperationException("Method navigate is not yet implemented in " + getClass().getName()); + } + + @Override + public boolean canNavigate() { + throw new UnsupportedOperationException("Method canNavigate is not yet implemented in " + getClass().getName()); + } + + @Override + public boolean canNavigateToSource() { + throw new UnsupportedOperationException("Method canNavigateToSource is not yet implemented in " + getClass().getName()); + } + + public List getDeclarations() { + return myDeclarations; + } + + @Override + public void accept(@NotNull final PsiElementVisitor visitor) { + throw new UnsupportedOperationException("Method accept is not yet implemented in " + getClass().getName()); + } + + @Override + public void acceptChildren(@NotNull final PsiElementVisitor visitor) { + throw new UnsupportedOperationException("Method acceptChildren is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiElement add(@NotNull final PsiElement element) throws IncorrectOperationException { + throw new UnsupportedOperationException("Method add is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiElement addAfter(@NotNull final PsiElement element, final PsiElement anchor) throws IncorrectOperationException { + throw new UnsupportedOperationException("Method addAfter is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiElement addBefore(@NotNull final PsiElement element, final PsiElement anchor) throws IncorrectOperationException { + throw new UnsupportedOperationException("Method addBefore is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiElement addRange(final PsiElement first, final PsiElement last) throws IncorrectOperationException { + throw new UnsupportedOperationException("Method addRange is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiElement addRangeAfter(final PsiElement first, final PsiElement last, final PsiElement anchor) throws IncorrectOperationException { + throw new UnsupportedOperationException("Method addRangeAfter is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiElement addRangeBefore(@NotNull final PsiElement first, @NotNull final PsiElement last, final PsiElement anchor) throws + IncorrectOperationException { + throw new UnsupportedOperationException("Method addRangeBefore is not yet implemented in " + getClass().getName()); + } + + @Override + public void checkAdd(@NotNull final PsiElement element) throws IncorrectOperationException { + throw new UnsupportedOperationException("Method checkAdd is not yet implemented in " + getClass().getName()); + } + + @Override + public void checkDelete() throws IncorrectOperationException { + throw new UnsupportedOperationException("Method checkDelete is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiElement copy() { + throw new UnsupportedOperationException("Method copy is not yet implemented in " + getClass().getName()); + } + + @Override + public void delete() throws IncorrectOperationException { + throw new UnsupportedOperationException("Method delete is not yet implemented in " + getClass().getName()); + } + + @Override + public void deleteChildRange(final PsiElement first, final PsiElement last) throws IncorrectOperationException { + throw new UnsupportedOperationException("Method deleteChildRange is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public PsiElement findElementAt(final int offset) { + throw new UnsupportedOperationException("Method findElementAt is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public PsiReference findReferenceAt(final int offset) { + throw new UnsupportedOperationException("Method findReferenceAt is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public PsiElement[] getChildren() { + throw new UnsupportedOperationException("Method getChildren is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiFile getContainingFile() throws PsiInvalidElementAccessException { + throw new UnsupportedOperationException("Method getContainingFile is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public PsiElement getContext() { + return getParent(); + } + + @Override + @Nullable + public T getCopyableUserData(final Key key) { + throw new UnsupportedOperationException("Method getCopyableUserData is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public PsiElement getFirstChild() { + throw new UnsupportedOperationException("Method getFirstChild is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public Language getLanguage() { + throw new UnsupportedOperationException("Method getLanguage is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public PsiElement getLastChild() { + throw new UnsupportedOperationException("Method getLastChild is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiManager getManager() { + return myManager; + } + + public void setManager(final PsiManager manager) { + myManager = manager; + } + + @Override + public PsiElement getNavigationElement() { + throw new UnsupportedOperationException("Method getNavigationElement is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public PsiElement getNextSibling() { + throw new UnsupportedOperationException("Method getNextSibling is not yet implemented in " + getClass().getName()); + } + + @Override + @Nullable + public ASTNode getNode() { + throw new UnsupportedOperationException("Method getNode is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiElement getOriginalElement() { + throw new UnsupportedOperationException("Method getOriginalElement is not yet implemented in " + getClass().getName()); + } + + public void setParent(PsiElement parent) { + myParent = Ref.create(parent); + } + + @Override + public PsiElement getParent() { + if (myParent == null) { + throw new UnsupportedOperationException("Method getParent is not yet implemented in " + getClass().getName()); + } + return myParent.get(); + } + + @Override + @Nullable + public PsiElement getPrevSibling() { + throw new UnsupportedOperationException("Method getPrevSibling is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public Project getProject() { + return myProject; + } + + @Override + @Nullable + public PsiReference getReference() { + throw new UnsupportedOperationException("Method getReference is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public PsiReference[] getReferences() { + throw new UnsupportedOperationException("Method getReferences is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public GlobalSearchScope getResolveScope() { + throw new UnsupportedOperationException("Method getResolveScope is not yet implemented in " + getClass().getName()); + } + + @Override + public int getStartOffsetInParent() { + throw new UnsupportedOperationException("Method getStartOffsetInParent is not yet implemented in " + getClass().getName()); + } + + @Override + @NonNls + public String getText() { + return myText; + } + + @Override + public int getTextLength() { + return myText.length(); + } + + @Override + public int getTextOffset() { + return getTextRange().getStartOffset(); + } + + @Override + public TextRange getTextRange() { + throw new UnsupportedOperationException("Method getTextRange is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public SearchScope getUseScope() { + throw new UnsupportedOperationException("Method getUseScope is not yet implemented in " + getClass().getName()); + } + + @Override + public boolean isPhysical() { + return false; + } + + @Override + public boolean isValid() { + return true; + } + + @Override + public boolean isWritable() { + throw new UnsupportedOperationException("Method isWritable is not yet implemented in " + getClass().getName()); + } + + @Nullable + protected T findDeclaration(String name, Class aClass) { + for (final PsiElement declaration : myDeclarations) { + if (declaration instanceof PsiNamedElement) { + final PsiNamedElement psiNamedElement = (PsiNamedElement)declaration; + if (name.equals(psiNamedElement.getName()) && aClass.isInstance(psiNamedElement)) { + return (T)psiNamedElement; + } + } + } + return null; + } + + public void addDeclaration(PsiElement declaration) { + if (myDeclarations.contains(declaration)) { + myDeclarations.remove(declaration); + } + else if (declaration instanceof PsiNamedElement) { + myDeclarations.remove(findDeclaration(((PsiNamedElement)declaration).getName(), ((PsiNamedElement)declaration).getClass())); + } + myDeclarations.add(declaration); + } + + @Override + public boolean processDeclarations(@NotNull final PsiScopeProcessor processor, + @NotNull final ResolveState state, final PsiElement lastParent, @NotNull final PsiElement place) { + for (final PsiElement declaration : myDeclarations) { + if (!processor.execute(declaration, state)) return false; + } + + return true; + } + + @Override + public void putCopyableUserData(final Key key, final T value) { + throw new UnsupportedOperationException("Method putCopyableUserData is not yet implemented in " + getClass().getName()); + } + + @Override + public PsiElement replace(@NotNull final PsiElement newElement) throws IncorrectOperationException { + throw new UnsupportedOperationException("Method replace is not yet implemented in " + getClass().getName()); + } + + @Override + public boolean textContains(final char c) { + throw new UnsupportedOperationException("Method textContains is not yet implemented in " + getClass().getName()); + } + + @Override + public boolean textMatches(@NotNull final PsiElement element) { + throw new UnsupportedOperationException("Method textMatches is not yet implemented in " + getClass().getName()); + } + + @Override + public boolean textMatches(@NotNull final CharSequence text) { + throw new UnsupportedOperationException("Method textMatches is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public char[] textToCharArray() { + throw new UnsupportedOperationException("Method textToCharArray is not yet implemented in " + getClass().getName()); + } + + @Override + public Icon getIcon(final int flags) { + return null; + } + + @Override + public boolean isEquivalentTo(final PsiElement another) { + return this == another; + } +} diff --git a/platform/testFramework/src/com/intellij/mock/MockPsiFile.java b/platform/testFramework/src/com/intellij/mock/MockPsiFile.java new file mode 100644 index 000000000000..90b6f7936b62 --- /dev/null +++ b/platform/testFramework/src/com/intellij/mock/MockPsiFile.java @@ -0,0 +1,382 @@ +package com.intellij.mock; + +import com.intellij.lang.FileASTNode; +import com.intellij.lang.Language; +import com.intellij.navigation.ItemPresentation; +import com.intellij.openapi.fileTypes.FileType; +import com.intellij.openapi.fileTypes.StdFileTypes; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Key; +import com.intellij.openapi.util.TextRange; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.*; +import com.intellij.psi.impl.source.resolve.FileContextUtil; +import com.intellij.psi.search.GlobalSearchScope; +import com.intellij.psi.search.PsiElementProcessor; +import com.intellij.psi.search.SearchScope; +import com.intellij.testFramework.LightVirtualFile; +import com.intellij.util.ArrayUtil; +import com.intellij.util.IncorrectOperationException; +import com.intellij.util.LocalTimeCounter; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class MockPsiFile extends MockPsiElement implements PsiFile { + private final long myModStamp = LocalTimeCounter.currentTime(); + private VirtualFile myVirtualFile = null; + public boolean valid = true; + public String text = ""; + private final FileViewProvider myFileViewProvider; + private final PsiManager myPsiManager; + + public MockPsiFile(@NotNull PsiManager psiManager) { + super(psiManager.getProject()); + myPsiManager = psiManager; + myFileViewProvider = new SingleRootFileViewProvider(getManager(), new LightVirtualFile("noname", getFileType(), "")); + } + + public MockPsiFile(@NotNull VirtualFile virtualFile, @NotNull PsiManager psiManager) { + super(psiManager.getProject()); + myPsiManager = psiManager; + myVirtualFile = virtualFile; + myFileViewProvider = new SingleRootFileViewProvider(getManager(), virtualFile); + } + + @Override + public VirtualFile getVirtualFile() { + return myVirtualFile; + } + + @Override + public boolean processChildren(final PsiElementProcessor processor) { + return true; + } + + @Override + @NotNull + public String getName() { + return "mock.file"; + } + + @Override + @Nullable + public ItemPresentation getPresentation() { + return null; + } + + @Override + public PsiElement setName(@NotNull String name) throws IncorrectOperationException { + throw new IncorrectOperationException("Not implemented"); + } + + @Override + public void checkSetName(String name) throws IncorrectOperationException { + throw new IncorrectOperationException("Not implemented"); + } + + @Override + public boolean isDirectory() { + return false; + } + + @Override + public PsiDirectory getContainingDirectory() { + return null; + } + + @Nullable + public PsiDirectory getParentDirectory() { + throw new UnsupportedOperationException("Method getParentDirectory is not yet implemented in " + getClass().getName()); + } + + @Override + public long getModificationStamp() { + return myModStamp; + } + + @Override + @NotNull + public PsiFile getOriginalFile() { + return this; + } + + @Override + @NotNull + public FileType getFileType() { + return StdFileTypes.JAVA; + } + + @Override + @NotNull + public Language getLanguage() { + return StdFileTypes.JAVA.getLanguage(); + } + + @Override + @NotNull + public PsiFile[] getPsiRoots() { + return new PsiFile[]{this}; + } + + @Override + @NotNull + public FileViewProvider getViewProvider() { + return myFileViewProvider; + } + + @Override + public PsiManager getManager() { + return myPsiManager; + } + + @Override + @NotNull + public PsiElement[] getChildren() { + return PsiElement.EMPTY_ARRAY; + } + + @Override + public PsiDirectory getParent() { + return null; + } + + @Override + public PsiElement getFirstChild() { + return null; + } + + @Override + public PsiElement getLastChild() { + return null; + } + + @Override + public void acceptChildren(@NotNull PsiElementVisitor visitor) { + } + + @Override + public PsiElement getNextSibling() { + return null; + } + + @Override + public PsiElement getPrevSibling() { + return null; + } + @Override + public PsiFile getContainingFile() { + return null; + } + + @Override + public TextRange getTextRange() { + return null; + } + + @Override + public int getStartOffsetInParent() { + return 0; + } + + @Override + public int getTextLength() { + return 0; + } + + @Override + public PsiElement findElementAt(int offset) { + return null; + } + + @Override + public PsiReference findReferenceAt(int offset) { + return null; + } + + @Override + public int getTextOffset() { + return 0; + } + + @Override + public String getText() { + return text; + } + + @Override + @NotNull + public char[] textToCharArray() { + return ArrayUtil.EMPTY_CHAR_ARRAY; + } + + @Override + public boolean textMatches(@NotNull CharSequence text) { + return false; + } + + @Override + public boolean textMatches(@NotNull PsiElement element) { + return false; + } + + @Override + public boolean textContains(char c) { + return false; + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + } + + @Override + public PsiElement copy() { + return null; + } + + @Override + public PsiElement add(@NotNull PsiElement element) throws IncorrectOperationException { + return null; + } + + @Override + public PsiElement addBefore(@NotNull PsiElement element, PsiElement anchor) throws IncorrectOperationException { + return null; + } + + @Override + public PsiElement addAfter(@NotNull PsiElement element, PsiElement anchor) throws IncorrectOperationException { + return null; + } + + @Override + public void checkAdd(@NotNull PsiElement element) throws IncorrectOperationException { + } + + @Override + public PsiElement addRange(PsiElement first, PsiElement last) throws IncorrectOperationException { + return null; + } + + @Override + public PsiElement addRangeBefore(@NotNull PsiElement first, @NotNull PsiElement last, PsiElement anchor) + throws IncorrectOperationException { + return null; + } + + @Override + public PsiElement addRangeAfter(PsiElement first, PsiElement last, PsiElement anchor) + throws IncorrectOperationException { + return null; + } + + @Override + public void delete() throws IncorrectOperationException { + } + + @Override + public void checkDelete() throws IncorrectOperationException { + } + + @Override + public void deleteChildRange(PsiElement first, PsiElement last) throws IncorrectOperationException { + } + + @Override + public PsiElement replace(@NotNull PsiElement newElement) throws IncorrectOperationException { + return null; + } + + @Override + public boolean isValid() { + return valid; + } + + @Override + public boolean isWritable() { + return false; + } + + @Override + public PsiReference getReference() { + return null; + } + + @Override + @NotNull + public PsiReference[] getReferences() { + return PsiReference.EMPTY_ARRAY; + } + + @Override + public T getCopyableUserData(Key key) { + return null; + } + + @Override + public void putCopyableUserData(Key key, T value) { + } + + @Override + @NotNull + public Project getProject() { + final PsiManager manager = getManager(); + if (manager == null) throw new PsiInvalidElementAccessException(this); + + return manager.getProject(); + } + + @Override + public boolean isPhysical() { + return true; + } + + @Override + public PsiElement getNavigationElement() { + return this; + } + + @Override + public PsiElement getOriginalElement() { + return this; + } + + @Override + @NotNull + public GlobalSearchScope getResolveScope() { + return GlobalSearchScope.EMPTY_SCOPE; + } + + @Override + @NotNull + public SearchScope getUseScope() { + return GlobalSearchScope.EMPTY_SCOPE; + } + + @Override + public FileASTNode getNode() { + return null; + } + + @Override + public void subtreeChanged() { + } + + @Override + public void navigate(boolean requestFocus) { + } + + @Override + public boolean canNavigate() { + return false; + } + + @Override + public boolean canNavigateToSource() { + return false; + } + + @Override + public PsiElement getContext() { + return FileContextUtil.getFileContext(this); + } +} From 71c94b5d64778e1108a7712f81740911c9a5c997 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 17:47:41 +0100 Subject: [PATCH 048/101] couple of tests moved to community --- .../psi/util/proximity/ProximityTest.java | 50 ++++++++++++++ .../statistics/StatisticsManagerTest.java | 66 +++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 java/java-tests/testSrc/com/intellij/psi/util/proximity/ProximityTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/statistics/StatisticsManagerTest.java diff --git a/java/java-tests/testSrc/com/intellij/psi/util/proximity/ProximityTest.java b/java/java-tests/testSrc/com/intellij/psi/util/proximity/ProximityTest.java new file mode 100644 index 000000000000..1bef1c5ffc52 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/psi/util/proximity/ProximityTest.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2000-2005 by JetBrains s.r.o. All Rights Reserved. + * Use is subject to license terms. + */ +package com.intellij.psi.util.proximity; + +import com.intellij.openapi.application.Result; +import com.intellij.openapi.command.WriteCommandAction; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.testFramework.PsiTestUtil; +import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory; +import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase; +import com.intellij.testFramework.fixtures.TempDirTestFixture; + +/** + * @author peter + */ +public class ProximityTest extends JavaCodeInsightFixtureTestCase { + + public void testSameSourceRoot() throws Throwable { + final TempDirTestFixture root1 = IdeaTestFixtureFactory.getFixtureFactory().createTempDirTestFixture(); + final TempDirTestFixture root2 = IdeaTestFixtureFactory.getFixtureFactory().createTempDirTestFixture(); + + root1.setUp(); + root2.setUp(); + + try { + new WriteCommandAction(getProject()) { + @Override + protected void run(Result result) throws Throwable { + PsiTestUtil.addSourceContentToRoots(myModule, root1.getFile("")); + PsiTestUtil.addSourceContentToRoots(myModule, root2.getFile("")); + } + }.execute(); + + final VirtualFile file1 = root1.createFile("buy.txt", ""); + final VirtualFile file2 = root2.createFile("buy.txt", ""); + final VirtualFile ctx = root2.createFile("ctx.txt", ""); + + final PsiProximityComparator comparator = new PsiProximityComparator(getPsiManager().findFile(ctx)); + assertTrue(comparator.compare(getPsiManager().findFile(file1), getPsiManager().findFile(file2)) > 0); + assertTrue(comparator.compare(getPsiManager().findFile(file2), getPsiManager().findFile(file1)) < 0); + } + finally { + root1.tearDown(); + root2.tearDown(); + } + } + +} diff --git a/platform/platform-tests/testSrc/com/intellij/statistics/StatisticsManagerTest.java b/platform/platform-tests/testSrc/com/intellij/statistics/StatisticsManagerTest.java new file mode 100644 index 000000000000..8e85860d83c8 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/statistics/StatisticsManagerTest.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2000-2005 by JetBrains s.r.o. All Rights Reserved. + * Use is subject to license terms. + */ +package com.intellij.statistics; + +import com.intellij.psi.statistics.StatisticsInfo; +import com.intellij.psi.statistics.StatisticsManager; +import com.intellij.psi.statistics.impl.StatisticsManagerImpl; +import com.intellij.testFramework.LightPlatformTestCase; +import org.jetbrains.annotations.NonNls; + +/** + * @author peter + */ +public class StatisticsManagerTest extends LightPlatformTestCase { + @NonNls private static final String TEST_CONTEXT = "testContext"; + + @Override + protected void setUp() throws Exception { + super.setUp(); + ((StatisticsManagerImpl)StatisticsManager.getInstance()).clearStatistics(); + } + + @Override + protected void tearDown() throws Exception { + ((StatisticsManagerImpl)StatisticsManager.getInstance()).clearStatistics(); + super.tearDown(); + } + + private void incUseCount(String value, int times) { + for (int i = 0; i < times; i++) { + StatisticsManager.getInstance().incUseCount(new StatisticsInfo(TEST_CONTEXT, value)); + } + } + + private int getUseCount(String value) { + return StatisticsManager.getInstance().getUseCount(new StatisticsInfo(TEST_CONTEXT, value)); + } + + public void testIncUseCount() throws Throwable { + incUseCount("b", 1); + assertEquals(1, getUseCount("b")); + assertEquals(0, getUseCount("c")); + + incUseCount("c", 1); + assertEquals(1, getUseCount("b")); + assertEquals(1, getUseCount("c")); + } + + public void testFlexibility() throws Throwable { + incUseCount("b", 100); + incUseCount("c", 4); + assertTrue(getUseCount("c") > getUseCount("b")); + } + + public void testReturn() throws Throwable { + incUseCount("b", 100); + incUseCount("c", 4); + incUseCount("b", 1); + assertTrue(getUseCount("c") >= getUseCount("b")); + incUseCount("b", 3); + assertTrue(getUseCount("c") < getUseCount("b")); + } + +} From 4f5a1370447dea46f8be1cc2563c6c2523ee252e Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 17:14:45 +0100 Subject: [PATCH 049/101] make static --- .../plugins/groovy/griffon/GriffonDefaultImportContributor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/griffon/GriffonDefaultImportContributor.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/griffon/GriffonDefaultImportContributor.java index 8a2f59d81848..eb02cebc1c93 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/griffon/GriffonDefaultImportContributor.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/griffon/GriffonDefaultImportContributor.java @@ -45,7 +45,7 @@ import java.util.List; */ public class GriffonDefaultImportContributor extends DefaultImportContributor { - private Pair, List> getDefaultImports(@NotNull final Module module) { + private static Pair, List> getDefaultImports(@NotNull final Module module) { return CachedValuesManager.getManager(module.getProject()).getCachedValue(module, new CachedValueProvider, List>>() { @Override public Result, List>> compute() { From 26453dcd32a64ab8ad7213db5eb8b4bdbd2b3bce Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 17:52:14 +0100 Subject: [PATCH 050/101] fix compilation, NameUtilTest to platform-tests --- java/java-tests/java-tests.iml | 1 + .../com/intellij/psi/util/NameUtilTest.java | 325 ++++++++++++++++++ 2 files changed, 326 insertions(+) create mode 100644 platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilTest.java diff --git a/java/java-tests/java-tests.iml b/java/java-tests/java-tests.iml index faf2fc05a870..21868504cd31 100644 --- a/java/java-tests/java-tests.iml +++ b/java/java-tests/java-tests.iml @@ -28,6 +28,7 @@ + diff --git a/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilTest.java b/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilTest.java new file mode 100644 index 000000000000..1a4bbac2867d --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilTest.java @@ -0,0 +1,325 @@ +/* + * @author max + */ +package com.intellij.psi.util; + +import com.intellij.openapi.util.TextRange; +import com.intellij.psi.codeStyle.NameUtil; +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.testFramework.UsefulTestCase; +import com.intellij.util.ThrowableRunnable; +import com.intellij.util.containers.CollectionFactory; +import org.jetbrains.annotations.NonNls; + +import java.util.ArrayList; +import java.util.List; + +public class NameUtilTest extends UsefulTestCase { + + public void testSimpleCases() throws Exception { + assertMatches("N", "NameUtilTest"); + assertMatches("NU", "NameUtilTest"); + assertMatches("NUT", "NameUtilTest"); + assertMatches("NaUT", "NameUtilTest"); + assertDoesntMatch("NeUT", "NameUtilTest"); + assertDoesntMatch("NaUTa", "NameUtilTest"); + assertMatches("NaUtT", "NameUtilTest"); + assertMatches("NaUtT", "NameUtilTest"); + assertMatches("NaUtTe", "NameUtilTest"); + assertMatches("AACl", "AAClass"); + assertMatches("ZZZ", "ZZZZZZZZZZ"); + } + + public void testSimpleCasesWithFirstLowercased() throws Exception { + assertMatches("N", "nameUtilTest"); + assertDoesntMatch("N", "anameUtilTest"); + assertMatches("NU", "nameUtilTest"); + assertDoesntMatch("NU", "anameUtilTest"); + assertMatches("NUT", "nameUtilTest"); + assertMatches("NaUT", "nameUtilTest"); + assertDoesntMatch("NeUT", "nameUtilTest"); + assertDoesntMatch("NaUTa", "nameUtilTest"); + assertMatches("NaUtT", "nameUtilTest"); + assertMatches("NaUtT", "nameUtilTest"); + assertMatches("NaUtTe", "nameUtilTest"); + } + + public void testSpaceDelimiters() throws Exception { + assertMatches("Na Ut Te", "name util test"); + assertMatches("Na Ut Te", "name Util Test"); + assertDoesntMatch("Na Ut Ta", "name Util Test"); + assertMatches("na ut te", "name util test"); + + assertMatches("na ut", "name_util_test"); + assertDoesntMatch("na te", "name_util_test"); + assertDoesntMatch("na ti", "name_util_test"); + } + + public void testXMLCompletion() throws Exception { + assertDoesntMatch("N_T", "NameUtilTest"); + assertDoesntMatch("ORGS_ACC", "ORGS_POSITION_ACCOUNTABILITY"); + assertDoesntMatch("ORGS-ACC", "ORGS-POSITION_ACCOUNTABILITY"); + assertDoesntMatch("ORGS.ACC", "ORGS.POSITION_ACCOUNTABILITY"); + } + + public void testUnderscoreStyle() throws Exception { + assertMatches("N_U_T", "NAME_UTIL_TEST"); + assertMatches("NUT", "NAME_UTIL_TEST"); + assertDoesntMatch("NUT", "NameutilTest"); + } + + public void testAllUppercase() { + assertMatches("NOS", "NetOutputStream"); + } + + public void testCommonFileNameConventions() throws Exception { + // See IDEADEV-12310 + + assertMatches("BLWN", "base_layout_without_navigation.xhtml"); + assertMatches("BLWN", "base-layout-without-navigation.xhtml"); + assertMatches("FC", "faces-config.xml"); + assertMatches("ARS", "activity_report_summary.jsp"); + assertMatches("AD", "arrow_down.gif"); + assertMatches("VL", "vehicle-listings.css"); + + assertMatches("ARS.j", "activity_report_summary.jsp"); + assertDoesntMatch("ARS.j", "activity_report_summary.xml"); + assertDoesntMatch("ARS.j", "activity_report_summary_justsometingwrong.xml"); + + assertDoesntMatch("foo.goo", "foo.bar.goo"); + } + + public void testIDEADEV15503() throws Exception { + assertMatches("AR.jsp", "add_relationship.jsp"); + assertMatches("AR.jsp", "advanced_rule.jsp"); + assertMatches("AR.jsp", "alarm_reduction.jsp"); + assertMatches("AR.jsp", "audiot_report.jsp"); + assertMatches("AR.jsp", "audiot_r.jsp"); + + assertMatches("AR.jsp", "alarm_rule_action.jsp"); + assertMatches("AR.jsp", "alarm_rule_admin.jsp"); + assertMatches("AR.jsp", "alarm_rule_administration.jsp"); + assertMatches("AR.jsp", "alarm_rule_controller.jsp"); + assertMatches("AR.jsp", "alarm_rule_frame.jsp"); + assertMatches("AR.jsp", "alarm_rule_severity.jsp"); + + assertMatches("AR.jsp", "AddRelationship.jsp"); + assertMatches("AR.jsp", "AdvancedRule.jsp"); + assertMatches("AR.jsp", "AlarmReduction.jsp"); + assertMatches("AR.jsp", "AudiotReport.jsp"); + assertMatches("AR.jsp", "AudiotR.jsp"); + + assertMatches("AR.jsp", "AlarmRuleAction.jsp"); + assertMatches("AR.jsp", "AlarmRuleAdmin.jsp"); + assertMatches("AR.jsp", "AlarmRuleAdministration.jsp"); + assertMatches("AR.jsp", "AlarmRuleController.jsp"); + assertMatches("AR.jsp", "AlarmRuleFrame.jsp"); + assertMatches("AR.jsp", "AlarmRuleSeverity.jsp"); + } + + public void testSkipDot() { + assertMatches("ja", "jquery.autocomplete.js"); + assertMatches("ja.js", "jquery.autocomplete.js"); + assertDoesntMatch("jajs", "jquery.autocomplete.js"); + assertDoesntMatch("j.ajs", "jquery.autocomplete.js"); + } + + public void testNoExtension() { + assertMatches("#.p", "#.php"); + assertMatches("#", "#.php"); + assertMatches("a", "a.php"); + } + + public void testStartsWithDot() throws Exception { + assertMatches(".foo", ".foo"); + } + + public void testProperDotEscaping() throws Exception { + assertMatches("*inspection*.pro", "InspectionsBundle.properties"); + assertDoesntMatch("*inspection*.pro", "InspectionsInProgress.png"); + } + + public void testIgnoreLeadingUnderscore() throws Exception { + assertMatches("form", "_form.html.erb"); + assertMatches("_form", "_form.html.erb"); + assertMatches("_form", "__form"); + assertFalse(NameUtil.buildMatcher("_form", 1, true, true, false).matches("__form")); + } + + public void testLowerCaseWords() throws Exception { + assertTrue(matches("uct", "unit_controller_test", true)); + assertTrue(matches("unictest", "unit_controller_test", true)); + assertTrue(matches("uc", "unit_controller_test", true)); + assertFalse(matches("nc", "unit_controller_test", true)); + assertFalse(matches("utc", "unit_controller_test", true)); + } + + public void testObjectiveCCases() throws Exception { + assertMatches("textField:sh", "textField:shouldChangeCharactersInRange:replacementString:"); + assertMatches("text:sh", "textField:shouldChangeCharactersInRange:replacementString:"); + assertMatches("text*:sh", "textField:shouldChangeCharactersInRange:replacementString:"); + } + + public void testMiddleMatching() { + assertMatches("SWU*H*7", "SWUpgradeHdlrFSPR7Test"); + assertMatches("SWU*H*R", "SWUpgradeHdlrFSPR7Test"); + assertMatches("SWU*H*R", "SWUPGRADEHDLRFSPR7TEST"); + assertMatches("*git", "GitBlaBla"); + assertMatches("*Git", "GitBlaBla"); + assertMatches("*git", "BlaGitBla"); + assertMatches("*Git", "BlaGitBla"); + assertDoesntMatch("*Git", "BlagitBla"); + assertMatches("*git", "BlagitBla"); + assertMatches("*Git*", "AtpGenerationItem"); + assertMatches("Collec*Util*", "CollectionUtils"); + assertMatches("Collec*Util*", "CollectionUtilsTest"); + } + + public void testSpaceInCompletionPrefix() throws Exception { + assertTrue(NameUtil.buildCompletionMatcher("create ", 0, true, true).matches("create module")); + } + + public void testLong() throws Exception { + assertTrue(matches("Product.findByDateAndNameGreaterThanEqualsAndQualityGreaterThanEqual", "Product.findByDateAndNameGreaterThanEqualsAndQualityGreaterThanEqualsIntellijIdeaRulezzz", false)); + } + + private static void assertMatches(@NonNls String pattern, @NonNls String name) { + assertTrue(matches(pattern, name, false)); + } + private static void assertDoesntMatch(@NonNls String pattern, @NonNls String name) { + assertFalse(matches(pattern, name, false)); + } + + private static boolean matches(@NonNls final String pattern, @NonNls final String name, final boolean lowerCaseWords) { + //System.out.println("\n--- " + name + " " + lowerCaseWords); + return NameUtil.buildMatcher(pattern, 0, true, true, lowerCaseWords).matches(name); + } + + public void testLowerCaseHumps() { + assertMatches("foo", "foo"); + assertDoesntMatch("foo", "fxoo"); + assertMatches("foo", "fOo"); + assertMatches("foo", "fxOo"); + assertDoesntMatch("foo", "fXOo"); + assertDoesntMatch("fOo", "foo"); + assertMatches("fOo", "FaOaOaXXXX"); + assertMatches("ncdfoe", "NoClassDefFoundException"); + assertMatches("fob", "FOO_BAR"); + assertMatches("fo_b", "FOO_BAR"); + assertMatches("fob", "FOO BAR"); + assertMatches("fo b", "FOO BAR"); + assertMatches("AACl", "AAClass"); + assertMatches("ZZZ", "ZZZZZZZZZZ"); + assertMatches("em", "emptyList"); + assertMatches("bui", "BuildConfig.groovy"); + assertMatches("buico", "BuildConfig.groovy"); + assertMatches("buico.gr", "BuildConfig.groovy"); + assertMatches("bui.gr", "BuildConfig.groovy"); + assertMatches("*fz", "azzzfzzz"); + + assertDoesntMatch("WebLogic", "Weblogic"); + assertMatches("WebLOgic", "WebLogic"); + assertMatches("WEbLogic", "WebLogic"); + assertDoesntMatch("WebLogic", "Webologic"); + } + + public void testFinalSpace() { + assertMatches("GrDebT ", "GroovyDebuggerTest"); + assertMatches("grdebT ", "GroovyDebuggerTest"); + assertDoesntMatch("grdebt ", "GroovyDebuggerTest"); + assertMatches("Foo ", "Foo"); + assertDoesntMatch("Foo ", "FooBar"); + assertDoesntMatch("Foo ", "Foox"); + assertDoesntMatch("Collections ", "CollectionSplitter"); + assertMatches("CollectionS ", "CollectionSplitter"); + } + + public void testDigits() { + assertMatches("foba4", "FooBar4"); + assertMatches("foba", "Foo4Bar"); + assertMatches("*TEST-* ", "TEST-001"); + assertMatches("*TEST-0* ", "TEST-001"); + } + + public void testSpecialSymbols() { + assertMatches("a@b", "a@bc"); + + assertMatches("a/text", "a/Text"); + assertDoesntMatch("a/text", "a/bbbText"); + } + + public void testMinusculeFirstLetter() { + assertTrue(new NameUtil.MinusculeMatcher("WebLogic", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("WebLogic")); + assertFalse(new NameUtil.MinusculeMatcher("webLogic", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("WebLogic")); + assertFalse(new NameUtil.MinusculeMatcher("cL", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("class")); + assertTrue(new NameUtil.MinusculeMatcher("CL", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("Class")); + assertFalse(new NameUtil.MinusculeMatcher("abc", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("_abc")); + } + + public void testMinusculeAllImportant() { + assertTrue(new NameUtil.MinusculeMatcher("WebLogic", NameUtil.MatchingCaseSensitivity.ALL).matches("WebLogic")); + assertFalse(new NameUtil.MinusculeMatcher("webLogic", NameUtil.MatchingCaseSensitivity.ALL).matches("weblogic")); + assertFalse(new NameUtil.MinusculeMatcher("FOO", NameUtil.MatchingCaseSensitivity.ALL).matches("foo")); + assertFalse(new NameUtil.MinusculeMatcher("foo", NameUtil.MatchingCaseSensitivity.ALL).matches("fOO")); + assertFalse(new NameUtil.MinusculeMatcher("Wl", NameUtil.MatchingCaseSensitivity.ALL).matches("WebLogic")); + assertTrue(new NameUtil.MinusculeMatcher("WL", NameUtil.MatchingCaseSensitivity.ALL).matches("WebLogic")); + assertFalse(new NameUtil.MinusculeMatcher("WL", NameUtil.MatchingCaseSensitivity.ALL).matches("Weblogic")); + assertFalse(new NameUtil.MinusculeMatcher("WL", NameUtil.MatchingCaseSensitivity.ALL).matches("weblogic")); + assertFalse(new NameUtil.MinusculeMatcher("webLogic", NameUtil.MatchingCaseSensitivity.ALL).matches("WebLogic")); + assertFalse(new NameUtil.MinusculeMatcher("Str", NameUtil.MatchingCaseSensitivity.ALL).matches("SomeThingRidiculous")); + } + + public void testMatchingFragments() { + @NonNls String sample = "NoClassDefFoundException"; + // 0 2 7 10 15 21 + assertOrderedEquals(new NameUtil.MinusculeMatcher("ncldfou*ion", NameUtil.MatchingCaseSensitivity.NONE).matchingFragments(sample), + TextRange.from(0, 1), TextRange.from(2, 2), TextRange.from(7, 1), TextRange.from(10, 3), TextRange.from(21, 3)); + + sample = "doGet(HttpServletRequest, HttpServletResponse):void"; + // 0 22 + assertOrderedEquals(new NameUtil.MinusculeMatcher("d*st", NameUtil.MatchingCaseSensitivity.NONE).matchingFragments(sample), + TextRange.from(0, 1), TextRange.from(22, 2)); + assertOrderedEquals(new NameUtil.MinusculeMatcher("doge*st", NameUtil.MatchingCaseSensitivity.NONE).matchingFragments(sample), + TextRange.from(0, 4), TextRange.from(22, 2)); + + } + + public void testMatchingDegree() { + assertPreference("OCO", "OneCoolObject", "OCObject"); + assertPreference("MUp", "MavenUmlProvider", "MarkUp"); + assertPreference("MUP", "MarkUp", "MavenUmlProvider"); + assertPreference("CertificateExce", "CertificateEncodingException", "CertificateException"); + } + + private static void assertPreference(@NonNls String pattern, @NonNls String less, @NonNls String more) { + NameUtil.MinusculeMatcher matcher = new NameUtil.MinusculeMatcher(pattern, NameUtil.MatchingCaseSensitivity.FIRST_LETTER); + assertTrue(less + ">=" + more, matcher.matchingDegree(less) < matcher.matchingDegree(more)); + } + + public void testPerformance() { + @NonNls final String longName = "ThisIsAQuiteLongNameWithParentheses().Dots.-Minuses-_UNDERSCORES_digits239:colons:/slashes\\AndOfCourseManyLetters"; + final List matching = new ArrayList(); + final List nonMatching = new ArrayList(); + + for (String s : CollectionFactory.ar("*", "*i", "*a", "*u", "T", "ti", longName, longName.substring(0, 20))) { + matching.add(new NameUtil.MinusculeMatcher(s, NameUtil.MatchingCaseSensitivity.NONE)); + } + for (String s : CollectionFactory.ar("A", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ta")) { + nonMatching.add(new NameUtil.MinusculeMatcher(s, NameUtil.MatchingCaseSensitivity.NONE)); + } + + PlatformTestUtil.startPerformanceTest("Matcher is slow", 1200, new ThrowableRunnable() { + @Override + public void run() { + for (int i = 0; i < 100000; i++) { + for (NameUtil.MinusculeMatcher matcher : matching) { + assertTrue(matcher.matches(longName)); + } + for (NameUtil.MinusculeMatcher matcher : nonMatching) { + assertFalse(matcher.matches(longName)); + } + } + } + }).cpuBound().assertTiming(); + } +} From 02371fdac59a9cd7533f489aafadd5d2aa13d9a3 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 17:55:37 +0100 Subject: [PATCH 051/101] external annotations tests moved to community --- .../content/anno/p/annotations.xml | 8 + .../content/anno/suppressed/annotations.xml | 10 + .../annotationsExistingExternalName_after.xml | 13 ++ .../annotationsNewSuppress_after.xml | 15 ++ .../annotationsSecondSuppression_after.xml | 10 + .../externalAnnotations/lib/p/Test.java | 6 + .../lib/p/TestAnnotated.java | 11 ++ .../lib/p/TestDeannotation.java | 8 + .../lib/p/TestDeannotation1.java | 8 + .../lib/p/TestPrimitive.java | 6 + .../src/suppressed/ExistingExternalName.java | 8 + .../src/suppressed/NewSuppress.java | 7 + .../src/suppressed/SecondSuppression.java | 7 + .../codeInsight/AddAnnotationFixTest.java | 179 ++++++++++++++++++ .../codeInsight/SuppressExternalTest.java | 100 ++++++++++ 15 files changed, 396 insertions(+) create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/content/anno/p/annotations.xml create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotations.xml create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsExistingExternalName_after.xml create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsNewSuppress_after.xml create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsSecondSuppression_after.xml create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/lib/p/Test.java create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestAnnotated.java create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestDeannotation.java create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestDeannotation1.java create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestPrimitive.java create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/ExistingExternalName.java create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/NewSuppress.java create mode 100644 java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/SecondSuppression.java create mode 100644 java/java-tests/testSrc/com/intellij/codeInsight/AddAnnotationFixTest.java create mode 100644 java/java-tests/testSrc/com/intellij/codeInsight/SuppressExternalTest.java diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/p/annotations.xml b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/p/annotations.xml new file mode 100644 index 000000000000..4d905a4befdb --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/p/annotations.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotations.xml b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotations.xml new file mode 100644 index 000000000000..01443638aa18 --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotations.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsExistingExternalName_after.xml b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsExistingExternalName_after.xml new file mode 100644 index 000000000000..3ea793646df7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsExistingExternalName_after.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsNewSuppress_after.xml b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsNewSuppress_after.xml new file mode 100644 index 000000000000..03f8c40dc079 --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsNewSuppress_after.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsSecondSuppression_after.xml b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsSecondSuppression_after.xml new file mode 100644 index 000000000000..afdf1536b9d0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/content/anno/suppressed/annotationsSecondSuppression_after.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/Test.java b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/Test.java new file mode 100644 index 000000000000..2cb4d8ca6c86 --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/Test.java @@ -0,0 +1,6 @@ +package p; +class Test { + String get() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestAnnotated.java b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestAnnotated.java new file mode 100644 index 000000000000..306ac0abb5dc --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestAnnotated.java @@ -0,0 +1,11 @@ +package p; + +import org.jetbrains.annotations.NotNull; + +class Test { + + @NotNull + String get() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestDeannotation.java b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestDeannotation.java new file mode 100644 index 000000000000..f175b9fa8ad2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestDeannotation.java @@ -0,0 +1,8 @@ +package p; + +public class TestDeannotation { + + String get() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestDeannotation1.java b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestDeannotation1.java new file mode 100644 index 000000000000..b40b9408a626 --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestDeannotation1.java @@ -0,0 +1,8 @@ +package p; + +public class TestDeannotation1 { + + String get(String ss) { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestPrimitive.java b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestPrimitive.java new file mode 100644 index 000000000000..0be49a922aed --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/lib/p/TestPrimitive.java @@ -0,0 +1,6 @@ +package p; +class Test { + boolean get() { + return false; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/ExistingExternalName.java b/java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/ExistingExternalName.java new file mode 100644 index 000000000000..6a875f8d3360 --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/ExistingExternalName.java @@ -0,0 +1,8 @@ +package suppressed; +class ExistingExternalName { + String foo(){ + String str = ""; + str = str; + return str; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/NewSuppress.java b/java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/NewSuppress.java new file mode 100644 index 000000000000..cf61cb1db672 --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/NewSuppress.java @@ -0,0 +1,7 @@ +package suppressed; +class NewSuppress { + void barr() { + String str = ""; + str = str; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/SecondSuppression.java b/java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/SecondSuppression.java new file mode 100644 index 000000000000..70f4b18038bb --- /dev/null +++ b/java/java-tests/testData/codeInsight/externalAnnotations/src/suppressed/SecondSuppression.java @@ -0,0 +1,7 @@ +package suppressed; +class SecondSuppression { + void second() { + String str = ""; + str = str; + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/AddAnnotationFixTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/AddAnnotationFixTest.java new file mode 100644 index 000000000000..b9f60b8b4544 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/codeInsight/AddAnnotationFixTest.java @@ -0,0 +1,179 @@ +/* + * User: anna + * Date: 27-Jun-2007 + */ +package com.intellij.codeInsight; + +import com.intellij.codeInsight.intention.IntentionAction; +import com.intellij.codeInsight.intention.impl.DeannotateIntentionAction; +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.Result; +import com.intellij.openapi.application.ex.PathManagerEx; +import com.intellij.openapi.command.WriteCommandAction; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.fileEditor.FileDocumentManager; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.AnnotationOrderRootType; +import com.intellij.openapi.roots.ModifiableRootModel; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.roots.OrderRootType; +import com.intellij.openapi.roots.libraries.Library; +import com.intellij.openapi.roots.libraries.LibraryTable; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiModifierListOwner; +import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PsiTestUtil; +import com.intellij.testFramework.UsefulTestCase; +import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; +import com.intellij.testFramework.fixtures.*; +import org.jetbrains.annotations.NonNls; + +import java.util.List; + +public class AddAnnotationFixTest extends UsefulTestCase { + private CodeInsightTestFixture myFixture; + private Module myModule; + + public AddAnnotationFixTest() { + IdeaTestCase.initPlatformPrefix(); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + final TestFixtureBuilder projectBuilder = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(); + + myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture()); + final String dataPath = PathManagerEx.getTestDataPath() + "/codeInsight/externalAnnotations"; + myFixture.setTestDataPath(dataPath); + final JavaModuleFixtureBuilder builder = projectBuilder.addModule(JavaModuleFixtureBuilder.class); + builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15); + + myFixture.setUp(); + myModule = builder.getFixture().getModule(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + myFixture.tearDown(); + myFixture = null; + myModule = null; + } + + protected void addLibrary() { + ApplicationManager.getApplication().runWriteAction(new Runnable() { + @Override + public void run() { + final ModifiableRootModel model = ModuleRootManager.getInstance(myModule).getModifiableModel(); + final LibraryTable libraryTable = model.getModuleLibraryTable(); + final Library library = libraryTable.createLibrary("test"); + + final Library.ModifiableModel libraryModel = library.getModifiableModel(); + libraryModel.addRoot(VfsUtil.pathToUrl(myFixture.getTempDirPath() + "/lib"), OrderRootType.SOURCES); + libraryModel.addRoot(VfsUtil.pathToUrl(myFixture.getTempDirPath() + "/content/anno"), AnnotationOrderRootType.getInstance()); + libraryModel.commit(); + model.commit(); + } + }); + } + + public void testAnnotateLibrary() throws Throwable { + + addLibrary(); + myFixture.configureByFiles("lib/p/TestPrimitive.java", "content/anno/p/annotations.xml"); + myFixture.configureByFiles("lib/p/Test.java"); + final Project project = myFixture.getProject(); + final PsiFile file = myFixture.getFile(); + final Editor editor = myFixture.getEditor(); + + final IntentionAction fix = myFixture.findSingleIntention("Annotate method 'get' as @NotNull"); + assertTrue(fix.isAvailable(project, editor, file)); + + new WriteCommandAction(project){ + @Override + protected void run(final Result result) throws Throwable { + fix.invoke(project, editor, file); + } + }.execute(); + + FileDocumentManager.getInstance().saveAllDocuments(); + + final PsiElement psiElement = file.findElementAt(editor.getCaretModel().getOffset()); + assertNotNull(psiElement); + final PsiModifierListOwner listOwner = PsiTreeUtil.getParentOfType(psiElement, PsiModifierListOwner.class); + assertNotNull(listOwner); + assertNotNull(ExternalAnnotationsManager.getInstance(project).findExternalAnnotation(listOwner, AnnotationUtil.NOT_NULL)); + } + + public void testPrimitive() throws Throwable { + PsiFile psiFile = myFixture.configureByFile("lib/p/TestPrimitive.java"); + PsiTestUtil.addSourceRoot(myModule, psiFile.getVirtualFile().getParent()); + + assertNotAvailable("Annotate method 'get' as @NotNull"); + } + + private void assertNotAvailable(String hint) { + List actions = myFixture.filterAvailableIntentions(hint); + assertEmpty(actions); + } + + public void testAnnotated() throws Throwable { + PsiFile psiFile = myFixture.configureByFile("lib/p/TestAnnotated.java"); + PsiTestUtil.addSourceRoot(myModule, psiFile.getVirtualFile().getParent()); + final Project project = myFixture.getProject(); + final PsiFile file = myFixture.getFile(); + final Editor editor = myFixture.getEditor(); + assertNotAvailable("Annotate method 'get' as @NotNull"); + assertNotAvailable("Annotate method 'get' as @Nullable"); + + final DeannotateIntentionAction deannotateFix = new DeannotateIntentionAction(); + assertFalse(deannotateFix.isAvailable(project, editor, file)); + } + + public void testDeannotation() throws Throwable { + addLibrary(); + myFixture.configureByFiles("lib/p/TestPrimitive.java", "content/anno/p/annotations.xml"); + doDeannotate("lib/p/TestDeannotation.java", "Annotate method 'get' as @NotNull", "Annotate method 'get' as @Nullable"); + } + + public void testDeannotation1() throws Throwable { + addLibrary(); + myFixture.configureByFiles("lib/p/TestPrimitive.java", "content/anno/p/annotations.xml"); + doDeannotate("lib/p/TestDeannotation1.java", "Annotate parameter 'ss' as @NotNull", "Annotate parameter 'ss' as @Nullable"); + } + + private void doDeannotate(@NonNls final String testPath, String hint1, String hint2) throws Throwable { + myFixture.configureByFile(testPath); + final Project project = myFixture.getProject(); + final PsiFile file = myFixture.getFile(); + final Editor editor = myFixture.getEditor(); + + assertNotAvailable(hint1); + assertNotAvailable(hint2); + + final DeannotateIntentionAction deannotateFix = new DeannotateIntentionAction(); + assertTrue(deannotateFix.isAvailable(project, editor, file)); + + new WriteCommandAction(project){ + @Override + protected void run(final Result result) throws Throwable { + ExternalAnnotationsManager.getInstance(project).deannotate(DeannotateIntentionAction.getContainer(editor, file), AnnotationUtil.NOT_NULL); + } + }.execute(); + + FileDocumentManager.getInstance().saveAllDocuments(); + + IntentionAction fix = myFixture.findSingleIntention(hint1); + assertNotNull(fix); + + fix = myFixture.findSingleIntention(hint2); + assertNotNull(fix); + + assertFalse(deannotateFix.isAvailable(project, editor, file)); + } +} diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/SuppressExternalTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/SuppressExternalTest.java new file mode 100644 index 000000000000..02d1c996716b --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/codeInsight/SuppressExternalTest.java @@ -0,0 +1,100 @@ +/* + * User: anna + * Date: 17-Jun-2010 + */ +package com.intellij.codeInsight; + +import com.intellij.codeInsight.intention.IntentionAction; +import com.intellij.codeInspection.sillyAssignment.SillyAssignmentInspection; +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.ex.PathManagerEx; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.roots.AnnotationOrderRootType; +import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.openapi.roots.ModifiableRootModel; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.pom.java.LanguageLevel; +import com.intellij.psi.JavaPsiFacade; +import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.UsefulTestCase; +import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; +import com.intellij.testFramework.fixtures.*; + +import java.io.File; +import java.io.IOException; + +public class SuppressExternalTest extends UsefulTestCase { + protected CodeInsightTestFixture myFixture; + + private LanguageLevel myLanguageLevel; + + public SuppressExternalTest() { + IdeaTestCase.initPlatformPrefix(); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory(); + final TestFixtureBuilder testFixtureBuilder = fixtureFactory.createFixtureBuilder(); + myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture()); + myFixture.setTestDataPath(PathManagerEx.getTestDataPath() + "/codeInsight/externalAnnotations"); + final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class); + new File(myFixture.getTempDirPath() + "/src/").mkdir(); + builder.addContentRoot(myFixture.getTempDirPath()).addSourceRoot("src"); + builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15); + myFixture.enableInspections(new SillyAssignmentInspection()); + myFixture.setUp(); + + addAnnotationsModuleRoot(); + + final JavaPsiFacade facade = JavaPsiFacade.getInstance(myFixture.getProject()); + myLanguageLevel = LanguageLevelProjectExtension.getInstance(facade.getProject()).getLanguageLevel(); + LanguageLevelProjectExtension.getInstance(facade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); + } + + private void addAnnotationsModuleRoot() throws IOException { + myFixture.copyDirectoryToProject("content/anno/suppressed", "content/anno/suppressed"); + ApplicationManager.getApplication().runWriteAction(new Runnable() { + @Override + public void run() { + final Module module = myFixture.getModule(); + final ModifiableRootModel model = ModuleRootManager.getInstance(module).getModifiableModel(); + model.setRootUrls(AnnotationOrderRootType.getInstance(), new String[]{VfsUtil.pathToUrl(myFixture.getTempDirPath() + "/content/anno")}); + model.commit(); + } + }); + } + + + @Override + public void tearDown() throws Exception { + LanguageLevelProjectExtension.getInstance(myFixture.getProject()).setLanguageLevel(myLanguageLevel); + myFixture.tearDown(); + myFixture = null; + super.tearDown(); + } + + + private void doTest(String testName) throws Exception { + final IntentionAction action = myFixture.getAvailableIntention("Suppress for method", "src/suppressed/" + testName + ".java"); + assertNotNull(action); + myFixture.launchAction(action); + myFixture.checkResultByFile("content/anno/suppressed/annotations.xml", "content/anno/suppressed/annotations" + testName + "_after.xml", true); + } + + + public void testNewSuppress() throws Throwable { + doTest("NewSuppress"); + } + + public void testExistingExternalName() throws Exception { + doTest("ExistingExternalName"); + } + + public void testSecondSuppression() throws Exception { + doTest("SecondSuppression"); + } + +} From 14746f95f3317ca3d6adf51b6aa5b810f43a6e0e Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 18:06:28 +0100 Subject: [PATCH 052/101] couple more tests to community --- .../com/intellij/lexer/LayeredLexerTest.java | 110 +++++++++ .../diff/SelectedBlockHistoryTest.java | 225 ++++++++++++++++++ 2 files changed, 335 insertions(+) create mode 100644 java/java-tests/testSrc/com/intellij/lexer/LayeredLexerTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/diff/SelectedBlockHistoryTest.java diff --git a/java/java-tests/testSrc/com/intellij/lexer/LayeredLexerTest.java b/java/java-tests/testSrc/com/intellij/lexer/LayeredLexerTest.java new file mode 100644 index 000000000000..21bc0650d6e0 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/lexer/LayeredLexerTest.java @@ -0,0 +1,110 @@ +package com.intellij.lexer; + +import com.intellij.pom.java.LanguageLevel; +import com.intellij.psi.JavaTokenType; +import com.intellij.psi.tree.IElementType; +import junit.framework.TestCase; + +/** + * @author max + */ +public class LayeredLexerTest extends TestCase { + public void testInTheMiddle() throws Exception { + Lexer lexer = setupLexer("s=\"abc\\ndef\";"); + + assertEquals("s", nextToken(lexer)); + assertEquals("=", nextToken(lexer)); + assertEquals("\"abc", nextToken(lexer)); + assertEquals("\\n", nextToken(lexer)); + assertEquals("def\"", nextToken(lexer)); + assertEquals(";", nextToken(lexer)); + assertEquals(null, lexer.getTokenType()); + } + + public void testModification() throws Exception { + Lexer lexer = setupLexer("s=\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\";"); + assertEquals("s", nextToken(lexer)); + assertEquals("=", nextToken(lexer)); + assertEquals("\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"", nextToken(lexer)); + assertEquals(";", nextToken(lexer)); + assertEquals(null, lexer.getTokenType()); + + lexer.start(lexer.getBufferSequence(), 2, lexer.getBufferEnd(), (short) 1); + assertEquals("\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"", nextToken(lexer)); + assertEquals(";", nextToken(lexer)); + assertEquals(null, lexer.getTokenType()); + } + + + public void testInTheAtStartup() throws Exception { + Lexer lexer = setupLexer("s=\"\\ndef\";"); + + assertEquals("s", nextToken(lexer)); + assertEquals("=", nextToken(lexer)); + assertEquals("\"", nextToken(lexer)); + assertEquals("\\n", nextToken(lexer)); + assertEquals("def\"", nextToken(lexer)); + assertEquals(";", nextToken(lexer)); + assertEquals(null, lexer.getTokenType()); + } + + public void testInTheAtEnd() throws Exception { + Lexer lexer = setupLexer("s=\"abc\\n\";"); + + assertEquals("s", nextToken(lexer)); + assertEquals("=", nextToken(lexer)); + assertEquals("\"abc", nextToken(lexer)); + assertEquals("\\n", nextToken(lexer)); + assertEquals("\"", nextToken(lexer)); + assertEquals(";", nextToken(lexer)); + assertEquals(null, lexer.getTokenType()); + } + + public void testNonTerminated() throws Exception { + Lexer lexer = setupLexer("s=\"abc\\n"); + + assertEquals("s", nextToken(lexer)); + assertEquals("=", nextToken(lexer)); + assertEquals("\"abc", nextToken(lexer)); + assertEquals("\\n", nextToken(lexer)); + assertEquals(null, lexer.getTokenType()); + } + + public void testNonTerminated2() throws Exception { + Lexer lexer = setupLexer("s=\"abc\\"); + + assertEquals("s", nextToken(lexer)); + assertEquals("=", nextToken(lexer)); + assertEquals("\"abc", nextToken(lexer)); + assertEquals("\\", nextToken(lexer)); + assertEquals(null, lexer.getTokenType()); + } + + public void testUnicode() throws Exception { + Lexer lexer = setupLexer("s=\"\\uFFFF\";"); + assertEquals("s", nextToken(lexer)); + assertEquals("=", nextToken(lexer)); + assertEquals("\"", nextToken(lexer)); + assertEquals("\\uFFFF", nextToken(lexer)); + assertEquals("\"", nextToken(lexer)); + assertEquals(";", nextToken(lexer)); + assertEquals(null, lexer.getTokenType()); + } + + private Lexer setupLexer(String text) { + LayeredLexer lexer = new LayeredLexer(new JavaLexer(LanguageLevel.JDK_1_3)); + lexer.registerSelfStoppingLayer(new StringLiteralLexer('\"', JavaTokenType.STRING_LITERAL), + new IElementType[]{JavaTokenType.STRING_LITERAL}, + IElementType.EMPTY_ARRAY); + + lexer.start(text); + return lexer; + } + + private String nextToken(Lexer lexer) { + assertTrue(lexer.getTokenType() != null); + final String s = lexer.getBufferSequence().subSequence(lexer.getTokenStart(), lexer.getTokenEnd()).toString(); + lexer.advance(); + return s; + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/diff/SelectedBlockHistoryTest.java b/platform/platform-tests/testSrc/com/intellij/diff/SelectedBlockHistoryTest.java new file mode 100644 index 000000000000..cf8f1c0c0ea3 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/diff/SelectedBlockHistoryTest.java @@ -0,0 +1,225 @@ +package com.intellij.diff; + +import com.intellij.util.ArrayUtil; +import com.intellij.util.containers.ContainerUtil; +import com.intellij.util.diff.FilesTooBigForDiffException; +import junit.framework.TestCase; + +import java.util.ArrayList; +import java.util.List; + +/** + * author: lesya + */ + +public class SelectedBlockHistoryTest extends TestCase { + + public void test1() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"}, + + new String[]{"1", "2", "3"}, + new String[]{"4", "52", "6"}, + new String[]{"7", "8", "9"} + ); + } + + public void test2() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"}, + + new String[]{"1", "2", "3"}, + new String[]{"4", "52", "6"}, + new String[]{"7", "8", "9"} + ); + } + + public void test3() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"}, + + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"} + ); + } + + public void test4() throws FilesTooBigForDiffException { + doTest( + new String[]{}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"}, + + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"} + ); + } + + public void test5() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{}, + + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"} + ); + } + + public void test6() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"}, + + new String[]{}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"} + ); + } + + public void test7() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"}, + + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{} + ); + } + + public void test8() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"}, + + new String[]{"1", "2", "3"}, + new String[]{"44", "4", "5", "6", "66"}, + new String[]{"7", "8", "9"} + ); + } + + public void test9() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"}, + + new String[]{"1", "2", "3"}, + new String[]{"44", "4", "55", "6", "66"}, + new String[]{"7", "8", "9"} + ); + } + + public void test10() throws FilesTooBigForDiffException { + doTest( + new String[]{"0.5", "1", "3", "3.5"}, + new String[]{"4", "5","5.5", "6"}, + new String[]{"6,5", "7", "8", "9", "9.5"}, + + new String[]{"+0.5", "1", "2", "3", "3.5+", "3.5++"}, + new String[]{"4", "5","5.5+", "6"}, + new String[]{"+6,5","++6,5", "7", "9", "9.5+", "9.5++"} + ); + } + + public void test11() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{"a", "a"}, + new String[]{"7", "8", "9"}, + + new String[]{"1", "2", "3"}, + new String[]{"b"}, + new String[]{"7", "8", "9"} + ); + } + + public void test12() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{}, + new String[]{"7", "8", "9"}, + + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"} + ); + } + + public void test13() throws FilesTooBigForDiffException { + doTest( + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"}, + + new String[]{}, + new String[]{"4", "52", "6"}, + new String[]{} + ); + } + + public void test14() throws FilesTooBigForDiffException { + doTest( + new String[]{}, + new String[]{"4", "52", "6"}, + new String[]{}, + + new String[]{"1", "2", "3"}, + new String[]{"4", "5", "6"}, + new String[]{"7", "8", "9"} + ); + } + + + public void testContent(){ + Block block = new Block("0\n1\n2\n3\n4\n5\n6", 3, 6); + String blockContent = block.getBlockContent(); + assertEquals("3\n4\n5\n6", blockContent); + + block = new Block("0\n1\n2\n3\n4\n5\n6\n", 3, 6); + blockContent = block.getBlockContent(); + assertEquals("3\n4\n5\n6", blockContent); + + } + + private void doTest( + String[] beforePrevBlock, + String[] prevBlock, + String[] afterPrevBlock, + String[] beforeBlock, + String[] block, + String[] afterBlock) throws FilesTooBigForDiffException { + + String[] prevVersion = composeVersion(beforePrevBlock, prevBlock, afterPrevBlock); + String[] currentVersion = composeVersion(beforeBlock, block, afterBlock); + FindBlock findBlock = new FindBlock(prevVersion, + new Block(currentVersion, beforeBlock.length, beforeBlock.length + block.length - 1)); + + Block actualBlock = findBlock.getBlockInThePrevVersion(); + Block expectedBlock = new Block(prevVersion,beforePrevBlock.length, beforePrevBlock.length + prevBlock.length - 1); + + assertEquals(expectedBlock, actualBlock); + + } + + private String[] composeVersion(String[] beforeBlock, String[] block, String[] afterBlock) { + List beforeList = new ArrayList(); + ContainerUtil.addAll(beforeList, beforeBlock); + ContainerUtil.addAll(beforeList, block); + ContainerUtil.addAll(beforeList, afterBlock); + return (String[])ArrayUtil.toStringArray(beforeList); + + } +} From 85d5155e064ca7b77bd25f210322e1ddc4dc4e3a Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 17:55:26 +0100 Subject: [PATCH 053/101] dead code --- .../psi/impl/cache/impl/VfsIndexer.java | 122 ------------------ 1 file changed, 122 deletions(-) delete mode 100644 platform/lang-impl/src/com/intellij/psi/impl/cache/impl/VfsIndexer.java diff --git a/platform/lang-impl/src/com/intellij/psi/impl/cache/impl/VfsIndexer.java b/platform/lang-impl/src/com/intellij/psi/impl/cache/impl/VfsIndexer.java deleted file mode 100644 index a0bf1e3a792b..000000000000 --- a/platform/lang-impl/src/com/intellij/psi/impl/cache/impl/VfsIndexer.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2000-2009 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.intellij.psi.impl.cache.impl; - -import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.progress.ProgressIndicator; -import com.intellij.openapi.progress.ProgressManager; -import com.intellij.openapi.vfs.VfsUtil; -import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.openapi.vfs.VirtualFileFilter; -import com.intellij.psi.PsiBundle; - -import java.io.*; -import java.util.ArrayList; -import java.util.List; - -public class VfsIndexer { - private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.cache.impl.VfsIndexer"); - - public static VirtualFile[] writeFileIndex( - OutputStream stream, - VirtualFile root, - VirtualFileFilter filter) throws IOException { - - List result = new ArrayList(); - - ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator(); - if (progress != null){ - progress.setText2(PsiBundle.message("psi.scanning.files.in.folder.progress", root.getPresentableUrl())); - } - - DataOutputStream out = stream == null ? null : new DataOutputStream(stream); - - _writeFileIndex(out, root, filter, result); - - if (out != null){ - out.flush(); - } - - return VfsUtil.toVirtualFileArray(result); - } - - private static void _writeFileIndex(DataOutputStream out, VirtualFile file, VirtualFileFilter filter, List result) throws IOException { - ProgressManager.checkCanceled(); - - result.add(file); - if (out != null){ - out.writeUTF(file.getName()); - } - - VirtualFile[] children = file.getChildren(); - if (children == null) { - if (out != null){ - out.writeInt(0); - } - return; - } - - int childrenCount = 0; - for (VirtualFile child : children) { - if (filter.accept(child)) childrenCount++; - } - - if (out != null){ - out.writeInt(childrenCount); - } - for (VirtualFile child : children) { - if (filter.accept(child)) { - _writeFileIndex(out, child, filter, result); - } - } - } - - public static VirtualFile[] readFileIndex( - InputStream stream, - VirtualFile root, - VirtualFileFilter filter - ) throws IOException { - List result = new ArrayList(); - - DataInputStream in = new DataInputStream(stream); - - String rootName = in.readUTF(); - LOG.assertTrue(root.getName().equals(rootName)); - _readFileIndex(in, root, filter, result); - - return VfsUtil.toVirtualFileArray(result); - } - - private static void _readFileIndex(DataInputStream in, VirtualFile file, VirtualFileFilter filter, List result) throws IOException { - ProgressManager.checkCanceled(); - - result.add(file); - int childrenCount = in.readInt(); - if (childrenCount == 0) return; - - for (int i = 0; i < childrenCount; i++) { - String name = in.readUTF(); - VirtualFile child = file != null ? file.findChild(name) : null; - - if (child != null && !filter.accept(child)){ - child = null; - } - - _readFileIndex(in, child, filter, result); - } - } -} From d696eb30f713008938271ce9cce09bb1405d6c6c Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 18:07:07 +0100 Subject: [PATCH 054/101] some tests -> community --- .../intellij/run/PathMacrosCollectorTest.java | 88 +++++ .../intellij/structureView/TestGrouper.java | 102 ++++++ .../intellij/structureView/TestTreeModel.java | 142 ++++++++ .../RemotelyConfigurableStatServiceTest.java | 79 ++++ .../StatisticsUploadAssistantTest.java | 245 +++++++++++++ .../intellij/util/io/BTreeEnumeratorTest.java | 192 ++++++++++ .../intellij/util/io/PersistentMapTest.java | 342 ++++++++++++++++++ .../util/io/StringEnumeratorTest.java | 181 +++++++++ .../ui/update/MergingUpdateQueueTest.java | 295 +++++++++++++++ 9 files changed, 1666 insertions(+) create mode 100644 platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/structureView/TestGrouper.java create mode 100644 platform/platform-tests/testSrc/com/intellij/structureView/TestTreeModel.java create mode 100644 platform/platform-tests/testSrc/com/intellij/usagesStatistics/RemotelyConfigurableStatServiceTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/usagesStatistics/StatisticsUploadAssistantTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/util/io/BTreeEnumeratorTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/util/io/StringEnumeratorTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/util/ui/update/MergingUpdateQueueTest.java diff --git a/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java b/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java new file mode 100644 index 000000000000..84e06a1f9d02 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2000-2004 by JetBrains s.r.o. All Rights Reserved. + * Use is subject to license terms. + */ +package com.intellij.run; + +import com.intellij.application.options.PathMacrosCollector; +import com.intellij.application.options.PathMacrosImpl; +import com.intellij.util.NotNullFunction; +import junit.framework.TestCase; +import org.jdom.Attribute; +import org.jdom.Element; +import org.jdom.Text; +import org.jetbrains.annotations.NotNull; + +import java.util.Set; + +/** + * @author Eugene Zhuravlev + * Date: Nov 14, 2006 + */ +public class PathMacrosCollectorTest extends TestCase { + public void testCollectMacros() { + Element root = new Element("root"); + root.addContent(new Text("$MACro1$ some text $macro2$ other text $MACRo3$")); + root.addContent(new Text("$macro4$ some text")); + root.addContent(new Text("some text$macro5$")); + root.addContent(new Text("file:$mac_ro6$")); + root.addContent(new Text("jar://$macr.o7$ ")); + root.addContent(new Text("$mac-ro8$ ")); + root.addContent(new Text("$$$ ")); + root.addContent(new Text("$c:\\a\\b\\c$ ")); + root.addContent(new Text("$Revision 1.23$")); + + final Set macros = PathMacrosCollector.getMacroNames(root, null, null, new PathMacrosImpl()); + + assertEquals(5, macros.size()); + assertTrue(macros.contains("MACro1")); + assertTrue(macros.contains("macro4")); + assertTrue(macros.contains("mac_ro6")); + assertTrue(macros.contains("macr.o7")); + assertTrue(macros.contains("mac-ro8")); + } + + public void testWithRecursiveFilter() throws Exception { + Element root = new Element("root"); + final Element configuration = new Element("configuration"); + configuration.setAttribute("value", "some text$macro5$fdsjfhdskjfsd$MACRO$"); + root.addContent(configuration); + + final Set macros = PathMacrosCollector.getMacroNames(root, null, new NotNullFunction() { + @Override + @NotNull + public Boolean fun(Object o) { + return (o instanceof Attribute) && "value".equals(((Attribute)o).getName()); + } + }, new PathMacrosImpl()); + + assertEquals(2, macros.size()); + assertTrue(macros.contains("macro5")); + assertTrue(macros.contains("MACRO")); + } + + public void testWithFilter() throws Exception { + Element root = new Element("root"); + final Element testTag = new Element("test"); + testTag.setAttribute("path", "$MACRO$"); + testTag.setAttribute("ignore", "$PATH$"); + root.addContent(testTag); + + final Set macros = PathMacrosCollector.getMacroNames(root, null, null, new PathMacrosImpl()); + assertEquals(2, macros.size()); + assertTrue(macros.contains("MACRO")); + assertTrue(macros.contains("PATH")); + + final Set filtered = PathMacrosCollector.getMacroNames(root, new NotNullFunction() { + @Override + @NotNull + public Boolean fun(Object o) { + if (o instanceof Attribute && "ignore".equals(((Attribute)o).getName())) return false; + return true; + } + }, null, new PathMacrosImpl()); + + assertEquals(1, filtered.size()); + assertTrue(macros.contains("MACRO")); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/structureView/TestGrouper.java b/platform/platform-tests/testSrc/com/intellij/structureView/TestGrouper.java new file mode 100644 index 000000000000..f4474c547514 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/structureView/TestGrouper.java @@ -0,0 +1,102 @@ +package com.intellij.structureView; + +import com.intellij.ide.util.treeView.AbstractTreeNode; +import com.intellij.ide.util.treeView.smartTree.ActionPresentation; +import com.intellij.ide.util.treeView.smartTree.Group; +import com.intellij.ide.util.treeView.smartTree.Grouper; +import com.intellij.ide.util.treeView.smartTree.TreeElement; +import com.intellij.navigation.ItemPresentation; +import com.intellij.util.containers.ContainerUtil; +import gnu.trove.THashSet; +import org.jetbrains.annotations.NotNull; + +import java.util.*; + +public class TestGrouper implements Grouper { + private final String[] mySubStrings; + + public TestGrouper(String[] subString) { + mySubStrings = subString; + } + + @Override + @NotNull + public ActionPresentation getPresentation() { + throw new RuntimeException(); + } + + @Override + @NotNull + public String getName() { + throw new RuntimeException(); + } + + private class StringGroup implements Group { + private final String myString; + private final Collection myChildren; + private final Collection myChildrenUsedStrings; + + public StringGroup(String string, final Collection children, Collection childrenStrings) { + myString = string; + myChildrenUsedStrings = childrenStrings; + myChildren = new ArrayList(children); + } + + @Override + public Collection getChildren() { + Collection result = new LinkedHashSet(); + for (TreeElement object : myChildren) { + if (object.toString().indexOf(myString) >= 0) { + result.add(object); + } + } + return result; + } + + @Override + public ItemPresentation getPresentation() { + return null; + } + + public String toString() { + return "Group:" + myString; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Group)) return false; + + final StringGroup group = (StringGroup)o; + + if (myString != null ? !myString.equals(group.myString) : group.myString != null) return false; + + return true; + } + + public int hashCode() { + return (myString != null ? myString.hashCode() : 0); + } + } + + @Override + @NotNull + public Collection group(final AbstractTreeNode parent, Collection children) { + List result = new ArrayList(); + Collection parentGroupUsedStrings = parent.getValue() instanceof StringGroup ? + ((StringGroup)parent.getValue()).myChildrenUsedStrings : + Collections.emptySet(); + Collection elements = new LinkedHashSet(children); + for (String subString : mySubStrings) { + if (parentGroupUsedStrings.contains(subString)) continue; + Set childrenStrings = new THashSet(parentGroupUsedStrings); + ContainerUtil.addAll(childrenStrings, mySubStrings); + StringGroup group = new StringGroup(subString, elements, childrenStrings); + Collection groupChildren = group.getChildren(); + if (!groupChildren.isEmpty()) { + elements.removeAll(groupChildren); + result.add(group); + } + } + return result; + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/structureView/TestTreeModel.java b/platform/platform-tests/testSrc/com/intellij/structureView/TestTreeModel.java new file mode 100644 index 000000000000..28dacd889fa8 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/structureView/TestTreeModel.java @@ -0,0 +1,142 @@ +package com.intellij.structureView; + +import com.intellij.ide.projectView.PresentationData; +import com.intellij.ide.structureView.FileEditorPositionListener; +import com.intellij.ide.structureView.ModelListener; +import com.intellij.ide.structureView.StructureViewModel; +import com.intellij.ide.structureView.StructureViewTreeElement; +import com.intellij.ide.util.treeView.smartTree.Filter; +import com.intellij.ide.util.treeView.smartTree.Grouper; +import com.intellij.ide.util.treeView.smartTree.Sorter; +import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class TestTreeModel implements StructureViewModel{ + private final StringTreeElement myRoot; + private final List myFilters = new ArrayList(); + private final List mySorters = new ArrayList(); + + public TestTreeModel(StringTreeElement root) { + myRoot = root; + + } + + @Override + @NotNull + public StructureViewTreeElement getRoot() { + return myRoot; + } + + @Override + @NotNull + public Filter[] getFilters() { + return myFilters.toArray(new Filter[myFilters.size()]); + } + + @Override + @NotNull + public Grouper[] getGroupers() { + return new Grouper[]{new TestGrouper(new String[]{"a", "b", "c"}), + new TestGrouper(new String[]{"d", "e", "f"})}; + } + + @Override + @NotNull + public Sorter[] getSorters() { + return mySorters.toArray(new Sorter[mySorters.size()]); + } + + public void addFlter(Filter filter) { + myFilters.add(filter); + } + + public void addSorter(Sorter sorter) { + mySorters.add(sorter); + } + + public static class StringTreeElement implements StructureViewTreeElement { + private final Collection myChildren = new ArrayList(); + private final String myValue; + + public StringTreeElement(@NonNls String value) { + myValue = value; + } + + @Override + public StructureViewTreeElement[] getChildren() { + return myChildren.toArray(new StructureViewTreeElement[myChildren.size()]); + + } + + @Override + public ItemPresentation getPresentation() { + return new PresentationData(myValue, null, null, null, null); + } + + public String toString() { + return myValue; + } + + public StringTreeElement addChild(@NonNls String s) { + StringTreeElement child = new StringTreeElement(s); + myChildren.add(child); + return child; + } + + @Override + public String getValue() { + return myValue; + } + + @Override + public void navigate(boolean requestFocus) { + } + + @Override + public boolean canNavigate() { + return false; + } + + @Override + public boolean canNavigateToSource() { + return false; + } + } + + @Override + public Object getCurrentEditorElement() { + return null; + } + + @Override + public void addEditorPositionListener(FileEditorPositionListener listener) { + } + + @Override + public void removeEditorPositionListener(FileEditorPositionListener listener) { + } + + @Override + public void dispose() { + } + + @Override + public boolean shouldEnterElement(final Object element) { + return false; + } + + @Override + public void addModelListener(ModelListener modelListener) { + + } + + @Override + public void removeModelListener(ModelListener modelListener) { + + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/usagesStatistics/RemotelyConfigurableStatServiceTest.java b/platform/platform-tests/testSrc/com/intellij/usagesStatistics/RemotelyConfigurableStatServiceTest.java new file mode 100644 index 000000000000..7dd8e8d2c063 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/usagesStatistics/RemotelyConfigurableStatServiceTest.java @@ -0,0 +1,79 @@ +package com.intellij.usagesStatistics; + +import com.intellij.internal.statistic.StatisticsUploadAssistant; +import com.intellij.internal.statistic.connect.StatisticsHttpClientSender; +import com.intellij.internal.statistic.connect.RemotelyConfigurableStatisticsService; +import com.intellij.internal.statistic.connect.StatisticsConnectionService; +import com.intellij.internal.statistic.connect.StatisticsResult; +import junit.framework.Assert; +import junit.framework.TestCase; +import org.jetbrains.annotations.NonNls; + +public class RemotelyConfigurableStatServiceTest extends TestCase { + + @NonNls + private static final String STAT_URL = "http://localhost:8080/stat.jsp"; + + @NonNls + private static final String STAT_CONFIG_URL = "http://localhost:8080/config.jsp"; + + public void testStatisticsConnectionServiceDefaultSettings() { + final StatisticsConnectionService connectionService = new StatisticsConnectionService(STAT_CONFIG_URL, STAT_URL); + + Assert.assertEquals(STAT_URL, connectionService.getServiceUrl()); + Assert.assertTrue(connectionService.isTransmissionPermitted()); + final String[] attributeNames = connectionService.getAttributeNames(); + + Assert.assertEquals(attributeNames.length, 2); + Assert.assertEquals(attributeNames[0], "url"); + Assert.assertEquals(attributeNames[1], "permitted"); + } + + public void testEmptyDataSending() { + RemotelyConfigurableStatisticsService service = new RemotelyConfigurableStatisticsService(new StatisticsConnectionService(), + new StatisticsHttpClientSender(), + new StatisticsUploadAssistant() { + @Override + public String getData() { + return ""; + } + }); + final StatisticsResult result = service.send(); + Assert.assertEquals(StatisticsResult.ResultCode.NOTHING_TO_SEND, result.getCode()); + } + + public void testIncorrectUrlSending() { + RemotelyConfigurableStatisticsService service = new RemotelyConfigurableStatisticsService(new StatisticsConnectionService(STAT_CONFIG_URL, STAT_URL), + new StatisticsHttpClientSender(), + new StatisticsUploadAssistant() { + @Override + public String getData() { + return "group:key1=11"; + } + }); + final StatisticsResult result = service.send(); + Assert.assertEquals(StatisticsResult.ResultCode.SEND_WITH_ERRORS, result.getCode()); + } + + public void testRemotelyDisabledTransmission() { + RemotelyConfigurableStatisticsService service = new RemotelyConfigurableStatisticsService(new StatisticsConnectionService() { + @Override + public Boolean isTransmissionPermitted() { + return false; + } + }, new StatisticsHttpClientSender(), + new StatisticsUploadAssistant()); + + final StatisticsResult result = service.send(); + Assert.assertEquals(StatisticsResult.ResultCode.NOT_PERMITTED_SERVER, result.getCode()); + } + + public void testErrorInRemoteConfiguration() { + RemotelyConfigurableStatisticsService service = + new RemotelyConfigurableStatisticsService(new StatisticsConnectionService(STAT_CONFIG_URL, null), + new StatisticsHttpClientSender(), + new StatisticsUploadAssistant()); + final StatisticsResult result = service.send(); + Assert.assertEquals(StatisticsResult.ResultCode.ERROR_IN_CONFIG, result.getCode()); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/usagesStatistics/StatisticsUploadAssistantTest.java b/platform/platform-tests/testSrc/com/intellij/usagesStatistics/StatisticsUploadAssistantTest.java new file mode 100644 index 000000000000..899f2a0e37d0 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/usagesStatistics/StatisticsUploadAssistantTest.java @@ -0,0 +1,245 @@ +package com.intellij.usagesStatistics; + +import com.intellij.internal.statistic.StatisticsUploadAssistant; +import com.intellij.internal.statistic.beans.ConvertUsagesUtil; +import com.intellij.internal.statistic.beans.GroupDescriptor; +import com.intellij.internal.statistic.beans.PatchedUsage; +import com.intellij.internal.statistic.beans.UsageDescriptor; +import com.intellij.internal.statistic.persistence.BasicSentUsagesPersistenceComponent; +import com.intellij.internal.statistic.persistence.SentUsagesPersistence; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.util.containers.hash.HashMap; +import com.intellij.util.containers.hash.LinkedHashMap; +import junit.framework.TestCase; +import org.jetbrains.annotations.NotNull; + +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class StatisticsUploadAssistantTest extends TestCase { + + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void testCreateNewPatch() { + final Map> all = createDescriptors("g:a1:1", "g:a2:2", "g:a3:3"); + final Map> sent = new HashMap>(); + + final Map> patched = StatisticsUploadAssistant.getPatchedUsages(all, sent); + + assertMapEquals(patched, createDescriptors("g:a1:1", "g:a2:2", "g:a3:3")); + } + + public void testEmptyPatchs() { + final Map> all = new HashMap>(); + final Map> sent = new HashMap>(); + assertEquals(StatisticsUploadAssistant.getPatchedUsages(all, sent).size(), 0); + } + + public void testCreateEmptyPatch() { + final Map> all = createDescriptors("g:a1:1", "g:a2:2", "g:a3:3", "g2:a1:1", "g2:a2:2", "g2:a3:3"); + final Map> sent = createDescriptors("g:a1:1", "g:a2:2", "g:a3:3", "g2:a1:1", "g2:a2:2", "g2:a3:3"); + + assertEquals(StatisticsUploadAssistant.getPatchedUsages(all, sent).size(), 0); + } + + public void testCreatePatchEmptyAll() { + final Map> all = new HashMap>(); + final Map> sent = createDescriptors("g:a1:1", "g:a2:2", "g2:a1:1", "g2:a2:2", "g2:a3:3"); + + final Map> patched = StatisticsUploadAssistant.getPatchedUsages(all, sent); + + assertMapEquals(patched, createDescriptors("g:a1:-1", "g2:a2:-2", "g2:a3:-3", "g:a2:-2", "g2:a1:-1")); + } + + public void testCreatePatchMerged() { + final Map> all = createDescriptors("g:a1:100", "g:a2:2", "g2:a1:0", "g2:a2:1"); + final Map> sent = createDescriptors("g:a1:2", "g:a2:100", "g2:a1:1", "g2:a2:1", "g2:a3:3"); + + final Map> patched = StatisticsUploadAssistant.getPatchedUsages(all, sent); + + assertMapEquals(patched, createDescriptors("g:a1:98", "g:a2:-98", "g2:a1:-1", "g2:a3:-3")); + } + + public void testPersistSentPatch() { + final Map> allUsages = createDescriptors("g:a1:-1", "g2:a2:-2", "g2:a3:-3", "g:a2:-2", "g2:a1:-1", "g3:a1:13"); + final SentUsagesPersistence usagesPersistence = new BasicSentUsagesPersistenceComponent(); + + Map> patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence); + String result = StatisticsUploadAssistant.getStringPatch(patchedUsages, 500); + StatisticsUploadAssistant.persistSentPatch(result, usagesPersistence); + + assertMapEquals(ConvertUsagesUtil.convertString(result), ConvertUsagesUtil.convertString("g:a2=-2,a1=-1;g2:a3=-3,a2=-2,a1=-1;g3:a1=13;")); + + patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence); + result = StatisticsUploadAssistant.getStringPatch(patchedUsages, 500); + StatisticsUploadAssistant.persistSentPatch(result, usagesPersistence); + + assertEquals("sent usages must be persisted", result.length(), 0); + assertEquals(allUsages.size(), usagesPersistence.getSentUsages().size()); + } + + public void testConvertUsages() { + final Map> patchedUsages = StatisticsUploadAssistant + .getPatchedUsages(createDescriptors("g:a1:-1", "g2:a2:-2", "g2:a3:-3", "g:a2:-2", "g2:a1:-1", "g3:a1:13"), + new HashMap>()); + + final String result = ConvertUsagesUtil.convertUsages(patchedUsages); + final Map> convertedUsages = ConvertUsagesUtil.convertString(result); + + assertMapEquals(patchedUsages, convertedUsages); + } + + public void testConvertUsagesWithPriority() { + final Map> patchedUsages = new HashMap>(); + + createPatchDescriptor(patchedUsages, "low", GroupDescriptor.LOWER_PRIORITY, "l1", 1); + createPatchDescriptor(patchedUsages, "low", GroupDescriptor.LOWER_PRIORITY, "l2", 1); + createPatchDescriptor(patchedUsages, "high", GroupDescriptor.HIGHER_PRIORITY, "h", 1); + createPatchDescriptor(patchedUsages, "high", GroupDescriptor.HIGHER_PRIORITY, "h2", 1); + createPatchDescriptor(patchedUsages, "default_1", GroupDescriptor.DEFAULT_PRIORITY, "d11", 1); + createPatchDescriptor(patchedUsages, "default_2", GroupDescriptor.DEFAULT_PRIORITY, "d21", 1); + createPatchDescriptor(patchedUsages, "default_1", GroupDescriptor.DEFAULT_PRIORITY, "d12", 1); + + + assertEquals(ConvertUsagesUtil.convertUsages(patchedUsages), + "high:h=1,h2=1;default_1:d11=1,d12=1;default_2:d21=1;low:l1=1,l2=1;"); + } + + public void testConvertUsagesWithEqualPriority() { + final Map> patchedUsages = new HashMap>(); + + createPatchDescriptor(patchedUsages, "g4", GroupDescriptor.HIGHER_PRIORITY, "1", 1); + createPatchDescriptor(patchedUsages, "g2", GroupDescriptor.HIGHER_PRIORITY, "2", 1); + createPatchDescriptor(patchedUsages, "g1", GroupDescriptor.HIGHER_PRIORITY, "3", 1); + createPatchDescriptor(patchedUsages, "g3", GroupDescriptor.HIGHER_PRIORITY, "4", 1); + + + assertEquals(ConvertUsagesUtil.convertUsages(patchedUsages), "g1:3=1;g2:2=1;g3:4=1;g4:1=1;"); + } + + public void testConvertString() { + final Map> patchedUsages = new HashMap>(); + + createPatchDescriptor(patchedUsages, "g4", GroupDescriptor.HIGHER_PRIORITY, "1", 1); + createPatchDescriptor(patchedUsages, "g2", GroupDescriptor.HIGHER_PRIORITY, "2", 1); + createPatchDescriptor(patchedUsages, "g1", GroupDescriptor.HIGHER_PRIORITY, "3", 1); + createPatchDescriptor(patchedUsages, "g3", GroupDescriptor.HIGHER_PRIORITY, "4", 1); + + assertMapEquals(patchedUsages, ConvertUsagesUtil.convertString("g3:4=1;g1:3=1;g4:1=1;g2:2=1;")); + } + + public void testConvertEmptyString() { + assertEquals(ConvertUsagesUtil.convertString("").size(), 0); + } + + public void testConvertBrokenString() { + assertEquals(ConvertUsagesUtil.convertString("asdfasdfsad").size(), 0); + assertEquals(ConvertUsagesUtil.convertString("asdf:asdfsad").size(), 0); + assertEquals(ConvertUsagesUtil.convertString("asdfa:sd;fsad").size(), 0); + assertEquals(ConvertUsagesUtil.convertString("asdfa:sd;fs,ad").size(), 0); + assertEquals(ConvertUsagesUtil.convertString("asdfa:sd;f;sad").size(), 0); + assertEquals(ConvertUsagesUtil.convertString("asdfa:sd=ds2,f=f,sad=;").size(), 0); + } + + public void testPersistSentPatchWithRestrictedSize() { + int size = 15; + final Map> allUsages = createDescriptors("g:a1:-1", "g2:a2:-2", "g2:a3:-3", "g:a2:-2", "g3:a1:-1", "g3:a2:13"); + + final SentUsagesPersistence usagesPersistence = new BasicSentUsagesPersistenceComponent(); + Map> patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence); + String first = StatisticsUploadAssistant.getStringPatch(patchedUsages, size); + StatisticsUploadAssistant.persistSentPatch(first, usagesPersistence); + + assertTrue(first.length() <= size); + assertMapEquals(ConvertUsagesUtil.convertString(first), ConvertUsagesUtil.convertString("g:a1=-1,a2=-2")); + + patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence); + String second = StatisticsUploadAssistant.getStringPatch(patchedUsages, size); + StatisticsUploadAssistant.persistSentPatch(second, usagesPersistence); + assertTrue(second.length() <= size); + assertFalse(second.contains(first)); + assertMapEquals(ConvertUsagesUtil.convertString(second), ConvertUsagesUtil.convertString("g2:a2=-2,a3=-3")); + + patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence); + String third = StatisticsUploadAssistant.getStringPatch(patchedUsages, size); + StatisticsUploadAssistant.persistSentPatch(third, usagesPersistence); + assertTrue(third.length() <= size); + assertFalse(third.contains(first)); + assertFalse(third.contains(second)); + assertMapEquals(ConvertUsagesUtil.convertString(third), ConvertUsagesUtil.convertString("g3:a1=-1,a2=13")); + + + patchedUsages = StatisticsUploadAssistant.getPatchedUsages(allUsages, usagesPersistence); + assertEquals(patchedUsages.size(), 0); + + assertEquals(allUsages.size(), usagesPersistence.getSentUsages().size()); + } + + private static void assertMapEquals(@NotNull Map> expected, @NotNull Map> actual) { + assertEquals(expected.size(), actual.size()); + + for (Map.Entry> expectedEntry : expected.entrySet()) { + final GroupDescriptor expectedGroupDescriptor = expectedEntry.getKey(); + + assertTrue(actual.containsKey(expectedGroupDescriptor)); + + assertSetEquals(expectedEntry.getValue(), actual.get(expectedEntry.getKey())); + } + } + + private static void assertSetEquals(@NotNull Set expected, @NotNull Set actual) { + assertEquals(expected.size(), actual.size()); + for (UsageDescriptor usageDescriptor : expected) { + boolean exists = false; + for (UsageDescriptor descriptor : actual) { + if (usageDescriptor.getKey().equals(descriptor.getKey()) && usageDescriptor.getValue() == descriptor.getValue()) { + exists = true; + break; + } + } + assertTrue(asString(usageDescriptor) + " usage doesn't exist", exists); + } + } + + private static String asString(UsageDescriptor usage) { + return usage.getKey() + "=" + usage.getValue(); + } + + private static void createPatchDescriptor(Map> patchedUsages, String groupId, double priority, String key, int i) { + final GroupDescriptor groupDescriptor = GroupDescriptor.create(groupId, priority); + + if (!patchedUsages.containsKey(groupDescriptor)){ + patchedUsages.put(groupDescriptor, new LinkedHashSet()); + } + patchedUsages.get(groupDescriptor).add(new PatchedUsage(key, i)); + } + + + protected static UsageDescriptor createDescriptor(String k, int i) { + return new UsageDescriptor(k, i); + } + + protected static Map> createDescriptors(String... strs) { + Map> set = new LinkedHashMap>(); + for (String str : strs) { + final List list = StringUtil.split(str, ":"); + final GroupDescriptor g = GroupDescriptor.create(list.get(0)); + if (!set.containsKey(g)) { + set.put(g, new LinkedHashSet()); + } + set.get(g).add(createDescriptor(list.get(1), Integer.parseInt(list.get(2)))); + } + + return set; + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/BTreeEnumeratorTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/BTreeEnumeratorTest.java new file mode 100644 index 000000000000..c666f358d4d2 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/util/io/BTreeEnumeratorTest.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2006 JetBrains s.r.o. All Rights Reserved. + */ +package com.intellij.util.io; + +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.util.ThrowableRunnable; +import com.intellij.util.containers.IntObjectCache; +import gnu.trove.THashMap; +import junit.framework.TestCase; + +import java.io.File; +import java.io.IOException; +import java.util.*; + +public class BTreeEnumeratorTest extends TestCase { + private static final String COLLISION_1 = ""; + private static final String COLLISION_2 = "\u0000"; + private static final String UTF_1 = "\ue534"; + private static final String UTF_2 = + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + + static class TestStringEnumerator extends PersistentBTreeEnumerator { + public TestStringEnumerator(File file) throws IOException { + super(file, new EnumeratorStringDescriptor(), 4096); + } + } + private TestStringEnumerator myEnumerator; + private File myFile; + + @Override + protected void setUp() throws Exception { + super.setUp(); + myFile = FileUtil.createTempFile("persistent", "trie"); + myEnumerator = new TestStringEnumerator(myFile); + } + + @Override + protected void tearDown() throws Exception { + myEnumerator.close(); + FileUtil.delete(myFile); + FileUtil.delete(new File(myFile.getParentFile(), myFile.getName() + ".len")); + assertTrue(!myFile.exists()); + super.tearDown(); + } + + public void testAddEqualStrings() throws IOException { + final int index = myEnumerator.enumerate("IntelliJ IDEA"); + myEnumerator.enumerate("Just another string"); + assertEquals(index, myEnumerator.enumerate("IntelliJ IDEA")); + } + + public void testAddEqualStringsAndMuchGarbage() throws IOException { + final Map strings = new THashMap(10001); + String s = "IntelliJ IDEA"; + final int index = myEnumerator.enumerate(s); + strings.put(index, s); + + // clear strings and nodes cache + for (int i = 0; i < 10000; ++i) { + final String v = Integer.toString(i) + "Just another string"; + final int idx = myEnumerator.enumerate(v); + assertEquals(v, myEnumerator.valueOf(idx)); + strings.put(idx, v); + } + + for(Map.Entry e:strings.entrySet()) { + assertEquals((int)e.getKey(), myEnumerator.enumerate(e.getValue())); + } + + final Set enumerated = new HashSet(myEnumerator.getAllDataObjects(null)); + assertEquals(new HashSet(strings.values()), enumerated); + } + + public void testCollision() throws Exception { + int id1 = myEnumerator.enumerate(COLLISION_1); + int id2 = myEnumerator.enumerate(COLLISION_2); + assertFalse(id1 == id2); + + assertEquals(COLLISION_1, myEnumerator.valueOf(id1)); + assertEquals(COLLISION_2, myEnumerator.valueOf(id2)); + assertEquals(new HashSet(Arrays.asList(COLLISION_1, COLLISION_2)), new HashSet(myEnumerator.getAllDataObjects(null))); + } + + public void testCollision1() throws Exception { + int id1 = myEnumerator.enumerate(COLLISION_1); + + assertEquals(id1, myEnumerator.tryEnumerate(COLLISION_1)); + assertEquals(PersistentEnumerator.NULL_ID, myEnumerator.tryEnumerate(COLLISION_2)); + + int id2 = myEnumerator.enumerate(COLLISION_2); + assertFalse(id1 == id2); + + assertEquals(id1, myEnumerator.tryEnumerate(COLLISION_1)); + assertEquals(id2, myEnumerator.tryEnumerate(COLLISION_2)); + assertEquals(PersistentEnumerator.NULL_ID, myEnumerator.tryEnumerate("some string")); + + assertEquals(COLLISION_1, myEnumerator.valueOf(id1)); + assertEquals(COLLISION_2, myEnumerator.valueOf(id2)); + assertEquals(new HashSet(Arrays.asList(COLLISION_1, COLLISION_2)), new HashSet(myEnumerator.getAllDataObjects(null))); + } + + + public void testUTFString() throws Exception { + int id1 = myEnumerator.enumerate(UTF_1); + int id2 = myEnumerator.enumerate(UTF_2); + assertFalse(id1 == id2); + + assertEquals(UTF_1, myEnumerator.valueOf(id1)); + assertEquals(UTF_2, myEnumerator.valueOf(id2)); + assertEquals(new HashSet(Arrays.asList(UTF_1, UTF_2)), new HashSet(myEnumerator.getAllDataObjects(null))); + } + + public void testOpeningClosing() throws IOException { + ArrayList strings = new ArrayList(2000); + for (int i = 0; i < 2000; ++i) { + strings.add(createRandomString()); + } + for (int i = 0; i < 2000; ++i) { + myEnumerator.enumerate(strings.get(i)); + myEnumerator.close(); + myEnumerator = new TestStringEnumerator(myFile); + } + for (int i = 0; i < 2000; ++i) { + myEnumerator.enumerate(strings.get(i)); + assertTrue(!myEnumerator.isDirty()); + myEnumerator.close(); + myEnumerator = new TestStringEnumerator(myFile); + } + for (int i = 0; i < 2000; ++i) { + assertTrue(!myEnumerator.isDirty()); + myEnumerator.close(); + myEnumerator = new TestStringEnumerator(myFile); + } + final HashSet allStringsSet = new HashSet(strings); + assertEquals(allStringsSet, new HashSet(myEnumerator.getAllDataObjects(null))); + + final String additionalString = createRandomString(); + allStringsSet.add(additionalString); + myEnumerator.enumerate(additionalString); + assertTrue(myEnumerator.isDirty()); + assertEquals(allStringsSet, new HashSet(myEnumerator.getAllDataObjects(null))); + } + + public void testPerformance() throws IOException { + final IntObjectCache stringCache = new IntObjectCache(2000); + final IntObjectCache.DeletedPairsListener listener = new IntObjectCache.DeletedPairsListener() { + @Override + public void objectRemoved(final int key, final Object value) { + try { + assertEquals(myEnumerator.enumerate((String)value), key); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + }; + + PlatformTestUtil.startPerformanceTest("PersistentStringEnumerator performance failed", 2500, new ThrowableRunnable() { + @Override + public void run() throws Exception { + stringCache.addDeletedPairsListener(listener); + for (int i = 0; i < 100000; ++i) { + final String string = createRandomString(); + stringCache.cacheObject(myEnumerator.enumerate(string), string); + } + stringCache.removeDeletedPairsListener(listener); + stringCache.removeAll(); + } + }).assertTiming(); + myEnumerator.close(); + System.out.printf("File size = %d bytes\n", myFile.length()); + } + + private static final StringBuilder builder = new StringBuilder(100); + private static final Random random = new Random(13101977); + + static String createRandomString() { + builder.setLength(0); + int len = random.nextInt(40) + 10; + for (int i = 0; i < len; ++i) { + builder.append((char)(32 + random.nextInt(2 + i >> 1))); + } + return builder.toString(); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapTest.java new file mode 100644 index 000000000000..26406e674577 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapTest.java @@ -0,0 +1,342 @@ +package com.intellij.util.io; + +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.util.ThrowableRunnable; +import com.intellij.util.containers.IntObjectCache; +import com.intellij.util.io.storage.Storage; +import junit.framework.TestCase; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.util.*; + +/** + * @author Eugene Zhuravlev + * Date: Dec 19, 2007 + */ +public class PersistentMapTest extends TestCase { + + private PersistentHashMap myMap; + private File myFile; + private File myDataFile; + + @Override + protected void setUp() throws Exception { + super.setUp(); + myFile = FileUtil.createTempFile("persistent", "map"); + myDataFile = new File(myFile.getParentFile(), myFile.getName() + PersistentHashMap.DATA_FILE_EXTENSION); + myMap = new PersistentHashMap(myFile, new EnumeratorStringDescriptor(), new EnumeratorStringDescriptor()); + } + + @Override + protected void tearDown() throws Exception { + clearMap(myFile, myMap); + super.tearDown(); + } + + private static void clearMap(final File file1, PersistentHashMap map) throws IOException { + map.close(); + + final File[] files = file1.getParentFile().listFiles(new FileFilter() { + @Override + public boolean accept(final File pathname) { + return pathname.getName().startsWith(file1.getName()); + } + }); + + if (files != null) { + for (File file : files) { + FileUtil.delete(file); + assertTrue(!file.exists()); + } + } + } + + public void testMap() throws IOException { + myMap.put("AAA", "AAA_VALUE"); + + assertEquals("AAA_VALUE", myMap.get("AAA")); + assertNull(myMap.get("BBB")); + assertEquals(new HashSet(Arrays.asList("AAA")), new HashSet(myMap.getAllKeysWithExistingMapping())); + + myMap.put("BBB", "BBB_VALUE"); + assertEquals("BBB_VALUE", myMap.get("BBB")); + assertEquals(new HashSet(Arrays.asList("AAA", "BBB")), new HashSet(myMap.getAllKeysWithExistingMapping())); + + myMap.put("AAA", "ANOTHER_AAA_VALUE"); + assertEquals("ANOTHER_AAA_VALUE", myMap.get("AAA")); + assertEquals(new HashSet(Arrays.asList("AAA", "BBB")), new HashSet(myMap.getAllKeysWithExistingMapping())); + + myMap.remove("AAA"); + assertNull(myMap.get("AAA")); + assertEquals("BBB_VALUE", myMap.get("BBB")); + assertEquals(new HashSet(Arrays.asList("BBB")), new HashSet(myMap.getAllKeysWithExistingMapping())); + + myMap.remove("BBB"); + assertNull(myMap.get("AAA")); + assertNull(myMap.get("BBB")); + assertEquals(new HashSet(), new HashSet(myMap.getAllKeysWithExistingMapping())); + + myMap.put("AAA", "FINAL_AAA_VALUE"); + assertEquals("FINAL_AAA_VALUE", myMap.get("AAA")); + assertNull(myMap.get("BBB")); + assertEquals(new HashSet(Arrays.asList("AAA")), new HashSet(myMap.getAllKeysWithExistingMapping())); + } + + public void testOpeningClosing() throws IOException { + List strings = new ArrayList(2000); + for (int i = 0; i < 2000; ++i) { + strings.add(createRandomString()); + } + for (int i = 0; i < 2000; ++i) { + final String key = strings.get(i); + myMap.put(key, key + "_value"); + myMap.close(); + myMap = new PersistentHashMap(myFile, new EnumeratorStringDescriptor(), new EnumeratorStringDescriptor()); + } + for (int i = 0; i < 2000; ++i) { + final String key = strings.get(i); + final String value = key + "_value"; + assertEquals(value, myMap.get(key)); + + myMap.put(key, value); + assertTrue(myMap.isDirty()); + + myMap.close(); + myMap = new PersistentHashMap(myFile, new EnumeratorStringDescriptor(), new EnumeratorStringDescriptor()); + } + for (int i = 0; i < 2000; ++i) { + assertTrue(!myMap.isDirty()); + myMap.close(); + myMap = new PersistentHashMap(myFile, new EnumeratorStringDescriptor(), new EnumeratorStringDescriptor()); + } + final String randomKey = createRandomString(); + myMap.put(randomKey, randomKey + "_value"); + assertTrue(myMap.isDirty()); + } + + public void testOpeningWithCompact() throws IOException { + final int stringsCount = 5/*1000000*/; + Set strings = new HashSet(stringsCount); + for (int i = 0; i < stringsCount; ++i) { + final String key = createRandomString(); + strings.add(key); + myMap.put(key, key + "_value"); + } + myMap.close(); + myMap = new PersistentHashMap(myFile, new EnumeratorStringDescriptor(), new EnumeratorStringDescriptor()); + + { // before compact + final Collection allKeys = new HashSet(myMap.getAllKeysWithExistingMapping()); + assertEquals(strings, allKeys); + for (String key : allKeys) { + final String val = myMap.get(key); + assertEquals(key + "_value", val); + } + } + myMap.compact(); + + { // after compact + final Collection allKeys = new HashSet(myMap.getAllKeysWithExistingMapping()); + assertEquals(strings, allKeys); + for (String key : allKeys) { + final String val = myMap.get(key); + assertEquals(key + "_value", val); + } + } + } + + public void testGarbageSizeUpdatedAfterCompact() throws IOException { + final int stringsCount = 5/*1000000*/; + Set strings = new HashSet(stringsCount); + for (int i = 0; i < stringsCount; ++i) { + final String key = createRandomString(); + strings.add(key); + myMap.put(key, key + "_value"); + } + + // create some garbage + for (String string : strings) { + myMap.remove(string); + } + strings.clear(); + + for (int i = 0; i < stringsCount; ++i) { + final String key = createRandomString(); + strings.add(key); + myMap.put(key, key + "_value"); + } + + myMap.close(); + + final int garbageSizeOnClose = myMap.getGarbageSize(); + + myMap = new PersistentHashMap(myFile, new EnumeratorStringDescriptor(), new EnumeratorStringDescriptor()); + + final int garbageSizeOnOpen = myMap.getGarbageSize(); + + assertEquals(garbageSizeOnClose, garbageSizeOnOpen); + + { // before compact + final Collection allKeys = new HashSet(myMap.getAllKeysWithExistingMapping()); + assertEquals(strings, allKeys); + for (String key : allKeys) { + final String val = myMap.get(key); + assertEquals(key + "_value", val); + } + } + + myMap.compact(); + + assertEquals(0, myMap.getGarbageSize()); + + myMap.close(); + myMap = new PersistentHashMap(myFile, new EnumeratorStringDescriptor(), new EnumeratorStringDescriptor()); + + final int garbageSizeAfterCompact = myMap.getGarbageSize(); + assertEquals(0, garbageSizeAfterCompact); + + { // after compact + final Collection allKeys = new HashSet(myMap.getAllKeysWithExistingMapping()); + assertEquals(strings, allKeys); + for (String key : allKeys) { + final String val = myMap.get(key); + assertEquals(key + "_value", val); + } + } + } + + public void testOpeningWithCompact2() throws IOException { + File file = FileUtil.createTempFile("persistent", "map"); + + PersistentHashMap map = new PersistentHashMap(file, new IntInlineKeyDescriptor(), new EnumeratorStringDescriptor()); + try { + final int stringsCount = 5/*1000000*/; + Map testMapping = new LinkedHashMap(stringsCount); + for (int i = 0; i < stringsCount; ++i) { + final String key = createRandomString(); + String value = key + "_value"; + testMapping.put(i, value); + map.put(i, value); + } + map.close(); + map = new PersistentHashMap(file, new IntInlineKeyDescriptor(), new EnumeratorStringDescriptor()); + + { // before compact + final Collection allKeys = new HashSet(map.getAllKeysWithExistingMapping()); + assertEquals(new HashSet(testMapping.keySet()), allKeys); + for (Integer key : allKeys) { + final String val = map.get(key); + assertEquals(testMapping.get(key), val); + } + } + map.compact(); + + { // after compact + final Collection allKeys = new HashSet(map.getAllKeysWithExistingMapping()); + assertEquals(new HashSet(testMapping.keySet()), allKeys); + for (Integer key : allKeys) { + final String val = map.get(key); + assertEquals(testMapping.get(key), val); + } + } + } + finally { + clearMap(file, map); + } + } + + public void testPerformance() throws IOException { + final IntObjectCache stringCache = new IntObjectCache(2000); + final IntObjectCache.DeletedPairsListener listener = new IntObjectCache.DeletedPairsListener() { + @Override + public void objectRemoved(final int key, final Object mapKey) { + try { + final String _mapKey = (String)mapKey; + assertEquals(myMap.enumerate(_mapKey), key); + + final String expectedMapValue = _mapKey == null ? null : _mapKey + "_value"; + final String actual = myMap.get(_mapKey); + assertEquals(expectedMapValue, actual); + + myMap.remove(_mapKey); + + assertNull(myMap.get(_mapKey)); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + }; + + PlatformTestUtil.startPerformanceTest("Perforamnce", 9000, new ThrowableRunnable() { + @Override + public void run() throws Exception { + try { + stringCache.addDeletedPairsListener(listener); + for (int i = 0; i < 100000; ++i) { + final String string = createRandomString(); + final int id = myMap.enumerate(string); + stringCache.put(id, string); + myMap.put(string, string + "_value"); + } + stringCache.removeDeletedPairsListener(listener); + for (String key : stringCache) { + myMap.remove(key); + } + stringCache.removeAll(); + myMap.compact(); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + }).ioBound().assertTiming(); + + myMap.close(); + System.out.printf("File size = %d bytes\n", myFile.length()); + System.out + .printf("Data file size = %d bytes\n", new File(myDataFile.getParentFile(), myDataFile.getName() + Storage.DATA_EXTENSION).length()); + } + + public void testPerformance1() throws IOException { + final List strings = new ArrayList(2000); + for (int i = 0; i < 100000; ++i) { + strings.add(createRandomString()); + } + + PlatformTestUtil.startPerformanceTest("perf1",5000, new ThrowableRunnable() { + @Override + public void run() throws Exception { + for (int i = 0; i < 100000; ++i) { + final String string = strings.get(i); + myMap.put(string, string); + } + + for (int i = 0; i < 100000; ++i) { + final String string = createRandomString(); + myMap.get(string); + } + + for (int i = 0; i < 100000; ++i) { + final String string = createRandomString(); + myMap.remove(string); + } + + for (String string : strings) { + myMap.remove(string); + } + } + }).assertTiming(); + myMap.close(); + System.out.printf("File size = %d bytes\n", myFile.length()); + System.out + .printf("Data file size = %d bytes\n", new File(myDataFile.getParentFile(), myDataFile.getName() + Storage.DATA_EXTENSION).length()); + } + + private static String createRandomString() { + return StringEnumeratorTest.createRandomString(); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/StringEnumeratorTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/StringEnumeratorTest.java new file mode 100644 index 000000000000..5d6c88b19d10 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/util/io/StringEnumeratorTest.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2006 JetBrains s.r.o. All Rights Reserved. + */ +package com.intellij.util.io; + +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.util.ThrowableRunnable; +import com.intellij.util.containers.IntObjectCache; +import junit.framework.TestCase; + +import java.io.File; +import java.io.IOException; +import java.util.*; + +public class StringEnumeratorTest extends TestCase { + private static final String COLLISION_1 = ""; + private static final String COLLISION_2 = "\u0000"; + private static final String UTF_1 = "\ue534"; + private static final String UTF_2 = + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + + private PersistentStringEnumerator myEnumerator; + private File myFile; + + @Override + protected void setUp() throws Exception { + super.setUp(); + myFile = FileUtil.createTempFile("persistent", "trie"); + myEnumerator = new PersistentStringEnumerator(myFile); + } + + @Override + protected void tearDown() throws Exception { + myEnumerator.close(); + FileUtil.delete(myFile); + FileUtil.delete(new File(myFile.getParentFile(), myFile.getName() + ".len")); + assertTrue(!myFile.exists()); + super.tearDown(); + } + + public void testAddEqualStrings() throws IOException { + final int index = myEnumerator.enumerate("IntelliJ IDEA"); + myEnumerator.enumerate("Just another string"); + assertEquals(index, myEnumerator.enumerate("IntelliJ IDEA")); + } + + public void testAddEqualStringsAndMuchGarbage() throws IOException { + final Set stringsAded = new HashSet(); + final int index = myEnumerator.enumerate("IntelliJ IDEA"); + stringsAded.add("IntelliJ IDEA"); + // clear strings and nodes cache + for (int i = 0; i < 20000; ++i) { + final String v = Integer.toString(i) + "Just another string"; + stringsAded.add(v); + final int idx = myEnumerator.enumerate(v); + assertEquals(v, myEnumerator.valueOf(idx)); + } + + assertEquals(index, myEnumerator.enumerate("IntelliJ IDEA")); + final Set enumerated = new HashSet(myEnumerator.getAllDataObjects(null)); + assertEquals(stringsAded, enumerated); + } + + public void testCollision() throws Exception { + int id1 = myEnumerator.enumerate(COLLISION_1); + int id2 = myEnumerator.enumerate(COLLISION_2); + assertFalse(id1 == id2); + + assertEquals(COLLISION_1, myEnumerator.valueOf(id1)); + assertEquals(COLLISION_2, myEnumerator.valueOf(id2)); + assertEquals(new HashSet(Arrays.asList(COLLISION_1, COLLISION_2)), new HashSet(myEnumerator.getAllDataObjects(null))); + } + + public void testCollision1() throws Exception { + int id1 = myEnumerator.enumerate(COLLISION_1); + + assertEquals(id1, myEnumerator.tryEnumerate(COLLISION_1)); + assertEquals(PersistentEnumerator.NULL_ID, myEnumerator.tryEnumerate(COLLISION_2)); + + int id2 = myEnumerator.enumerate(COLLISION_2); + assertFalse(id1 == id2); + + assertEquals(id1, myEnumerator.tryEnumerate(COLLISION_1)); + assertEquals(id2, myEnumerator.tryEnumerate(COLLISION_2)); + assertEquals(PersistentEnumerator.NULL_ID, myEnumerator.tryEnumerate("some string")); + + assertEquals(COLLISION_1, myEnumerator.valueOf(id1)); + assertEquals(COLLISION_2, myEnumerator.valueOf(id2)); + assertEquals(new HashSet(Arrays.asList(COLLISION_1, COLLISION_2)), new HashSet(myEnumerator.getAllDataObjects(null))); + } + + + public void testUTFString() throws Exception { + int id1 = myEnumerator.enumerate(UTF_1); + int id2 = myEnumerator.enumerate(UTF_2); + assertFalse(id1 == id2); + + assertEquals(UTF_1, myEnumerator.valueOf(id1)); + assertEquals(UTF_2, myEnumerator.valueOf(id2)); + assertEquals(new HashSet(Arrays.asList(UTF_1, UTF_2)), new HashSet(myEnumerator.getAllDataObjects(null))); + } + + public void testOpeningClosing() throws IOException { + ArrayList strings = new ArrayList(2000); + for (int i = 0; i < 2000; ++i) { + strings.add(createRandomString()); + } + for (int i = 0; i < 2000; ++i) { + myEnumerator.enumerate(strings.get(i)); + myEnumerator.close(); + myEnumerator = new PersistentStringEnumerator(myFile); + } + for (int i = 0; i < 2000; ++i) { + myEnumerator.enumerate(strings.get(i)); + assertTrue(!myEnumerator.isDirty()); + myEnumerator.close(); + myEnumerator = new PersistentStringEnumerator(myFile); + } + for (int i = 0; i < 2000; ++i) { + assertTrue(!myEnumerator.isDirty()); + myEnumerator.close(); + myEnumerator = new PersistentStringEnumerator(myFile); + } + final HashSet allStringsSet = new HashSet(strings); + assertEquals(allStringsSet, new HashSet(myEnumerator.getAllDataObjects(null))); + + final String additionalString = createRandomString(); + allStringsSet.add(additionalString); + myEnumerator.enumerate(additionalString); + assertTrue(myEnumerator.isDirty()); + assertEquals(allStringsSet, new HashSet(myEnumerator.getAllDataObjects(null))); + } + + public void testPerformance() throws IOException { + final IntObjectCache stringCache = new IntObjectCache(2000); + final IntObjectCache.DeletedPairsListener listener = new IntObjectCache.DeletedPairsListener() { + @Override + public void objectRemoved(final int key, final Object value) { + try { + assertEquals(myEnumerator.enumerate((String)value), key); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + }; + + PlatformTestUtil.startPerformanceTest("PersistentStringEnumerator performance failed", 2500, new ThrowableRunnable() { + @Override + public void run() throws Exception { + stringCache.addDeletedPairsListener(listener); + for (int i = 0; i < 100000; ++i) { + final String string = createRandomString(); + stringCache.cacheObject(myEnumerator.enumerate(string), string); + } + stringCache.removeDeletedPairsListener(listener); + stringCache.removeAll(); + } + }).cpuBound().assertTiming(); + myEnumerator.close(); + System.out.printf("File size = %d bytes\n", myFile.length()); + } + + private static final StringBuilder builder = new StringBuilder(100); + private static final Random random = new Random(); + + static String createRandomString() { + builder.setLength(0); + int len = random.nextInt(40) + 10; + for (int i = 0; i < len; ++i) { + builder.append((char)(32 + random.nextInt(2 + i >> 1))); + } + return builder.toString(); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/util/ui/update/MergingUpdateQueueTest.java b/platform/platform-tests/testSrc/com/intellij/util/ui/update/MergingUpdateQueueTest.java new file mode 100644 index 000000000000..d6ac3110711e --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/util/ui/update/MergingUpdateQueueTest.java @@ -0,0 +1,295 @@ +/* + * Copyright (c) 2000-2004 by JetBrains s.r.o. All Rights Reserved. + * Use is subject to license terms. + */ +package com.intellij.util.ui.update; + +import com.intellij.testFramework.FlyIdeaTestCase; +import com.intellij.util.WaitFor; + +public class MergingUpdateQueueTest extends FlyIdeaTestCase { + public void testOnShowNotify() throws Exception { + final MyUpdate first = new MyUpdate("first"); + final MyUpdate second = new MyUpdate("second"); + + final MyQueue queue = new MyQueue(); + + queue.queue(first); + queue.queue(second); + + assertFalse(first.isExecuted()); + assertFalse(second.isExecuted()); + + queue.showNotify(); + + waitForExecution(queue); + + assertAfterProcessing(first, true, true); + assertAfterProcessing(second, true, true); + } + + public void testPriority() throws Exception { + final boolean attemps[] = new boolean[3]; + + final MyQueue queue = new MyQueue(); + + final MyUpdate first = new MyUpdate("addedFirstButRunLast") { // default priority is 999 + @Override + public void run() { + super.run(); + attemps[0] = true; + assertTrue(attemps[1]); + assertTrue(attemps[2]); + } + }; + + final MyUpdate second = new MyUpdate("addedSecondButRunFirst", Update.HIGH_PRIORITY) { + @Override + public void run() { + super.run(); + assertFalse(attemps[0]); + attemps[1] = true; + assertFalse(attemps[2]); + } + }; + + final MyUpdate third = new MyUpdate("addedThirdButRunSecond", 100) { + @Override + public void run() { + super.run(); + assertFalse(attemps[0]); + assertTrue(attemps[1]); + attemps[2] = true; + } + }; + + queue.queue(first); + queue.queue(second); + queue.queue(third); + + waitForExecution(queue); + + assertAfterProcessing(first, true, true); + assertAfterProcessing(second, true, true); + assertAfterProcessing(third, true, true); + } + + public void testDoNoExecuteExpired() throws Throwable { + + final boolean[] expired = new boolean[1]; + + final MyUpdate first = new MyUpdate("first") { + @Override + public boolean isExpired() { + return expired[0]; + } + }; + final MyUpdate second = new MyUpdate("second"); + + final MyQueue queue = new MyQueue(); + + queue.queue(first); + queue.queue(second); + + assertFalse(first.isExecuted()); + assertFalse(second.isExecuted()); + + expired[0] = true; + + queue.showNotify(); + waitForExecution(queue); + + assertAfterProcessing(first, false, true); + assertAfterProcessing(second, true, true); + } + + + public void testOnShowNotifyMerging() throws Exception { + final MyUpdate twin1 = new MyUpdate("twin"); + final MyUpdate twin2 = new MyUpdate("twin"); + + final MyQueue queue = new MyQueue(); + + queue.queue(twin1); + queue.queue(twin2); + + assertFalse(twin1.isExecuted()); + assertFalse(twin2.isExecuted()); + + queue.showNotify(); + waitForExecution(queue); + + assertAfterProcessing(twin1, false, true); + assertAfterProcessing(twin2, true, true); + } + + public void testExecuteWhenActive() throws Exception { + final MyQueue queue = new MyQueue(); + + queue.showNotify(); + + final MyUpdate first = new MyUpdate("first"); + final MyUpdate second = new MyUpdate("second"); + + queue.queue(first); + queue.queue(second); + + waitForExecution(queue); + + assertAfterProcessing(first, true, true); + assertAfterProcessing(second, true, true); + } + + public void testMergeWhenActive() throws Exception { + final MyQueue queue = new MyQueue(); + + queue.showNotify(); + + final MyUpdate twin1 = new MyUpdate("twin"); + final MyUpdate twin2 = new MyUpdate("twin"); + + queue.queue(twin1); + queue.queue(twin2); + + waitForExecution(queue); + + assertAfterProcessing(twin1, false, true); + assertAfterProcessing(twin2, true, true); + } + + public void testEatByQueue() throws Exception { + executeEatingTest(false); + } + + public void testEatUpdatesInQueue() throws Exception { + executeEatingTest(true); + } + + private void executeEatingTest(boolean foodFirst) throws Exception{ + final MyQueue queue = new MyQueue(); + queue.showNotify(); + + final MyUpdate food = new MyUpdate("food"); + MyUpdate hungry = new MyUpdate("hungry") { + @Override + public boolean canEat(Update update) { + return update == food; + } + }; + + if (foodFirst) { + queue.queue(food); + queue.queue(hungry); + } else { + queue.queue(hungry); + queue.queue(food); + } + + waitForExecution(queue); + + assertAfterProcessing(hungry, true, true); + assertAfterProcessing(food, false, false); + } + + public void testCuncurrentFlushing() throws Exception { + final MyQueue queue = new MyQueue(); + queue.showNotify(); + + queue.queue(new MyUpdate("update") { + @Override + public boolean isExpired() { + queue.flush(); + return false; + } + }); + + waitForExecution(queue); + } + + public void testConcurrentQueing() throws Exception { + final MyQueue queue = new MyQueue(); + queue.showNotify(); + + queue.queue(new MyUpdate("update") { + @Override + public boolean isExpired() { + queue.queue(new MyUpdate("update again")); + return false; + } + }); + + waitForExecution(queue); + } + + + private void assertAfterProcessing(MyUpdate update, boolean shouldBeExecuted, boolean shouldBeProcessed) { + assertEquals(shouldBeExecuted, update.isExecuted()); + assertEquals(shouldBeProcessed, update.wasProcessed()); + } + + private static class MyUpdate extends Update { + + private boolean myExecuted; + + MyUpdate(String s) { + super(s); + } + + MyUpdate(Object identity, int priority) { + super(identity, priority); + } + + @Override + public void run() { + myExecuted = true; + } + + public boolean isExecuted() { + return myExecuted; + } + } + + private static class MyQueue extends MergingUpdateQueue { + private boolean myExecuted; + + MyQueue() { + super("Test", 400, false, null); + setPassThrough(false); + } + + @Override + public void run() { + + } + + public void onTimer() { + super.run(); + } + + @Override + protected void execute(final Update[] update) { + super.execute(update); + myExecuted = true; + } + + public boolean wasExecuted() { + return myExecuted; + } + + @Override + protected boolean isModalityStateCorrect() { + return true; + } + } + + private void waitForExecution(final MyQueue queue) { + queue.onTimer(); + new WaitFor(5000) { + @Override + protected boolean condition() { + return queue.wasExecuted(); + } + }; + } + +} From edc378071f05d537663fe760bdd0a4a682a8bc98 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 18:21:31 +0100 Subject: [PATCH 055/101] cleaning up test dependencies --- .../intellij/mock/MockInspectionProfile.java | 57 ++++++++ .../com/intellij/mock/MockVirtualFile.java | 136 ++++++++++++++++++ .../com/intellij/util/xml/CallRegistry.java | 42 ++++++ 3 files changed, 235 insertions(+) create mode 100644 platform/testFramework/src/com/intellij/mock/MockInspectionProfile.java create mode 100644 platform/testFramework/src/com/intellij/mock/MockVirtualFile.java create mode 100644 platform/testFramework/src/com/intellij/util/xml/CallRegistry.java diff --git a/platform/testFramework/src/com/intellij/mock/MockInspectionProfile.java b/platform/testFramework/src/com/intellij/mock/MockInspectionProfile.java new file mode 100644 index 000000000000..030a5d63814a --- /dev/null +++ b/platform/testFramework/src/com/intellij/mock/MockInspectionProfile.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved. + */ +package com.intellij.mock; + +import com.intellij.codeInsight.daemon.HighlightDisplayKey; +import com.intellij.codeInspection.InspectionProfileEntry; +import com.intellij.codeInspection.ex.InspectionProfileImpl; +import com.intellij.openapi.util.Condition; +import com.intellij.psi.PsiElement; +import com.intellij.util.containers.ContainerUtil; +import gnu.trove.THashSet; +import org.jetbrains.annotations.NotNull; + +import java.util.Set; + +/** + * @author peter +*/ +public class MockInspectionProfile extends InspectionProfileImpl { + private InspectionProfileEntry[] myInspectionTools = new InspectionProfileEntry[0]; + private final Set myDisabledTools = new THashSet(); + + public MockInspectionProfile() { + super("a"); + } + + public void setEnabled(InspectionProfileEntry tool, boolean enabled) { + if (enabled) { + myDisabledTools.remove(tool); + } else { + myDisabledTools.add(tool); + } + } + + @Override + public boolean isToolEnabled(final HighlightDisplayKey key, PsiElement element) { + final InspectionProfileEntry entry = ContainerUtil.find(myInspectionTools, new Condition() { + @Override + public boolean value(final InspectionProfileEntry inspectionProfileEntry) { + return key.equals(HighlightDisplayKey.find(inspectionProfileEntry.getShortName())); + } + }); + assert entry != null; + return !myDisabledTools.contains(entry); + } + + public void setInspectionTools(final InspectionProfileEntry... entries) { + myInspectionTools = entries; + } + + @Override + @NotNull + public InspectionProfileEntry[] getInspectionTools(PsiElement element) { + return myInspectionTools; + } +} diff --git a/platform/testFramework/src/com/intellij/mock/MockVirtualFile.java b/platform/testFramework/src/com/intellij/mock/MockVirtualFile.java new file mode 100644 index 000000000000..5478d0b84890 --- /dev/null +++ b/platform/testFramework/src/com/intellij/mock/MockVirtualFile.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2000-2007 JetBrains s.r.o. All Rights Reserved. + */ +package com.intellij.mock; + +import com.intellij.openapi.fileTypes.FileType; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileSystem; +import com.intellij.util.SmartList; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; + +/** + * @author peter + */ +public class MockVirtualFile extends VirtualFile { + private VirtualFile myParent; + private final String myName; + private final boolean myDirectory; + private final List myChildren = new SmartList(); + private String myText; + private FileType myFileType; + private final MockVirtualFileSystem myFileSystem = new MockVirtualFileSystem(); + + public MockVirtualFile(final String name) { + this(false, name); + } + + public MockVirtualFile(final boolean directory, final String name) { + myDirectory = directory; + myName = name; + } + + public void setText(final String text) { + myText = text; + } + + @Override + @NotNull + @NonNls + public String getName() { + return myName; + } + + public void setParent(final VirtualFile parent) { + myParent = parent; + } + + @Override + public VirtualFile createChildData(final Object requestor, @NotNull @NonNls final String name) { + final MockVirtualFile file = new MockVirtualFile(name); + file.setParent(this); + myChildren.add(file); + return file; + } + + @Override + @NotNull + public VirtualFileSystem getFileSystem() { + return myFileSystem; + } + + @Override + public String getPath() { + String prefix = myParent == null ? "MOCK_ROOT:" : myParent.getPath(); + return prefix + "/" + myName; + } + + @Override + public boolean isWritable() { + throw new UnsupportedOperationException("Method isWritable is not yet implemented in " + getClass().getName()); + } + + @Override + public boolean isDirectory() { + return myDirectory; + } + + @Override + public boolean isValid() { + return true; + } + + @Override + @Nullable + public VirtualFile getParent() { + return myParent; + } + + @Override + public VirtualFile[] getChildren() { + return (VirtualFile[])VfsUtil.toVirtualFileArray(myChildren); + } + + @Override + @NotNull + public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) throws IOException { + throw new UnsupportedOperationException("Method getOutputStream is not yet implemented in " + getClass().getName()); + } + + @Override + @NotNull + public byte[] contentsToByteArray() throws IOException { + return myText.getBytes(); + } + + @Override + public long getTimeStamp() { + throw new UnsupportedOperationException("Method getTimeStamp is not yet implemented in " + getClass().getName()); + } + + @Override + public long getLength() { + throw new UnsupportedOperationException("Method getLength is not yet implemented in " + getClass().getName()); + } + + @Override + public void refresh(boolean asynchronous, boolean recursive, Runnable postRunnable) { + throw new UnsupportedOperationException("Method refresh is not yet implemented in " + getClass().getName()); + } + + @Override + public InputStream getInputStream() throws IOException { + throw new UnsupportedOperationException("Method getInputStream is not yet implemented in " + getClass().getName()); + } + + + +} diff --git a/platform/testFramework/src/com/intellij/util/xml/CallRegistry.java b/platform/testFramework/src/com/intellij/util/xml/CallRegistry.java new file mode 100644 index 000000000000..d44588a4732a --- /dev/null +++ b/platform/testFramework/src/com/intellij/util/xml/CallRegistry.java @@ -0,0 +1,42 @@ +package com.intellij.util.xml; + +import junit.framework.Assert; + +/** + * @author peter + */ +public class CallRegistry { + private int mySize; + private final StringBuilder myExpected = new StringBuilder(); + private final StringBuilder myActual = new StringBuilder(); + + public void putActual(T o) { + myActual.append(o); + myActual.append("\n"); + mySize++; + } + + public void putExpected(T o) { + myExpected.append(o); + myExpected.append("\n"); + } + + public void clear() { + mySize = 0; + myExpected.setLength(0); + myActual.setLength(0); + } + + public void assertResultsAndClear() { + Assert.assertEquals(myExpected.toString(), myActual.toString()); + clear(); + } + + public String toString() { + return myActual.toString(); + } + + public int getSize() { + return mySize; + } +} From 07908fe7ce8a43028dedd5b45c6a36d1e9d80cb2 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 18:39:58 +0100 Subject: [PATCH 056/101] SmartTreeStructureTest -> platform-tests; allow running platform-tests with module classpath --- .../intellij/testFramework/IdeaTestUtil.java | 28 --- platform/platform-tests/platform-tests.iml | 5 + .../structureView/SmartTreeStructureTest.java | 238 ++++++++++++++++++ .../testFramework/PlatformTestUtil.java | 36 ++- 4 files changed, 268 insertions(+), 39 deletions(-) create mode 100644 platform/platform-tests/testSrc/com/intellij/structureView/SmartTreeStructureTest.java diff --git a/java/testFramework/src/com/intellij/testFramework/IdeaTestUtil.java b/java/testFramework/src/com/intellij/testFramework/IdeaTestUtil.java index 5846f97dad70..2ae92ce833ac 100644 --- a/java/testFramework/src/com/intellij/testFramework/IdeaTestUtil.java +++ b/java/testFramework/src/com/intellij/testFramework/IdeaTestUtil.java @@ -15,40 +15,12 @@ */ package com.intellij.testFramework; -import com.intellij.ide.util.treeView.AbstractTreeNode; import com.intellij.openapi.module.Module; import com.intellij.openapi.roots.LanguageLevelModuleExtension; import com.intellij.openapi.roots.LanguageLevelProjectExtension; -import com.intellij.openapi.ui.Queryable; import com.intellij.pom.java.LanguageLevel; -import java.util.Comparator; - public class IdeaTestUtil extends PlatformTestUtil { - public static Comparator createComparator(final Queryable.PrintInfo printInfo) { - return new Comparator() { - @Override - public int compare(final AbstractTreeNode o1, final AbstractTreeNode o2) { - String displayText1 = o1.toTestString(printInfo); - String displayText2 = o2.toTestString(printInfo); - return displayText1.compareTo(displayText2); - } - }; - } - - /** - * Use {@link #createComparator(com.intellij.openapi.ui.Queryable.PrintInfo)} instead. - */ - @Deprecated - public static final Comparator DEFAULT_COMPARATOR = new Comparator() { - @Override - public int compare(AbstractTreeNode o1, AbstractTreeNode o2) { - String displayText1 = o1.getTestPresentation(); - String displayText2 = o2.getTestPresentation(); - return displayText1.compareTo(displayText2); - } - }; - public static void main(String[] args) { printDetectedPerformanceTimings(); } diff --git a/platform/platform-tests/platform-tests.iml b/platform/platform-tests/platform-tests.iml index 689106134d58..f739c73cdda3 100644 --- a/platform/platform-tests/platform-tests.iml +++ b/platform/platform-tests/platform-tests.iml @@ -14,6 +14,11 @@ + + + + + diff --git a/platform/platform-tests/testSrc/com/intellij/structureView/SmartTreeStructureTest.java b/platform/platform-tests/testSrc/com/intellij/structureView/SmartTreeStructureTest.java new file mode 100644 index 000000000000..6275b5fdd8d5 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/structureView/SmartTreeStructureTest.java @@ -0,0 +1,238 @@ +package com.intellij.structureView; + +import com.intellij.ide.util.treeView.smartTree.*; +import com.intellij.testFramework.PlatformTestCase; +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; + +import java.util.Comparator; + +public class SmartTreeStructureTest extends LightPlatformCodeInsightFixtureTestCase { + private TestTreeModel myModel; + + public SmartTreeStructureTest() { + PlatformTestCase.initPlatformLangPrefix(); + } + + @Override + protected void setUp() throws Exception { + super.setUp(); + TestTreeModel.StringTreeElement root = new TestTreeModel.StringTreeElement("root"); + myModel = new TestTreeModel(root); + root.addChild("abc").addChild("abcde"); + root.addChild("bcd").addChild("bhgyt"); + root.addChild("ade").addChild("aed"); + root.addChild("bft").addChild("ttt"); + root.addChild("xxx"); + root.addChild("eed").addChild("zzz"); + root.addChild("xxx").addChild("aaa").addChild("bbb"); + + } + + public void testGrouping() throws Exception { + assertStructureEqual("root\n" + + ".Group:a\n" + + "..Group:d\n" + + "...ade\n" + + "....Group:a\n" + + ".....Group:d\n" + + "......aed\n" + + "..abc\n" + + "...Group:a\n" + + "....Group:d\n" + + ".....abcde\n" + + ".Group:b\n" + + "..Group:d\n" + + "...bcd\n" + + "....Group:b\n" + + ".....bhgyt\n" + + "..Group:f\n" + + "...bft\n" + + "....ttt\n" + + ".Group:d\n" + + "..eed\n" + + "...zzz\n" + + ".xxx\n" + + ".xxx\n" + + "..Group:a\n" + + "...aaa\n" + + "....Group:b\n" + + ".....bbb\n", PlatformTestUtil.DEFAULT_COMPARATOR); + + + } + + public void testFiltering() throws Exception { + myModel.addFlter(new Filter(){ + @Override + @NotNull + public ActionPresentation getPresentation() { + throw new RuntimeException(); + } + + @Override + @NotNull + public String getName() { + throw new RuntimeException(); + } + + @Override + public boolean isVisible(TreeElement treeNode) { + return !treeNode.toString().contains("a"); + } + + @Override + public boolean isReverted() { + return false; + } + }); + + assertStructureEqual("root\n" + + ".Group:b\n" + + "..Group:d\n" + + "...bcd\n" + + "....Group:b\n" + + ".....bhgyt\n" + + "..Group:f\n" + + "...bft\n" + + "....ttt\n" + + ".Group:d\n" + + "..eed\n" + + "...zzz\n" + + ".xxx\n" + + ".xxx\n", PlatformTestUtil.DEFAULT_COMPARATOR); + + } + + public void testSorting() throws Exception { + + + myModel.addSorter(new Sorter() { + @Override + public Comparator getComparator() { + return new Comparator() { + @Override + public int compare(Object o1, Object o2) { + if (o1 instanceof Group && !(o2 instanceof Group)) return -1; + if (!(o1 instanceof Group) && o2 instanceof Group) return 1; + return 0; + } + }; + } + + @Override + public boolean isVisible() { + return true; + } + + @Override + @NotNull + public ActionPresentation getPresentation() { + throw new RuntimeException(); + } + + @Override + @NotNull + public String getName() { + throw new RuntimeException(); + } + }); + + myModel.addSorter(new Sorter() { + @Override + public Comparator getComparator() { + return new Comparator() { + @Override + public int compare(Object o1, Object o2) { + return o1.toString().compareTo(o2.toString()); + } + }; + } + + @Override + public boolean isVisible() { + return true; + } + + @Override + @NotNull + public ActionPresentation getPresentation() { + throw new RuntimeException(); + } + + @Override + @NotNull + public String getName() { + throw new RuntimeException(); + } + }); + + assertStructureEqual("root\n" + + ".Group:a\n" + + "..Group:d\n" + + "...ade\n" + + "....Group:a\n" + + ".....Group:d\n" + + "......aed\n" + + "..abc\n" + + "...Group:a\n" + + "....Group:d\n" + + ".....abcde\n" + + ".Group:b\n" + + "..Group:d\n" + + "...bcd\n" + + "....Group:b\n" + + ".....bhgyt\n" + + "..Group:f\n" + + "...bft\n" + + "....ttt\n" + + ".Group:d\n" + + "..eed\n" + + "...zzz\n" + + ".xxx\n" + + ".xxx\n" + + "..Group:a\n" + + "...aaa\n" + + "....Group:b\n" + + ".....bbb\n" + , null); + + } + + public void testUnsorted(){ + TestTreeModel.StringTreeElement root = new TestTreeModel.StringTreeElement("root"); + myModel = new TestTreeModel(root); + root.addChild("xxx"); + root.addChild("bbb"); + root.addChild("bbb"); + root.addChild("zzz").addChild("ttt"); + root.addChild("aaa"); + root.addChild("aaa").addChild("zzz"); + root.addChild("xxx"); + assertStructureEqual("root\n" + + ".xxx\n" + + ".Group:b\n" + + "..bbb\n" + + "..bbb\n" + + ".zzz\n" + + "..ttt\n" + + ".Group:a\n" + + "..aaa\n" + + "..aaa\n" + + "...zzz\n" + + ".xxx\n", null); + + } + + private void assertStructureEqual(@NonNls String expected, Comparator comparator) { + SmartTreeStructure structure = new SmartTreeStructure(myFixture.getProject(), myModel); + + String actual = PlatformTestUtil.print(structure, structure.getRootElement(), 0, comparator, -1, '.', null).toString(); + + + assertEquals(expected, actual); + } + +} diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java index 2604da35f53f..c155d4ebe703 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java @@ -323,17 +323,6 @@ public class PlatformTestUtil { return buffer; } - private static int doPrint(StringBuffer buffer, - int currentLevel, - Object node, - AbstractTreeStructure structure, - Comparator comparator, - int maxRowCount, - int currentLine, - char paddingChar) { - return doPrint(buffer, currentLevel, node, structure, comparator, maxRowCount, currentLine, paddingChar, null); - } - private static int doPrint(StringBuffer buffer, int currentLevel, Object node, @@ -740,4 +729,29 @@ public class PlatformTestUtil { } return homePath; } + + public static Comparator createComparator(final Queryable.PrintInfo printInfo) { + return new Comparator() { + @Override + public int compare(final AbstractTreeNode o1, final AbstractTreeNode o2) { + String displayText1 = o1.toTestString(printInfo); + String displayText2 = o2.toTestString(printInfo); + return displayText1.compareTo(displayText2); + } + }; + } + + /** + * Use {@link #createComparator(com.intellij.openapi.ui.Queryable.PrintInfo)} instead. + */ + @Deprecated + public static final Comparator DEFAULT_COMPARATOR = new Comparator() { + @Override + public int compare(AbstractTreeNode o1, AbstractTreeNode o2) { + String displayText1 = o1.getTestPresentation(); + String displayText2 = o2.getTestPresentation(); + return displayText1.compareTo(displayText2); + } + }; + } From 74c214e099be7f38ffc77aefbc6bad134af0ca76 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 18:43:35 +0100 Subject: [PATCH 057/101] more tests to platform-tests --- .../unscramble/NormalizeTextTest.java | 116 +++++++++++ .../ex/FileChooserCompletionTest.java | 183 +++++++++++++++++ .../patterns/StandardPatternsTest.java | 194 ++++++++++++++++++ .../com/intellij/psi/PsiNameHelperTest.java | 42 ++++ .../intellij/ui/FileNameSplittingTest.java | 122 +++++++++++ 5 files changed, 657 insertions(+) create mode 100644 java/java-tests/testSrc/com/intellij/unscramble/NormalizeTextTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/openapi/fileChooser/ex/FileChooserCompletionTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/patterns/StandardPatternsTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/psi/PsiNameHelperTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/ui/FileNameSplittingTest.java diff --git a/java/java-tests/testSrc/com/intellij/unscramble/NormalizeTextTest.java b/java/java-tests/testSrc/com/intellij/unscramble/NormalizeTextTest.java new file mode 100644 index 000000000000..e00b46d40241 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/unscramble/NormalizeTextTest.java @@ -0,0 +1,116 @@ +package com.intellij.unscramble; + +import junit.framework.TestCase; +import org.jetbrains.annotations.NonNls; + +/** + * @author cdr + */ +public class NormalizeTextTest extends TestCase { + public void testCausedBy() { + doTest("javax.faces.FacesException: Error calling action method of component with id _id6:_id10\n" + + " at java.lang.Th\n" + + "read.run(Thread.java:626)\n" + + "Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{_loginAction.login}\n" + + " at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)\n" + + " at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)\n", + + "javax.faces.FacesException: Error calling action method of component with id _id6:_id10\n" + + " at java.lang.Thread.run(Thread.java:626)\n" + + "Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{_loginAction.login}\n" + + " at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)\n" + + " at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)" + ); + } + + public void testThreadNames() { + doTest("\"Background process\" prio=6 tid=0x21193b88 nid=0x11ea4 waiting on condition [0x2\n" + "2cbf000..0x22cbfd68]\n" + + " at java.lang.Thread.sleep(Native Method)\n" + " at com.intellij.util.ui.Timer$1.run(Timer.java:23)\n" + "\n" + + "\"Alarm pool\" prio=6 tid=0x37cacbe0 nid=0x7940 waiting on condition [0x3972f000..\n" + "0x3972fae8]\n" + + " at sun.misc.Unsafe.park(Native Method)\n" + + " at java.util.concurrent.locks.LockSupport.park(LockSupport.java:118)\n" + + " at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject\n" + + ".await(AbstractQueuedSynchronizer.java:1767)\n\n" + + " at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.jav\n" + "a:359)\n" + + " at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.ja\n" + "va:470)\n" + + " at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor\n" + ".java:674)\n" + + " at java.lang.Thread.run(Thread.java:595)", + + + "\"Background process\" prio=6 tid=0x21193b88 nid=0x11ea4 waiting on condition [0x22cbf000..0x22cbfd68]\n" + + " at java.lang.Thread.sleep(Native Method)\n" + + " at com.intellij.util.ui.Timer$1.run(Timer.java:23)\n" + + "\n" + + "\"Alarm pool\" prio=6 tid=0x37cacbe0 nid=0x7940 waiting on condition [0x3972f000..0x3972fae8]\n" + + " at sun.misc.Unsafe.park(Native Method)\n" + + " at java.util.concurrent.locks.LockSupport.park(LockSupport.java:118)\n" + + " at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1767)\n" + + " at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)\n" + + " at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:470)\n" + + " at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:674)\n" + + " at java.lang.Thread.run(Thread.java:595)" + ); + } + + public void testLocked() { + doTest(" at com.intellij.lang.jsp.JspFileViewProviderImpl.getKeyPrefixes(JspFileV\n" + "iewProviderImpl.java:76)\n" + + " at com.intellij.lang.jsp.JspFileViewProviderImpl.getKnownTaglibPrefixes(\n" + "JspFileViewProviderImpl.java:89)\n" + + " - locked <0x04cc0768> (a java.lang.Object)\n" + + " at com.intellij.psi.impl.source.parsing.jsp.JspLexer.doInitOriginal(JspL\n" + "exer.java:39)\n" + + " at com.intellij.psi.impl.source.parsing.jsp.JspLexer.start(JspLexer.java\n" + ":49)", + + " at com.intellij.lang.jsp.JspFileViewProviderImpl.getKeyPrefixes(JspFileViewProviderImpl.java:76)\n" + + " at com.intellij.lang.jsp.JspFileViewProviderImpl.getKnownTaglibPrefixes(JspFileViewProviderImpl.java:89)\n" + + " - locked <0x04cc0768> (a java.lang.Object)\n" + + " at com.intellij.psi.impl.source.parsing.jsp.JspLexer.doInitOriginal(JspLexer.java:39)\n" + + " at com.intellij.psi.impl.source.parsing.jsp.JspLexer.start(JspLexer.java:49)"); + } + public void testAtSplit() { + doTest("java.lang.Throwable\n" + + "at\n" + + "com.intellij.openapi.util.objectTree.ObjectNode.(ObjectNode.jav\n" + "a:31)\n" + + "at\n" + + "com.intellij.openapi.util.objectTree.ObjectTree.getNodeFor(ObjectTree\n" + ".java:79)", + + "java.lang.Throwable\n" + + "at com.intellij.openapi.util.objectTree.ObjectNode.(ObjectNode.java:31)\n" + + "at com.intellij.openapi.util.objectTree.ObjectTree.getNodeFor(ObjectTree.java:79)"); + } + + public void testSplitMergedLines() { + doTest("org.apache.velocity.exception.MethodInvocationException " + + "at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:246) " + + "at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175) " + + "at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:327) " + + "at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:51) " + + "at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:95) " + + "at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55) " + + "at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:166) " + + "at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114) " + + "at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230) " + + "at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:172) " + + "at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114) " + + "at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230) " + + "at org.apache.velocity.Template.merge(Template.java:256)", + + "org.apache.velocity.exception.MethodInvocationException\n" + + "at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:246)\n" + + "at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)\n" + + "at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:327)\n" + + "at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:51)\n" + + "at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:95)\n" + + "at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)\n" + + "at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:166)\n" + + "at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)\n" + + "at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)\n" + + "at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:172)\n" + + "at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)\n" + + "at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)\n" + + "at org.apache.velocity.Template.merge(Template.java:256)"); + } + + private static void doTest(@NonNls String stackTrace, @NonNls String expected) { + String normalized = UnscrambleDialog.normalizeText(stackTrace); + assertEquals(expected, normalized); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileChooser/ex/FileChooserCompletionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileChooser/ex/FileChooserCompletionTest.java new file mode 100644 index 000000000000..7ae1a97a7f6e --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileChooser/ex/FileChooserCompletionTest.java @@ -0,0 +1,183 @@ +package com.intellij.openapi.fileChooser.ex; + +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.testFramework.FlyIdeaTestCase; +import com.intellij.util.ArrayUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.swing.*; +import java.io.File; +import java.io.IOException; +import java.util.*; + +public class FileChooserCompletionTest extends FlyIdeaTestCase { + + private File myParent; + private LocalFsFinder myFinder; + + private final Map myMacros = new HashMap(); + private File myFolder11; + private File myFolder21; + + private void basicSetup() throws IOException { + myParent = getTempDir(); + + myFolder11 = new File(myParent, "folder1/folder11"); + assertTrue(myFolder11.mkdirs()); + assertTrue(new File(myParent, "a").mkdirs()); + myFolder21 = new File(myParent, "folder1/folder11/folder21"); + assertTrue(myFolder21.mkdirs()); + assertTrue(new File(myParent, "folder1/folder12").mkdirs()); + assertTrue(new File(myParent, "file1").mkdir()); + } + + public void testBasicComplete() throws Exception { + assertComplete("", ArrayUtil.EMPTY_STRING_ARRAY, null); + assertComplete("1", ArrayUtil.EMPTY_STRING_ARRAY, null); + + + basicSetup(); + + assertComplete("f", ArrayUtil.EMPTY_STRING_ARRAY, null); + + assertComplete("/", new String[] { + "a", + "folder1", + "file1" + }, "a"); + + assertComplete("/f", new String[] { + "folder1", + "file1" + }, "file1"); + + assertComplete("/fo", new String[] { + "folder1", + }, "folder1"); + + assertComplete("/folder", new String[] { + "folder1", + }, "folder1"); + + assertComplete("/folder1", new String[] { + "folder1", + }, "folder1"); + + assertComplete("/folder1/", new String[] { + "folder11", + "folder12", + }, "folder11"); + + assertComplete("/folder1/folder1", new String[] { + "folder11", + "folder12", + }, "folder11"); + + assertComplete("/foo", ArrayUtil.EMPTY_STRING_ARRAY, null); + + assertTrue(new File(myParent, "qw/child.txt").mkdirs()); + assertTrue(new File(myParent, "qwe").mkdir()); + assertComplete("/qw", new String[] { + "qw", + "qwe" + }, "qw"); + + assertComplete("/qw/", new String[] { + "child.txt" + }, "child.txt"); + } + + public void testComplete() throws Exception { + basicSetup(); + + myParent = null; + myMacros.put("$FOLDER_11$", myFolder11.getAbsolutePath()); + myMacros.put("$FOLDER_21$", myFolder21.getAbsolutePath()); + myMacros.put("$WHATEVER$", "/somepath"); + + assertComplete("$", new String[] {"$FOLDER_11$", "$FOLDER_21$"}, "$FOLDER_11$"); + } + + private void assertComplete(String typed, String[] expected, String preselected) { + myFinder = new LocalFsFinder() { + @Override + public LookupFile find(@NotNull final String path) { + final File ioFile = new File(path); + return ioFile.isAbsolute() ? new IoFile(ioFile) : null; + } + }; + + String typedText = typed.replace("/", myFinder.getSeparator()); + + final FileTextFieldImpl.CompletionResult result = new FileTextFieldImpl.CompletionResult(); + result.myCompletionBase = myParent != null ? (myParent.getAbsolutePath() + typedText) : typedText; + + new FileTextFieldImpl(new JTextField(), myFinder, new FileLookup.LookupFilter() { + @Override + public boolean isAccepted(final FileLookup.LookupFile file) { + return true; + } + }, myMacros, getRootDisposable()) { + @Override + @Nullable + public VirtualFile getSelectedFile() { + return null; + } + }.processCompletion(result); + + for (int i = 0; i < expected.length; i++) { + expected[i] = expected[i].replace("/", myFinder.getSeparator()); + } + + final List expectedList = Arrays.asList(expected); + + Collections.sort(result.myToComplete, new Comparator() { + @Override + public int compare(final FileLookup.LookupFile o1, final FileLookup.LookupFile o2) { + return o1.getName().compareTo(o2.getName()); + } + }); + Collections.sort(expectedList); + + assertEquals(asString(expectedList, result), asString(result.myToComplete, result)); + + final String preselectedText = preselected != null ? preselected.replace("/", myFinder.getSeparator()) : null; + assertEquals(preselectedText, toFileText(result.myPreselected, result)); + if (preselected != null) { + assertTrue(result.myToComplete.contains(result.myPreselected)); + } + } + + private String asString(List objects, FileTextFieldImpl.CompletionResult completion) { + StringBuffer result = new StringBuffer(); + for (int i = 0; i < objects.size(); i++) { + final Object each = objects.get(i); + result.append(toFileText(each, completion)); + if (i < objects.size() - 1) { + result.append("\n"); + } + } + + return result.toString(); + } + + private String toFileText(final Object each, final FileTextFieldImpl.CompletionResult completion) { + String text = null; + if (each instanceof FileLookup.LookupFile) { + final FileLookup.LookupFile file = (FileLookup.LookupFile)each; + if (file.getMacro() != null) { + text = file.getMacro(); + } else { + text = file.getName(); + } + } else if (each != null) { + text = each.toString(); + } + + if (text == null) return null; + + return (completion.myKidsAfterSeparator.contains(each) ? myFinder.getSeparator() : "" ) + text; + } + +} diff --git a/platform/platform-tests/testSrc/com/intellij/patterns/StandardPatternsTest.java b/platform/platform-tests/testSrc/com/intellij/patterns/StandardPatternsTest.java new file mode 100644 index 000000000000..1e05add24302 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/patterns/StandardPatternsTest.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2000-2007 JetBrains s.r.o. All Rights Reserved. + */ +package com.intellij.patterns; + +import com.intellij.openapi.util.Key; +import com.intellij.testFramework.UsefulTestCase; +import com.intellij.util.ProcessingContext; + +import java.util.Arrays; + +import static com.intellij.patterns.StandardPatterns.*; + +/** + * @author peter + */ +public class StandardPatternsTest extends UsefulTestCase { + + public void testNull() throws Throwable { + assertTrue(object().isNull().accepts(null)); + assertFalse(object().isNull().accepts("")); + assertFalse(string().isNull().accepts("")); + assertTrue(string().isNull().accepts(null)); + } + + public void testString() throws Throwable { + final ElementPattern pattern = string(); + assertFalse(string().accepts(new Object())); + assertTrue(pattern.accepts("")); + } + + public void testStartsWith() throws Throwable { + final ElementPattern pattern = string().startsWith("abc"); + assertFalse(pattern.accepts("")); + assertTrue(pattern.accepts("abcd")); + assertTrue(pattern.accepts("abc")); + + assertFalse(string().startsWith("abc").accepts(new Object())); + } + + public void testEndsWith() throws Throwable { + final ElementPattern pattern = string().endsWith("abc"); + assertFalse(pattern.accepts("")); + assertFalse(pattern.accepts("abcd")); + assertTrue(pattern.accepts("abc")); + } + + private static void checkPrefixSuffix(final ElementPattern pattern) { + assertFalse(pattern.accepts("")); + assertFalse(pattern.accepts("abcd")); + assertTrue(pattern.accepts("abc")); + assertTrue(pattern.accepts("abcdabc")); + assertFalse(pattern.accepts("abcdab")); + } + + public void testPrefixSuffix() throws Throwable { + checkPrefixSuffix(string().endsWith("abc").startsWith("abc")); + } + + public void testAnd1() throws Throwable { + checkPrefixSuffix(and(string().endsWith("abc"), string().startsWith("abc"))); + } + + public void testAnd2() throws Throwable { + checkPrefixSuffix(string().endsWith("abc").and(string().startsWith("abc"))); + } + + public void testOr1() throws Throwable { + checkOr(or(string().endsWith("abc"), string().startsWith("abc"))); + } + + public void testNot1() throws Throwable { + final ElementPattern pattern = not(or(string().endsWith("abc"), string().startsWith("abc"))); + assertTrue(pattern.accepts("")); + assertTrue(pattern.accepts("xxx")); + assertFalse(pattern.accepts("abcd")); + assertTrue(pattern.accepts("dabcd")); + assertFalse(pattern.accepts("abc")); + assertFalse(pattern.accepts("abcdabc")); + assertFalse(pattern.accepts("abcdab")); + } + + private static void checkOr(final ElementPattern filterFactory) { + assertFalse(filterFactory.accepts("")); + assertFalse(filterFactory.accepts("xxx")); + assertTrue(filterFactory.accepts("abcd")); + assertFalse(filterFactory.accepts("dabcd")); + assertTrue(filterFactory.accepts("abc")); + assertTrue(filterFactory.accepts("abcdabc")); + assertTrue(filterFactory.accepts("abcdab")); + } + + public void testEquals() throws Throwable { + final Object foo = new Object(); + final Object bar = new Object(); + ElementPattern objectPattern = object().equalTo(foo); + assertTrue(objectPattern.accepts(foo)); + assertFalse(objectPattern.accepts(bar)); + + ElementPattern stringPattern = string().equalTo("foo"); + assertTrue(stringPattern.accepts("foo")); + assertFalse(stringPattern.accepts("bar")); + } + + + + public void testAll() throws Throwable { + ElementPattern pattern = collection(String.class).all(string().startsWith("abc")); + assertTrue(pattern.accepts(Arrays.asList("abc"))); + assertTrue(pattern.accepts(Arrays.asList("abc", "abcd"))); + assertFalse(pattern.accepts(Arrays.asList("abc", "bcd"))); + } + + public void testAtLeastOne() throws Throwable { + ElementPattern pattern = collection(String.class).atLeastOne(string().startsWith("abc")); + assertTrue(pattern.accepts(Arrays.asList("abc"))); + assertTrue(pattern.accepts(Arrays.asList("abc", "abcd"))); + assertTrue(pattern.accepts(Arrays.asList("abc", "bcd"))); + assertFalse(pattern.accepts(Arrays.asList("bc", "bcd"))); + assertTrue(pattern.accepts(Arrays.asList("bc", "abc"))); + } + + public void testFilter() throws Throwable { + ElementPattern pattern = collection(String.class).filter(string().endsWith("x"), collection(String.class).all(string().startsWith("abc"))); + assertTrue(pattern.accepts(Arrays.asList("abc"))); + assertTrue(pattern.accepts(Arrays.asList("abc", "abcd"))); + assertFalse(pattern.accepts(Arrays.asList("bcx", "bcd"))); + assertTrue(pattern.accepts(Arrays.asList("abcx", "abc"))); + } + + public void testFirst() throws Throwable { + ElementPattern pattern = collection(String.class).first(string().startsWith("abc")); + assertFalse(pattern.accepts(Arrays.asList())); + assertTrue(pattern.accepts(Arrays.asList("abc"))); + assertTrue(pattern.accepts(Arrays.asList("abc", "abcd"))); + assertTrue(pattern.accepts(Arrays.asList("abc", "bcd"))); + assertFalse(pattern.accepts(Arrays.asList("bc", "bcd"))); + assertFalse(pattern.accepts(Arrays.asList("bc", "abc"))); + } + + public void testLast() throws Throwable { + //collection(String.class) + + ElementPattern pattern = collection(String.class).last(string().startsWith("abc")); + assertFalse(pattern.accepts(Arrays.asList())); + assertTrue(pattern.accepts(Arrays.asList("abc"))); + assertTrue(pattern.accepts(Arrays.asList("abc", "abcd"))); + assertFalse(pattern.accepts(Arrays.asList("abc", "bcd"))); + assertFalse(pattern.accepts(Arrays.asList("bc", "bcd"))); + assertTrue(pattern.accepts(Arrays.asList("bc", "abc"))); + } + + public void testSize() throws Throwable { + final CollectionPattern filter = collection(String.class); + assertTrue(filter.size(0).accepts(Arrays.asList())); + assertFalse(filter.size(0).accepts(Arrays.asList("abc"))); + assertFalse(filter.size(0).accepts(Arrays.asList("abc", "abc"))); + + assertFalse(filter.size(1).accepts(Arrays.asList())); + assertTrue(filter.size(1).accepts(Arrays.asList("abc"))); + assertFalse(filter.size(1).accepts(Arrays.asList("abc", "abc"))); + + assertFalse(filter.size(2).accepts(Arrays.asList())); + assertFalse(filter.size(2).accepts(Arrays.asList("abc"))); + assertTrue(filter.size(2).accepts(Arrays.asList("abc", "abc"))); + } + + public void testEmpty() throws Throwable { + final CollectionPattern filter = collection(String.class); + assertTrue(filter.empty().accepts(Arrays.asList())); + assertFalse(filter.empty().accepts(Arrays.asList("abc"))); + assertFalse(filter.empty().accepts(Arrays.asList("abc", "abc"))); + + assertFalse(not(filter.empty()).accepts(Arrays.asList())); + assertTrue(not(filter.empty()).accepts(Arrays.asList("abc"))); + assertTrue(not(filter.empty()).accepts(Arrays.asList("abc", "abc"))); + } + + public void testSave() throws Throwable { + Key key = Key.create("abc"); + final ProcessingContext context = new ProcessingContext(); + assertFalse(string().contains("abc").save(key).accepts(null)); + assertNull(context.get(key)); + + assertFalse(string().contains("abc").save(key).accepts("def")); + assertNull(context.get(key)); + + final String s = "defabcdef"; + assertTrue(string().contains("abc").save(key).accepts(s, context)); + assertSame(s, context.get(key)); + } + + +} diff --git a/platform/platform-tests/testSrc/com/intellij/psi/PsiNameHelperTest.java b/platform/platform-tests/testSrc/com/intellij/psi/PsiNameHelperTest.java new file mode 100644 index 000000000000..8ba390ceee77 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/psi/PsiNameHelperTest.java @@ -0,0 +1,42 @@ +package com.intellij.psi; + +import junit.framework.TestCase; + +import java.util.Arrays; + +import com.intellij.psi.codeStyle.NameUtil; + +/** + * @author dsl + */ +public class PsiNameHelperTest extends TestCase { + public void testSplitIntoWords1() throws Exception { + assertSplitEquals(new String[]{"I", "Base"}, "IBase"); + } + + public void testSplitIntoWords2() throws Exception { + assertSplitEquals(new String[]{"Order", "Index"}, "OrderIndex"); + } + + public void testSplitIntoWords3() throws Exception { + assertSplitEquals(new String[]{"order", "Index"}, "orderIndex"); + } + + public void testSplitIntoWords4() throws Exception { + assertSplitEquals(new String[]{"Order", "Index"}, "Order_Index"); + } + + public void testSplitIntoWords5() throws Exception { + assertSplitEquals(new String[]{"ORDER", "INDEX"}, "ORDER_INDEX"); + } + + + public void testSplitIntoWords6() throws Exception { + assertSplitEquals(new String[]{"gg", "J"}, "ggJ"); + } + + private void assertSplitEquals(String[] expected, String name) { + final String[] result = NameUtil.splitNameIntoWords(name); + assertEquals(Arrays.asList(expected).toString(), Arrays.asList(result).toString()); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/ui/FileNameSplittingTest.java b/platform/platform-tests/testSrc/com/intellij/ui/FileNameSplittingTest.java new file mode 100644 index 000000000000..7ddf2bc6f856 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/ui/FileNameSplittingTest.java @@ -0,0 +1,122 @@ +package com.intellij.ui; + +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.util.ThrowableRunnable; +import com.intellij.util.ui.FilePathSplittingPolicy; +import junit.framework.TestCase; +import org.jetbrains.annotations.NonNls; + +import java.io.File; + +/** + * author: lesya + */ +public class FileNameSplittingTest extends TestCase { + private static final File FILE = new File("c:/dir1/dir2/dir3/dir4/file.txt"); + + private FilePathSplittingPolicy myPolicy; + + public void testSplitByLetter() { + myPolicy = FilePathSplittingPolicy.SPLIT_BY_LETTER; + @NonNls String[] expectedStrings = { + "t", + "xt", + "txt", + ".txt", + "e.txt", + "le.txt", + "ile.txt", + "file.txt", + ".file.txt", + "..file.txt", + "...file.txt", + "c...file.txt", + "c.../file.txt", + "c:.../file.txt", + "c:...4/file.txt", + "c:/...4/file.txt", + "c:/...r4/file.txt", + "c:/d...r4/file.txt", + "c:/d...ir4/file.txt", + "c:/di...ir4/file.txt", + "c:/di...dir4/file.txt", + "c:/dir...dir4/file.txt", + "c:/dir.../dir4/file.txt", + "c:/dir1.../dir4/file.txt", + "c:/dir1/...3/dir4/file.txt", + "c:/dir1/...r3/dir4/file.txt", + "c:/dir1/d...r3/dir4/file.txt", + "c:/dir1/d...ir3/dir4/file.txt", + "c:/dir1/di...ir3/dir4/file.txt", + "c:/dir1/dir2/dir3/dir4/file.txt" + }; + + for (String expectedString : expectedStrings) { + doTest(expectedString, expectedString.length()); + } + + } + + public void testSplitByFileSeparator(){ + myPolicy = FilePathSplittingPolicy.SPLIT_BY_SEPARATOR; + @NonNls String[] expectedStrings = { + "...", + "...", + "...", + "...", + "...", + "...", + "...", + "file.txt", + "file.txt", + "file.txt", + "...file.txt", + "...file.txt", + "c:...file.txt", + "c:.../file.txt", + "c:/.../file.txt", + "c:/.../file.txt", + "c:/.../file.txt", + "c:/.../file.txt", + "c:/...dir4/file.txt", + "c:/...dir4/file.txt", + "c:/...dir4/file.txt", + "c:/...dir4/file.txt", + "c:/dir1...dir4/file.txt", + "c:/dir1.../dir4/file.txt", + "c:/dir1/.../dir4/file.txt", + "c:/dir1/.../dir4/file.txt", + "c:/dir1/.../dir4/file.txt", + "c:/dir1/.../dir4/file.txt", + "c:/dir1/...dir3/dir4/file.txt", + "c:/dir1/...dir3/dir4/file.txt", + "c:/dir1/dir2/dir3/dir4/file.txt" + }; + for (int i = 0; i < expectedStrings.length; i++) { + int count = i + 1; + String expectedString = expectedStrings[i]; + assertTrue(expectedString, expectedString.length() <= count || i < 3); + doTest(expectedString, count); + } + + } + + public void testPerformance() { + myPolicy = FilePathSplittingPolicy.SPLIT_BY_SEPARATOR; + + PlatformTestUtil.startPerformanceTest("FileNameSplitting performance", 70, new ThrowableRunnable() { + @Override + public void run() throws Exception { + for (int i = 0; i < 100; i++) { + for (int j = 0; j < FILE.getPath().length(); j++) + myPolicy.getPresentableName(FILE, j); + } + } + }).cpuBound().assertTiming(); + } + + private void doTest(String expected, int count) { + assertEquals(expected.replace('/', File.separatorChar), + myPolicy.getPresentableName(FILE, count)); + } +} From 0423ab9df17ba7f7da07221e7f08c1a9e727ed29 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 18:49:51 +0100 Subject: [PATCH 058/101] tests to community --- .../com/intellij/lang/psi/PsiBuilderTest.java | 232 ++++++++++++++++++ .../intellij/psi/util/PropertyUtilTest.java | 75 ++++++ .../options/ReplacePathToMacroMapTest.java | 91 +++++++ .../ide/search/PorterStemmerTest.java | 24 ++ .../severities/HighlightSeveritiesTest.java | 42 ++++ 5 files changed, 464 insertions(+) create mode 100644 java/java-tests/testSrc/com/intellij/lang/psi/PsiBuilderTest.java create mode 100644 java/java-tests/testSrc/com/intellij/psi/util/PropertyUtilTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/application/options/ReplacePathToMacroMapTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/ide/search/PorterStemmerTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/ide/severities/HighlightSeveritiesTest.java diff --git a/java/java-tests/testSrc/com/intellij/lang/psi/PsiBuilderTest.java b/java/java-tests/testSrc/com/intellij/lang/psi/PsiBuilderTest.java new file mode 100644 index 000000000000..5dc954bf59ee --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/lang/psi/PsiBuilderTest.java @@ -0,0 +1,232 @@ +package com.intellij.lang.psi; + +import com.intellij.lang.*; +import com.intellij.lang.impl.PsiBuilderImpl; +import com.intellij.lexer.JavaLexer; +import com.intellij.openapi.fileTypes.StdFileTypes; +import com.intellij.pom.java.LanguageLevel; +import com.intellij.psi.JavaTokenType; +import com.intellij.psi.PsiFile; +import com.intellij.psi.impl.java.stubs.JavaStubElementTypes; +import com.intellij.psi.impl.source.DummyHolder; +import com.intellij.psi.impl.source.tree.JavaElementType; +import com.intellij.psi.impl.source.tree.SharedImplUtil; +import com.intellij.psi.impl.source.tree.TreeElement; +import com.intellij.psi.text.BlockSupport; +import com.intellij.testFramework.LightIdeaTestCase; +import junit.framework.AssertionFailedError; + +/** + * Date: Jan 21, 2005 + * @author max + */ +public class PsiBuilderTest extends LightIdeaTestCase { + private PsiBuilderImpl myBuilder; + + public void testEmptyProgram() throws Exception { + myBuilder = createBuilder(""); + final PsiBuilder.Marker fileMarker = myBuilder.mark(); + fileMarker.done(JavaStubElementTypes.JAVA_FILE); + ASTNode fileNode = myBuilder.getTreeBuilt(); + assertNotNull(fileNode); + assertEquals("", fileNode.getText()); + } + + public void testProgramWithSingleKeyword() throws Exception { + myBuilder = createBuilder("package"); + + final PsiBuilder.Marker fileMarker = myBuilder.mark(); + assertEquals("package", myBuilder.getTokenText()); + assertEquals(JavaTokenType.PACKAGE_KEYWORD, myBuilder.getTokenType()); + final PsiBuilder.Marker packageStatementMarker = myBuilder.mark(); + myBuilder.advanceLexer(); + assertTrue(myBuilder.eof()); + packageStatementMarker.done(JavaElementType.PACKAGE_STATEMENT); + fileMarker.done(JavaStubElementTypes.JAVA_FILE); + + ASTNode fileNode = myBuilder.getTreeBuilt(); + assertNotNull(fileNode); + assertEquals("package", fileNode.getText()); + assertSame(fileNode.getFirstChildNode(), fileNode.getLastChildNode()); + ASTNode packageNode = fileNode.getFirstChildNode(); + assertNotNull(packageNode); + assertEquals("package", packageNode.getText()); + assertEquals(JavaElementType.PACKAGE_STATEMENT, packageNode.getElementType()); + + ASTNode leaf = packageNode.getFirstChildNode(); + assertNotNull(leaf); + assertEquals(JavaTokenType.PACKAGE_KEYWORD, leaf.getElementType()); + } + + private static PsiBuilderImpl createBuilder(final String text) { + return createBuilder(text,null); + } + private static PsiBuilderImpl createBuilder(final String text, ASTNode originalTree) { + final Language lang = StdFileTypes.JAVA.getLanguage(); + final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(lang); + assertNotNull(parserDefinition); + PsiFile psiFile = createFile("x.java", text); + return new PsiBuilderImpl(getProject(), psiFile, parserDefinition, new JavaLexer(LanguageLevel.JDK_1_5), + SharedImplUtil.findCharTableByTree(psiFile.getNode()), text, originalTree, null); + } + + public void testTrailingWhitespaces() throws Exception { + myBuilder = createBuilder("foo\n\nx"); + final PsiBuilder.Marker marker = myBuilder.mark(); + while (!myBuilder.eof()) { + myBuilder.advanceLexer(); + } + marker.done(JavaStubElementTypes.JAVA_FILE); + assertEquals("foo\n\nx", myBuilder.getTreeBuilt().getText()); + } + + public void testRollback() throws Exception { + myBuilder = createBuilder("package"); + + PsiBuilder.Marker fileMarker = myBuilder.mark(); + assertEquals("package", myBuilder.getTokenText()); + assertEquals(JavaTokenType.PACKAGE_KEYWORD, myBuilder.getTokenType()); + PsiBuilder.Marker packageStatementMarker = myBuilder.mark(); + myBuilder.advanceLexer(); + assertTrue(myBuilder.eof()); + packageStatementMarker.done(JavaElementType.PACKAGE_STATEMENT); + + fileMarker.rollbackTo(); + + fileMarker = myBuilder.mark(); + assertEquals("package", myBuilder.getTokenText()); + assertEquals(JavaTokenType.PACKAGE_KEYWORD, myBuilder.getTokenType()); + packageStatementMarker = myBuilder.mark(); + myBuilder.advanceLexer(); + assertTrue(myBuilder.eof()); + packageStatementMarker.done(JavaElementType.PACKAGE_STATEMENT); + fileMarker.done(JavaStubElementTypes.JAVA_FILE); + + ASTNode fileNode = myBuilder.getTreeBuilt(); + assertNotNull(fileNode); + assertEquals("package", fileNode.getText()); + assertSame(fileNode.getFirstChildNode(), fileNode.getLastChildNode()); + ASTNode packageNode = fileNode.getFirstChildNode(); + assertNotNull(packageNode); + assertEquals("package", packageNode.getText()); + assertEquals(JavaElementType.PACKAGE_STATEMENT, packageNode.getElementType()); + + ASTNode leaf = packageNode.getFirstChildNode(); + assertNotNull(leaf); + assertEquals(JavaTokenType.PACKAGE_KEYWORD, leaf.getElementType()); + } + + public void testDrop() throws Exception { + myBuilder = createBuilder("package"); + + final PsiBuilder.Marker fileMarker = myBuilder.mark(); + assertEquals("package", myBuilder.getTokenText()); + assertEquals(JavaTokenType.PACKAGE_KEYWORD, myBuilder.getTokenType()); + final PsiBuilder.Marker packageStatementMarker = myBuilder.mark(); + myBuilder.advanceLexer(); + assertTrue(myBuilder.eof()); + packageStatementMarker.drop(); + fileMarker.done(JavaStubElementTypes.JAVA_FILE); + + ASTNode fileNode = myBuilder.getTreeBuilt(); + assertNotNull(fileNode); + assertEquals("package", fileNode.getText()); + assertSame(fileNode.getFirstChildNode(), fileNode.getLastChildNode()); + + ASTNode leaf = fileNode.getFirstChildNode(); + assertNotNull(leaf); + assertEquals(JavaTokenType.PACKAGE_KEYWORD, leaf.getElementType()); + assertEquals("package", leaf.getText()); + assertNull(leaf.getFirstChildNode()); + } + + public void testAdvanceBeyondEof() { + myBuilder = createBuilder("package"); + for(int i=0; i<20; i++) { + myBuilder.eof(); + myBuilder.advanceLexer(); + } + assertTrue(myBuilder.eof()); + } + + public void testAssertionFailureOnUnbalancedMarkers() { + myBuilder = createBuilder("foo"); + myBuilder.setDebugMode(true); + final PsiBuilder.Marker m = myBuilder.mark(); + final PsiBuilder.Marker m1 = myBuilder.mark(); + myBuilder.getTokenType(); + myBuilder.advanceLexer(); + try { + m.done(JavaTokenType.PACKAGE_KEYWORD); + fail("Assertion must fire"); + } + catch (AssertionFailedError e) { + throw e; + } + catch (Throwable e) { + if (!e.getMessage().startsWith("Another not done marker")) { + fail("Wrong assertion message"); + } + } + } + + public void testNotAllTokensProcessed() { + myBuilder = createBuilder("foo"); + myBuilder.setDebugMode(true); + final PsiBuilder.Marker m = myBuilder.mark(); + m.done(JavaTokenType.PACKAGE_KEYWORD); + try { + myBuilder.getTreeBuilt(); + fail("Assertion must fire"); + } + catch (AssertionFailedError e) { + throw e; + } + catch (Throwable e) { + if (!e.getMessage().startsWith("Tokens [IDENTIFIER] were not inserted into the tree")) { + fail("Wrong assertion message"); + } + } + } + + public void testMergeWhenEmptyElementAfterWhitespaceIsLastChild() throws Throwable { + myBuilder = createBuilder(" foo bar"); + parseWhenEmptyElementAfterWhitespaceIsLastChild(); + final ASTNode tree = myBuilder.getTreeBuilt(); + new DummyHolder(getPsiManager(), (TreeElement)tree, null); + + myBuilder = createBuilder(" bar", tree); + parseWhenEmptyElementAfterWhitespaceIsLastChild(); + try { + myBuilder.getTreeBuilt(); + fail(); + } + catch (BlockSupport.ReparsedSuccessfullyException e) { + e.getDiffLog().performActualPsiChange(tree.getPsi().getContainingFile()); + } + + assertEquals(" bar", tree.getText()); + } + + private void parseWhenEmptyElementAfterWhitespaceIsLastChild() { + final PsiBuilder.Marker root = myBuilder.mark(); + + final PsiBuilder.Marker composite = myBuilder.mark(); + final PsiBuilder.Marker backup = myBuilder.mark(); + if ("foo".equals(myBuilder.getTokenText())) { + myBuilder.advanceLexer(); + myBuilder.getTokenType(); + myBuilder.mark().done(JavaStubElementTypes.TYPE_PARAMETER_LIST); + backup.done(JavaStubElementTypes.ANNOTATION_METHOD); + } else { + backup.rollbackTo(); + } + composite.done(JavaStubElementTypes.ANONYMOUS_CLASS); + + myBuilder.getTokenType(); + myBuilder.advanceLexer(); + root.done(JavaStubElementTypes.ENUM_CONSTANT_INITIALIZER); + } + + +} diff --git a/java/java-tests/testSrc/com/intellij/psi/util/PropertyUtilTest.java b/java/java-tests/testSrc/com/intellij/psi/util/PropertyUtilTest.java new file mode 100644 index 000000000000..cf556cf65abd --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/psi/util/PropertyUtilTest.java @@ -0,0 +1,75 @@ +/* + * Created by IntelliJ IDEA. + * User: mike + * Date: Jun 14, 2002 + * Time: 8:05:58 PM + * To change template for new class use + * Code Style | Class Templates options (Tools | IDE Options). + */ +package com.intellij.psi.util; + +import com.intellij.psi.*; +import com.intellij.testFramework.LightCodeInsightTestCase; +import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.NonNls; + +public class PropertyUtilTest extends LightCodeInsightTestCase { + public void testSuggestGetterName() throws Exception { + assertEquals("isValid", PropertyUtil.suggestGetterName("valid", getType("boolean"))); + assertEquals("getValid", PropertyUtil.suggestGetterName("valid", getType("Object"))); + assertEquals("isValid", PropertyUtil.suggestGetterName(ourProject, createField("valid", "boolean"))); + assertEquals("getValid", PropertyUtil.suggestGetterName(ourProject, createField("valid", "Object"))); + + assertEquals("getURL", PropertyUtil.suggestGetterName("URL", getType("Object"))); + assertEquals("getURL", PropertyUtil.suggestGetterName(ourProject, createField("URL", "Object"))); + + assertEquals("isaURL", PropertyUtil.suggestGetterName(ourProject, createField("aURL", "boolean"))); + assertEquals("getaURL", PropertyUtil.suggestGetterName(ourProject, createField("aURL", "Object"))); + assertEquals("getBool", PropertyUtil.suggestGetterName(ourProject, createField("bool", "java.lang.Boolean"))); + } + + public void testSuggestSetterName() throws Exception { + assertEquals("setValid", PropertyUtil.suggestSetterName("valid")); + assertEquals("setValid", PropertyUtil.suggestSetterName(ourProject, createField("valid", "Object"))); + + assertEquals("setURL", PropertyUtil.suggestSetterName("URL")); + assertEquals("setURL", PropertyUtil.suggestSetterName(ourProject, createField("URL", "Object"))); + + assertEquals("setaURL", PropertyUtil.suggestSetterName("aURL")); + assertEquals("setaURL", PropertyUtil.suggestSetterName(ourProject, createField("aURL", "Object"))); + assertEquals("setBool", PropertyUtil.suggestSetterName(ourProject, createField("bool", "java.lang.Boolean"))); + } + + public void testSuggestPropertyName() throws Exception { + assertEquals("valid", PropertyUtil.getPropertyName("isValid")); + assertEquals("valid", PropertyUtil.getPropertyName("getValid")); + assertEquals("valid", PropertyUtil.getPropertyName("setValid")); + + assertEquals("URL", PropertyUtil.getPropertyName("isURL")); + assertEquals("URL", PropertyUtil.getPropertyName("getURL")); + assertEquals("URL", PropertyUtil.getPropertyName("setURL")); + + assertEquals("aURL", PropertyUtil.getPropertyName("isaURL")); + assertEquals("aURL", PropertyUtil.getPropertyName("getaURL")); + assertEquals("aURL", PropertyUtil.getPropertyName("setaURL")); + } + + public void testBooleanPropertyGetters() { + assertTrue(PropertyUtil.hasGetterName(createMethod("isOk", "boolean"))); + assertFalse(PropertyUtil.hasGetterName(createMethod("isOk", CommonClassNames.JAVA_LANG_BOOLEAN))); + assertTrue(PropertyUtil.hasGetterName(createMethod("getOk", CommonClassNames.JAVA_LANG_BOOLEAN))); + assertFalse(PropertyUtil.hasGetterName(createMethod("isOk", "int"))); + } + + private static PsiType getType(@NonNls String type) throws IncorrectOperationException { + return PsiElementFactory.SERVICE.getInstance(ourProject).createTypeFromText(type, null); + } + + private static PsiField createField(@NonNls String name, @NonNls String type) throws IncorrectOperationException { + return PsiElementFactory.SERVICE.getInstance(ourProject).createField(name, getType(type)); + } + + private static PsiMethod createMethod(@NonNls String name, String type) throws IncorrectOperationException { + return PsiElementFactory.SERVICE.getInstance(ourProject).createMethod(name, getType(type)); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/application/options/ReplacePathToMacroMapTest.java b/platform/platform-tests/testSrc/com/intellij/application/options/ReplacePathToMacroMapTest.java new file mode 100644 index 000000000000..12b034db6080 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/application/options/ReplacePathToMacroMapTest.java @@ -0,0 +1,91 @@ +package com.intellij.application.options; + +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +/** + * @author mike + */ +public class ReplacePathToMacroMapTest { + private ReplacePathToMacroMap myMap; + + @Before + public final void setupMap() { + myMap = new ReplacePathToMacroMap(); + + myMap.put("file:///tmp/foo", "file://$MODULE_DIR$"); + myMap.put("file://tmp/foo", "file:/$MODULE_DIR$"); + myMap.put("file:/tmp/foo", "file:$MODULE_DIR$"); + myMap.put("jar:///tmp/foo", "jar://$MODULE_DIR$"); + myMap.put("jar://tmp/foo", "jar:/$MODULE_DIR$"); + myMap.put("jar:/tmp/foo", "jar:$MODULE_DIR$"); + myMap.put("/tmp/foo", "$MODULE_DIR$"); + } + + @Test + public void testSubstitute_NoSubstitute() throws Exception { + assertEquals("/foo/bar", substitute("/foo/bar")); + } + + @Test + public void testSubstitute_CompleteMatch() throws Exception { + assertEquals("$MODULE_DIR$", substitute("/tmp/foo")); + assertEquals("jar:$MODULE_DIR$", substitute("jar:/tmp/foo")); + assertEquals("jar:/$MODULE_DIR$", substitute("jar://tmp/foo")); + assertEquals("jar://$MODULE_DIR$", substitute("jar:///tmp/foo")); + assertEquals("file:$MODULE_DIR$", substitute("file:/tmp/foo")); + assertEquals("file:/$MODULE_DIR$", substitute("file://tmp/foo")); + assertEquals("file://$MODULE_DIR$", substitute("file:///tmp/foo")); + } + + @Test + public void testSubstitute_PrefixMatch() throws Exception { + assertEquals("$MODULE_DIR$/bar", substitute("/tmp/foo/bar")); + assertEquals("jar:$MODULE_DIR$/bar", substitute("jar:/tmp/foo/bar")); + assertEquals("jar:/$MODULE_DIR$/bar", substitute("jar://tmp/foo/bar")); + assertEquals("jar://$MODULE_DIR$/bar", substitute("jar:///tmp/foo/bar")); + assertEquals("file:$MODULE_DIR$/bar", substitute("file:/tmp/foo/bar")); + assertEquals("file:/$MODULE_DIR$/bar", substitute("file://tmp/foo/bar")); + assertEquals("file://$MODULE_DIR$/bar", substitute("file:///tmp/foo/bar")); + } + + @Test + public void testSubstitute_JarPrefixMatch() throws Exception { + assertEquals("$MODULE_DIR$!/bar", substitute("/tmp/foo!/bar")); + assertEquals("jar:$MODULE_DIR$!/bar", substitute("jar:/tmp/foo!/bar")); + assertEquals("jar:/$MODULE_DIR$!/bar", substitute("jar://tmp/foo!/bar")); + assertEquals("jar://$MODULE_DIR$!/bar", substitute("jar:///tmp/foo!/bar")); + assertEquals("file:$MODULE_DIR$!/bar", substitute("file:/tmp/foo!/bar")); + assertEquals("file:/$MODULE_DIR$!/bar", substitute("file://tmp/foo!/bar")); + assertEquals("file://$MODULE_DIR$!/bar", substitute("file:///tmp/foo!/bar")); + } + + @Test + public void testSubstitute_WindowsRootSubstitution() throws Exception { + myMap.put("C:/", "../$MODULE_DIR$/"); + + assertEquals("../$MODULE_DIR$/", substitute("C:/")); + assertEquals("../$MODULE_DIR$/foo", substitute("C:/foo")); + } + + @Test + public void testSubstitute_NoSubstituteInTheMiddleOccurs() throws Exception { + assertEquals("/bar/tmp/foo/bar", substitute("/bar/tmp/foo/bar")); + } + + @Test + public void testSubstitute_NoDoubleSubstitution() throws Exception { + assertEquals("$MODULE_DIR$/bar/tmp/foo", substitute("/tmp/foo/bar/tmp/foo")); + } + + @Test + public void testSubstitute_NoPartialSubstituteIsPerformed() throws Exception { + assertEquals("/tmp/foobar", substitute("/tmp/foobar")); + } + + private String substitute(final String s) { + return myMap.substitute(s, true); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/ide/search/PorterStemmerTest.java b/platform/platform-tests/testSrc/com/intellij/ide/search/PorterStemmerTest.java new file mode 100644 index 000000000000..d45d435682d3 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/ide/search/PorterStemmerTest.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved. + */ + +package com.intellij.ide.search; + +import com.intellij.ide.ui.search.PorterStemmerUtil; +import junit.framework.TestCase; + +/** + * User: anna + * Date: 15-Feb-2006 + */ +public class PorterStemmerTest extends TestCase { + public void test() throws Exception { + assertEquals("name", PorterStemmerUtil.stem("names")); + assertEquals("j2ee", PorterStemmerUtil.stem("j2ee")); + assertEquals("keyword1", PorterStemmerUtil.stem("keyword1")); + assertEquals("initi", PorterStemmerUtil.stem("initializer")); + assertEquals("initi", PorterStemmerUtil.stem("initialization")); + assertEquals("go2file", PorterStemmerUtil.stem("go2file")); + } + +} diff --git a/platform/platform-tests/testSrc/com/intellij/ide/severities/HighlightSeveritiesTest.java b/platform/platform-tests/testSrc/com/intellij/ide/severities/HighlightSeveritiesTest.java new file mode 100644 index 000000000000..2e4f8b9dcf82 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/ide/severities/HighlightSeveritiesTest.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved. + */ + +/* + * Created by IntelliJ IDEA. + * User: Anna.Kozlova + * Date: 20-Jul-2006 + * Time: 18:26:01 + */ +package com.intellij.ide.severities; + +import com.intellij.lang.annotation.HighlightSeverity; +import junit.framework.TestCase; +import org.jdom.Element; + +public class HighlightSeveritiesTest extends TestCase { + private int myOldSeverity; + + @Override + protected void setUp() throws Exception { + super.setUp(); + myOldSeverity = HighlightSeverity.ERROR.myVal; + } + + + @Override + protected void tearDown() throws Exception { + HighlightSeverity.ERROR.myVal = myOldSeverity; + super.tearDown(); + } + + public void testSeveritiesMigration() throws Exception{ + HighlightSeverity.ERROR.myVal = 200; + final Element element = new Element("temp"); + new HighlightSeverity(HighlightSeverity.ERROR.myName, 500).writeExternal(element); + HighlightSeverity.ERROR.readExternal(element); + assertEquals(500, HighlightSeverity.ERROR.myVal); + } + + +} \ No newline at end of file From 0fe813998c03d59134067ab4dd6fd88d85ffce2e Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 18:57:20 +0100 Subject: [PATCH 059/101] tests to community --- .../com/intellij/psi/util/PsiUtilTest.java | 57 ++++++ platform/platform-tests/platform-tests.iml | 1 + .../com/intellij/psi/TextBlockTest.java | 193 ++++++++++++++++++ .../psi/impl/meta/MetaRegistryTest.java | 95 +++++++++ 4 files changed, 346 insertions(+) create mode 100644 java/java-tests/testSrc/com/intellij/psi/util/PsiUtilTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/psi/TextBlockTest.java create mode 100644 platform/platform-tests/testSrc/com/intellij/psi/impl/meta/MetaRegistryTest.java diff --git a/java/java-tests/testSrc/com/intellij/psi/util/PsiUtilTest.java b/java/java-tests/testSrc/com/intellij/psi/util/PsiUtilTest.java new file mode 100644 index 000000000000..c03a253ce7c8 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/psi/util/PsiUtilTest.java @@ -0,0 +1,57 @@ +package com.intellij.psi.util; + +import com.intellij.psi.JavaPsiFacade; +import com.intellij.psi.PsiClass; +import com.intellij.psi.PsiElementFactory; +import com.intellij.psi.PsiTypeParameter; +import com.intellij.testFramework.LightCodeInsightTestCase; +import com.intellij.util.IncorrectOperationException; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; + +/** + * @author dsl + */ +public class PsiUtilTest extends LightCodeInsightTestCase { + public void testTypeParameterIterator() throws Exception { + PsiClass classA = createClass("class A {}"); + final Iterator iterator = PsiUtil.typeParametersIterator(classA); + compareIterator(new String[]{"T"}, iterator); + } + + private static PsiClass createClass(String text) throws IncorrectOperationException { + final PsiElementFactory factory = JavaPsiFacade.getInstance(ourProject).getElementFactory(); + final PsiClass classA = factory.createClassFromText(text, null).getInnerClasses()[0]; + return classA; + } + + public void testTypeParameterIterator1() throws Exception { + final PsiClass classA = createClass("class A { class B {}}"); + final Iterator iterator = PsiUtil.typeParametersIterator(classA.getInnerClasses()[0]); + compareIterator(new String[]{"X","T"}, iterator); + } + + public void testTypeParameterIterator2() throws Exception { + final PsiClass classA = createClass("class A { static class B {}}"); + final Iterator iterator = PsiUtil.typeParametersIterator(classA.getInnerClasses()[0]); + compareIterator(new String[]{"X"}, iterator); + } + + public void testTypeParameterIterator3() throws Exception { + final PsiClass classA = createClass("class A { class B {}}"); + final Iterator iterator = PsiUtil.typeParametersIterator(classA.getInnerClasses()[0]); + compareIterator(new String[]{"Y", "X", "T"}, iterator); + } + + + private static void compareIterator(String[] expected, Iterator it) { + final ArrayList actual = new ArrayList(); + while (it.hasNext()) { + PsiTypeParameter typeParameter = it.next(); + actual.add(typeParameter.getName()); + } + assertEquals(Arrays.asList(expected).toString(), actual.toString()); + } +} diff --git a/platform/platform-tests/platform-tests.iml b/platform/platform-tests/platform-tests.iml index f739c73cdda3..ded732970c68 100644 --- a/platform/platform-tests/platform-tests.iml +++ b/platform/platform-tests/platform-tests.iml @@ -19,6 +19,7 @@ + diff --git a/platform/platform-tests/testSrc/com/intellij/psi/TextBlockTest.java b/platform/platform-tests/testSrc/com/intellij/psi/TextBlockTest.java new file mode 100644 index 000000000000..0498c37efd09 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/psi/TextBlockTest.java @@ -0,0 +1,193 @@ +package com.intellij.psi; + +import com.intellij.mock.MockDocument; +import com.intellij.openapi.editor.impl.event.DocumentEventImpl; +import com.intellij.psi.impl.TextBlock; +import junit.framework.TestCase; + +public class TextBlockTest extends TestCase { + private TextBlock myTextBlock; + private MockDocument myDocument; + + @Override + protected void setUp() throws Exception { + super.setUp(); + myDocument = new MockDocument(); + myTextBlock = new TextBlock(); + } + + public void testIsEmpty_AfterCreate() throws Exception { + assertTrue(myTextBlock.isEmpty()); + } + + public void testTextInserted_Once() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "", "xxx", 1, false)); + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(13, myTextBlock.getTextEndOffset()); + assertEquals(10, myTextBlock.getPsiEndOffset()); + } + + public void testReset() throws Exception { + assertTrue(myTextBlock.isEmpty()); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "", "xxx", 1, false)); + assertTrue(!myTextBlock.isEmpty()); + myTextBlock.clear(); + assertTrue(myTextBlock.isEmpty()); + } + + public void testTextInserted_SecondNonAdjFragmentsAfter() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "", "xxx", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 20, "", "xxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(23, myTextBlock.getTextEndOffset()); + assertEquals(17, myTextBlock.getPsiEndOffset()); + } + + public void testTextInserted_SecondNonAdjFragmentsBefore() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "", "xxx", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 5, "", "xxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(5, myTextBlock.getStartOffset()); + assertEquals(16, myTextBlock.getTextEndOffset()); + assertEquals(10, myTextBlock.getPsiEndOffset()); + } + + public void testTextInserted_SecondAdjFragmentsAfter() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "", "xxx", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 13, "", "xxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(16, myTextBlock.getTextEndOffset()); + assertEquals(10, myTextBlock.getPsiEndOffset()); + } + + public void testTextInserted_SecondAdjFragmentsBefore() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "", "xxx", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "", "xxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(16, myTextBlock.getTextEndOffset()); + assertEquals(10, myTextBlock.getPsiEndOffset()); + } + + public void testTextDeleted_Once() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(10, myTextBlock.getTextEndOffset()); + assertEquals(13, myTextBlock.getPsiEndOffset()); + } + + public void testTextDeleted_SecondNonAdjFragmentAfter() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 17, "xxx", "", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(17, myTextBlock.getTextEndOffset()); + assertEquals(23, myTextBlock.getPsiEndOffset()); + } + + public void testTextDeleted_SecondNonAdjFragmentBefore() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 5, "xxx", "", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(5, myTextBlock.getStartOffset()); + assertEquals(7, myTextBlock.getTextEndOffset()); + assertEquals(13, myTextBlock.getPsiEndOffset()); + } + + public void testTextDeleted_SecondAdjFragment() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(10, myTextBlock.getTextEndOffset()); + assertEquals(16, myTextBlock.getPsiEndOffset()); + } + + public void testTextChanged_ChangedToTheSameSize_Once1() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "xxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(13, myTextBlock.getTextEndOffset()); + assertEquals(13, myTextBlock.getPsiEndOffset()); + } + + public void testTextChanged_ChangedToTheSameSize_Once2() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 0, "xxx", "yyy", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(0, myTextBlock.getStartOffset()); + assertEquals(3, myTextBlock.getTextEndOffset()); + assertEquals(3, myTextBlock.getPsiEndOffset()); + } + + public void testTextChanged_ChangedToTheSameSize_SecondNonAdjFragmentAfter() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "xxx", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 20, "xxx", "xxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(23, myTextBlock.getTextEndOffset()); + assertEquals(23, myTextBlock.getPsiEndOffset()); + } + + public void testTextChanged_ChangedToTheSameSize_SecondNonAdjFragmentBefore() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "xxx", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 5, "xxx", "xxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(5, myTextBlock.getStartOffset()); + assertEquals(13, myTextBlock.getTextEndOffset()); + assertEquals(13, myTextBlock.getPsiEndOffset()); + } + + public void testTextChanged_ChangedToTheSameSize_SecondNonFragmentAfter() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "xxx", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 13, "xxx", "xxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(16, myTextBlock.getTextEndOffset()); + assertEquals(16, myTextBlock.getPsiEndOffset()); + } + + public void testTextChanged_ChangedToTheSameSize_SecondNonFragmentBefore() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "xxx", 1, false)); + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 7, "xxx", "xxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(7, myTextBlock.getStartOffset()); + assertEquals(13, myTextBlock.getTextEndOffset()); + assertEquals(13, myTextBlock.getPsiEndOffset()); + } + + public void testTextChanged_ChangedToLessSize() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "xx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(12, myTextBlock.getTextEndOffset()); + assertEquals(13, myTextBlock.getPsiEndOffset()); + } + + public void testTextChanged_ChangedToGreaterSize() throws Exception { + myTextBlock.documentChanged(new DocumentEventImpl(myDocument, 10, "xxx", "xxxx", 1, false)); + + assertTrue(!myTextBlock.isEmpty()); + assertEquals(10, myTextBlock.getStartOffset()); + assertEquals(14, myTextBlock.getTextEndOffset()); + assertEquals(13, myTextBlock.getPsiEndOffset()); + } +} diff --git a/platform/platform-tests/testSrc/com/intellij/psi/impl/meta/MetaRegistryTest.java b/platform/platform-tests/testSrc/com/intellij/psi/impl/meta/MetaRegistryTest.java new file mode 100644 index 000000000000..ea35cfd1f3fd --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/psi/impl/meta/MetaRegistryTest.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved. + */ + +package com.intellij.psi.impl.meta; + +import com.intellij.openapi.application.Result; +import com.intellij.openapi.command.WriteCommandAction; +import com.intellij.psi.PsiElement; +import com.intellij.psi.filters.ElementFilter; +import com.intellij.psi.meta.PsiMetaData; +import com.intellij.psi.xml.XmlFile; +import com.intellij.psi.xml.XmlTag; +import com.intellij.testFramework.LightPlatformTestCase; +import com.intellij.testFramework.UsefulTestCase; +import org.jetbrains.annotations.NonNls; + +/** +* @author peter +*/ +public class MetaRegistryTest extends LightPlatformTestCase { + + public void testChangingMetaData() throws Throwable { + final boolean[] flag = new boolean[]{false}; + MetaRegistry.addMetadataBinding(new ElementFilter() { + @Override + public boolean isAcceptable(Object element, PsiElement context) { + return flag[0]; + } + + @Override + public boolean isClassAcceptable(Class hintClass) { + return true; + } + }, MyTrueMetaData.class, myTestRootDisposable); + MetaRegistry.addMetadataBinding(new ElementFilter() { + @Override + public boolean isAcceptable(Object element, PsiElement context) { + return !flag[0]; + } + + @Override + public boolean isClassAcceptable(Class hintClass) { + return true; + } + }, MyFalseMetaData.class, myTestRootDisposable); + + final XmlTag tag = ((XmlFile)LightPlatformTestCase.createFile("a.xml", "")).getDocument().getRootTag(); + UsefulTestCase.assertInstanceOf(tag.getMetaData(), MyFalseMetaData.class); + flag[0] = true; + new WriteCommandAction(LightPlatformTestCase.getProject()) { + @Override + protected void run(Result result) throws Throwable { + tag.setName("b"); + } + }.execute(); + UsefulTestCase.assertInstanceOf(tag.getMetaData(), MyTrueMetaData.class); + } + + public static class MyAbstractMetaData implements PsiMetaData { + private PsiElement myDeclaration; + + @Override + public PsiElement getDeclaration() { + return myDeclaration; + } + + @Override + public Object[] getDependences() { + return new Object[]{myDeclaration}; + } + + @Override + @NonNls + public String getName() { + return null; + } + + @Override + @NonNls + public String getName(PsiElement context) { + return null; + } + + @Override + public void init(PsiElement element) { + myDeclaration = element; + } + + } + + public static class MyTrueMetaData extends MyAbstractMetaData {} + public static class MyFalseMetaData extends MyAbstractMetaData {} + +} From 7f4af30d2e9d653bf1d5bce20c6d0e42d0a9ffde Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 16 Dec 2011 18:58:22 +0100 Subject: [PATCH 060/101] tests to community --- .../PatternRegexpConvertorTest.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 platform/platform-tests/testSrc/com/intellij/ide/packageSets/PatternRegexpConvertorTest.java diff --git a/platform/platform-tests/testSrc/com/intellij/ide/packageSets/PatternRegexpConvertorTest.java b/platform/platform-tests/testSrc/com/intellij/ide/packageSets/PatternRegexpConvertorTest.java new file mode 100644 index 000000000000..1473ae9b39d6 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/ide/packageSets/PatternRegexpConvertorTest.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved. + */ + +/* + * Created by IntelliJ IDEA. + * User: Anna.Kozlova + * Date: 13-Sep-2006 + * Time: 16:37:57 + */ +package com.intellij.ide.packageSets; + +import com.intellij.psi.search.scope.packageSet.FilePatternPackageSet; +import junit.framework.TestCase; + +public class PatternRegexpConvertorTest extends TestCase { + public void testConvertToRegexp() throws Exception { + assertEquals("a\\.[^\\.]*", FilePatternPackageSet.convertToRegexp("a.*", '.')); + assertEquals("a\\.(.*\\.)?[^\\.]*", FilePatternPackageSet.convertToRegexp("a..*", '.')); + assertEquals("a\\/[^\\/]*", FilePatternPackageSet.convertToRegexp("a/*", '/')); + assertEquals("a\\/(.*\\/)?[^\\/]*", FilePatternPackageSet.convertToRegexp("a//*", '/')); + assertEquals("[^\\.]*", FilePatternPackageSet.convertToRegexp("*", '.')); + } +} \ No newline at end of file From 53522e6c315c1301c146dc89c466e940b336d020 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Fri, 16 Dec 2011 22:15:27 +0100 Subject: [PATCH 061/101] suppress redundant cvs error messages --- .../cvsMessages/CvsMessagesTranslator.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsoperations/cvsMessages/CvsMessagesTranslator.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsoperations/cvsMessages/CvsMessagesTranslator.java index 137790a6ad1a..4aaad5bea2a3 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsoperations/cvsMessages/CvsMessagesTranslator.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsoperations/cvsMessages/CvsMessagesTranslator.java @@ -130,13 +130,13 @@ public class CvsMessagesTranslator implements IFileInfoListener, IMessageListene } } - public void gotEntry(FileObject fileObject, Entry entry) { - - } + public void gotEntry(FileObject fileObject, Entry entry) {} public void messageSent(String message, final byte[] byteMessage, boolean error, boolean tagged) { myListener.addMessage(new MessageEvent(message, error, tagged)); - if (message.length() == 0) return; + if (message.isEmpty()) { + return; + } if (isFileMessage(message)) { lastMessage = MessageType.FILE_MESSAGE; @@ -159,6 +159,7 @@ public class CvsMessagesTranslator implements IFileInfoListener, IMessageListene myListener.addError(s, null, myCvsFileSystem, myCvsRoot, false); } myPreviousErrorMessages.clear(); + return; } final String relativeFileName = errorMessagePattern.getRelativeFileName(message); lastMessage = MessageType.ERROR; @@ -200,7 +201,9 @@ public class CvsMessagesTranslator implements IFileInfoListener, IMessageListene @Nullable private static CvsMessagePattern getErrorMessagePattern(String message, CvsMessagePattern[] patterns) { for (CvsMessagePattern pattern : patterns) { - if (pattern.matches(message)) return pattern; + if (pattern.matches(message)) { + return pattern; + } } return null; } @@ -211,7 +214,9 @@ public class CvsMessagesTranslator implements IFileInfoListener, IMessageListene } public void operationCompleted() { - if (!CvsEntriesManager.getInstance().isActive()) return; + if (!CvsEntriesManager.getInstance().isActive()) { + return; + } for (File file : myFileToInfoMap.keySet()) { addFileMessage(myFileToInfoMap.get(file), file); } From 28c93ce970ed40ebdfce19cb15b5422ecb45c88b Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sat, 17 Dec 2011 19:06:51 +0400 Subject: [PATCH 062/101] IDEA-78831 Remove unnecessary semicolons intention --- .../util/CommonRefactoringUtil.java | 2 +- .../after.groovy.template | 2 + .../before.groovy.template | 2 + .../description.html | 5 + plugins/groovy/src/META-INF/plugin.xml | 5 + .../GroovyIntentionsBundle.properties | 3 + .../RemoveUnnecessarySemicolonsIntention.java | 198 +++++++ .../lang/psi/GroovyPsiElementFactory.java | 2 +- .../RemoveUnnecessarySemicolonTest.groovy | 549 ++++++++++++++++++ 9 files changed, 766 insertions(+), 2 deletions(-) create mode 100644 plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/after.groovy.template create mode 100644 plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/before.groovy.template create mode 100644 plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/description.html create mode 100644 plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/RemoveUnnecessarySemicolonsIntention.java create mode 100644 plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/RemoveUnnecessarySemicolonTest.groovy diff --git a/platform/lang-api/src/com/intellij/refactoring/util/CommonRefactoringUtil.java b/platform/lang-api/src/com/intellij/refactoring/util/CommonRefactoringUtil.java index c8892f351473..f7deece87d89 100644 --- a/platform/lang-api/src/com/intellij/refactoring/util/CommonRefactoringUtil.java +++ b/platform/lang-api/src/com/intellij/refactoring/util/CommonRefactoringUtil.java @@ -59,7 +59,7 @@ public class CommonRefactoringUtil { } } - public static void showErrorHint(Project project, @Nullable Editor editor, String message, String title, String helpId) { + public static void showErrorHint(Project project, @Nullable Editor editor, String message, String title, @Nullable @NonNls String helpId) { if (ApplicationManager.getApplication().isUnitTestMode()) throw new RefactoringErrorHintException(message); if (editor == null) { diff --git a/plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/after.groovy.template b/plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/after.groovy.template new file mode 100644 index 000000000000..015b148cbee1 --- /dev/null +++ b/plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/after.groovy.template @@ -0,0 +1,2 @@ +print 2 +print 3 \ No newline at end of file diff --git a/plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/before.groovy.template b/plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/before.groovy.template new file mode 100644 index 000000000000..9849021583a6 --- /dev/null +++ b/plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/before.groovy.template @@ -0,0 +1,2 @@ +print 2; +print 3 \ No newline at end of file diff --git a/plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/description.html b/plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/description.html new file mode 100644 index 000000000000..b347e0197809 --- /dev/null +++ b/plugins/groovy/resources/intentionDescriptions/RemoveUnnecessarySemicolonsIntention/description.html @@ -0,0 +1,5 @@ + + +Removes unnecessary semicolons from selected text or a semicolon under caret if it is unnecessary. + + \ No newline at end of file diff --git a/plugins/groovy/src/META-INF/plugin.xml b/plugins/groovy/src/META-INF/plugin.xml index 85c4a56a3cc8..03f92e0930d7 100644 --- a/plugins/groovy/src/META-INF/plugin.xml +++ b/plugins/groovy/src/META-INF/plugin.xml @@ -914,6 +914,11 @@ intention.category.groovy/intention.category.groovy.style org.jetbrains.plugins.groovy.intentions.style.JavaStylePropertiesInvocationIntention + + org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle + intention.category.groovy/intention.category.groovy.style + org.jetbrains.plugins.groovy.intentions.style.RemoveUnnecessarySemicolonsIntention + org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle intention.category.groovy/intention.category.groovy.style diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.properties b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.properties index 23bda96924da..f5e53960a867 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.properties +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.properties @@ -138,3 +138,6 @@ convert.to.geese.braces.intention.family.name=Format closing closure braces in o convert.from.geese.braces.intention.name=Format braces in separate lines convert.from.geese.braces.intention.family.name=Format braces in separate lines +remove.unnecessary.semicolons.name=Remove unnecessary semicolons +remove.unnecessary.semicolons.family.name=Remove unnecessary semicolons from selected text +no.unnecessary.semicolons.found=No unnecessary semicolons found diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/RemoveUnnecessarySemicolonsIntention.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/RemoveUnnecessarySemicolonsIntention.java new file mode 100644 index 000000000000..3afe51a7405b --- /dev/null +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/RemoveUnnecessarySemicolonsIntention.java @@ -0,0 +1,198 @@ +/* + * Copyright 2000-2011 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 org.jetbrains.plugins.groovy.intentions.style; + +import com.intellij.codeInsight.intention.IntentionAction; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.editor.SelectionModel; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.TextRange; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiRecursiveElementVisitor; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.refactoring.util.CommonRefactoringUtil; +import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle; +import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes; +import org.jetbrains.plugins.groovy.lang.psi.GroovyFile; +import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase; +import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory; +import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement; +import org.jetbrains.plugins.groovy.lang.psi.util.PsiUtil; + +import java.util.ArrayList; + +/** + * @author Max Medvedev + */ +public class RemoveUnnecessarySemicolonsIntention implements IntentionAction { + @NotNull + @Override + public String getText() { + return GroovyIntentionsBundle.message("remove.unnecessary.semicolons.name"); + } + + @NotNull + @Override + public String getFamilyName() { + return GroovyIntentionsBundle.message("remove.unnecessary.semicolons.family.name"); + } + + @Override + public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) { + if (!(file instanceof GroovyFileBase) || editor.getSelectionModel().hasBlockSelection()) { + return false; + } + + + if (editor.getSelectionModel().hasSelection()) return true; + + int offset = editor.getCaretModel().getOffset(); + if (offset >= editor.getDocument().getTextLength()) offset = editor.getDocument().getTextLength() - 1; + final PsiElement element = file.findElementAt(offset); + if (element == null) return false; + if (element.getNode().getElementType() == GroovyTokenTypes.mSEMI) return true; + + final PsiElement next = PsiTreeUtil.nextLeaf(element); + if (next != null && next.getNode().getElementType() == GroovyTokenTypes.mSEMI) return true; + + + final PsiElement prev = PsiTreeUtil.prevLeaf(element); + if (prev != null && prev.getNode().getElementType() == GroovyTokenTypes.mSEMI) return true; + + return false; + } + + @Override + public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException { + final SelectionModel selectionModel = editor.getSelectionModel(); + if (selectionModel.hasBlockSelection()) return; + + Document document = editor.getDocument(); + if (selectionModel.hasSelection()) { + final int start = selectionModel.getSelectionStart(); + final int end = selectionModel.getSelectionEnd(); + final TextRange range = new TextRange(start, end); + + final ArrayList colons = new ArrayList(); + file.accept(new PsiRecursiveElementVisitor() { + @Override + public void visitElement(PsiElement element) { + if (!range.intersects(element.getTextRange())) return; + + final IElementType elementType = element.getNode().getElementType(); + if (elementType == GroovyTokenTypes.mSEMI) { + colons.add(element); + } + else { + super.visitElement(element); + } + } + }); + + boolean removed = false; + for (PsiElement colon : colons) { + final boolean b = checkAndRemove(project, colon, document); + removed = removed || b; + } + + if (!removed) { + CommonRefactoringUtil.showErrorHint(project, editor, GroovyIntentionsBundle.message("no.unnecessary.semicolons.found"), + GroovyIntentionsBundle.message("remove.unnecessary.semicolons.name"), null); + } + } + else { + int offset = editor.getCaretModel().getOffset(); + if (offset >= document.getTextLength()) offset = document.getTextLength() - 1; + final PsiElement element = file.findElementAt(offset); + if (element == null) return; + if (checkAndRemove(project, element, document)) return; + + if (checkAndRemove(project, PsiTreeUtil.nextLeaf(element), document)) return; + if (checkAndRemove(project, PsiTreeUtil.prevLeaf(element), document)) return; + + CommonRefactoringUtil.showErrorHint(project, editor, GroovyIntentionsBundle.message("no.unnecessary.semicolons.found"), + GroovyIntentionsBundle.message("remove.unnecessary.semicolons.name"), null); + } + } + + private static boolean checkAndRemove(Project project, @Nullable PsiElement element, Document document) { + if (element != null && element.getNode().getElementType() == GroovyTokenTypes.mSEMI) { + if (isColonUnnecessary(element, document.getText(), project)) { + element.delete(); + return true; + } + } + return false; + } + + private static boolean isColonUnnecessary(PsiElement colon, String text, Project project) { + final GrStatement prev = getPreviousStatement(colon); + final GrStatement next = getNextStatement(colon); + + if (prev == null || next == null) return true; + + final int startOffset = prev.getTextRange().getStartOffset(); + final int endOffset = next.getTextRange().getEndOffset(); + + final int offset = colon.getTextRange().getStartOffset(); + final String statementWithoutColon = text.substring(startOffset, offset) + text.substring(offset + 1, endOffset); + final GroovyFile file = GroovyPsiElementFactory.getInstance(project).createGroovyFile(statementWithoutColon, false, null); + final GrStatement[] statements = file.getStatements(); + if (statements.length != 2) return false; + + return checkEquality(prev, statements[0]) && checkEquality(next, statements[1]); + } + + private static boolean checkEquality(PsiElement l, PsiElement r) { + if (!l.getText().equals(r.getText())) return false; + if (l.getNode().getElementType() != r.getNode().getElementType()) return false; + + final PsiElement[] lChildren = l.getChildren(); + final PsiElement[] rChildren = r.getChildren(); + + if (lChildren.length != rChildren.length) return false; + + for (int i = 0; i < rChildren.length; i++) { + if (!checkEquality(lChildren[i], rChildren[i])) return false; + } + return true; + } + + @Nullable + private static GrStatement getPreviousStatement(PsiElement colon) { + final PsiElement prev = PsiUtil.skipWhitespaces(colon.getPrevSibling(), false); + if (prev instanceof GrStatement) return (GrStatement)prev; + return null; + } + + @Nullable + private static GrStatement getNextStatement(PsiElement colon) { + final PsiElement next = PsiUtil.skipWhitespaces(colon.getNextSibling(), true); + if (next instanceof GrStatement) return (GrStatement)next; + return null; + } + + @Override + public boolean startInWriteAction() { + return true; + } +} diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/GroovyPsiElementFactory.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/GroovyPsiElementFactory.java index 75570c56ae7b..c52feb2632cf 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/GroovyPsiElementFactory.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/GroovyPsiElementFactory.java @@ -188,7 +188,7 @@ public abstract class GroovyPsiElementFactory implements JVMElementFactory { public abstract GrAnnotation createAnnotationFromText(String annoText); - public abstract GroovyFile createGroovyFile(String text, boolean isPhysical, PsiElement context); + public abstract GroovyFile createGroovyFile(String text, boolean isPhysical, @Nullable PsiElement context); public abstract GrMethod createMethodFromText(String modifier, String name, String type, String[] paramTypes, PsiElement context); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/RemoveUnnecessarySemicolonTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/RemoveUnnecessarySemicolonTest.groovy new file mode 100644 index 000000000000..8955a0e2b6f7 --- /dev/null +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/RemoveUnnecessarySemicolonTest.groovy @@ -0,0 +1,549 @@ +/* + * Copyright 2000-2011 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 org.jetbrains.plugins.groovy.intentions + +import com.intellij.refactoring.util.CommonRefactoringUtil.RefactoringErrorHintException +import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase +import org.jetbrains.plugins.groovy.util.TestUtils + +/** + * @author Max Medvedev + */ +class RemoveUnnecessarySemicolonTest extends LightCodeInsightFixtureTestCase { + private static final String hint = GroovyIntentionsBundle.message('remove.unnecessary.semicolons.name'); + + @Override + protected String getBasePath() { + return "${TestUtils.testDataPath}intentions/removeUnnecessaryBraces/"; + } + + void testSimpleCase1() { + doTest('print 2;\nprint 3', 'print 2\nprint 3') + } + + void testSimpleCase2() { + doTest('print 2;\nprint 3', 'print 2\nprint 3') + } + + void testSimpleCase3() { + doTest('print 2;\nprint 3', 'print 2\nprint 3') + } + + void testDontRemoveSimple() { + doTest('print 2; print 3') + } + + void testClosure() { + doTest('print( a );\n{->print 3}') + } + + private doTest(String before, String after) { + myFixture.configureByText('a.groovy', before) + def intentions = myFixture.filterAvailableIntentions(hint) + assertEquals(1, intentions.size()) + + myFixture.launchAction(intentions[0]) + myFixture.checkResult(after) + } + + private doTest(String text) { + try { + doTest(text, text) + } + catch (RefactoringErrorHintException e) { + return; + } + fail('RefactoringErrorHintException should be thrown') + } + + private doFalseTest(String before) { + myFixture.configureByText('a.groovy', before) + def intentions = myFixture.filterAvailableIntentions(hint) + assertEmpty(intentions) + } + + void testBig() { + doTest('''\ +/* + * Copyright 2000-2011 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.intellij.refactoring.util; + +import com.intellij.codeInsight.hint.HintManager; +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.fileTypes.FileTypeManager; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.vfs.JarFileSystem; +import com.intellij.openapi.vfs.ReadonlyStatusHandler; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.*; +import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.refactoring.RefactoringBundle; +import com.intellij.util.containers.ContainerUtil; +import gnu.trove.THashSet; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + +/** + * @author ven + */ +public class CommonRefactoringUtil { + private CommonRefactoringUtil() {} + + public static void showErrorMessage(String title, String message, @Nullable @NonNls String helpId, @NotNull Project project) { + if (ApplicationManager.getApplication().isUnitTestMode()) throw new RuntimeException(message); + RefactoringMessageDialog dialog = new RefactoringMessageDialog(title, message, helpId, "OptionPane.errorIcon", false, project); + dialog.show(); + } + + /** + * Fatal refactoring problem during unit test run. Corresponds to message of modal dialog shown during user driven refactoring. + */ + public static class RefactoringErrorHintException extends RuntimeException { + public RefactoringErrorHintException(String message) { + super(message); + } + } + + public static void showErrorHint(Project project, @Nullable Editor editor, String message, String title, @Nullable @NonNls String helpId) { + if (ApplicationManager.getApplication().isUnitTestMode()) throw new RefactoringErrorHintException(message); + + if (editor == null) { + showErrorMessage(title, message, helpId, project); + } + else { + HintManager.getInstance().showErrorHint(editor, message); + } + } + + @NonNls + public static String htmlEmphasize(String text) { + return "" + text + ""; + } + + public static boolean checkReadOnlyStatus(@NotNull PsiElement element) { + final VirtualFile file = element.getContainingFile().getVirtualFile(); + return file != null && !ReadonlyStatusHandler.getInstance(element.getProject()).ensureFilesWritable(file).hasReadonlyFiles(); + } + + public static boolean checkReadOnlyStatus(@NotNull Project project, @NotNull PsiElement element) { + return checkReadOnlyStatus(element, project, RefactoringBundle.message("refactoring.cannot.be.performed")); + } + + public static boolean checkReadOnlyStatus(@NotNull Project project, @NotNull PsiElement... elements) { + return checkReadOnlyStatus(Arrays.asList(elements), project, RefactoringBundle.message("refactoring.cannot.be.performed"), false, true); + } + + public static boolean checkReadOnlyStatus(@NotNull PsiElement element, @NotNull Project project, String messagePrefix) { + return element.isWritable() || + checkReadOnlyStatus(Collections.singleton(element), project, messagePrefix, false, true); + } + + public static boolean checkReadOnlyStatusRecursively(@NotNull Project project, @NotNull Collection elements) { + return checkReadOnlyStatus(elements, project, RefactoringBundle.message("refactoring.cannot.be.performed"), true, false); + } + public static boolean checkReadOnlyStatusRecursively(@NotNull Project project, @NotNull Collection elements, boolean notifyOnFail) { + return checkReadOnlyStatus(elements, project, RefactoringBundle.message("refactoring.cannot.be.performed"), true, notifyOnFail); + } + + private static boolean checkReadOnlyStatus(@NotNull Collection elements, + @NotNull Project project, + final String messagePrefix, + boolean recursively, + final boolean notifyOnFail) { + final Collection readonly = new THashSet(); // not writable, but could be checked out + final Collection failed = new THashSet(); // those located in jars + boolean seenNonWritablePsiFilesWithoutVirtualFile = false; + + for (PsiElement element : elements) { + if (element instanceof PsiDirectory) { + final PsiDirectory dir = (PsiDirectory)element; + final VirtualFile vFile = dir.getVirtualFile(); + if (vFile.getFileSystem() instanceof JarFileSystem) { + failed.add(vFile); + } + else { + if (recursively) { + addVirtualFiles(vFile, readonly); + } + else { + readonly.add(vFile); + } + } + } + else if (element instanceof PsiDirectoryContainer) { + final PsiDirectory[] directories = ((PsiDirectoryContainer)element).getDirectories(); + for (PsiDirectory directory : directories) { + VirtualFile virtualFile = directory.getVirtualFile(); + if (recursively) { + if (virtualFile.getFileSystem() instanceof JarFileSystem) { + failed.add(virtualFile); + } + else { + addVirtualFiles(virtualFile, readonly); + } + } + else { + if (virtualFile.getFileSystem() instanceof JarFileSystem) { + failed.add(virtualFile); + } + else { + readonly.add(virtualFile); + } + } + } + } + else if (element instanceof PsiCompiledElement) { + final PsiFile file = element.getContainingFile(); + if (file != null) { + failed.add(file.getVirtualFile()); + } + } + else { + PsiFile file = element.getContainingFile(); + if (file == null) { + if (!element.isWritable()) { + seenNonWritablePsiFilesWithoutVirtualFile = true; + } + } + else { + final VirtualFile vFile = file.getVirtualFile(); + if (vFile != null) { + readonly.add(vFile); + } + else { + if (!element.isWritable()) { + seenNonWritablePsiFilesWithoutVirtualFile = true; + } + } + } + } + } + + final VirtualFile[] files = VfsUtil.toVirtualFileArray(readonly); + final ReadonlyStatusHandler.OperationStatus status = ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(files); + ContainerUtil.addAll(failed, status.getReadonlyFiles()); + if (notifyOnFail && (!failed.isEmpty() || seenNonWritablePsiFilesWithoutVirtualFile && readonly.isEmpty())) { + StringBuilder message = new StringBuilder(messagePrefix); + message.append('\\n'); + int i = 0; + for (VirtualFile virtualFile : failed) { + final String presentableUrl = virtualFile.getPresentableUrl(); + final String subj = virtualFile.isDirectory() + ? RefactoringBundle.message("directory.description", presentableUrl) + : RefactoringBundle.message("file.description", presentableUrl); + if (virtualFile.getFileSystem() instanceof JarFileSystem) { + message.append(RefactoringBundle.message("0.is.located.in.a.jar.file", subj)); + } + else { + message.append(RefactoringBundle.message("0.is.read.only", subj)); + } + if (i++ > 20) { + message.append("...\\n"); + break; + } + } + showErrorMessage(RefactoringBundle.message("error.title"), message.toString(), null, project); + return false; + } + + return failed.isEmpty(); + } + + private static void addVirtualFiles(final VirtualFile vFile, final Collection list) { + if (!vFile.isWritable()) { + list.add(vFile); + } + if (!vFile.isSymLink()) { + final VirtualFile[] children = vFile.getChildren(); + if (children != null) { + final FileTypeManager fileTypeManager = FileTypeManager.getInstance(); + for (VirtualFile virtualFile : children) { + if (fileTypeManager.isFileIgnored(virtualFile)) continue; + addVirtualFiles(virtualFile, list); + } + } + } + } + + public static String capitalize(String text) { + return Character.toUpperCase(text.charAt(0)) + text.substring(1); + } + + public static boolean isAncestor(final PsiElement resolved, final Collection scopes) { + for (final PsiElement scope : scopes) { + if (PsiTreeUtil.isAncestor(scope, resolved, false)) return true; + } + return false; + } +} +''', '''\ +/* + * Copyright 2000-2011 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.intellij.refactoring.util + +import com.intellij.codeInsight.hint.HintManager +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.fileTypes.FileTypeManager +import com.intellij.openapi.project.Project +import com.intellij.openapi.vfs.JarFileSystem +import com.intellij.openapi.vfs.ReadonlyStatusHandler +import com.intellij.openapi.vfs.VfsUtil +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.* +import com.intellij.psi.util.PsiTreeUtil +import com.intellij.refactoring.RefactoringBundle +import com.intellij.util.containers.ContainerUtil +import gnu.trove.THashSet +import org.jetbrains.annotations.NonNls +import org.jetbrains.annotations.NotNull +import org.jetbrains.annotations.Nullable + +import java.util.Arrays +import java.util.Collection +import java.util.Collections + +/** + * @author ven + */ +public class CommonRefactoringUtil { + private CommonRefactoringUtil() {} + + public static void showErrorMessage(String title, String message, @Nullable @NonNls String helpId, @NotNull Project project) { + if (ApplicationManager.getApplication().isUnitTestMode()) throw new RuntimeException(message) + RefactoringMessageDialog dialog = new RefactoringMessageDialog(title, message, helpId, "OptionPane.errorIcon", false, project) + dialog.show() + } + + /** + * Fatal refactoring problem during unit test run. Corresponds to message of modal dialog shown during user driven refactoring. + */ + public static class RefactoringErrorHintException extends RuntimeException { + public RefactoringErrorHintException(String message) { + super(message) + } + } + + public static void showErrorHint(Project project, @Nullable Editor editor, String message, String title, @Nullable @NonNls String helpId) { + if (ApplicationManager.getApplication().isUnitTestMode()) throw new RefactoringErrorHintException(message) + + if (editor == null) { + showErrorMessage(title, message, helpId, project) + } + else { + HintManager.getInstance().showErrorHint(editor, message) + } + } + + @NonNls + public static String htmlEmphasize(String text) { + return "" + text + "" + } + + public static boolean checkReadOnlyStatus(@NotNull PsiElement element) { + final VirtualFile file = element.getContainingFile().getVirtualFile() + return file != null && !ReadonlyStatusHandler.getInstance(element.getProject()).ensureFilesWritable(file).hasReadonlyFiles() + } + + public static boolean checkReadOnlyStatus(@NotNull Project project, @NotNull PsiElement element) { + return checkReadOnlyStatus(element, project, RefactoringBundle.message("refactoring.cannot.be.performed")) + } + + public static boolean checkReadOnlyStatus(@NotNull Project project, @NotNull PsiElement... elements) { + return checkReadOnlyStatus(Arrays.asList(elements), project, RefactoringBundle.message("refactoring.cannot.be.performed"), false, true) + } + + public static boolean checkReadOnlyStatus(@NotNull PsiElement element, @NotNull Project project, String messagePrefix) { + return element.isWritable() || + checkReadOnlyStatus(Collections.singleton(element), project, messagePrefix, false, true) + } + + public static boolean checkReadOnlyStatusRecursively(@NotNull Project project, @NotNull Collection elements) { + return checkReadOnlyStatus(elements, project, RefactoringBundle.message("refactoring.cannot.be.performed"), true, false) + } + public static boolean checkReadOnlyStatusRecursively(@NotNull Project project, @NotNull Collection elements, boolean notifyOnFail) { + return checkReadOnlyStatus(elements, project, RefactoringBundle.message("refactoring.cannot.be.performed"), true, notifyOnFail) + } + + private static boolean checkReadOnlyStatus(@NotNull Collection elements, + @NotNull Project project, + final String messagePrefix, + boolean recursively, + final boolean notifyOnFail) { + final Collection readonly = new THashSet() // not writable, but could be checked out + final Collection failed = new THashSet() // those located in jars + boolean seenNonWritablePsiFilesWithoutVirtualFile = false + + for (PsiElement element : elements) { + if (element instanceof PsiDirectory) { + final PsiDirectory dir = (PsiDirectory)element + final VirtualFile vFile = dir.getVirtualFile() + if (vFile.getFileSystem() instanceof JarFileSystem) { + failed.add(vFile) + } + else { + if (recursively) { + addVirtualFiles(vFile, readonly) + } + else { + readonly.add(vFile) + } + } + } + else if (element instanceof PsiDirectoryContainer) { + final PsiDirectory[] directories = ((PsiDirectoryContainer)element).getDirectories() + for (PsiDirectory directory : directories) { + VirtualFile virtualFile = directory.getVirtualFile() + if (recursively) { + if (virtualFile.getFileSystem() instanceof JarFileSystem) { + failed.add(virtualFile) + } + else { + addVirtualFiles(virtualFile, readonly) + } + } + else { + if (virtualFile.getFileSystem() instanceof JarFileSystem) { + failed.add(virtualFile) + } + else { + readonly.add(virtualFile) + } + } + } + } + else if (element instanceof PsiCompiledElement) { + final PsiFile file = element.getContainingFile() + if (file != null) { + failed.add(file.getVirtualFile()) + } + } + else { + PsiFile file = element.getContainingFile() + if (file == null) { + if (!element.isWritable()) { + seenNonWritablePsiFilesWithoutVirtualFile = true + } + } + else { + final VirtualFile vFile = file.getVirtualFile() + if (vFile != null) { + readonly.add(vFile) + } + else { + if (!element.isWritable()) { + seenNonWritablePsiFilesWithoutVirtualFile = true + } + } + } + } + } + + final VirtualFile[] files = VfsUtil.toVirtualFileArray(readonly) + final ReadonlyStatusHandler.OperationStatus status = ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(files) + ContainerUtil.addAll(failed, status.getReadonlyFiles()) + if (notifyOnFail && (!failed.isEmpty() || seenNonWritablePsiFilesWithoutVirtualFile && readonly.isEmpty())) { + StringBuilder message = new StringBuilder(messagePrefix) + message.append('\\n') + int i = 0 + for (VirtualFile virtualFile : failed) { + final String presentableUrl = virtualFile.getPresentableUrl() + final String subj = virtualFile.isDirectory() + ? RefactoringBundle.message("directory.description", presentableUrl) + : RefactoringBundle.message("file.description", presentableUrl) + if (virtualFile.getFileSystem() instanceof JarFileSystem) { + message.append(RefactoringBundle.message("0.is.located.in.a.jar.file", subj)) + } + else { + message.append(RefactoringBundle.message("0.is.read.only", subj)) + } + if (i++ > 20) { + message.append("...\\n") + break + } + } + showErrorMessage(RefactoringBundle.message("error.title"), message.toString(), null, project) + return false + } + + return failed.isEmpty() + } + + private static void addVirtualFiles(final VirtualFile vFile, final Collection list) { + if (!vFile.isWritable()) { + list.add(vFile) + } + if (!vFile.isSymLink()) { + final VirtualFile[] children = vFile.getChildren() + if (children != null) { + final FileTypeManager fileTypeManager = FileTypeManager.getInstance() + for (VirtualFile virtualFile : children) { + if (fileTypeManager.isFileIgnored(virtualFile)) continue + addVirtualFiles(virtualFile, list) + } + } + } + } + + public static String capitalize(String text) { + return Character.toUpperCase(text.charAt(0)) + text.substring(1) + } + + public static boolean isAncestor(final PsiElement resolved, final Collection scopes) { + for (final PsiElement scope : scopes) { + if (PsiTreeUtil.isAncestor(scope, resolved, false)) return true + } + return false + } +} +''') + } +} From 78ee8593f595c77edb7d2d0342a5e1e4fa19c49b Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sat, 17 Dec 2011 22:49:31 +0400 Subject: [PATCH 063/101] IDEA-78924 Groovy: Copy+Paste a groovy script file doubles the file extension --- .../refactoring/copy/CopyClassesHandler.java | 4 +- .../copy/CopyFilesOrDirectoriesHandler.java | 26 ++++++-- .../copy/GroovyCopyClassTest.groovy | 65 ++++++++++++++++++ .../refactoring/copy/GroovyCopyClassTest.java | 66 ------------------- 4 files changed, 88 insertions(+), 73 deletions(-) create mode 100644 plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.groovy delete mode 100644 plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.java diff --git a/java/java-impl/src/com/intellij/refactoring/copy/CopyClassesHandler.java b/java/java-impl/src/com/intellij/refactoring/copy/CopyClassesHandler.java index aa7658215630..164d43dce300 100644 --- a/java/java-impl/src/com/intellij/refactoring/copy/CopyClassesHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/copy/CopyClassesHandler.java @@ -128,7 +128,9 @@ public class CopyClassesHandler extends CopyHandlerDelegateBase { if (classes != null) { topLevelClasses = ArrayUtil.mergeArrays(classes, topLevelClasses, PsiClass.ARRAY_FACTORY); } - result.put(containingFile, topLevelClasses); + if (topLevelClasses != null) { + result.put(containingFile, topLevelClasses); + } } public void doCopy(PsiElement[] elements, PsiDirectory defaultTargetDirectory) { diff --git a/platform/lang-impl/src/com/intellij/refactoring/copy/CopyFilesOrDirectoriesHandler.java b/platform/lang-impl/src/com/intellij/refactoring/copy/CopyFilesOrDirectoriesHandler.java index ea3e0c896ecf..b0c1ec443a6b 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/copy/CopyFilesOrDirectoriesHandler.java +++ b/platform/lang-impl/src/com/intellij/refactoring/copy/CopyFilesOrDirectoriesHandler.java @@ -73,11 +73,22 @@ public class CopyFilesOrDirectoriesHandler extends CopyHandlerDelegateBase { } public static void copyAsFiles(PsiElement[] elements, PsiDirectory defaultTargetDirectory, Project project) { - CopyFilesOrDirectoriesDialog dialog = new CopyFilesOrDirectoriesDialog(elements, defaultTargetDirectory, project, false); - dialog.show(); - if (dialog.isOK()) { - final String newName = elements.length == 1 ? dialog.getNewName() : null; - final PsiDirectory targetDirectory = dialog.getTargetDirectory(); + PsiDirectory targetDirectory = null; + String newName = null; + + if (ApplicationManager.getApplication().isUnitTestMode()) { + targetDirectory = defaultTargetDirectory; + } + else { + CopyFilesOrDirectoriesDialog dialog = new CopyFilesOrDirectoriesDialog(elements, defaultTargetDirectory, project, false); + dialog.show(); + if (dialog.isOK()) { + newName = elements.length == 1 ? dialog.getNewName() : null; + targetDirectory = dialog.getTargetDirectory(); + } + } + + if (targetDirectory != null) { try { for (PsiElement element : elements) { PsiFileSystemItem psiElement = (PsiFileSystemItem)element; @@ -155,7 +166,10 @@ public class CopyFilesOrDirectoriesHandler extends CopyHandlerDelegateBase { * @param newName can be not null only if elements.length == 1 * @param targetDirectory */ - private static void copyImpl(final PsiElement[] elements, final String newName, final PsiDirectory targetDirectory, final boolean doClone) { + private static void copyImpl(@NotNull final PsiElement[] elements, + @Nullable final String newName, + @NotNull final PsiDirectory targetDirectory, + final boolean doClone) { if (doClone && elements.length != 1) { throw new IllegalArgumentException("invalid number of elements to clone:" + elements.length); } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.groovy new file mode 100644 index 000000000000..0e5a7605e992 --- /dev/null +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.groovy @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2009 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 org.jetbrains.plugins.groovy.refactoring.copy + +import com.intellij.openapi.application.Result +import com.intellij.openapi.command.WriteCommandAction +import com.intellij.psi.PsiClass +import com.intellij.psi.PsiFile +import com.intellij.psi.search.GlobalSearchScope +import com.intellij.refactoring.copy.CopyClassesHandler +import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase +import org.jetbrains.plugins.groovy.util.TestUtils + +/** + * @author peter + */ +public class GroovyCopyClassTest extends LightCodeInsightFixtureTestCase { + + @Override + protected String getBasePath() { + return "${TestUtils.testDataPath}refactoring/copy/"; + } + + public void testBetweenPackages() throws Throwable { + final String testName = getTestName(false); + myFixture.copyFileToProject("${testName}.groovy", "foo/${testName}.groovy"); + myFixture.addClass("package foo; public class Bar {}"); + myFixture.addClass("package bar; public class Bar {}"); + + final PsiClass srcClass = myFixture.javaFacade.findClass("foo.$testName", GlobalSearchScope.allScope(project)); + assertTrue(CopyClassesHandler.canCopyClass(srcClass)); + new WriteCommandAction(project, [] as PsiFile[]) { + @Override + protected void run(Result result) throws Throwable { + def map = Collections.singletonMap(srcClass.navigationElement.containingFile, [srcClass] as PsiClass[]) + def dir = srcClass.manager.findDirectory(myFixture.tempDirFixture.getFile("bar")) + CopyClassesHandler.doCopyClasses(map, "${testName}_after", dir, project); + } + }.execute(); + + myFixture.checkResultByFile("bar/${testName}_after.groovy", "${testName}_after.groovy", true); + } + + public void testCopyScript() throws Throwable { + final String testName = getTestName(false); + def file = myFixture.copyFileToProject("${testName}.groovy", "/foo/${testName}.groovy"); + def psiFile = myFixture.psiManager.findFile(file) + //would be copied as file + assertFalse(CopyClassesHandler.canCopyClass(myFixture.javaFacade.findClass("foo.$testName", GlobalSearchScope.allScope(project)))); + assertFalse(CopyClassesHandler.canCopyClass(psiFile)); + } +} diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.java deleted file mode 100644 index cc774f8591cb..000000000000 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/copy/GroovyCopyClassTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2000-2009 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 org.jetbrains.plugins.groovy.refactoring.copy; - -import com.intellij.openapi.application.Result; -import com.intellij.openapi.command.WriteCommandAction; -import com.intellij.psi.PsiClass; -import com.intellij.psi.search.GlobalSearchScope; -import com.intellij.refactoring.copy.CopyClassesHandler; -import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; -import org.jetbrains.plugins.groovy.util.TestUtils; - -import java.util.Collections; - -/** - * @author peter - */ -public class GroovyCopyClassTest extends LightCodeInsightFixtureTestCase { - - @Override - protected String getBasePath() { - return TestUtils.getTestDataPath() + "refactoring/copy/"; - } - - public void testBetweenPackages() throws Throwable { - final String testName = getTestName(false); - myFixture.copyFileToProject(testName + ".groovy", "foo/" + testName + ".groovy"); - myFixture.addClass("package foo; public class Bar {}"); - myFixture.addClass("package bar; public class Bar {}"); - - final PsiClass srcClass = myFixture.getJavaFacade().findClass("foo." + testName, GlobalSearchScope.allScope(getProject())); - assertTrue(CopyClassesHandler.canCopyClass(srcClass)); - new WriteCommandAction(getProject()) { - @Override - protected void run(Result result) throws Throwable { - CopyClassesHandler.doCopyClasses(Collections.singletonMap(srcClass.getNavigationElement().getContainingFile(), new PsiClass[]{srcClass}), testName + "_after", srcClass.getManager().findDirectory(myFixture.getTempDirFixture().getFile("bar")), - getProject()); - } - }.execute(); - - myFixture.checkResultByFile("bar/" + testName + "_after.groovy", testName + "_after.groovy", true); - } - - public void testCopyScript() throws Throwable { - final String testName = getTestName(false); - myFixture.copyFileToProject(testName + ".groovy", "/foo/" + testName + ".groovy"); - - //would be copied as file - assertFalse( - CopyClassesHandler.canCopyClass(myFixture.getJavaFacade().findClass("foo." + testName, GlobalSearchScope.allScope(getProject())))); - } - -} From e8eea0610c3a9291f7c74a48ea58542d79ae7c6b Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sat, 17 Dec 2011 23:07:42 +0400 Subject: [PATCH 064/101] IDEA-79043 Convert to GString bug --- .../RemoveUnnecessarySemicolonsIntention.java | 19 +++---------------- .../groovy/lang/psi/util/GrStringUtil.java | 6 +++--- .../refactoring/GroovyRefactoringUtil.java | 15 +++++++++++++++ .../ConvertConcatenationToGstringTest.java | 17 ++++++++++++----- .../convertConcatenationToGstring/Dot.groovy | 1 + .../Dot_after.groovy | 1 + 6 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 plugins/groovy/testdata/intentions/convertConcatenationToGstring/Dot.groovy create mode 100644 plugins/groovy/testdata/intentions/convertConcatenationToGstring/Dot_after.groovy diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/RemoveUnnecessarySemicolonsIntention.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/RemoveUnnecessarySemicolonsIntention.java index 3afe51a7405b..31b873ce5780 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/RemoveUnnecessarySemicolonsIntention.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/style/RemoveUnnecessarySemicolonsIntention.java @@ -37,6 +37,7 @@ import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase; import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory; import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement; import org.jetbrains.plugins.groovy.lang.psi.util.PsiUtil; +import org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringUtil; import java.util.ArrayList; @@ -159,22 +160,8 @@ public class RemoveUnnecessarySemicolonsIntention implements IntentionAction { final GrStatement[] statements = file.getStatements(); if (statements.length != 2) return false; - return checkEquality(prev, statements[0]) && checkEquality(next, statements[1]); - } - - private static boolean checkEquality(PsiElement l, PsiElement r) { - if (!l.getText().equals(r.getText())) return false; - if (l.getNode().getElementType() != r.getNode().getElementType()) return false; - - final PsiElement[] lChildren = l.getChildren(); - final PsiElement[] rChildren = r.getChildren(); - - if (lChildren.length != rChildren.length) return false; - - for (int i = 0; i < rChildren.length; i++) { - if (!checkEquality(lChildren[i], rChildren[i])) return false; - } - return true; + return GroovyRefactoringUtil.checkPsiElementsAreEqual(prev, statements[0]) && + GroovyRefactoringUtil.checkPsiElementsAreEqual(next, statements[1]); } @Nullable diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GrStringUtil.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GrStringUtil.java index f7bee66d167d..4a9779ffa51b 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GrStringUtil.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GrStringUtil.java @@ -2,7 +2,6 @@ package org.jetbrains.plugins.groovy.lang.psi.util; import com.intellij.lang.ASTNode; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.util.Comparing; import com.intellij.psi.PsiElement; import com.intellij.psi.impl.source.tree.LeafPsiElement; import org.jetbrains.annotations.NonNls; @@ -17,6 +16,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrRefere import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrString; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrStringInjection; +import org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringUtil; /** * @author Maxim.Medvedev @@ -313,7 +313,7 @@ public class GrStringUtil { final GroovyPsiElementFactory elementFactory = GroovyPsiElementFactory.getInstance(injected.getProject()); final GrExpression gString; try { - gString = elementFactory.createExpressionFromText("\"$" + injected.getText() + nextChar + '"'); + gString = elementFactory.createExpressionFromText("\"$" + injected.getText() + next.getText() + '"'); } catch (Exception e) { return false; @@ -327,7 +327,7 @@ public class GrStringUtil { if (!(refExprCopy instanceof GrReferenceExpression)) return false; final GrReferenceExpression refExpr = (GrReferenceExpression)injected; - return Comparing.equal(refExpr.getName(), ((GrReferenceExpression)refExprCopy).getName()); + return GroovyRefactoringUtil.checkPsiElementsAreEqual(refExpr, refExprCopy); } public static void removeUnnecessaryBracesInGString(GrString grString) { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/GroovyRefactoringUtil.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/GroovyRefactoringUtil.java index aa1ece9b1c31..e79950900934 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/GroovyRefactoringUtil.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/GroovyRefactoringUtil.java @@ -718,4 +718,19 @@ public abstract class GroovyRefactoringUtil { GrTypeArgumentList typeArgumentList = referenceElement.getTypeArgumentList(); return typeArgumentList != null && typeArgumentList.isDiamond(); } + + public static boolean checkPsiElementsAreEqual(PsiElement l, PsiElement r) { + if (!l.getText().equals(r.getText())) return false; + if (l.getNode().getElementType() != r.getNode().getElementType()) return false; + + final PsiElement[] lChildren = l.getChildren(); + final PsiElement[] rChildren = r.getChildren(); + + if (lChildren.length != rChildren.length) return false; + + for (int i = 0; i < rChildren.length; i++) { + if (!checkPsiElementsAreEqual(lChildren[i], rChildren[i])) return false; + } + return true; + } } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/ConvertConcatenationToGstringTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/ConvertConcatenationToGstringTest.java index 1b165ab2cae3..6823a76f6b94 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/ConvertConcatenationToGstringTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/ConvertConcatenationToGstringTest.java @@ -32,6 +32,9 @@ import org.jetbrains.plugins.groovy.util.TestUtils; * @author Maxim.Medvedev */ public class ConvertConcatenationToGstringTest extends GrIntentionTestCase { + + private static final String CONVERT_TO_GSTRING = "Convert to GString"; + @NotNull @Override protected LightProjectDescriptor getProjectDescriptor() { @@ -52,22 +55,26 @@ public class ConvertConcatenationToGstringTest extends GrIntentionTestCase { } public void testSimpleCase() throws Exception { - doTest("Convert to GString", true); + doTest(CONVERT_TO_GSTRING, true); } public void testVeryComplicatedCase() throws Exception { - doTest("Convert to GString", true); + doTest(CONVERT_TO_GSTRING, true); } public void testQuotes() throws Exception { - doTest("Convert to GString", true); + doTest(CONVERT_TO_GSTRING, true); } public void testQuotes2() throws Exception { - doTest("Convert to GString", true); + doTest(CONVERT_TO_GSTRING, true); } public void testQuotesInMultilineString() throws Exception { - doTest("Convert to GString", true); + doTest(CONVERT_TO_GSTRING, true); + } + + public void testDot() { + doTest(CONVERT_TO_GSTRING, true); } } diff --git a/plugins/groovy/testdata/intentions/convertConcatenationToGstring/Dot.groovy b/plugins/groovy/testdata/intentions/convertConcatenationToGstring/Dot.groovy new file mode 100644 index 000000000000..b40c523f0339 --- /dev/null +++ b/plugins/groovy/testdata/intentions/convertConcatenationToGstring/Dot.groovy @@ -0,0 +1 @@ +print test+".test" \ No newline at end of file diff --git a/plugins/groovy/testdata/intentions/convertConcatenationToGstring/Dot_after.groovy b/plugins/groovy/testdata/intentions/convertConcatenationToGstring/Dot_after.groovy new file mode 100644 index 000000000000..a8b09fdb3e6f --- /dev/null +++ b/plugins/groovy/testdata/intentions/convertConcatenationToGstring/Dot_after.groovy @@ -0,0 +1 @@ +print "${test}.test" \ No newline at end of file From 8cb72dd8ba01d1e777c9abca60294390ddb8cba0 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Sun, 18 Dec 2011 14:37:50 +0100 Subject: [PATCH 065/101] compilation fix after community/ultimate tests refactorings --- .../refactoring/FixMethodJavadocTest.java | 58 +++++++++++++++++ .../refactoring/RenamePackageTest.java | 63 +++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 java/java-tests/testSrc/com/intellij/refactoring/FixMethodJavadocTest.java create mode 100644 java/java-tests/testSrc/com/intellij/refactoring/RenamePackageTest.java diff --git a/java/java-tests/testSrc/com/intellij/refactoring/FixMethodJavadocTest.java b/java/java-tests/testSrc/com/intellij/refactoring/FixMethodJavadocTest.java new file mode 100644 index 000000000000..0a8937f7bcb0 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/refactoring/FixMethodJavadocTest.java @@ -0,0 +1,58 @@ +package com.intellij.refactoring; + +import com.intellij.FileSetTestCase; +import com.intellij.psi.*; +import com.intellij.refactoring.util.RefactoringUtil; +import com.intellij.util.containers.HashSet; +import junit.framework.Test; + +import java.io.File; +import java.net.URL; +import java.util.Arrays; +import java.util.Set; + +/** + * @author dsl + */ +public abstract class FixMethodJavadocTest extends FileSetTestCase { + FixMethodJavadocTest() { + super(findPath()); + } + + private static String findPath() { + final URL res = FixMethodJavadocTest.class.getResource("/" + FixMethodJavadocTest.class.getName().replace('.', '/') + ".class"); + File f = new File(res.getFile()); + String result = f.getParent() + File.separatorChar + "methodJavaDocData"; + result = result.replaceAll("classes", ""); + return result; + } + + @Override + public String transform(String testName, String[] data) throws Exception { + final PsiManager manager = PsiManager.getInstance(myProject); + final PsiElementFactory factory = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory(); + final PsiMethod method = factory.createMethodFromText(data[0], null); + final HashSet newParameters = new HashSet(); + if (data.length == 2) { + final String[] strings = data[1].split("\\s+"); + collectNewParameters(method, strings, newParameters); + } + RefactoringUtil.fixJavadocsForParams(method, newParameters); + return method.getText(); + } + + private void collectNewParameters(PsiMethod method, String[] names, Set newParameters) { + Set newNames = new HashSet(Arrays.asList(names)); + final PsiParameter[] parameters = method.getParameterList().getParameters(); + for (int i = 0; i < parameters.length; i++) { + PsiParameter parameter = parameters[i]; + if (newNames.contains(parameter.getName())) { + newParameters.add(parameter); + } + } + } + + public static Test suite() { + return new FixMethodJavadocTest(){}; + } +} diff --git a/java/java-tests/testSrc/com/intellij/refactoring/RenamePackageTest.java b/java/java-tests/testSrc/com/intellij/refactoring/RenamePackageTest.java new file mode 100644 index 000000000000..c3782af2980e --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/refactoring/RenamePackageTest.java @@ -0,0 +1,63 @@ +package com.intellij.refactoring; + +import com.intellij.codeInsight.CodeInsightTestCase; +import com.intellij.openapi.application.ex.PathManagerEx; +import com.intellij.openapi.fileEditor.FileDocumentManager; +import com.intellij.openapi.projectRoots.impl.JavaSdkImpl; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.JavaPsiFacade; +import com.intellij.psi.PsiPackage; +import com.intellij.refactoring.rename.RenameProcessor; +import com.intellij.testFramework.IdeaTestUtil; +import com.intellij.testFramework.PsiTestUtil; + +import java.io.File; + +public class RenamePackageTest extends CodeInsightTestCase { + public void testJspImport() throws Exception { + doTest("jspImport", "pack1", "pack2"); + } + + public void testNonJava() throws Exception { + doTest("nonJava", "com.foo", "fooNew"); + } + + public void testInBrokenXml() throws Exception { + doTest("inBrokenXml", "somepckg", "somepckg1"); + } + + + public void testJsp() throws Exception { + doTest("jsp", "pack1", "pack2"); + } + + private void doTest(String testName, String packageName, String newPackageName) throws Exception { + String root = PathManagerEx.getTestDataPath()+ "/refactoring/renamePackage/" + testName; + + String rootBefore = root + "/before"; + PsiTestUtil.removeAllRoots(myModule, JavaSdkImpl.getMockJdk17()); + VirtualFile rootDir = PsiTestUtil.createTestProjectStructure(myProject, myModule, rootBefore, myFilesToDelete); + + performAction(packageName, newPackageName); + + String rootAfter = root + "/after"; + VirtualFile rootDir2 = LocalFileSystem.getInstance().findFileByPath(rootAfter.replace(File.separatorChar, '/')); + IdeaTestUtil.assertDirectoriesEqual(rootDir2, rootDir, IdeaTestUtil.CVS_FILE_FILTER); + } + + private void performAction(String packageName, String newPackageName) throws Exception { + PsiPackage aPackage = JavaPsiFacade.getInstance(myPsiManager.getProject()).findPackage(packageName); + assertNotNull("Package " + packageName + " not found", aPackage); + + //PsiDirectory dir = aPackage.getDirectories()[0]; + //it is now impossible to rename dir without renaming corresponding package via rename processor - move processor would be used instead + new RenameProcessor(myProject, aPackage, newPackageName, true, true).run(); + FileDocumentManager.getInstance().saveAllDocuments(); + } + + @Override + protected boolean isRunInWriteAction() { + return false; + } +} From dcf5dfffb76b90eaeaa69374b12a7acf447b1332 Mon Sep 17 00:00:00 2001 From: "kirill.safonov" Date: Sun, 18 Dec 2011 18:53:39 +0400 Subject: [PATCH 066/101] IDE errors dialog: show label if report will include attachment(s) (IDEA-78964) --- .../DropAnErrorWithAttachmentsAction.java | 42 ++++++++++++++++++ .../intellij/diagnostic/IdeErrorsDialog.java | 44 ++++++++++++++++++- .../errordialog/AttachmentsTabForm.java | 19 ++++++++ .../errordialog/IdeErrorsDialog.form | 34 +++++++++++--- .../src/messages/DiagnosticBundle.properties | 2 + .../src/idea/PlatformActions.xml | 1 + 6 files changed, 134 insertions(+), 8 deletions(-) create mode 100644 platform/platform-impl/src/com/intellij/diagnostic/DropAnErrorWithAttachmentsAction.java diff --git a/platform/platform-impl/src/com/intellij/diagnostic/DropAnErrorWithAttachmentsAction.java b/platform/platform-impl/src/com/intellij/diagnostic/DropAnErrorWithAttachmentsAction.java new file mode 100644 index 000000000000..f8b18e7df375 --- /dev/null +++ b/platform/platform-impl/src/com/intellij/diagnostic/DropAnErrorWithAttachmentsAction.java @@ -0,0 +1,42 @@ +/* + * Copyright 2000-2011 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.intellij.diagnostic; + +import com.intellij.diagnostic.errordialog.Attachment; +import com.intellij.openapi.actionSystem.AnAction; +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.diagnostic.Logger; + +import java.awt.event.InputEvent; + +@SuppressWarnings({"HardCodedStringLiteral"}) +public class DropAnErrorWithAttachmentsAction extends AnAction { + public DropAnErrorWithAttachmentsAction() { + super("Drop an error with attachments", "Hold down SHIFT for multiple attachments", null); + } + + public void actionPerformed(AnActionEvent e) { + final boolean multipleAttachments = (e.getModifiers() & InputEvent.SHIFT_MASK) != 0; + Attachment[] attachments; + if (multipleAttachments) { + attachments = new Attachment[]{new Attachment("first.txt", "first content"), new Attachment("second.txt", "second content")}; + } + else { + attachments = new Attachment[]{new Attachment("attachment.txt", "content")}; + } + Logger.getInstance("test (with attachments)").error(LogMessageEx.createEvent("test", "test details", attachments)); + } +} diff --git a/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java b/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java index 88a50c44c538..5fd3dd4e8420 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java @@ -38,6 +38,7 @@ import com.intellij.ui.HyperlinkLabel; import com.intellij.ui.IdeBorderFactory; import com.intellij.util.Consumer; import com.intellij.util.Function; +import com.intellij.util.containers.ContainerUtil; import com.intellij.util.text.DateFormatUtil; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; @@ -58,7 +59,7 @@ import java.util.List; public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListener, TypeSafeDataProvider { private static final Logger LOG = Logger.getInstance(IdeErrorsDialog.class.getName()); - public static final boolean INTERNAL_MODE = ApplicationManagerEx.getApplicationEx().isInternal(); + public static final boolean INTERNAL_MODE = false; //ApplicationManagerEx.getApplicationEx().isInternal(); @NonNls private static final String ACTIVE_TAB_OPTION = IdeErrorsDialog.class.getName() + "activeTab"; public static DataKey CURRENT_TRACE_KEY = DataKey.create("current_stack_trace_key"); public static final int COMPONENTS_WIDTH = 670; @@ -74,6 +75,8 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene private JPanel myCredentialsPanel; private HyperlinkLabel myCredentialsLabel; private JPanel myForeignPluginWarningPanel; + private JPanel myAttachmentWarningPanel; + private HyperlinkLabel myAttachmentWarningLabel; private int myIndex = 0; private final List> myMergedMessages = new ArrayList>(); @@ -246,6 +249,11 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene myTabs.addTab(DiagnosticBundle.message("error.details.tab.title"), myDetailsTabForm.getContentPane()); myAttachmentsTabForm = new AttachmentsTabForm(); + myAttachmentsTabForm.addInclusionListener(new ChangeListener() { + public void stateChanged(final ChangeEvent e) { + updateAttachmentWarning(getSelectedMessage()); + } + }); int activeTabIndex = Integer.parseInt(PropertiesComponent.getInstance().getValue(ACTIVE_TAB_OPTION, "0")); if (activeTabIndex >= myTabs.getTabCount() || activeTabIndex < 0) { @@ -286,6 +294,16 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene } }); + myAttachmentWarningLabel.setIcon(UIUtil.getBalloonWarningIcon()); + myAttachmentWarningLabel.addHyperlinkListener(new HyperlinkListener() { + public void hyperlinkUpdate(final HyperlinkEvent e) { + if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { + myTabs.setSelectedIndex(myTabs.indexOfComponent(myAttachmentsTabForm.getContentPane())); + myAttachmentsTabForm.selectFirstIncludedAttachment(); + } + } + }); + return myContentPane; } @@ -359,6 +377,7 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene final AbstractMessage message = getSelectedMessage(); updateInfoLabel(message); updateCredentialsPane(message); + updateAttachmentWarning(message); myDisableLink.setVisible(canDisablePlugin(message)); updateForeignPluginLabel(message != null ? message : null); updateTabs(); @@ -370,6 +389,29 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene } } + private void updateAttachmentWarning(final AbstractMessage message) { + final List includedAttachments; + if (message instanceof LogMessageEx && + !(includedAttachments = ContainerUtil.filter(((LogMessageEx)message).getAttachments(), new Condition() { + public boolean value(final Attachment attachment) { + return attachment.isIncluded(); + } + })).isEmpty()) { + myAttachmentWarningPanel.setVisible(true); + if (includedAttachments.size() == 1) { + myAttachmentWarningLabel.setHtmlText( + DiagnosticBundle.message("diagnostic.error.report.include.attachment.warning", includedAttachments.get(0).getName())); + } + else { + myAttachmentWarningLabel.setHtmlText( + DiagnosticBundle.message("diagnostic.error.report.include.attachments.warning", includedAttachments.size())); + } + } + else { + myAttachmentWarningPanel.setVisible(false); + } + } + private static boolean canDisablePlugin(AbstractMessage message) { if (message == null) { return false; diff --git a/platform/platform-impl/src/com/intellij/diagnostic/errordialog/AttachmentsTabForm.java b/platform/platform-impl/src/com/intellij/diagnostic/errordialog/AttachmentsTabForm.java index 26f602a1ec72..312f8ea67c93 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/errordialog/AttachmentsTabForm.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/errordialog/AttachmentsTabForm.java @@ -4,10 +4,13 @@ import com.intellij.diagnostic.DiagnosticBundle; import com.intellij.ide.plugins.InstalledPluginsTableModel; import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.table.TableView; +import com.intellij.util.EventDispatcher; import com.intellij.util.ui.ColumnInfo; import com.intellij.util.ui.ListTableModel; import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import java.awt.event.ActionEvent; @@ -23,6 +26,7 @@ public class AttachmentsTabForm { private JPanel myContentPane; private TableView myTable; private LabeledTextComponent myFileTextArea; + private final EventDispatcher myInclusionEventDispatcher = EventDispatcher.create(ChangeListener.class); private final ColumnInfo ENABLED_COLUMN = new ColumnInfo(DiagnosticBundle.message("error.dialog.attachment.include.column.title")) { @@ -49,6 +53,7 @@ public class AttachmentsTabForm { @Override public void setValue(Attachment attachment, Boolean value) { attachment.setIncluded(value); + myInclusionEventDispatcher.getMulticaster().stateChanged(new ChangeEvent(attachment)); } }; @@ -110,4 +115,18 @@ public class AttachmentsTabForm { public JPanel getContentPane() { return myContentPane; } + + public void addInclusionListener(ChangeListener listener) { + myInclusionEventDispatcher.addListener(listener); + } + + public void selectFirstIncludedAttachment() { + final List items = ((ListTableModel)myTable.getModel()).getItems(); + for (Object item : items) { + if (((Attachment)item).isIncluded()) { + myTable.setSelection(Collections.singleton((Attachment)item)); + break; + } + } + } } diff --git a/platform/platform-impl/src/com/intellij/diagnostic/errordialog/IdeErrorsDialog.form b/platform/platform-impl/src/com/intellij/diagnostic/errordialog/IdeErrorsDialog.form index f67b8c4a8c24..bda913ce86bd 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/errordialog/IdeErrorsDialog.form +++ b/platform/platform-impl/src/com/intellij/diagnostic/errordialog/IdeErrorsDialog.form @@ -90,17 +90,37 @@ - + - - - + - - + + - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platform/platform-resources-en/src/messages/DiagnosticBundle.properties b/platform/platform-resources-en/src/messages/DiagnosticBundle.properties index 60c87bb1406c..661d6dafcb3a 100644 --- a/platform/platform-resources-en/src/messages/DiagnosticBundle.properties +++ b/platform/platform-resources-en/src/messages/DiagnosticBundle.properties @@ -90,3 +90,5 @@ error.dialog.attachment.path.column.title=Path error.dialog.attachment.include.column.title=Include error.attachments.tab.title=Attachments error.dialog.filecontent.title=File content +diagnostic.error.report.include.attachment.warning=Report will include attachment: ''{0}''. +diagnostic.error.report.include.attachments.warning=Report will include {0} attachments. diff --git a/platform/platform-resources/src/idea/PlatformActions.xml b/platform/platform-resources/src/idea/PlatformActions.xml index 679fb01392fd..8f16cfe5b38d 100644 --- a/platform/platform-resources/src/idea/PlatformActions.xml +++ b/platform/platform-resources/src/idea/PlatformActions.xml @@ -485,6 +485,7 @@ + From 659f9e81b10959cc45da815558796bb5e4d24e4e Mon Sep 17 00:00:00 2001 From: "kirill.safonov" Date: Sun, 18 Dec 2011 18:57:51 +0400 Subject: [PATCH 067/101] restore accidental change --- .../src/com/intellij/diagnostic/IdeErrorsDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java b/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java index 5fd3dd4e8420..aa2ecac599d8 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java @@ -59,7 +59,7 @@ import java.util.List; public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListener, TypeSafeDataProvider { private static final Logger LOG = Logger.getInstance(IdeErrorsDialog.class.getName()); - public static final boolean INTERNAL_MODE = false; //ApplicationManagerEx.getApplicationEx().isInternal(); + public static final boolean INTERNAL_MODE = ApplicationManagerEx.getApplicationEx().isInternal(); @NonNls private static final String ACTIVE_TAB_OPTION = IdeErrorsDialog.class.getName() + "activeTab"; public static DataKey CURRENT_TRACE_KEY = DataKey.create("current_stack_trace_key"); public static final int COMPONENTS_WIDTH = 670; From 86f87f5476da910d44fc313644c1ef61187e8540 Mon Sep 17 00:00:00 2001 From: "kirill.safonov" Date: Sun, 18 Dec 2011 21:43:55 +0400 Subject: [PATCH 068/101] Choose action icon dialog cosmetics (IDEA-79031) --- .../CustomizableActionsPanel.java | 50 +++++++++++++------ .../src/messages/IdeBundle.properties | 8 +-- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizableActionsPanel.java b/platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizableActionsPanel.java index 3c8040fcf5fb..74061c3e6da4 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizableActionsPanel.java +++ b/platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizableActionsPanel.java @@ -34,6 +34,7 @@ import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.TextFieldWithBrowseButton; import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.Pair; +import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; @@ -522,13 +523,19 @@ public class CustomizableActionsPanel { node.getUserObject() instanceof Pair ? ((Pair)node.getUserObject()).first : null); } - protected void doSetIcon(DefaultMutableTreeNode node, String path) { + protected boolean doSetIcon(DefaultMutableTreeNode node, @Nullable String path, Component component) { + if (StringUtil.isNotEmpty(path) && !new File(path).isFile()) { + Messages + .showErrorDialog(component, IdeBundle.message("error.file.not.found.message", path), IdeBundle.message("title.choose.action.icon")); + return false; + } + String actionId = getActionId(node); - if (actionId == null) return; + if (actionId == null) return false; final AnAction action = ActionManager.getInstance().getAction(actionId); if (action != null && action.getTemplatePresentation() != null) { - if (path != null && path.length() > 0) { + if (StringUtil.isNotEmpty(path)) { Image image = null; try { image = ImageLoader.loadFromStream(VfsUtil.convertToURL(VfsUtil.pathToUrl(path.replace(File.separatorChar, @@ -540,8 +547,8 @@ public class CustomizableActionsPanel { Icon icon = new File(path).exists() ? IconLoader.getIcon(image) : null; if (icon != null) { if (icon.getIconWidth() > EMPTY_ICON.getIconWidth() || icon.getIconHeight() > EMPTY_ICON.getIconHeight()) { - Messages.showErrorDialog(myActionsTree, IdeBundle.message("custom.icon.validation.message"), IdeBundle.message("custom.icon.validation.title")); - return; + Messages.showErrorDialog(component, IdeBundle.message("custom.icon.validation.message"), IdeBundle.message("title.choose.action.icon")); + return false; } node.setUserObject(Pair.create(actionId, icon)); mySelectedSchema.addIconCustomization(actionId, path); @@ -556,13 +563,15 @@ public class CustomizableActionsPanel { node.setUserObject(nodeOnToolbar.getUserObject()); } } + return true; } + return false; } private static TextFieldWithBrowseButton createBrowseField(){ TextFieldWithBrowseButton textField = new TextFieldWithBrowseButton(); - textField.setPreferredSize(new Dimension(150, textField.getPreferredSize().height)); - textField.setMinimumSize(new Dimension(150, textField.getPreferredSize().height)); + textField.setPreferredSize(new Dimension(200, textField.getPreferredSize().height)); + textField.setMinimumSize(new Dimension(200, textField.getPreferredSize().height)); final FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false) { public boolean isFileSelectable(VirtualFile file) { //noinspection HardCodedStringLiteral @@ -581,15 +590,25 @@ public class CustomizableActionsPanel { protected EditIconDialog(DefaultMutableTreeNode node) { super(false); - setTitle(IdeBundle.message("title.choose.action.icon.path")); + setTitle(IdeBundle.message("title.choose.action.icon")); init(); myNode = node; final String actionId = getActionId(node); if (actionId != null) { - myTextField.setText(mySelectedSchema.getIconPath(actionId)); + final String iconPath = mySelectedSchema.getIconPath(actionId); + myTextField.setText(FileUtil.toSystemDependentName(iconPath)); } } + @Override + public JComponent getPreferredFocusedComponent() { + return myTextField.getChildComponent(); + } + + protected String getDimensionServiceKey() { + return getClass().getName(); + } + protected JComponent createCenterPanel() { myTextField = createBrowseField(); JPanel northPanel = new JPanel(new BorderLayout()); @@ -599,11 +618,9 @@ public class CustomizableActionsPanel { protected void doOKAction() { if (myNode != null) { - if (myTextField.getText().length() > 0 && !new File(myTextField.getText()).exists()){ - Messages.showErrorDialog(myPanel, IdeBundle.message("error.file.not.found.message", myTextField.getText())); + if (!doSetIcon(myNode, myTextField.getText(), getContentPane())) { return; } - doSetIcon(myNode, myTextField.getText()); final Object userObject = myNode.getUserObject(); if (userObject instanceof Pair) { String actionId = (String)((Pair)userObject).first; @@ -659,7 +676,7 @@ public class CustomizableActionsPanel { public void actionPerformed(ActionEvent e) { final TreePath selectionPath = myTree.getSelectionPath(); if (selectionPath != null) { - doSetIcon((DefaultMutableTreeNode)selectionPath.getLastPathComponent(), myTextField.getText()); + doSetIcon((DefaultMutableTreeNode)selectionPath.getLastPathComponent(), myTextField.getText(), getContentPane()); myTree.repaint(); } } @@ -672,7 +689,9 @@ public class CustomizableActionsPanel { }); JPanel northPanel = new JPanel(new BorderLayout()); northPanel.add(myTextField, BorderLayout.CENTER); - northPanel.add(new JLabel(IdeBundle.message("label.icon.path")), BorderLayout.WEST); + final JLabel label = new JLabel(IdeBundle.message("label.icon.path")); + label.setLabelFor(myTextField.getChildComponent()); + northPanel.add(label, BorderLayout.WEST); northPanel.add(mySetIconButton, BorderLayout.EAST); northPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); JPanel panel = new JPanel(new BorderLayout()); @@ -687,7 +706,8 @@ public class CustomizableActionsPanel { final DefaultMutableTreeNode node = (DefaultMutableTreeNode)selectionPath.getLastPathComponent(); final String actionId = getActionId(node); if (actionId != null) { - myTextField.setText(mySelectedSchema.getIconPath(actionId)); + final String iconPath = mySelectedSchema.getIconPath(actionId); + myTextField.setText(FileUtil.toSystemDependentName(iconPath)); } } } diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index b566ce38f0bb..e58fb3eac2e1 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -640,12 +640,12 @@ error.adding.action.without.icon.to.toolbar=You are adding an action without ico title.unable.to.add.action.without.icon.to.toolbar=Unable to add action without icon to the toolbar error.please.specify.new.name.for.schema=Please, specify new name for scheme ''{0}''. title.browse.icon=Browse Icon -prompt.browse.icon.for.selected.action=Browse icon for selected action -title.choose.action.icon.path=Choose Action Icon Path +prompt.browse.icon.for.selected.action=Browse icon for selected action (*.png) +title.choose.action.icon=Choose Action Icon action.choose.actions.to.add=Choose Actions To Add button.set.icon=&Set icon -label.icon.path=Icon Path: -button.edit.action.icon=Edit Action &Icon +label.icon.path=&Icon Path: +button.edit.action.icon=Edit Action &Icon... button.add.separator=Add &Separator button.move.up.u=Move &Up button.move.down.d=Move &Down From a7ab11a90631bd5fff436625a0cd1b38006ba1e6 Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sun, 18 Dec 2011 12:41:38 +0400 Subject: [PATCH 069/101] slash at the end of dollar-slashy string --- .../groovy/lang/lexer/_GroovyLexer.java | 2864 ++++++++--------- .../plugins/groovy/lang/lexer/groovy.flex | 2 +- .../lang/parser/ExpressionsParsingTest.groovy | 1 + .../expressions/regex/dollarSlashy5.test | 15 + 4 files changed, 1449 insertions(+), 1433 deletions(-) create mode 100644 plugins/groovy/testdata/parsing/groovy/expressions/regex/dollarSlashy5.test diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/_GroovyLexer.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/_GroovyLexer.java index 7debd61611c6..79cce29ae69a 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/_GroovyLexer.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/_GroovyLexer.java @@ -1,4 +1,4 @@ -/* The following code was generated by JFlex 1.4.3 on 12/11/11 11:16 AM */ +/* The following code was generated by JFlex 1.4.3 on 12/18/11 11:36 AM */ /* * Copyright 2000-2010 JetBrains s.r.o. @@ -27,7 +27,7 @@ import java.util.Stack; /** * This class is a scanner generated by * JFlex 1.4.3 - * on 12/11/11 11:16 AM from the specification file + * on 12/18/11 11:36 AM from the specification file * C:/Home/IDEA/tools/lexer/../../community/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex */ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { @@ -556,815 +556,815 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { "\11\0\1\u0150\1\0\14\u0150\2\0\1\u0150\1\0\2\u0150"+ "\1\0\2\u0150\1\0\1\u0150\1\0\1\u0150\2\0\17\u0150"+ "\34\0\16\216\2\0\7\216\1\0\1\216\1\0\1\216"+ - "\2\0\17\216\23\0\5\220\1\u0151\34\220\1\u0152\107\220"+ - "\1\u0153\45\220\11\u0154\1\0\1\u0154\14\0\2\u0154\1\0"+ - "\1\u0154\2\0\1\u0154\2\0\1\u0154\1\0\1\u0154\1\0"+ - "\2\u0154\20\0\22\u0154\11\0\1\u0155\1\0\14\u0155\2\0"+ - "\1\u0155\1\0\2\u0155\1\0\2\u0155\1\0\1\u0155\1\0"+ - "\1\u0155\2\0\17\u0155\24\0\3\226\1\u0156\104\0\2\226"+ - "\105\0\114\235\1\0\35\235\1\0\2\235\1\u0157\42\235"+ - "\45\0\1\u0158\43\0\2\34\107\0\1\35\105\0\1\243"+ - "\2\0\105\243\6\u0159\1\u015a\101\u0159\70\0\1\u015b\17\0"+ - "\1\251\2\0\105\251\70\0\1\u015c\31\0\1\u015d\14\0"+ - "\2\u015e\1\0\1\u015d\2\0\1\u015d\64\0\1\44\16\0"+ - "\1\261\1\44\2\0\1\44\64\0\1\u015f\17\0\1\u015f"+ - "\2\0\1\u015f\63\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\10\43\1\u0160\6\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\11\43\1\u0161\5\43\34\0\6\43"+ - "\1\u0162\7\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\6\43"+ - "\1\u0163\10\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\11\43\1\u0164\5\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\1\u0165\16\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\4\43\1\u0166\1\u0167\11\43"+ - "\34\0\4\43\1\u0168\11\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\2\43"+ - "\1\u0169\2\0\17\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\4\43\1\u016a\12\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\5\43\1\u016b\11\43\34\0"+ - "\16\43\2\0\7\43\1\0\2\43\1\u016c\2\0\17\43"+ - "\55\0\1\u016d\2\0\1\u016d\63\0\2\u016e\2\0\2\u016e"+ - "\4\0\4\u016e\3\0\4\u016e\11\0\2\u016e\50\0\14\43"+ - "\1\u016f\1\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\10\43"+ - "\1\u0170\6\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\5\43\1\u0171\11\43\63\0\1\u0172\36\0\1\u0173"+ - "\10\0\1\315\2\0\1\315\1\316\37\315\1\u0174\46\315"+ - "\1\u0175\1\u0176\103\315\44\0\1\u0177\43\0\1\320\2\0"+ - "\1\320\1\321\35\320\1\0\2\320\1\u0178\45\320\1\u0179"+ - "\1\u017a\103\320\45\0\1\u017b\53\0\16\43\2\0\2\43"+ - "\1\u017c\4\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\2\43\1\u017d\14\43"+ - "\34\0\10\43\1\u017e\5\43\2\0\7\43\1\0\3\43"+ - "\2\0\10\43\1\u017f\6\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\4\43\1\u0180\12\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\4\43\1\u0181\12\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\1\43"+ - "\1\u0182\15\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\4\43\1\u0183\1\u0184\11\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\11\43\1\u0185\5\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\1\43\1\u0186"+ - "\15\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\1\u0187\16\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\1\43\1\u0188\4\43\1\u0189\10\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\11\43\1\u018a\5\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\10\43"+ - "\1\u018b\6\43\34\0\10\43\1\u018c\5\43\2\0\7\43"+ + "\2\0\17\216\23\0\5\220\1\u0151\34\220\1\u0152\52\220"+ + "\1\0\34\220\1\u0153\45\220\11\u0154\1\0\1\u0154\14\0"+ + "\2\u0154\1\0\1\u0154\2\0\1\u0154\2\0\1\u0154\1\0"+ + "\1\u0154\1\0\2\u0154\20\0\22\u0154\11\0\1\u0155\1\0"+ + "\14\u0155\2\0\1\u0155\1\0\2\u0155\1\0\2\u0155\1\0"+ + "\1\u0155\1\0\1\u0155\2\0\17\u0155\24\0\3\226\1\u0156"+ + "\104\0\2\226\105\0\114\235\1\0\35\235\1\0\2\235"+ + "\1\u0157\42\235\45\0\1\u0158\43\0\2\34\107\0\1\35"+ + "\105\0\1\243\2\0\105\243\6\u0159\1\u015a\101\u0159\70\0"+ + "\1\u015b\17\0\1\251\2\0\105\251\70\0\1\u015c\31\0"+ + "\1\u015d\14\0\2\u015e\1\0\1\u015d\2\0\1\u015d\64\0"+ + "\1\44\16\0\1\261\1\44\2\0\1\44\64\0\1\u015f"+ + "\17\0\1\u015f\2\0\1\u015f\63\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\10\43\1\u0160\6\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\11\43\1\u0161\5\43"+ + "\34\0\6\43\1\u0162\7\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\6\43\1\u0163\10\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\11\43\1\u0164\5\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\1\u0165\16\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\4\43\1\u0166"+ + "\1\u0167\11\43\34\0\4\43\1\u0168\11\43\2\0\7\43"+ "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ - "\1\0\2\43\1\u018d\2\0\1\43\1\u018e\11\43\1\u018f"+ - "\3\43\34\0\10\43\1\u0190\5\43\2\0\7\43\1\0"+ - "\3\43\2\0\6\43\1\u0191\10\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\5\43\1\u0192\11\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\16\43\1\u0193"+ - "\34\0\6\43\1\u0194\7\43\2\0\7\43\1\0\3\43"+ + "\1\0\2\43\1\u0169\2\0\17\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\4\43\1\u016a\12\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u016b"+ + "\11\43\34\0\16\43\2\0\7\43\1\0\2\43\1\u016c"+ + "\2\0\17\43\55\0\1\u016d\2\0\1\u016d\63\0\2\u016e"+ + "\2\0\2\u016e\4\0\4\u016e\3\0\4\u016e\11\0\2\u016e"+ + "\50\0\14\43\1\u016f\1\43\2\0\7\43\1\0\3\43"+ "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\5\43\1\u0195\11\43\34\0\6\43\1\u0196\1\43"+ - "\1\u0197\5\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\10\43\1\u0198\5\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\113\0\1\u0199\10\0\1\u019a\106\0\1\u019b"+ - "\77\0\1\u019c\107\0\1\u019d\7\0\1\u019e\20\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\10\117"+ - "\1\u019f\6\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\11\117\1\u01a0\5\117\34\0\6\117"+ - "\1\u01a1\7\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\10\43\1\u0170\6\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\5\43\1\u0171\11\43\63\0\1\u0172"+ + "\36\0\1\u0173\10\0\1\315\2\0\1\315\1\316\37\315"+ + "\1\u0174\46\315\1\u0175\1\u0176\103\315\44\0\1\u0177\43\0"+ + "\1\320\2\0\1\320\1\321\35\320\1\0\2\320\1\u0178"+ + "\45\320\1\u0179\1\u017a\103\320\45\0\1\u017b\53\0\16\43"+ + "\2\0\2\43\1\u017c\4\43\1\0\3\43\2\0\17\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\2\43"+ + "\1\u017d\14\43\34\0\10\43\1\u017e\5\43\2\0\7\43"+ + "\1\0\3\43\2\0\10\43\1\u017f\6\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\4\43\1\u0180\12\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\4\43"+ + "\1\u0181\12\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\1\43\1\u0182\15\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\4\43\1\u0183\1\u0184\11\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\11\43\1\u0185"+ + "\5\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\1\43\1\u0186\15\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\1\u0187\16\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\1\43\1\u0188\4\43\1\u0189\10\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\11\43"+ + "\1\u018a\5\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\10\43\1\u018b\6\43\34\0\10\43\1\u018c\5\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ + "\2\0\7\43\1\0\2\43\1\u018d\2\0\1\43\1\u018e"+ + "\11\43\1\u018f\3\43\34\0\10\43\1\u0190\5\43\2\0"+ + "\7\43\1\0\3\43\2\0\6\43\1\u0191\10\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u0192"+ + "\11\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\16\43\1\u0193\34\0\6\43\1\u0194\7\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\5\43\1\u0195\11\43\34\0\6\43"+ + "\1\u0196\1\43\1\u0197\5\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\10\43\1\u0198\5\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\113\0\1\u0199\10\0\1\u019a"+ + "\106\0\1\u019b\77\0\1\u019c\107\0\1\u019d\7\0\1\u019e"+ + "\20\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\10\117\1\u019f\6\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\11\117\1\u01a0\5\117"+ + "\34\0\6\117\1\u01a1\7\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\6\117\1\u01a2\10\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\11\117\1\u01a3\5\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\1\u01a4\16\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\4\117\1\u01a5\1\u01a6\11\117\34\0\4\117\1\u01a7\11\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\u01a8"+ "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\6\117\1\u01a2\10\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\11\117"+ - "\1\u01a3\5\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\1\u01a4\16\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\4\117\1\u01a5"+ - "\1\u01a6\11\117\34\0\4\117\1\u01a7\11\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\u01a8\2\0\17\117"+ - "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\4\117\1\u01a9\12\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\5\117\1\u01aa\11\117"+ - "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\u01ab"+ - "\2\0\17\117\34\0\14\117\1\u01ac\1\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\10\117"+ - "\1\u01ad\6\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\5\117\1\u01ae\11\117\34\0\16\117"+ - "\2\0\2\117\1\u01af\4\117\1\0\1\117\1\0\1\117"+ - "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\2\117\1\u01b0\14\117\34\0\10\117"+ - "\1\u01b1\5\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\10\117\1\u01b2\6\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\4\117\1\u01b3\12\117"+ - "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\4\117\1\u01b4\12\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\1\117\1\u01b5\15\117"+ - "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\4\117\1\u01b6\1\u01b7\11\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u01b8"+ - "\5\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\1\117\1\u01b9\15\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\1\u01ba\16\117"+ - "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\1\117\1\u01bb\4\117\1\u01bc\10\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\11\117"+ - "\1\u01bd\5\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\10\117\1\u01be\6\117\34\0\10\117"+ - "\1\u01bf\5\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\u01c0\2\0\1\117\1\u01c1\11\117\1\u01c2\3\117"+ - "\34\0\10\117\1\u01c3\5\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\6\117\1\u01c4\10\117\34\0\16\117"+ + "\1\0\1\117\2\0\4\117\1\u01a9\12\117\34\0\16\117"+ "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\5\117"+ - "\1\u01c5\11\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\16\117\1\u01c6\34\0\6\117\1\u01c7"+ - "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\5\117\1\u01c8\11\117\34\0\6\117\1\u01c9"+ - "\1\117\1\u01ca\5\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\10\117\1\u01cb\5\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\10\141\1\u01cc\6\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\11\141\1\u01cd\5\141\34\0"+ - "\6\141\1\u01ce\7\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\6\141\1\u01cf\10\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\11\141\1\u01d0\5\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\1\u01d1\16\141\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\4\141"+ - "\1\u01d2\1\u01d3\11\141\34\0\4\141\1\u01d4\11\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\u01d5\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\4\141\1\u01d6\12\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u01d7"+ - "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\u01d8\2\0\17\141\34\0\14\141\1\u01d9\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\10\141\1\u01da\6\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\5\141\1\u01db\11\141\34\0"+ - "\16\141\2\0\2\141\1\u01dc\4\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\2\141\1\u01dd\14\141\34\0"+ - "\10\141\1\u01de\5\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\10\141\1\u01df\6\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\4\141\1\u01e0"+ - "\12\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\4\141\1\u01e1\12\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u01e2"+ - "\15\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\4\141\1\u01e3\1\u01e4\11\141\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\11\141"+ - "\1\u01e5\5\141\34\0\16\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\1\141\1\u01e6\15\141\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\1\u01e7"+ - "\16\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\1\141\1\u01e8\4\141\1\u01e9\10\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\11\141\1\u01ea\5\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\10\141\1\u01eb\6\141\34\0"+ - "\10\141\1\u01ec\5\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\u01ed\2\0\1\141\1\u01ee\11\141\1\u01ef"+ - "\3\141\34\0\10\141\1\u01f0\5\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\6\141\1\u01f1\10\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\5\141\1\u01f2\11\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\16\141\1\u01f3\34\0\6\141"+ - "\1\u01f4\7\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\5\141\1\u01f5\11\141\34\0\6\141"+ - "\1\u01f6\1\141\1\u01f7\5\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\10\141\1\u01f8\5\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\24\0\2\163\105\0\3\162\1\u0144\1\u01f9\35\162\1\0"+ - "\2\162\1\0\43\162\1\u01fa\1\u01fb\1\162\1\164\35\162"+ - "\1\0\2\162\1\0\42\162\4\167\1\0\35\167\1\0"+ - "\2\167\1\u01fc\46\167\1\0\35\167\1\0\2\167\1\u01fd"+ - "\42\167\11\0\16\u0148\2\0\7\u0148\1\0\1\u0148\1\0"+ - "\1\u0148\2\0\17\u0148\34\0\16\u0149\2\0\7\u0149\1\0"+ - "\1\u0149\1\0\1\u0149\2\0\17\u0149\24\0\2\176\107\0"+ - "\1\202\105\0\4\u01fe\1\u01ff\1\u014f\3\u01fe\1\210\1\u01fe"+ - "\14\210\2\u01fe\1\210\1\u01fe\2\210\1\u01fe\2\210\1\u01fe"+ - "\1\210\1\u0200\1\210\2\u01fe\20\210\22\u01fe\11\0\16\u0150"+ - "\2\0\7\u0150\1\0\1\u0150\1\0\1\u0150\2\0\17\u0150"+ - "\23\0\42\220\1\0\45\220\11\0\16\u0155\2\0\7\u0155"+ - "\1\0\1\u0155\1\0\1\u0155\2\0\17\u0155\23\0\4\235"+ - "\1\0\35\235\1\0\2\235\1\0\42\235\45\0\1\u0201"+ - "\42\0\6\u0159\1\u0202\101\u0159\5\u0203\1\u0204\1\u015a\101\u0203"+ - "\12\0\1\u015d\2\u0205\2\254\4\0\2\257\4\0\1\u015e"+ - "\1\u015d\2\0\1\u015d\64\0\1\u015d\17\0\1\u015d\2\0"+ - "\1\u015d\64\0\1\u015f\2\u0205\2\254\4\0\2\257\2\260"+ - "\2\0\1\u0206\1\u015f\2\0\1\u015f\63\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\1\43\1\u0207\15\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\1\43\1\u0208"+ - "\15\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\4\43\1\u0209\12\43\34\0\2\43\1\u020a\13\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\6\43\1\u020b"+ - "\7\43\2\0\7\43\1\0\3\43\2\0\10\43\1\u020c"+ - "\6\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\5\43\1\u020d\11\43\34\0\14\43\1\u020e\1\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\1\43\1\u020f\15\43\34\0"+ - "\16\43\2\0\2\43\1\u0210\4\43\1\0\3\43\2\0"+ - "\17\43\34\0\14\43\1\u0211\1\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\34\0\14\43\1\u0212\1\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\7\43\1\u0213\7\43\36\0"+ - "\2\253\2\0\2\255\2\256\6\0\1\u0214\1\u016d\2\0"+ - "\1\u016d\63\0\2\u016e\2\253\2\u016e\2\255\2\256\4\u016e"+ - "\2\0\1\u0215\4\u016e\11\0\2\u016e\50\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\1\43\1\u0216\15\43\34\0"+ - "\6\43\1\u0217\7\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\14\43\1\u0218\1\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\23\0\3\315\1\u0175\1\u0219\37\315"+ - "\1\u0174\44\315\1\u021a\1\u021b\1\315\1\316\37\315\1\u0174"+ - "\43\315\4\u0177\1\u021c\37\u0177\1\u021d\43\u0177\3\320\1\u0179"+ - "\1\u021e\35\320\1\0\2\320\1\u0178\43\320\1\u021f\1\u0220"+ - "\1\320\1\321\35\320\1\0\2\320\1\u0178\42\320\4\u0221"+ - "\1\u0222\35\u0221\1\0\2\u0221\1\u0223\42\u0221\11\0\6\43"+ - "\1\u0224\7\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\3\43"+ - "\1\u0225\13\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\12\43\1\u0226\4\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\5\43\1\u0227\11\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\5\43\1\u0228\11\43"+ - "\34\0\14\43\1\u0229\1\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\4\43\1\u022a\12\43\34\0\14\43\1\u022b\1\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\2\43\1\u022c\14\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\5\43"+ - "\1\u022d\11\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\6\43\1\u022e\10\43\34\0\14\43\1\u022f\1\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\5\43\1\u0230\11\43"+ - "\34\0\10\43\1\u0231\5\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\2\43\1\u0232\14\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\6\43\1\u0233\10\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\5\43\1\u0234\11\43"+ - "\34\0\14\43\1\u0235\1\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\11\43\1\u0236\5\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\4\43\1\u0237\12\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\10\43\1\u0238\6\43"+ - "\34\0\16\43\2\0\7\43\1\0\2\43\1\u0239\2\0"+ - "\17\43\34\0\6\43\1\u023a\7\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\34\0\10\43\1\u023b\5\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\1\43\1\u023c\15\43\34\0"+ - "\12\43\1\u023d\3\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\6\43\1\u023e\7\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\113\0\1\u023f\30\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u0240"+ - "\15\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\1\117\1\u0241\15\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\4\117\1\u0242"+ - "\12\117\34\0\2\117\1\u0243\13\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\6\117\1\u0244"+ - "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\10\117\1\u0245\6\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u0246\11\117\34\0"+ - "\14\117\1\u0247\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\1\117\1\u0248\15\117\34\0"+ - "\16\117\2\0\2\117\1\u0249\4\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\14\117\1\u024a\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\14\117\1\u024b\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\7\117\1\u024c\7\117\34\0"+ + "\1\u01aa\11\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\u01ab\2\0\17\117\34\0\14\117\1\u01ac\1\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\10\117\1\u01ad\6\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\5\117\1\u01ae\11\117"+ + "\34\0\16\117\2\0\2\117\1\u01af\4\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\2\117\1\u01b0\14\117"+ + "\34\0\10\117\1\u01b1\5\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\10\117\1\u01b2\6\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\4\117"+ + "\1\u01b3\12\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\4\117\1\u01b4\12\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\1\117"+ + "\1\u01b5\15\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\4\117\1\u01b6\1\u01b7\11\117\34\0"+ "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\1\117\1\u024d\15\117\34\0\6\117\1\u024e\7\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\14\117\1\u024f\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\6\117\1\u0250\7\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\11\117\1\u01b8\5\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\1\117\1\u01b9\15\117\34\0"+ "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\3\117\1\u0251\13\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\12\117\1\u0252\4\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\5\117\1\u0253\11\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u0254\11\117\34\0"+ - "\14\117\1\u0255\1\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\u01ba\16\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\1\117\1\u01bb\4\117\1\u01bc\10\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\11\117\1\u01bd\5\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\10\117\1\u01be\6\117"+ + "\34\0\10\117\1\u01bf\5\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\u01c0\2\0\1\117\1\u01c1\11\117"+ + "\1\u01c2\3\117\34\0\10\117\1\u01c3\5\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\6\117\1\u01c4\10\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\5\117\1\u01c5\11\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\16\117\1\u01c6\34\0"+ + "\6\117\1\u01c7\7\117\2\0\7\117\1\0\1\117\1\0"+ "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\4\117\1\u0256\12\117\34\0"+ - "\14\117\1\u0257\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\2\117\1\u0258\14\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\5\117\1\u0259\11\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\6\117\1\u025a\10\117\34\0"+ - "\14\117\1\u025b\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u025c\11\117\34\0"+ - "\10\117\1\u025d\5\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\2\117\1\u025e\14\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\6\117\1\u025f\10\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u0260\11\117\34\0"+ - "\14\117\1\u0261\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\11\117\1\u0262\5\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\4\117\1\u0263\12\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\10\117\1\u0264\6\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\u0265\2\0"+ - "\17\117\34\0\6\117\1\u0266\7\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\10\117\1\u0267"+ + "\1\117\1\0\1\117\2\0\5\117\1\u01c8\11\117\34\0"+ + "\6\117\1\u01c9\1\117\1\u01ca\5\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\10\117\1\u01cb"+ "\5\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\1\117\1\u0268\15\117\34\0\12\117\1\u0269"+ - "\3\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\6\117\1\u026a\7\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u026b"+ + "\17\117\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\10\141\1\u01cc\6\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\11\141\1\u01cd"+ + "\5\141\34\0\6\141\1\u01ce\7\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u01cf"+ + "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\11\141\1\u01d0\5\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\1\u01d1\16\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\4\141\1\u01d2\1\u01d3\11\141\34\0\4\141\1\u01d4"+ + "\11\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\u01d5\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\4\141\1\u01d6\12\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\5\141\1\u01d7\11\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\u01d8\2\0\17\141\34\0\14\141\1\u01d9"+ + "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\10\141\1\u01da\6\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u01db"+ + "\11\141\34\0\16\141\2\0\2\141\1\u01dc\4\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u01dd"+ + "\14\141\34\0\10\141\1\u01de\5\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\10\141\1\u01df\6\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\4\141\1\u01e0\12\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\4\141\1\u01e1\12\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\1\141\1\u01e2\15\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\4\141\1\u01e3\1\u01e4\11\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\11\141\1\u01e5\5\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\1\141\1\u01e6\15\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\1\u01e7\16\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\1\141\1\u01e8\4\141\1\u01e9"+ + "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\11\141\1\u01ea\5\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\10\141\1\u01eb"+ + "\6\141\34\0\10\141\1\u01ec\5\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\u01ed\2\0\1\141\1\u01ee"+ + "\11\141\1\u01ef\3\141\34\0\10\141\1\u01f0\5\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u01f1"+ + "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\5\141\1\u01f2\11\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\16\141\1\u01f3"+ + "\34\0\6\141\1\u01f4\7\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\5\141\1\u01f5\11\141"+ + "\34\0\6\141\1\u01f6\1\141\1\u01f7\5\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\10\141"+ + "\1\u01f8\5\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\24\0\2\163\105\0\3\162\1\u0144\1\u01f9"+ + "\35\162\1\0\2\162\1\0\43\162\1\u01fa\1\u01fb\1\162"+ + "\1\164\35\162\1\0\2\162\1\0\42\162\4\167\1\0"+ + "\35\167\1\0\2\167\1\u01fc\46\167\1\0\35\167\1\0"+ + "\2\167\1\u01fd\42\167\11\0\16\u0148\2\0\7\u0148\1\0"+ + "\1\u0148\1\0\1\u0148\2\0\17\u0148\34\0\16\u0149\2\0"+ + "\7\u0149\1\0\1\u0149\1\0\1\u0149\2\0\17\u0149\24\0"+ + "\2\176\107\0\1\202\105\0\4\u01fe\1\u01ff\1\u014f\3\u01fe"+ + "\1\210\1\u01fe\14\210\2\u01fe\1\210\1\u01fe\2\210\1\u01fe"+ + "\2\210\1\u01fe\1\210\1\u0200\1\210\2\u01fe\20\210\22\u01fe"+ + "\11\0\16\u0150\2\0\7\u0150\1\0\1\u0150\1\0\1\u0150"+ + "\2\0\17\u0150\23\0\5\220\1\0\34\220\1\0\45\220"+ + "\11\0\16\u0155\2\0\7\u0155\1\0\1\u0155\1\0\1\u0155"+ + "\2\0\17\u0155\23\0\4\235\1\0\35\235\1\0\2\235"+ + "\1\0\42\235\45\0\1\u0201\42\0\6\u0159\1\u0202\101\u0159"+ + "\5\u0203\1\u0204\1\u015a\101\u0203\12\0\1\u015d\2\u0205\2\254"+ + "\4\0\2\257\4\0\1\u015e\1\u015d\2\0\1\u015d\64\0"+ + "\1\u015d\17\0\1\u015d\2\0\1\u015d\64\0\1\u015f\2\u0205"+ + "\2\254\4\0\2\257\2\260\2\0\1\u0206\1\u015f\2\0"+ + "\1\u015f\63\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\1\43\1\u0207\15\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\1\43\1\u0208\15\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\4\43\1\u0209\12\43\34\0"+ + "\2\43\1\u020a\13\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\6\43\1\u020b\7\43\2\0\7\43\1\0"+ + "\3\43\2\0\10\43\1\u020c\6\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\5\43\1\u020d\11\43\34\0"+ + "\14\43\1\u020e\1\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\1\43\1\u020f\15\43\34\0\16\43\2\0\2\43\1\u0210"+ + "\4\43\1\0\3\43\2\0\17\43\34\0\14\43\1\u0211"+ + "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\14\43\1\u0212\1\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\7\43\1\u0213\7\43\36\0\2\253\2\0\2\255\2\256"+ + "\6\0\1\u0214\1\u016d\2\0\1\u016d\63\0\2\u016e\2\253"+ + "\2\u016e\2\255\2\256\4\u016e\2\0\1\u0215\4\u016e\11\0"+ + "\2\u016e\50\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\1\43\1\u0216\15\43\34\0\6\43\1\u0217\7\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\14\43\1\u0218"+ + "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\23\0"+ + "\3\315\1\u0175\1\u0219\37\315\1\u0174\44\315\1\u021a\1\u021b"+ + "\1\315\1\316\37\315\1\u0174\43\315\4\u0177\1\u021c\37\u0177"+ + "\1\u021d\43\u0177\3\320\1\u0179\1\u021e\35\320\1\0\2\320"+ + "\1\u0178\43\320\1\u021f\1\u0220\1\320\1\321\35\320\1\0"+ + "\2\320\1\u0178\42\320\4\u0221\1\u0222\35\u0221\1\0\2\u0221"+ + "\1\u0223\42\u0221\11\0\6\43\1\u0224\7\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\3\43\1\u0225\13\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\12\43\1\u0226\4\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\5\43"+ + "\1\u0227\11\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\5\43\1\u0228\11\43\34\0\14\43\1\u0229\1\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\4\43\1\u022a\12\43"+ + "\34\0\14\43\1\u022b\1\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\2\43\1\u022c\14\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\5\43\1\u022d\11\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\6\43\1\u022e\10\43"+ + "\34\0\14\43\1\u022f\1\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\5\43\1\u0230\11\43\34\0\10\43\1\u0231\5\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\2\43\1\u0232\14\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\6\43"+ + "\1\u0233\10\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\5\43\1\u0234\11\43\34\0\14\43\1\u0235\1\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\11\43\1\u0236\5\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\4\43"+ + "\1\u0237\12\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\10\43\1\u0238\6\43\34\0\16\43\2\0\7\43"+ + "\1\0\2\43\1\u0239\2\0\17\43\34\0\6\43\1\u023a"+ + "\7\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\10\43\1\u023b\5\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\1\43\1\u023c\15\43\34\0\12\43\1\u023d\3\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\6\43\1\u023e"+ + "\7\43\2\0\7\43\1\0\3\43\2\0\17\43\113\0"+ + "\1\u023f\30\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\1\117\1\u0240\15\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u0241"+ + "\15\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\4\117\1\u0242\12\117\34\0\2\117\1\u0243"+ + "\13\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\6\117\1\u0244\7\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\10\117\1\u0245\6\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\5\117\1\u0246\11\117\34\0\14\117\1\u0247\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\1\117\1\u0248\15\117\34\0\16\117\2\0\2\117\1\u0249"+ + "\4\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\14\117\1\u024a\1\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\14\117\1\u024b\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\7\117\1\u024c\7\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\1\117\1\u024d\15\117\34\0"+ + "\6\117\1\u024e\7\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\14\117\1\u024f\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\6\117\1\u0250\7\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\3\117\1\u0251\13\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\12\117\1\u0252\4\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\5\117\1\u0253\11\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\5\117\1\u0254\11\117\34\0\14\117\1\u0255\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\4\117\1\u0256\12\117\34\0\14\117\1\u0257\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\2\117\1\u0258\14\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\5\117\1\u0259\11\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\6\117\1\u025a\10\117\34\0\14\117\1\u025b\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\5\117\1\u025c\11\117\34\0\10\117\1\u025d\5\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\2\117\1\u025e\14\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\6\117\1\u025f\10\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\5\117\1\u0260\11\117\34\0\14\117\1\u0261\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\11\117\1\u0262\5\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\4\117\1\u0263\12\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\10\117\1\u0264\6\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\u0265\2\0\17\117\34\0\6\117\1\u0266"+ + "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\10\117\1\u0267\5\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u0268"+ + "\15\117\34\0\12\117\1\u0269\3\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\6\117\1\u026a"+ + "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\1\141\1\u026b\15\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u026c"+ "\15\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\1\141\1\u026c\15\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\4\141\1\u026d"+ - "\12\141\34\0\2\141\1\u026e\13\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\6\141\1\u026f"+ + "\1\141\2\0\4\141\1\u026d\12\141\34\0\2\141\1\u026e"+ + "\13\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\6\141\1\u026f\7\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\10\141\1\u0270\6\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\5\141\1\u0271\11\141\34\0\14\141\1\u0272\1\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\1\141\1\u0273\15\141\34\0\16\141\2\0\2\141\1\u0274"+ + "\4\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\14\141\1\u0275\1\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\14\141\1\u0276\1\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\7\141\1\u0277\7\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\1\141\1\u0278\15\141\34\0"+ + "\6\141\1\u0279\7\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\14\141\1\u027a\1\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\6\141\1\u027b\7\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\3\141\1\u027c\13\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\12\141\1\u027d\4\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\5\141\1\u027e\11\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\5\141\1\u027f\11\141\34\0\14\141\1\u0280\1\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\4\141\1\u0281\12\141\34\0\14\141\1\u0282\1\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\2\141\1\u0283\14\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\5\141\1\u0284\11\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\6\141\1\u0285\10\141\34\0\14\141\1\u0286\1\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\5\141\1\u0287\11\141\34\0\10\141\1\u0288\5\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\2\141\1\u0289\14\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\6\141\1\u028a\10\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\5\141\1\u028b\11\141\34\0\14\141\1\u028c\1\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\11\141\1\u028d\5\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\4\141\1\u028e\12\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\10\141\1\u028f\6\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\u0290\2\0\17\141\34\0\6\141\1\u0291"+ "\7\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\10\141\1\u0270\6\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\5\141\1\u0271\11\141\34\0"+ - "\14\141\1\u0272\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\1\141\1\u0273\15\141\34\0"+ - "\16\141\2\0\2\141\1\u0274\4\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\14\141\1\u0275\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\14\141\1\u0276\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\7\141\1\u0277\7\141\34\0"+ + "\17\141\34\0\10\141\1\u0292\5\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u0293"+ + "\15\141\34\0\12\141\1\u0294\3\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\6\141\1\u0295"+ + "\7\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\23\0\1\162\1\u0296\2\u0144\1\u0145\103\162\1\0"+ + "\1\162\1\u0144\1\u01fb\1\u0297\104\0\2\162\1\u01fb\1\u0297"+ + "\103\0\4\167\1\0\35\167\1\0\2\167\1\u0298\42\167"+ + "\5\u0159\1\u0299\1\u029a\101\u0159\6\u0203\1\u029b\101\u0203\12\0"+ + "\1\u015f\16\0\1\u0206\1\u015f\2\0\1\u015f\63\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\5\43\1\u029c\11\43"+ + "\34\0\6\43\1\u029d\7\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\14\43\1\u029e\1\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\14\43\1\u029f\1\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\6\43\1\u02a0\10\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\1\43"+ + "\1\u02a1\15\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\6\43\1\u02a2\10\43\34\0\16\43\2\0\7\43"+ + "\1\0\2\43\1\u02a3\2\0\17\43\34\0\6\43\1\u02a4"+ + "\7\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\11\43\1\u02a5"+ + "\5\43\54\0\1\u0214\1\u016d\2\0\1\u016d\63\0\2\u016e"+ + "\2\0\2\u016e\4\0\4\u016e\2\0\1\u0215\4\u016e\11\0"+ + "\2\u016e\50\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\3\43\1\u02a6\13\43\34\0\14\43\1\u02a7\1\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\23\0\1\315\1\u02a8"+ + "\2\u0175\1\u0176\103\315\1\0\1\315\1\u0175\1\u021b\1\u02a9"+ + "\104\0\2\315\1\u021b\1\u02a9\103\0\4\u0177\1\u021c\37\u0177"+ + "\1\u02aa\107\u0177\1\u02ab\43\u0177\1\320\1\u02ac\2\u0179\1\u017a"+ + "\103\320\1\0\1\320\1\u0179\1\u0220\1\u02ad\104\0\2\320"+ + "\1\u0220\1\u02ad\103\0\4\u0221\1\u0222\35\u0221\1\0\2\u0221"+ + "\1\u02ae\156\u0221\1\0\35\u0221\1\0\2\u0221\1\u02af\42\u0221"+ + "\11\0\10\43\1\u02b0\5\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\1\43\1\u02b1\15\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\1\43\1\u02b2\15\43\34\0\14\43"+ + "\1\u02b3\1\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\6\43"+ + "\1\u02b4\10\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\6\43\1\u02b5\10\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\4\43\1\u02b6\12\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\14\43\1\u02b7\2\43"+ + "\34\0\10\43\1\u02b8\5\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\6\43\1\u02b9\10\43\34\0\10\43\1\u02ba\5\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\2\43\1\u02bb\14\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\14\43"+ + "\1\u02bc\2\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\5\43\1\u02bd\11\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\2\43\1\u02be\14\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\4\43\1\u02bf\12\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\16\43"+ + "\1\u02c0\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\6\43\1\u02c1\10\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\12\43\1\u02c2\4\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\5\43\1\u02c3\11\43\34\0"+ + "\14\43\1\u02c4\1\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\5\117\1\u02c5\11\117\34\0\6\117\1\u02c6"+ + "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\14\117\1\u02c7\1\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\14\117\1\u02c8"+ + "\1\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\6\117\1\u02c9\10\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u02ca"+ + "\15\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\6\117\1\u02cb\10\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\u02cc\2\0\17\117\34\0"+ + "\6\117\1\u02cd\7\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\11\117\1\u02ce\5\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\3\117\1\u02cf\13\117\34\0\14\117\1\u02d0\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\10\117\1\u02d1\5\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\1\117\1\u02d2\15\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\1\117\1\u02d3\15\117\34\0\14\117\1\u02d4\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\6\117\1\u02d5\10\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\6\117\1\u02d6\10\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\4\117\1\u02d7\12\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\14\117\1\u02d8\2\117\34\0"+ + "\10\117\1\u02d9\5\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\6\117\1\u02da\10\117\34\0"+ + "\10\117\1\u02db\5\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\2\117\1\u02dc\14\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\14\117\1\u02dd\2\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\5\117\1\u02de\11\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\2\117\1\u02df\14\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\4\117\1\u02e0\12\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\16\117\1\u02e1\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\6\117\1\u02e2\10\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\12\117"+ + "\1\u02e3\4\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\5\117\1\u02e4\11\117\34\0\14\117"+ + "\1\u02e5\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\5\141\1\u02e6\11\141\34\0\6\141"+ + "\1\u02e7\7\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\14\141\1\u02e8\1\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\14\141"+ + "\1\u02e9\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\6\141\1\u02ea\10\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\1\141"+ + "\1\u02eb\15\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\6\141\1\u02ec\10\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\u02ed\2\0\17\141"+ + "\34\0\6\141\1\u02ee\7\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\11\141\1\u02ef\5\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\3\141\1\u02f0\13\141\34\0\14\141\1\u02f1\1\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ + "\34\0\10\141\1\u02f2\5\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\1\141\1\u02f3\15\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\1\141\1\u02f4\15\141\34\0\14\141\1\u02f5\1\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\6\141\1\u02f6\10\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\6\141\1\u02f7\10\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\4\141\1\u02f8\12\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\14\141\1\u02f9\2\141"+ + "\34\0\10\141\1\u02fa\5\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\6\141\1\u02fb\10\141"+ + "\34\0\10\141\1\u02fc\5\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\2\141\1\u02fd\14\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\14\141\1\u02fe\2\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\5\141\1\u02ff\11\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\2\141\1\u0300\14\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\4\141\1\u0301\12\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\16\141\1\u0302\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\6\141\1\u0303\10\141\34\0"+ "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\1\141\1\u0278\15\141\34\0\6\141\1\u0279\7\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\14\141\1\u027a\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\6\141\1\u027b\7\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\3\141\1\u027c\13\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\12\141\1\u027d\4\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\5\141\1\u027e\11\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\5\141\1\u027f\11\141\34\0"+ - "\14\141\1\u0280\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\4\141\1\u0281\12\141\34\0"+ - "\14\141\1\u0282\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\2\141\1\u0283\14\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\5\141\1\u0284\11\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\6\141\1\u0285\10\141\34\0"+ - "\14\141\1\u0286\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\5\141\1\u0287\11\141\34\0"+ - "\10\141\1\u0288\5\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\2\141\1\u0289\14\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\6\141\1\u028a\10\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\5\141\1\u028b\11\141\34\0"+ - "\14\141\1\u028c\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\11\141\1\u028d\5\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\4\141\1\u028e\12\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\10\141\1\u028f\6\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\u0290\2\0"+ - "\17\141\34\0\6\141\1\u0291\7\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\10\141\1\u0292"+ + "\12\141\1\u0304\4\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\5\141\1\u0305\11\141\34\0"+ + "\14\141\1\u0306\1\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\23\0\2\162\2\u0144\1\u01f9\35\162"+ + "\1\0\2\162\1\0\42\162\1\0\1\u01fa\1\u01fb\105\0"+ + "\5\u0203\1\u0204\1\u0307\101\u0203\11\0\6\43\1\u0308\7\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\7\43\1\u0309\7\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\5\43"+ + "\1\u030a\11\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\11\43\1\u030b\5\43\34\0\4\43\1\u030c\11\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\6\43"+ + "\1\u030d\7\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\34\0\14\43\1\u030e\1\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\12\43\1\u030f\3\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\1\43\1\u0310\15\43\23\0\2\315"+ + "\2\u0175\1\u0219\37\315\1\u0174\43\315\1\0\1\u021a\1\u021b"+ + "\105\0\4\u0177\1\u021c\37\u0177\1\u0311\107\u0177\1\u0174\43\u0177"+ + "\2\320\2\u0179\1\u021e\35\320\1\0\2\320\1\u0178\42\320"+ + "\1\0\1\u021f\1\u0220\105\0\4\u0221\1\0\35\u0221\1\0"+ + "\2\u0221\1\u0312\46\u0221\1\0\35\u0221\1\0\2\u0221\1\0"+ + "\42\u0221\11\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\2\43\1\u0313\14\43\34\0\2\43\1\u0314\13\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\5\43\1\u0315\11\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\2\43\1\u0316"+ + "\14\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\1\43\1\u0317\15\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\5\43\1\u0318\11\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\11\43\1\u0319\5\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\2\43\1\u031a"+ + "\14\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\5\43\1\u031b\11\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\6\43\1\u031c\10\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\14\43\1\u031d\2\43\34\0"+ + "\10\43\1\u031e\5\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\4\43\1\u031f\12\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\11\43\1\u0320\5\43\34\0\14\43\1\u0321"+ + "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\10\43\1\u0322\5\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\6\117\1\u0323\7\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\7\117\1\u0324"+ + "\7\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\5\117\1\u0325\11\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u0326"+ + "\5\117\34\0\4\117\1\u0327\11\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\6\117\1\u0328"+ + "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\14\117\1\u0329\1\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\12\117\1\u032a"+ + "\3\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\1\117\1\u032b\15\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\2\117\1\u032c"+ + "\14\117\34\0\2\117\1\u032d\13\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\5\117\1\u032e"+ + "\11\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\2\117\1\u032f\14\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u0330"+ + "\15\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\5\117\1\u0331\11\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u0332"+ + "\5\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\2\117\1\u0333\14\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\5\117\1\u0334"+ + "\11\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\6\117\1\u0335\10\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\14\117\1\u0336"+ + "\2\117\34\0\10\117\1\u0337\5\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\4\117\1\u0338"+ + "\12\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\11\117\1\u0339\5\117\34\0\14\117\1\u033a"+ + "\1\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\10\117\1\u033b\5\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\6\141\1\u033c"+ + "\7\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\7\141\1\u033d\7\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u033e"+ + "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\11\141\1\u033f\5\141\34\0\4\141\1\u0340"+ + "\11\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\6\141\1\u0341\7\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\14\141\1\u0342"+ + "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\12\141\1\u0343\3\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u0344"+ + "\15\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\2\141\1\u0345\14\141\34\0\2\141\1\u0346"+ + "\13\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\5\141\1\u0347\11\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u0348"+ + "\14\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\1\141\1\u0349\15\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u034a"+ + "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\11\141\1\u034b\5\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u034c"+ + "\14\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\5\141\1\u034d\11\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u034e"+ + "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\14\141\1\u034f\2\141\34\0\10\141\1\u0350"+ "\5\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\1\141\1\u0293\15\141\34\0\12\141\1\u0294"+ - "\3\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\6\141\1\u0295\7\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\23\0\1\162\1\u0296"+ - "\2\u0144\1\u0145\103\162\1\0\1\162\1\u0144\1\u01fb\1\u0297"+ - "\104\0\2\162\1\u01fb\1\u0297\103\0\4\167\1\0\35\167"+ - "\1\0\2\167\1\u0298\42\167\5\u0159\1\u0299\1\u029a\101\u0159"+ - "\6\u0203\1\u029b\101\u0203\12\0\1\u015f\16\0\1\u0206\1\u015f"+ - "\2\0\1\u015f\63\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\5\43\1\u029c\11\43\34\0\6\43\1\u029d\7\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\14\43"+ - "\1\u029e\1\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\14\43\1\u029f\1\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\6\43\1\u02a0\10\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\1\43\1\u02a1\15\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\6\43\1\u02a2\10\43"+ - "\34\0\16\43\2\0\7\43\1\0\2\43\1\u02a3\2\0"+ - "\17\43\34\0\6\43\1\u02a4\7\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\11\43\1\u02a5\5\43\54\0\1\u0214\1\u016d"+ - "\2\0\1\u016d\63\0\2\u016e\2\0\2\u016e\4\0\4\u016e"+ - "\2\0\1\u0215\4\u016e\11\0\2\u016e\50\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\3\43\1\u02a6\13\43\34\0"+ - "\14\43\1\u02a7\1\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\23\0\1\315\1\u02a8\2\u0175\1\u0176\103\315\1\0"+ - "\1\315\1\u0175\1\u021b\1\u02a9\104\0\2\315\1\u021b\1\u02a9"+ - "\103\0\4\u0177\1\u021c\37\u0177\1\u02aa\107\u0177\1\u02ab\43\u0177"+ - "\1\320\1\u02ac\2\u0179\1\u017a\103\320\1\0\1\320\1\u0179"+ - "\1\u0220\1\u02ad\104\0\2\320\1\u0220\1\u02ad\103\0\4\u0221"+ - "\1\u0222\35\u0221\1\0\2\u0221\1\u02ae\156\u0221\1\0\35\u0221"+ - "\1\0\2\u0221\1\u02af\42\u0221\11\0\10\43\1\u02b0\5\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\1\43\1\u02b1\15\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\1\43"+ - "\1\u02b2\15\43\34\0\14\43\1\u02b3\1\43\2\0\7\43"+ - "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\6\43\1\u02b4\10\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\6\43\1\u02b5\10\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\4\43"+ - "\1\u02b6\12\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\14\43\1\u02b7\2\43\34\0\10\43\1\u02b8\5\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\6\43\1\u02b9\10\43"+ - "\34\0\10\43\1\u02ba\5\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\2\43\1\u02bb\14\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\14\43\1\u02bc\2\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\5\43\1\u02bd\11\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\2\43"+ - "\1\u02be\14\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\4\43\1\u02bf\12\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\16\43\1\u02c0\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\6\43\1\u02c1\10\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\12\43\1\u02c2"+ - "\4\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\5\43\1\u02c3\11\43\34\0\14\43\1\u02c4\1\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\5\117\1\u02c5"+ - "\11\117\34\0\6\117\1\u02c6\7\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\14\117\1\u02c7"+ - "\1\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\14\117\1\u02c8\1\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\6\117\1\u02c9"+ - "\10\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\1\117\1\u02ca\15\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\6\117\1\u02cb"+ - "\10\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\u02cc\2\0\17\117\34\0\6\117\1\u02cd\7\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\11\117\1\u02ce\5\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\3\117\1\u02cf\13\117\34\0"+ - "\14\117\1\u02d0\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\10\117\1\u02d1\5\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\1\117\1\u02d2\15\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\1\117\1\u02d3\15\117\34\0"+ - "\14\117\1\u02d4\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\6\117\1\u02d5\10\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\6\117\1\u02d6\10\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\4\117\1\u02d7\12\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\14\117\1\u02d8\2\117\34\0\10\117\1\u02d9\5\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\6\117\1\u02da\10\117\34\0\10\117\1\u02db\5\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\2\117\1\u02dc\14\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\14\117\1\u02dd\2\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\5\117\1\u02de\11\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\2\117\1\u02df\14\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\4\117\1\u02e0\12\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\16\117\1\u02e1\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\6\117"+ - "\1\u02e2\10\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\12\117\1\u02e3\4\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\5\117"+ - "\1\u02e4\11\117\34\0\14\117\1\u02e5\1\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\5\141"+ - "\1\u02e6\11\141\34\0\6\141\1\u02e7\7\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\14\141"+ - "\1\u02e8\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\17\141\34\0\14\141\1\u02e9\1\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\6\141"+ - "\1\u02ea\10\141\34\0\16\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\1\141\1\u02eb\15\141\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\6\141"+ - "\1\u02ec\10\141\34\0\16\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\u02ed\2\0\17\141\34\0\6\141\1\u02ee\7\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\11\141\1\u02ef\5\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\3\141\1\u02f0\13\141"+ - "\34\0\14\141\1\u02f1\1\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\10\141\1\u02f2\5\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\1\141\1\u02f3\15\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\1\141\1\u02f4\15\141"+ - "\34\0\14\141\1\u02f5\1\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\6\141\1\u02f6\10\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\6\141\1\u02f7\10\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\4\141\1\u02f8\12\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\14\141\1\u02f9\2\141\34\0\10\141\1\u02fa\5\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\6\141\1\u02fb\10\141\34\0\10\141\1\u02fc\5\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\2\141\1\u02fd\14\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\14\141\1\u02fe\2\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\5\141\1\u02ff\11\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\2\141\1\u0300\14\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\4\141\1\u0301\12\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\16\141\1\u0302\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\6\141\1\u0303\10\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\12\141\1\u0304\4\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\5\141\1\u0305\11\141\34\0\14\141\1\u0306\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\23\0"+ - "\2\162\2\u0144\1\u01f9\35\162\1\0\2\162\1\0\42\162"+ - "\1\0\1\u01fa\1\u01fb\105\0\5\u0203\1\u0204\1\u0307\101\u0203"+ - "\11\0\6\43\1\u0308\7\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\7\43\1\u0309\7\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\5\43\1\u030a\11\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\11\43\1\u030b\5\43"+ - "\34\0\4\43\1\u030c\11\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\6\43\1\u030d\7\43\2\0\7\43"+ - "\1\0\3\43\2\0\17\43\34\0\14\43\1\u030e\1\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\12\43"+ - "\1\u030f\3\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\1\43"+ - "\1\u0310\15\43\23\0\2\315\2\u0175\1\u0219\37\315\1\u0174"+ - "\43\315\1\0\1\u021a\1\u021b\105\0\4\u0177\1\u021c\37\u0177"+ - "\1\u0311\107\u0177\1\u0174\43\u0177\2\320\2\u0179\1\u021e\35\320"+ - "\1\0\2\320\1\u0178\42\320\1\0\1\u021f\1\u0220\105\0"+ - "\4\u0221\1\0\35\u0221\1\0\2\u0221\1\u0312\46\u0221\1\0"+ - "\35\u0221\1\0\2\u0221\1\0\42\u0221\11\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\2\43\1\u0313\14\43\34\0"+ - "\2\43\1\u0314\13\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\5\43\1\u0315\11\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\2\43\1\u0316\14\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\1\43\1\u0317\15\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u0318"+ - "\11\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\11\43\1\u0319\5\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\2\43\1\u031a\14\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\5\43\1\u031b\11\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\6\43\1\u031c"+ - "\10\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\14\43\1\u031d\2\43\34\0\10\43\1\u031e\5\43\2\0"+ + "\1\141\2\0\4\141\1\u0351\12\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\11\141\1\u0352"+ + "\5\141\34\0\14\141\1\u0353\1\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\10\141\1\u0354"+ + "\5\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\13\43\1\u0355\3\43\34\0\14\43\1\u0356\1\43\2\0"+ "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\4\43\1\u031f\12\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\11\43\1\u0320"+ - "\5\43\34\0\14\43\1\u0321\1\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\34\0\10\43\1\u0322\5\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\6\117\1\u0323"+ - "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\7\117\1\u0324\7\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\5\117\1\u0325"+ - "\11\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\11\117\1\u0326\5\117\34\0\4\117\1\u0327"+ - "\11\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\6\117\1\u0328\7\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\14\117\1\u0329"+ - "\1\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\12\117\1\u032a\3\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u032b"+ - "\15\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\2\117\1\u032c\14\117\34\0\2\117\1\u032d"+ - "\13\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\5\117\1\u032e\11\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\2\117\1\u032f"+ - "\14\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\1\117\1\u0330\15\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\5\117\1\u0331"+ - "\11\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\11\117\1\u0332\5\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\2\117\1\u0333"+ - "\14\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\5\117\1\u0334\11\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\6\117\1\u0335"+ - "\10\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\14\117\1\u0336\2\117\34\0\10\117\1\u0337"+ - "\5\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\4\117\1\u0338\12\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u0339"+ - "\5\117\34\0\14\117\1\u033a\1\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\10\117\1\u033b"+ - "\5\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\6\141\1\u033c\7\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\7\141\1\u033d"+ - "\7\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\5\141\1\u033e\11\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\11\141\1\u033f"+ - "\5\141\34\0\4\141\1\u0340\11\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\6\141\1\u0341"+ - "\7\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\14\141\1\u0342\1\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\12\141\1\u0343"+ - "\3\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\1\141\1\u0344\15\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u0345"+ - "\14\141\34\0\2\141\1\u0346\13\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u0347"+ - "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\2\141\1\u0348\14\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u0349"+ - "\15\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\5\141\1\u034a\11\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\11\141\1\u034b"+ - "\5\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\2\141\1\u034c\14\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u034d"+ - "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\6\141\1\u034e\10\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\14\141\1\u034f"+ - "\2\141\34\0\10\141\1\u0350\5\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\4\141\1\u0351"+ - "\12\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\11\141\1\u0352\5\141\34\0\14\141\1\u0353"+ - "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\10\141\1\u0354\5\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\13\43\1\u0355\3\43\34\0"+ - "\14\43\1\u0356\1\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\2\43\1\u0357\14\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\1\43\1\u0358\15\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\5\43\1\u0359\11\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\4\43\1\u035a"+ - "\12\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\11\43\1\u035b\5\43\23\0\44\u0177\1\u035c\43\u0177\4\u0221"+ - "\1\0\35\u0221\1\0\2\u0221\1\u0178\42\u0221\11\0\14\43"+ - "\1\u035d\1\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\14\43\1\u035e\1\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\5\43\1\u035f\11\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\2\43\1\u0360\14\43\34\0\16\43"+ - "\2\0\7\43\1\0\2\43\1\u0361\2\0\17\43\34\0"+ - "\4\43\1\u0362\11\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\10\43\1\u0363\6\43\34\0\14\43\1\u0364\1\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\6\43\1\u0365"+ - "\7\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\13\117\1\u0366\3\117\34\0\14\117\1\u0367\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\2\117\1\u0368\14\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\1\117\1\u0369\15\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\5\117\1\u036a\11\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\4\117\1\u036b\12\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\11\117\1\u036c\5\117\34\0\14\117\1\u036d\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\14\117\1\u036e\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u036f\11\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\2\117\1\u0370\14\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\u0371\2\0\17\117\34\0\4\117\1\u0372"+ - "\11\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\10\117\1\u0373\6\117\34\0\14\117\1\u0374"+ - "\1\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\6\117\1\u0375\7\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\13\141\1\u0376"+ - "\3\141\34\0\14\141\1\u0377\1\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u0378"+ - "\14\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\1\141\1\u0379\15\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u037a"+ - "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\4\141\1\u037b\12\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\11\141\1\u037c"+ - "\5\141\34\0\14\141\1\u037d\1\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\14\141\1\u037e"+ - "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\5\141\1\u037f\11\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u0380"+ - "\14\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\u0381\2\0\17\141\34\0\4\141\1\u0382\11\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\10\141\1\u0383\6\141\34\0\14\141\1\u0384\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\6\141\1\u0385\7\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\11\43\1\u0386\5\43\34\0\14\43\1\u0387"+ - "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\2\43\1\u0388"+ - "\14\43\34\0\14\43\1\u0389\1\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\5\43\1\u038a\11\43\34\0\14\43\1\u038b"+ - "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\1\u038c\16\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\11\43"+ - "\1\u038d\5\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\11\43\1\u038e\5\43\34\0\14\43\1\u038f\1\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\11\117"+ - "\1\u0390\5\117\34\0\14\117\1\u0391\1\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\2\117"+ - "\1\u0392\14\117\34\0\14\117\1\u0393\1\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\5\117"+ - "\1\u0394\11\117\34\0\14\117\1\u0395\1\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\1\u0396"+ - "\16\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\11\117\1\u0397\5\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u0398"+ - "\5\117\34\0\14\117\1\u0399\1\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\11\141\1\u039a"+ - "\5\141\34\0\14\141\1\u039b\1\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u039c"+ - "\14\141\34\0\14\141\1\u039d\1\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u039e"+ - "\11\141\34\0\14\141\1\u039f\1\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\1\u03a0\16\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\11\141\1\u03a1\5\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\11\141\1\u03a2\5\141"+ - "\34\0\14\141\1\u03a3\1\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\5\43\1\u03a4\11\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\10\43\1\u03a5\6\43"+ - "\34\0\14\43\1\u03a6\1\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\12\43\1\u03a7\3\43\2\0\7\43"+ - "\1\0\3\43\2\0\17\43\34\0\10\43\1\u03a8\5\43"+ + "\7\43\1\0\3\43\2\0\2\43\1\u0357\14\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\1\43\1\u0358"+ + "\15\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\5\43\1\u0359\11\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\4\43\1\u035a\12\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\11\43\1\u035b\5\43\23\0"+ + "\44\u0177\1\u035c\43\u0177\4\u0221\1\0\35\u0221\1\0\2\u0221"+ + "\1\u0178\42\u0221\11\0\14\43\1\u035d\1\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\14\43\1\u035e\1\43"+ "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\5\43\1\u03a9\11\43"+ - "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\5\117\1\u03aa\11\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\10\117\1\u03ab\6\117"+ - "\34\0\14\117\1\u03ac\1\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\17\117\34\0\12\117\1\u03ad\3\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ - "\34\0\10\117\1\u03ae\5\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\17\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\5\117\1\u03af\11\117"+ + "\2\0\7\43\1\0\3\43\2\0\5\43\1\u035f\11\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\2\43"+ + "\1\u0360\14\43\34\0\16\43\2\0\7\43\1\0\2\43"+ + "\1\u0361\2\0\17\43\34\0\4\43\1\u0362\11\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\10\43\1\u0363\6\43\34\0"+ + "\14\43\1\u0364\1\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\6\43\1\u0365\7\43\2\0\7\43\1\0"+ + "\3\43\2\0\17\43\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\13\117\1\u0366\3\117\34\0"+ + "\14\117\1\u0367\1\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\2\117\1\u0368\14\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\1\117\1\u0369\15\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\5\117\1\u036a\11\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\4\117\1\u036b\12\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\11\117\1\u036c\5\117\34\0"+ + "\14\117\1\u036d\1\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\14\117\1\u036e\1\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\5\117\1\u036f\11\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\2\117\1\u0370\14\117\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\u0371\2\0"+ + "\17\117\34\0\4\117\1\u0372\11\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\10\117\1\u0373"+ + "\6\117\34\0\14\117\1\u0374\1\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\6\117\1\u0375"+ + "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\13\141\1\u0376\3\141\34\0\14\141\1\u0377"+ + "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\2\141\1\u0378\14\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u0379"+ + "\15\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\5\141\1\u037a\11\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\4\141\1\u037b"+ + "\12\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\11\141\1\u037c\5\141\34\0\14\141\1\u037d"+ + "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\14\141\1\u037e\1\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u037f"+ + "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\2\141\1\u0380\14\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\u0381\2\0\17\141\34\0"+ + "\4\141\1\u0382\11\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\10\141\1\u0383\6\141\34\0"+ + "\14\141\1\u0384\1\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\6\141\1\u0385\7\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\11\43\1\u0386"+ + "\5\43\34\0\14\43\1\u0387\1\43\2\0\7\43\1\0"+ + "\3\43\2\0\17\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\2\43\1\u0388\14\43\34\0\14\43\1\u0389"+ + "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u038a"+ + "\11\43\34\0\14\43\1\u038b\1\43\2\0\7\43\1\0"+ + "\3\43\2\0\17\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\1\u038c\16\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\11\43\1\u038d\5\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\11\43\1\u038e\5\43"+ + "\34\0\14\43\1\u038f\1\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\11\117\1\u0390\5\117\34\0\14\117"+ + "\1\u0391\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\2\117\1\u0392\14\117\34\0\14\117"+ + "\1\u0393\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\5\117\1\u0394\11\117\34\0\14\117"+ + "\1\u0395\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\1\u0396\16\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u0397"+ + "\5\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\11\117\1\u0398\5\117\34\0\14\117\1\u0399"+ + "\1\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\17\117\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\11\141\1\u039a\5\141\34\0\14\141\1\u039b"+ + "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\2\141\1\u039c\14\141\34\0\14\141\1\u039d"+ + "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\5\141\1\u039e\11\141\34\0\14\141\1\u039f"+ + "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\1\u03a0\16\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\11\141\1\u03a1\5\141"+ "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\5\141\1\u03b0\11\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\10\141\1\u03b1\6\141"+ - "\34\0\14\141\1\u03b2\1\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\12\141\1\u03b3\3\141"+ + "\2\0\11\141\1\u03a2\5\141\34\0\14\141\1\u03a3\1\141"+ "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\10\141\1\u03b4\5\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\5\141\1\u03b5\11\141"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\4\43"+ - "\1\u03b6\12\43\34\0\4\43\1\u03b7\11\43\2\0\7\43"+ - "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\15\43\1\u03b8\1\43\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\4\117"+ - "\1\u03b9\12\117\34\0\4\117\1\u03ba\11\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\15\117"+ - "\1\u03bb\1\117\34\0\16\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\4\141\1\u03bc\12\141\34\0\4\141"+ - "\1\u03bd\11\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\15\141\1\u03be\1\141\34\0\14\43"+ - "\1\u03bf\1\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\14\117\1\u03c0\1\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\17\117\34\0\14\141\1\u03c1\1\141"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\5\43"+ + "\1\u03a4\11\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\10\43\1\u03a5\6\43\34\0\14\43\1\u03a6\1\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\12\43"+ + "\1\u03a7\3\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\34\0\10\43\1\u03a8\5\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\5\43\1\u03a9\11\43\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\5\117\1\u03aa\11\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\10\117\1\u03ab\6\117\34\0\14\117\1\u03ac\1\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\12\117\1\u03ad\3\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\10\117\1\u03ae\5\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\5\117\1\u03af\11\117\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\5\141\1\u03b0\11\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\10\141\1\u03b1\6\141\34\0\14\141\1\u03b2\1\141"+ "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\12\43\1\u03c2\3\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\12\117\1\u03c3\3\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\12\141"+ - "\1\u03c4\3\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\17\141\23\0"; + "\34\0\12\141\1\u03b3\3\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\10\141\1\u03b4\5\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\5\141\1\u03b5\11\141\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\4\43\1\u03b6\12\43\34\0\4\43"+ + "\1\u03b7\11\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\15\43"+ + "\1\u03b8\1\43\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\4\117\1\u03b9\12\117\34\0\4\117"+ + "\1\u03ba\11\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\15\117\1\u03bb\1\117\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\4\141"+ + "\1\u03bc\12\141\34\0\4\141\1\u03bd\11\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\15\141"+ + "\1\u03be\1\141\34\0\14\43\1\u03bf\1\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\14\117\1\u03c0\1\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\14\141\1\u03c1\1\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\12\43\1\u03c2\3\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\12\117"+ + "\1\u03c3\3\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\12\141\1\u03c4\3\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\17\141\23\0"; private static int [] zzUnpackTrans() { int [] result = new int[52632]; @@ -1755,168 +1755,149 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { zzMarkedPos = zzMarkedPosL; switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 70: - { yybegin(WAIT_FOR_REGEX); - return(mSPREAD_DOT); + case 58: + { yybegin(IN_DOLLAR_SLASH_REGEX_DOT); + return mIDENT; } case 173: break; - case 27: + case 5: { yybegin(WAIT_FOR_REGEX); - return(mMOD); + return(mSTAR); } case 174: break; - case 46: - { yybegin(NLS_AFTER_NLS); - afterComment = IN_TRIPLE_IDENT; - return mNLS; + case 73: + { yybegin(WAIT_FOR_REGEX); + return(mNOT_EQUAL); } case 175: break; - case 112: - { yybegin(WAIT_FOR_REGEX); - return(mSTAR_STAR_ASSIGN); + case 47: + { blockStack.push(mLCURLY); + braceCount.push(mLCURLY); + yybegin(NLS_AFTER_LBRACE); + return(mLCURLY); } case 176: break; case 133: { return( kTRUE ); } case 177: break; - case 122: - { yybegin(WAIT_FOR_REGEX); - return(mREGEX_MATCH); - } - case 178: break; - case 69: - { yybegin(WAIT_FOR_REGEX); - return(mSTAR_STAR); - } - case 179: break; case 135: { return( kNULL ); } - case 180: break; + case 178: break; + case 23: + { yybegin(WAIT_FOR_REGEX); + return(mCOMMA); + } + case 179: break; case 129: { return( kENUM ); } + case 180: break; + case 61: + { yybegin(IN_DOLLAR_SLASH_REGEX_DOLLAR); + return mDOLLAR; + } case 181: break; - case 53: - { blockStack.push(mDIV); - braceCount.push(mLCURLY); - yybegin(NLS_AFTER_LBRACE); - return mLCURLY; + case 83: + { yybegin(WAIT_FOR_REGEX); + return(mDEC); } case 182: break; - case 55: - { if (!gStringStack.isEmpty()) { - gStringStack.pop(); - } - if (blockStack.isEmpty()){ - yybegin(YYINITIAL); - } else { - yybegin(IN_INNER_BLOCK); - } - return mREGEX_END; - } - case 183: break; - case 62: - { yypushback(1); - yybegin(IN_DOLLAR_SLASH_REGEX); - } - case 184: break; case 80: { return( kDO ); } - case 185: break; - case 65: - { yypushback(1); - yybegin(NLS_AFTER_COMMENT); + case 183: break; + case 86: + { yybegin(WAIT_FOR_REGEX); + return(mRANGE_INCLUSIVE); } - case 186: break; + case 184: break; case 72: { return mSH_COMMENT; } + case 185: break; + case 125: + { yybegin(WAIT_FOR_REGEX); + return(mSR_ASSIGN); + } + case 186: break; + case 52: + { yybegin(IN_REGEX_DOT); + return mIDENT; + } case 187: break; - case 42: - { if (!gStringStack.isEmpty()) { - gStringStack.pop(); - } + case 105: + { yybegin(IN_DOLLAR_SLASH_REGEX); + gStringStack.push(mDOLLAR); + return mDOLLAR_SLASH_REGEX_BEGIN; + } + case 188: break; + case 49: + { yypushback(1); if (blockStack.isEmpty()){ yybegin(YYINITIAL); } else { yybegin(IN_INNER_BLOCK); } - return mGSTRING_END; } - case 188: break; + case 189: break; case 7: { return mIDENT; } - case 189: break; + case 190: break; + case 25: + { yybegin(WAIT_FOR_REGEX); + return(mGT); + } + case 191: break; case 144: { return( kSUPER ); } - case 190: break; - case 94: - { yybegin(WAIT_FOR_REGEX); - return(mREGEX_FIND); - } - case 191: break; - case 99: - { yybegin(WAIT_FOR_REGEX); - return(mBOR_ASSIGN); - } case 192: break; + case 119: + { yybegin(IN_TRIPLE_GSTRING); + gStringStack.push(mLBRACK); + return mGSTRING_BEGIN; + } + case 193: break; + case 68: + { yybegin(WAIT_FOR_REGEX); + return(mDIV_ASSIGN); + } + case 194: break; case 171: { return( kINSTANCEOF ); } - case 193: break; - case 35: - { blockStack.push(mLPAREN); - braceCount.push(mLCURLY); - yybegin(NLS_AFTER_LBRACE); - return mLCURLY; - } - case 194: break; - case 108: - { if (!gStringStack.isEmpty()) { - gStringStack.pop(); - } - if (blockStack.isEmpty()){ - yybegin(YYINITIAL); - } else { - yybegin(IN_INNER_BLOCK); - } - return mDOLLAR_SLASH_REGEX_END; - } case 195: break; - case 73: + case 93: { yybegin(WAIT_FOR_REGEX); - return(mNOT_EQUAL); + return(mEQUAL); } case 196: break; - case 103: - // lookahead expression with fixed base length - zzMarkedPos = zzStartRead + 1; - { yybegin(IN_SINGLE_IDENT); - return mDOT; + case 18: + { yybegin(WAIT_FOR_REGEX); + braceCount.push(mLPAREN); + return(mLPAREN); } case 197: break; + case 22: + { yybegin(WAIT_FOR_REGEX); + return(mCOLON); + } + case 198: break; case 152: { return( kSTATIC ); } - case 198: break; - case 100: - { yybegin(WAIT_FOR_REGEX); - return(mLOR); - } case 199: break; - case 57: - { yypushback(1); - yybegin(IN_REGEX); - } - case 200: break; case 143: { return( kCATCH ); } + case 200: break; + case 29: + { yybegin(WAIT_FOR_REGEX); + return(mBOR); + } case 201: break; case 54: { return mREGEX_CONTENT; @@ -1928,304 +1909,104 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { { return mREGEX_CONTENT; } case 203: break; - case 97: + case 27: { yybegin(WAIT_FOR_REGEX); - return(mMOD_ASSIGN); + return(mMOD); } case 204: break; - case 168: - { return( kPROTECTED ); + case 24: + { yybegin(WAIT_FOR_REGEX); + return(mLT); } case 205: break; - case 86: - { yybegin(WAIT_FOR_REGEX); - return(mRANGE_INCLUSIVE); + case 168: + { return( kPROTECTED ); } case 206: break; case 113: { return mNUM_BIG_DECIMAL; } case 207: break; - case 58: - { yybegin(IN_DOLLAR_SLASH_REGEX_DOT); - return mIDENT; + case 70: + { yybegin(WAIT_FOR_REGEX); + return(mSPREAD_DOT); } case 208: break; - case 25: - { yybegin(WAIT_FOR_REGEX); - return(mGT); - } - case 209: break; - case 33: - { yypushback(1); - yybegin(IN_SINGLE_GSTRING); - } - case 210: break; - case 125: - { yybegin(WAIT_FOR_REGEX); - return(mSR_ASSIGN); - } - case 211: break; case 149: { return( kDOUBLE ); } - case 212: break; - case 119: - { yybegin(IN_TRIPLE_GSTRING); - gStringStack.push(mLBRACK); - return mGSTRING_BEGIN; - } - case 213: break; - case 121: - { return( kNEW ); - } - case 214: break; - case 36: - { yypushback(1); - yybegin(IN_TRIPLE_GSTRING); - } - case 215: break; - case 17: - { yybegin(WAIT_FOR_REGEX); - return(mASSIGN); - } - case 216: break; - case 50: - { afterComment = YYINITIAL; - return(WHITE_SPACE); - } - case 217: break; - case 156: - { return( kNATIVE ); - } - case 218: break; - case 114: - { return( kFOR ); - } - case 219: break; - case 98: - { yybegin(WAIT_FOR_REGEX); - return(mBXOR_ASSIGN); - } - case 220: break; - case 132: - { return( kCHAR ); - } - case 221: break; - case 91: - { yybegin(WAIT_FOR_REGEX); - return(mOPTIONAL_DOT); - } - case 222: break; - case 24: - { yybegin(WAIT_FOR_REGEX); - return(mLT); - } - case 223: break; - case 148: - { return( kIMPORT ); - } - case 224: break; - case 159: - { return( kEXTENDS ); - } - case 225: break; - case 2: - { yybegin(NLS_AFTER_NLS); - afterComment = WAIT_FOR_REGEX; - return !braceCount.isEmpty() && - mLPAREN == braceCount.peek() ? WHITE_SPACE : mNLS; - } - case 226: break; - case 60: - { return mDOLLAR_SLASH_REGEX_CONTENT; - } - case 227: break; - case 109: - // lookahead expression with fixed lookahead length - yypushback(1); - { return mDOLLAR_SLASH_REGEX_CONTENT; - } - case 228: break; - case 63: - { yypushback(1); - yybegin(afterComment); - } - case 229: break; - case 157: - { return( kFINALLY ); - } - case 230: break; - case 82: - { yybegin(WAIT_FOR_REGEX); - return(mPLUS_ASSIGN); - } - case 231: break; - case 136: - { return( kVOID ); - } - case 232: break; - case 150: - { return( kPUBLIC ); - } - case 233: break; - case 128: - { return( kELSE ); - } - case 234: break; - case 12: - { return mSTRING_LITERAL; - } - case 235: break; - case 6: - { yybegin(WAIT_FOR_REGEX); - return(mLNOT); - } - case 236: break; - case 10: - { yybegin(WAIT_FOR_REGEX); - return(mMINUS); - } - case 237: break; - case 64: - { yypushback(1); - yybegin(WAIT_FOR_REGEX); - } - case 238: break; - case 59: - { blockStack.push(mDOLLAR); - braceCount.push(mLCURLY); - yybegin(NLS_AFTER_LBRACE); - return mLCURLY; - } - case 239: break; - case 30: - { yybegin(WAIT_FOR_REGEX); - return(mBAND); - } - case 240: break; - case 170: - { return( kIMPLEMENTS ); - } - case 241: break; - case 5: - { yybegin(WAIT_FOR_REGEX); - return(mSTAR); - } - case 242: break; - case 11: - { yybegin(WAIT_FOR_REGEX); - return(mDOT); - } - case 243: break; - case 8: - { return mNUM_INT; - } - case 244: break; - case 167: - { return( kINTERFACE ); - } - case 245: break; - case 81: - { yybegin(WAIT_FOR_REGEX); - return(mINC); - } - case 246: break; - case 161: - { return( kPACKAGE ); - } - case 247: break; - case 146: - { return( kTHROW ); - } - case 248: break; - case 92: - { yybegin(WAIT_FOR_REGEX); - return(mELVIS); - } - case 249: break; - case 79: - { return( kIN ); - } - case 250: break; - case 84: - { yybegin(WAIT_FOR_REGEX); - return(mMINUS_ASSIGN); - } - case 251: break; - case 66: - { return mSL_COMMENT; - } - case 252: break; + case 209: break; case 37: { yybegin(IN_TRIPLE_DOT); return mIDENT; } - case 253: break; - case 20: - { yybegin(WAIT_FOR_REGEX); - braceCount.push(mLPAREN); - return(mLBRACK); + case 210: break; + case 35: + { blockStack.push(mLPAREN); + braceCount.push(mLCURLY); + yybegin(NLS_AFTER_LBRACE); + return mLCURLY; } - case 254: break; - case 130: - { return( kBYTE ); - } - case 255: break; - case 137: - { yybegin(WAIT_FOR_REGEX); - return(mBSR_ASSIGN); - } - case 256: break; - case 52: - { yybegin(IN_REGEX_DOT); - return mIDENT; - } - case 257: break; - case 44: - { yybegin(IN_TRIPLE_GSTRING_DOLLAR); - return mDOLLAR; - } - case 258: break; - case 49: - { yypushback(1); + case 211: break; + case 126: + { if (!gStringStack.isEmpty()){ + gStringStack.pop(); + } if (blockStack.isEmpty()){ yybegin(YYINITIAL); } else { yybegin(IN_INNER_BLOCK); } + return mGSTRING_END; } - case 259: break; - case 172: - { return( kSYNCHRONIZED ); + case 212: break; + case 121: + { return( kNEW ); } - case 260: break; - case 117: - { yybegin(WAIT_FOR_REGEX); - return(mTRIPLE_DOT); + case 213: break; + case 156: + { return( kNATIVE ); } - case 261: break; - case 85: - { yybegin(WAIT_FOR_REGEX); - return(mCLOSABLE_BLOCK_OP); - } - case 262: break; + case 214: break; case 87: { yybegin(WAIT_FOR_REGEX); return(mMEMBER_POINTER); } - case 263: break; - case 120: - { return( kTRY ); - } - case 264: break; - case 21: + case 215: break; + case 19: { if (!braceCount.isEmpty() && mLPAREN == braceCount.peek()) { braceCount.pop(); } - return(mRBRACK); + return(mRPAREN); } - case 265: break; + case 216: break; + case 64: + { yypushback(1); + yybegin(WAIT_FOR_REGEX); + } + case 217: break; + case 114: + { return( kFOR ); + } + case 218: break; + case 132: + { return( kCHAR ); + } + case 219: break; + case 148: + { return( kIMPORT ); + } + case 220: break; + case 91: + { yybegin(WAIT_FOR_REGEX); + return(mOPTIONAL_DOT); + } + case 221: break; + case 101: + { yybegin(WAIT_FOR_REGEX); + return(mBAND_ASSIGN); + } + case 222: break; case 48: { if (!blockStack.isEmpty()) { IElementType br = blockStack.pop(); @@ -2242,21 +2023,106 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { } return mRCURLY; } - case 266: break; - case 131: - { return( kCASE ); + case 223: break; + case 159: + { return( kEXTENDS ); } - case 267: break; - case 77: - { return mNUM_DOUBLE; + case 224: break; + case 9: + { yybegin(WAIT_FOR_REGEX); + return(mPLUS); } - case 268: break; - case 158: - { return( kDEFAULT ); + case 225: break; + case 108: + { if (!gStringStack.isEmpty()) { + gStringStack.pop(); + } + if (blockStack.isEmpty()){ + yybegin(YYINITIAL); + } else { + yybegin(IN_INNER_BLOCK); + } + return mDOLLAR_SLASH_REGEX_END; } - case 269: break; - case 126: - { if (!gStringStack.isEmpty()){ + case 226: break; + case 94: + { yybegin(WAIT_FOR_REGEX); + return(mREGEX_FIND); + } + case 227: break; + case 26: + { yybegin(WAIT_FOR_REGEX); + return(mBNOT); + } + case 228: break; + case 60: + { return mDOLLAR_SLASH_REGEX_CONTENT; + } + case 229: break; + case 109: + // lookahead expression with fixed lookahead length + yypushback(1); + { return mDOLLAR_SLASH_REGEX_CONTENT; + } + case 230: break; + case 99: + { yybegin(WAIT_FOR_REGEX); + return(mBOR_ASSIGN); + } + case 231: break; + case 157: + { return( kFINALLY ); + } + case 232: break; + case 100: + { yybegin(WAIT_FOR_REGEX); + return(mLOR); + } + case 233: break; + case 71: + { yybegin(WAIT_FOR_REGEX); + return(mSTAR_ASSIGN); + } + case 234: break; + case 136: + { return( kVOID ); + } + case 235: break; + case 150: + { return( kPUBLIC ); + } + case 236: break; + case 128: + { return( kELSE ); + } + case 237: break; + case 38: + { blockStack.push(mLBRACK); + braceCount.push(mLCURLY); + yybegin(NLS_AFTER_LBRACE); + return mLCURLY; + } + case 238: break; + case 12: + { return mSTRING_LITERAL; + } + case 239: break; + case 84: + { yybegin(WAIT_FOR_REGEX); + return(mMINUS_ASSIGN); + } + case 240: break; + case 85: + { yybegin(WAIT_FOR_REGEX); + return(mCLOSABLE_BLOCK_OP); + } + case 241: break; + case 170: + { return( kIMPLEMENTS ); + } + case 242: break; + case 42: + { if (!gStringStack.isEmpty()) { gStringStack.pop(); } if (blockStack.isEmpty()){ @@ -2266,24 +2132,91 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { } return mGSTRING_END; } - case 270: break; - case 169: - { return( kTRANSIENT ); + case 243: break; + case 97: + { yybegin(WAIT_FOR_REGEX); + return(mMOD_ASSIGN); } - case 271: break; - case 111: - { return GROOVY_DOC_COMMENT; - } - case 272: break; + case 244: break; case 16: { yybegin(WAIT_FOR_REGEX); return(mQUESTION); } - case 273: break; - case 153: - { return( kSWITCH ); + case 245: break; + case 8: + { return mNUM_INT; } - case 274: break; + case 246: break; + case 167: + { return( kINTERFACE ); + } + case 247: break; + case 31: + { yybegin(WAIT_FOR_REGEX); + return(mSEMI); + } + case 248: break; + case 161: + { return( kPACKAGE ); + } + case 249: break; + case 146: + { return( kTHROW ); + } + case 250: break; + case 17: + { yybegin(WAIT_FOR_REGEX); + return(mASSIGN); + } + case 251: break; + case 79: + { return( kIN ); + } + case 252: break; + case 66: + { return mSL_COMMENT; + } + case 253: break; + case 88: + { yypushback(2); + yybegin(WAIT_FOR_REGEX); + } + case 254: break; + case 13: + { yybegin(IN_SINGLE_GSTRING); + gStringStack.push(mLPAREN); + return mGSTRING_BEGIN; + } + case 255: break; + case 130: + { return( kBYTE ); + } + case 256: break; + case 102: + { yybegin(WAIT_FOR_REGEX); + return(mLAND); + } + case 257: break; + case 33: + { yypushback(1); + yybegin(IN_SINGLE_GSTRING); + } + case 258: break; + case 28: + { yybegin(WAIT_FOR_REGEX); + return(mBXOR); + } + case 259: break; + case 57: + { yypushback(1); + yybegin(IN_REGEX); + } + case 260: break; + case 63: + { yypushback(1); + yybegin(afterComment); + } + case 261: break; case 4: { if (zzStartRead == 0 || zzBuffer.subSequence(0, zzStartRead).toString().trim().length() == 0) { @@ -2293,294 +2226,362 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { return(mDIV); } } + case 262: break; + case 172: + { return( kSYNCHRONIZED ); + } + case 263: break; + case 124: + { yybegin(WAIT_FOR_REGEX); + return(mSL_ASSIGN); + } + case 264: break; + case 56: + { yybegin(IN_REGEX_DOLLAR); + return mDOLLAR; + } + case 265: break; + case 36: + { yypushback(1); + yybegin(IN_TRIPLE_GSTRING); + } + case 266: break; + case 120: + { return( kTRY ); + } + case 267: break; + case 10: + { yybegin(WAIT_FOR_REGEX); + return(mMINUS); + } + case 268: break; + case 11: + { yybegin(WAIT_FOR_REGEX); + return(mDOT); + } + case 269: break; + case 131: + { return( kCASE ); + } + case 270: break; + case 103: + // lookahead expression with fixed base length + zzMarkedPos = zzStartRead + 1; + { yybegin(IN_SINGLE_IDENT); + return mDOT; + } + case 271: break; + case 77: + { return mNUM_DOUBLE; + } + case 272: break; + case 158: + { return( kDEFAULT ); + } + case 273: break; + case 122: + { yybegin(WAIT_FOR_REGEX); + return(mREGEX_MATCH); + } + case 274: break; + case 50: + { afterComment = YYINITIAL; + return(WHITE_SPACE); + } case 275: break; + case 169: + { return( kTRANSIENT ); + } + case 276: break; + case 81: + { yybegin(WAIT_FOR_REGEX); + return(mINC); + } + case 277: break; + case 111: + { return GROOVY_DOC_COMMENT; + } + case 278: break; + case 2: + { yybegin(NLS_AFTER_NLS); + afterComment = WAIT_FOR_REGEX; + return !braceCount.isEmpty() && + mLPAREN == braceCount.peek() ? WHITE_SPACE : mNLS; + } + case 279: break; + case 59: + { blockStack.push(mDOLLAR); + braceCount.push(mLCURLY); + yybegin(NLS_AFTER_LBRACE); + return mLCURLY; + } + case 280: break; + case 153: + { return( kSWITCH ); + } + case 281: break; + case 15: + { while (!braceCount.isEmpty() && mLCURLY != braceCount.peek()) { + braceCount.pop(); + } + if (!braceCount.isEmpty() && mLCURLY == braceCount.peek()) { + braceCount.pop(); + } + return mRCURLY; + } + case 282: break; + case 89: + { return mGSTRING_LITERAL; + } + case 283: break; + case 20: + { yybegin(WAIT_FOR_REGEX); + braceCount.push(mLPAREN); + return(mLBRACK); + } + case 284: break; + case 45: + { yypushback(1); + yybegin(IN_TRIPLE_IDENT); + } + case 285: break; + case 138: + { return( kFLOAT ); + } + case 286: break; + case 137: + { yybegin(WAIT_FOR_REGEX); + return(mBSR_ASSIGN); + } + case 287: break; + case 78: + { return( kIF ); + } + case 288: break; + case 92: + { yybegin(WAIT_FOR_REGEX); + return(mELVIS); + } + case 289: break; + case 139: + { return( kFINAL ); + } + case 290: break; + case 34: + { yybegin(IN_SINGLE_DOT); + return mIDENT; + } + case 291: break; + case 96: + { yybegin(WAIT_FOR_REGEX); + return(mGE); + } + case 292: break; + case 154: + { return( kTHROWS ); + } + case 293: break; case 110: // lookahead expression with fixed base length zzMarkedPos = zzStartRead + 1; { yybegin(IN_DOLLAR_SLASH_REGEX_IDENT); return mDOT; } - case 276: break; - case 89: - { return mGSTRING_LITERAL; - } - case 277: break; - case 124: - { yybegin(WAIT_FOR_REGEX); - return(mSL_ASSIGN); - } - case 278: break; - case 138: - { return( kFLOAT ); - } - case 279: break; - case 105: - { yybegin(IN_DOLLAR_SLASH_REGEX); - gStringStack.push(mDOLLAR); - return mDOLLAR_SLASH_REGEX_BEGIN; - } - case 280: break; - case 45: - { yypushback(1); - yybegin(IN_TRIPLE_IDENT); - } - case 281: break; - case 34: - { yybegin(IN_SINGLE_DOT); - return mIDENT; - } - case 282: break; - case 123: - { yybegin(WAIT_FOR_REGEX); - return(mCOMPARE_TO); - } - case 283: break; - case 88: - { yypushback(2); - yybegin(WAIT_FOR_REGEX); - } - case 284: break; - case 78: - { return( kIF ); - } - case 285: break; - case 139: - { return( kFINAL ); - } - case 286: break; - case 101: - { yybegin(WAIT_FOR_REGEX); - return(mBAND_ASSIGN); - } - case 287: break; - case 154: - { return( kTHROWS ); - } - case 288: break; + case 294: break; case 75: { return mNUM_FLOAT; } - case 289: break; - case 38: - { blockStack.push(mLBRACK); - braceCount.push(mLCURLY); - yybegin(NLS_AFTER_LBRACE); - return mLCURLY; + case 295: break; + case 117: + { yybegin(WAIT_FOR_REGEX); + return(mTRIPLE_DOT); } - case 290: break; - case 47: - { blockStack.push(mLCURLY); - braceCount.push(mLCURLY); - yybegin(NLS_AFTER_LBRACE); - return(mLCURLY); - } - case 291: break; + case 296: break; case 115: { return( kINT ); } - case 292: break; + case 297: break; case 165: { return( kSTRICTFP ); } - case 293: break; - case 9: - { yybegin(WAIT_FOR_REGEX); - return(mPLUS); + case 298: break; + case 65: + { yypushback(1); + yybegin(NLS_AFTER_COMMENT); } - case 294: break; + case 299: break; case 163: { return( kABSTRACT ); } - case 295: break; + case 300: break; case 140: { return( kFALSE ); } - case 296: break; - case 41: - { yybegin(IN_SINGLE_GSTRING_DOLLAR); - return mDOLLAR; - } - case 297: break; - case 26: - { yybegin(WAIT_FOR_REGEX); - return(mBNOT); - } - case 298: break; - case 13: - { yybegin(IN_SINGLE_GSTRING); - gStringStack.push(mLPAREN); - return mGSTRING_BEGIN; - } - case 299: break; + case 301: break; case 90: { return( kAS ); } - case 300: break; - case 71: - { yybegin(WAIT_FOR_REGEX); - return(mSTAR_ASSIGN); - } - case 301: break; - case 164: - { return( kCONTINUE ); - } case 302: break; - case 40: - { clearStacks(); - yybegin(NLS_AFTER_NLS); - afterComment = YYINITIAL; + case 46: + { yybegin(NLS_AFTER_NLS); + afterComment = IN_TRIPLE_IDENT; return mNLS; } case 303: break; - case 127: - { return( kLONG ); - } - case 304: break; - case 76: - { return mNUM_LONG; - } - case 305: break; - case 141: - { return( kBREAK ); - } - case 306: break; - case 160: - { return( kBOOLEAN ); - } - case 307: break; - case 151: - { return( kASSERT ); - } - case 308: break; - case 96: - { yybegin(WAIT_FOR_REGEX); - return(mGE); - } - case 309: break; - case 23: - { yybegin(WAIT_FOR_REGEX); - return(mCOMMA); - } - case 310: break; - case 93: - { yybegin(WAIT_FOR_REGEX); - return(mEQUAL); - } - case 311: break; - case 3: - { return WHITE_SPACE; - } - case 312: break; - case 134: - { return( kTHIS ); - } - case 313: break; - case 162: - { return( kPRIVATE ); - } - case 314: break; - case 18: - { yybegin(WAIT_FOR_REGEX); - braceCount.push(mLPAREN); - return(mLPAREN); - } - case 315: break; - case 104: - // lookahead expression with fixed base length - zzMarkedPos = zzStartRead + 1; - { yybegin(IN_TRIPLE_NLS); - return mDOT; - } - case 316: break; - case 51: - { yybegin(IN_REGEX); - gStringStack.push(mDIV); - return mREGEX_BEGIN; - } - case 317: break; - case 145: - { return( kSHORT ); - } - case 318: break; - case 83: - { yybegin(WAIT_FOR_REGEX); - return(mDEC); - } - case 319: break; - case 31: - { yybegin(WAIT_FOR_REGEX); - return(mSEMI); - } - case 320: break; - case 61: - { yybegin(IN_DOLLAR_SLASH_REGEX_DOLLAR); - return mDOLLAR; - } - case 321: break; - case 166: - { return( kVOLATILE ); - } - case 322: break; - case 14: - { yybegin(NLS_AFTER_LBRACE); - braceCount.push(mLCURLY); - return(mLCURLY); - } - case 323: break; - case 32: - { yybegin(WAIT_FOR_REGEX); - return(mAT); - } - case 324: break; - case 74: - { return mNUM_BIG_INT; - } - case 325: break; case 118: { yybegin(WAIT_FOR_REGEX); return(mRANGE_EXCLUSIVE); } - case 326: break; - case 142: - { return( kCLASS ); + case 304: break; + case 164: + { return( kCONTINUE ); } - case 327: break; - case 68: + case 305: break; + case 32: { yybegin(WAIT_FOR_REGEX); - return(mDIV_ASSIGN); + return(mAT); } - case 328: break; + case 306: break; + case 127: + { return( kLONG ); + } + case 307: break; + case 76: + { return mNUM_LONG; + } + case 308: break; + case 141: + { return( kBREAK ); + } + case 309: break; case 95: { yybegin(WAIT_FOR_REGEX); return(mLE); } - case 329: break; - case 155: - { return( kRETURN ); + case 310: break; + case 160: + { return( kBOOLEAN ); } - case 330: break; - case 22: - { yybegin(WAIT_FOR_REGEX); - return(mCOLON); + case 311: break; + case 151: + { return( kASSERT ); } - case 331: break; + case 312: break; case 107: // lookahead expression with fixed base length zzMarkedPos = zzStartRead + 1; { yybegin(IN_REGEX_IDENT); return mDOT; } - case 332: break; - case 56: - { yybegin(IN_REGEX_DOLLAR); + case 313: break; + case 3: + { return WHITE_SPACE; + } + case 314: break; + case 134: + { return( kTHIS ); + } + case 315: break; + case 51: + { yybegin(IN_REGEX); + gStringStack.push(mDIV); + return mREGEX_BEGIN; + } + case 316: break; + case 162: + { return( kPRIVATE ); + } + case 317: break; + case 44: + { yybegin(IN_TRIPLE_GSTRING_DOLLAR); return mDOLLAR; } - case 333: break; - case 19: + case 318: break; + case 145: + { return( kSHORT ); + } + case 319: break; + case 21: { if (!braceCount.isEmpty() && mLPAREN == braceCount.peek()) { braceCount.pop(); } - return(mRPAREN); + return(mRBRACK); + } + case 320: break; + case 14: + { yybegin(NLS_AFTER_LBRACE); + braceCount.push(mLCURLY); + return(mLCURLY); + } + case 321: break; + case 166: + { return( kVOLATILE ); + } + case 322: break; + case 104: + // lookahead expression with fixed base length + zzMarkedPos = zzStartRead + 1; + { yybegin(IN_TRIPLE_NLS); + return mDOT; + } + case 323: break; + case 6: + { yybegin(WAIT_FOR_REGEX); + return(mLNOT); + } + case 324: break; + case 69: + { yybegin(WAIT_FOR_REGEX); + return(mSTAR_STAR); + } + case 325: break; + case 74: + { return mNUM_BIG_INT; + } + case 326: break; + case 55: + { if (!gStringStack.isEmpty()) { + gStringStack.pop(); + } + if (blockStack.isEmpty()){ + yybegin(YYINITIAL); + } else { + yybegin(IN_INNER_BLOCK); + } + return mREGEX_END; + } + case 327: break; + case 142: + { return( kCLASS ); + } + case 328: break; + case 82: + { yybegin(WAIT_FOR_REGEX); + return(mPLUS_ASSIGN); + } + case 329: break; + case 30: + { yybegin(WAIT_FOR_REGEX); + return(mBAND); + } + case 330: break; + case 62: + { yypushback(1); + yybegin(IN_DOLLAR_SLASH_REGEX); + } + case 331: break; + case 123: + { yybegin(WAIT_FOR_REGEX); + return(mCOMPARE_TO); + } + case 332: break; + case 98: + { yybegin(WAIT_FOR_REGEX); + return(mBXOR_ASSIGN); + } + case 333: break; + case 155: + { return( kRETURN ); } case 334: break; case 43: @@ -2611,33 +2612,32 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { { return mGSTRING_CONTENT; } case 336: break; - case 102: + case 112: { yybegin(WAIT_FOR_REGEX); - return(mLAND); + return(mSTAR_STAR_ASSIGN); } case 337: break; - case 29: - { yybegin(WAIT_FOR_REGEX); - return(mBOR); - } - case 338: break; case 116: { return( kDEF ); } + case 338: break; + case 41: + { yybegin(IN_SINGLE_GSTRING_DOLLAR); + return mDOLLAR; + } case 339: break; - case 28: - { yybegin(WAIT_FOR_REGEX); - return(mBXOR); + case 40: + { clearStacks(); + yybegin(NLS_AFTER_NLS); + afterComment = YYINITIAL; + return mNLS; } case 340: break; - case 15: - { while (!braceCount.isEmpty() && mLCURLY != braceCount.peek()) { - braceCount.pop(); - } - if (!braceCount.isEmpty() && mLCURLY == braceCount.peek()) { - braceCount.pop(); - } - return mRCURLY; + case 53: + { blockStack.push(mDIV); + braceCount.push(mLCURLY); + yybegin(NLS_AFTER_LBRACE); + return mLCURLY; } case 341: break; case 147: diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex index 3ce2f0c8edbb..274cafbfe68e 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex @@ -145,7 +145,7 @@ mREGEX_ESC = \\ "$" ESCAPED_REGEX_SEP = \\ "/" mREGEX_CONTENT = ({mREGEX_ESC} | {ESCAPED_REGEX_SEP} | [^"/""$"])+ -mDOLLAR_SLASH_REGEX_CONTENT = ([^\/\$] | \/[^\$] )+ +mDOLLAR_SLASH_REGEX_CONTENT = ([^\/\$] | \/[^\/\$] )+ //////////////////////////////////////////////////////////////////////////// diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/ExpressionsParsingTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/ExpressionsParsingTest.groovy index 978360b13604..8f25fb1abff3 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/ExpressionsParsingTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/ExpressionsParsingTest.groovy @@ -178,6 +178,7 @@ public class ExpressionsParsingTest extends GroovyParsingTestCase { public void testregex$dollarSlashy2() throws Throwable { doTest(); } public void testregex$dollarSlashy3() throws Throwable { doTest(); } public void testregex$dollarSlashy4() throws Throwable { doTest(); } + public void testregex$dollarSlashy5() throws Throwable { doTest(); } public void testregex$dollarSlashyCode() throws Throwable { doTest(); } public void testregex$dollarSlashyCodeUnfinished() throws Throwable { doTest(); } public void testregex$dollarSlashyEof() throws Throwable { doTest(); } diff --git a/plugins/groovy/testdata/parsing/groovy/expressions/regex/dollarSlashy5.test b/plugins/groovy/testdata/parsing/groovy/expressions/regex/dollarSlashy5.test new file mode 100644 index 000000000000..26e76e73705a --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/expressions/regex/dollarSlashy5.test @@ -0,0 +1,15 @@ +print ($/abc//$) +----- +Groovy script + Method call + Reference expression + PsiElement(identifier)('print') + PsiWhiteSpace(' ') + Arguments + PsiElement(()('(') + Literal + GroovyASTPsiElementImpl($/ regex literal) + PsiElement($/ regex begin)('$/') + PsiElement($/ regex content)('abc/') + PsiElement($/ regex end)('/$') + PsiElement())(')') \ No newline at end of file From 759e6a8a6eb98610819406661b16bcc94a62e53d Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sun, 18 Dec 2011 12:57:55 +0400 Subject: [PATCH 070/101] string injection for dollar-slashy strings --- .../GroovyStringLiteralManipulator.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/GroovyStringLiteralManipulator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/GroovyStringLiteralManipulator.java index 3bf2b3e60adc..94da17e17241 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/GroovyStringLiteralManipulator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/GroovyStringLiteralManipulator.java @@ -16,6 +16,7 @@ package org.jetbrains.plugins.groovy.lang.resolve; import com.intellij.openapi.util.TextRange; +import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.AbstractElementManipulator; import com.intellij.psi.PsiElement; import com.intellij.util.IncorrectOperationException; @@ -28,13 +29,19 @@ import org.jetbrains.plugins.groovy.lang.psi.util.GrStringUtil; public class GroovyStringLiteralManipulator extends AbstractElementManipulator { public GrLiteral handleContentChange(GrLiteral expr, TextRange range, String newContent) throws IncorrectOperationException { if (!(expr.getValue() instanceof String)) throw new IncorrectOperationException("cannot handle content change"); + String oldText = expr.getText(); if (oldText.startsWith("'")) { newContent = GrStringUtil.escapeSymbolsForString(newContent, !oldText.startsWith("'''"), true); } - else { + else if (oldText.startsWith("\"")) { newContent = GrStringUtil.escapeSymbolsForGString(newContent, !oldText.startsWith("\"\"\""), true); } + else if (oldText.startsWith("/")) { + newContent = StringUtil.escapeSlashes(newContent); + } + //if there is $/-string we don't need to escape something + String newText; if (range.getStartOffset() == 1 && (newContent.indexOf('\n') >= 0 || newContent.indexOf('\r') >= 0)) { String corner = oldText.substring(0, 1) + oldText.substring(0, 1) + oldText.substring(0, 1); @@ -68,12 +75,22 @@ public class GroovyStringLiteralManipulator extends AbstractElementManipulator= begin.length()*2 && text.endsWith(begin)) { + if (text.length() >= begin.length() * 2 && text.endsWith(begin)) { fin -= begin.length(); } return new TextRange(start, Math.max(1, fin)); From 0f282d366d07f984cd71256323c52efc0ae89484 Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sun, 18 Dec 2011 21:05:22 +0400 Subject: [PATCH 071/101] remove unused method --- .../psi/api/statements/expressions/literals/GrLiteral.java | 1 - .../statements/expressions/literals/GrAbstractLiteral.java | 7 ------- 2 files changed, 8 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/api/statements/expressions/literals/GrLiteral.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/api/statements/expressions/literals/GrLiteral.java index f543c5aea6cb..797684b0d03c 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/api/statements/expressions/literals/GrLiteral.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/api/statements/expressions/literals/GrLiteral.java @@ -23,5 +23,4 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpres * @author ilyas */ public interface GrLiteral extends GrExpression, PsiLiteral { - void setStringValue(String value); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrAbstractLiteral.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrAbstractLiteral.java index e41ec6c04f85..296fdfb9e1de 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrAbstractLiteral.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrAbstractLiteral.java @@ -4,7 +4,6 @@ import com.intellij.lang.ASTNode; import org.jetbrains.annotations.NotNull; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral; import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.GrExpressionImpl; -import org.jetbrains.plugins.groovy.lang.resolve.GroovyStringLiteralManipulator; public abstract class GrAbstractLiteral extends GrExpressionImpl implements GrLiteral { @@ -12,10 +11,4 @@ public abstract class GrAbstractLiteral extends GrExpressionImpl implements GrLi public GrAbstractLiteral(@NotNull ASTNode node) { super(node); } - - @Override - public void setStringValue(String value) { - new GroovyStringLiteralManipulator().handleContentChange(this, value); - - } } From 2c6acb372b6fe77b91eaa32dd42a499f3213b768 Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sun, 18 Dec 2011 21:15:07 +0400 Subject: [PATCH 072/101] IDEA-78926 Groovy: AE at GrLiteralImpl.updateText() on applying intentions inside slashy strings with injection --- .../expressions/literals/GrLiteralImpl.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrLiteralImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrLiteralImpl.java index 4cf5acd77074..fff5e52bb71d 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrLiteralImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrLiteralImpl.java @@ -17,10 +17,10 @@ package org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.literals; import com.intellij.lang.ASTNode; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.psi.*; import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; -import com.intellij.psi.impl.source.tree.LeafElement; import com.intellij.psi.tree.IElementType; import com.intellij.util.Function; import com.intellij.util.NullableFunction; @@ -28,6 +28,8 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.lang.lexer.TokenSets; import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor; +import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory; +import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral; import org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiManager; import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil; @@ -42,8 +44,9 @@ import static org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes.*; * @author ilyas */ public class GrLiteralImpl extends GrAbstractLiteral implements GrLiteral, PsiLanguageInjectionHost { + private static final Logger LOG = Logger.getInstance(GrLiteralImpl.class); - private static final Function TYPE_CALCULATOR = new NullableFunction() { + private static final Function TYPE_CALCULATOR = new NullableFunction() { @Override public PsiType fun(GrLiteralImpl grLiteral) { IElementType elemType = getLiteralType(grLiteral); @@ -182,11 +185,13 @@ public class GrLiteralImpl extends GrAbstractLiteral implements GrLiteral, PsiLa public boolean isValidHost() { return getValue() instanceof String; } - - public PsiLanguageInjectionHost updateText(@NotNull final String text) { + + public GrLiteralImpl updateText(@NotNull final String text) { + final GrExpression newExpr = GroovyPsiElementFactory.getInstance(getProject()).createExpressionFromText(text); + LOG.assertTrue(newExpr instanceof GrLiteral); + LOG.assertTrue(newExpr.getFirstChild() != null); final ASTNode valueNode = getNode().getFirstChildNode(); - assert valueNode instanceof LeafElement; - ((LeafElement)valueNode).replaceWithText(text); + getNode().replaceChild(valueNode, newExpr.getFirstChild().getNode()); return this; } From cff751c721c51bc3751ae1119e85ff227519f8b1 Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sun, 18 Dec 2011 21:43:34 +0400 Subject: [PATCH 073/101] dollars can't be escaped in slashy strings --- .../groovy/lang/lexer/_GroovyLexer.java | 2989 ++++++++--------- .../plugins/groovy/lang/lexer/groovy.flex | 5 +- .../groovy/expressions/regex/regex10.test | 33 +- .../groovy/expressions/regex/regex20.test | 18 +- 4 files changed, 1532 insertions(+), 1513 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/_GroovyLexer.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/_GroovyLexer.java index 79cce29ae69a..cb36025f0ff9 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/_GroovyLexer.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/_GroovyLexer.java @@ -1,4 +1,4 @@ -/* The following code was generated by JFlex 1.4.3 on 12/18/11 11:36 AM */ +/* The following code was generated by JFlex 1.4.3 on 12/18/11 8:26 PM */ /* * Copyright 2000-2010 JetBrains s.r.o. @@ -27,7 +27,7 @@ import java.util.Stack; /** * This class is a scanner generated by * JFlex 1.4.3 - * on 12/18/11 11:36 AM from the specification file + * on 12/18/11 8:26 PM from the specification file * C:/Home/IDEA/tools/lexer/../../community/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex */ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { @@ -172,50 +172,50 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { "\1\146\5\42\1\116\1\42\1\117\1\42\1\120\12\42"+ "\1\132\21\42\5\45\1\116\1\45\1\117\1\45\1\120"+ "\12\45\1\132\21\45\1\0\4\47\1\147\1\150\1\0"+ - "\1\62\1\151\1\0\1\66\1\152\1\153\2\0\1\154"+ - "\1\155\1\156\3\0\1\103\1\157\1\160\1\111\1\161"+ - "\1\0\1\161\3\7\1\162\3\7\1\163\1\164\4\7"+ - "\2\10\3\7\1\165\1\166\4\14\1\131\2\0\1\167"+ - "\23\7\1\170\3\7\1\171\5\7\1\135\1\172\1\173"+ - "\1\174\1\175\1\0\3\42\1\162\3\42\1\163\1\164"+ - "\32\42\1\170\3\42\1\171\5\42\3\45\1\162\3\45"+ - "\1\163\1\164\32\45\1\170\3\45\1\171\5\45\1\47"+ - "\2\0\1\47\1\176\3\152\1\0\1\103\2\157\1\161"+ - "\1\0\3\7\1\177\6\7\1\200\1\7\1\201\2\0"+ - "\2\7\1\202\3\0\1\14\7\0\7\7\1\203\2\7"+ - "\1\204\6\7\1\205\1\7\1\206\2\7\1\207\2\7"+ - "\1\210\1\7\1\211\3\42\1\177\6\42\1\200\1\42"+ - "\1\201\2\42\1\202\7\42\1\203\2\42\1\204\6\42"+ - "\1\205\1\42\1\206\2\42\1\207\2\42\1\210\1\42"+ - "\3\45\1\177\6\45\1\200\1\45\1\201\2\45\1\202"+ - "\7\45\1\203\2\45\1\204\6\45\1\205\1\45\1\206"+ - "\2\45\1\207\2\45\1\210\1\45\1\47\1\0\1\53"+ - "\1\103\1\0\1\157\1\212\1\213\1\214\7\7\1\215"+ - "\1\7\1\14\1\0\1\14\5\0\6\7\1\216\1\217"+ - "\1\7\1\220\3\7\1\221\2\7\1\222\3\7\1\223"+ - "\1\212\1\213\1\214\7\42\1\215\7\42\1\216\1\217"+ - "\1\42\1\220\3\42\1\221\2\42\1\222\3\42\1\223"+ - "\1\212\1\213\1\214\7\45\1\215\7\45\1\216\1\217"+ - "\1\45\1\220\3\45\1\221\2\45\1\222\3\45\1\223"+ - "\1\0\2\7\1\224\3\7\1\225\2\7\2\0\1\226"+ - "\4\7\1\227\1\7\1\230\2\7\1\231\1\7\1\232"+ - "\1\233\1\234\1\7\2\42\1\224\3\42\1\225\2\42"+ - "\1\226\4\42\1\227\1\42\1\230\2\42\1\231\1\42"+ - "\1\232\1\233\1\234\1\42\2\45\1\224\3\45\1\225"+ - "\2\45\1\226\4\45\1\227\1\45\1\230\2\45\1\231"+ - "\1\45\1\232\1\233\1\234\1\45\1\235\3\7\1\236"+ - "\1\237\1\240\1\14\1\241\1\242\7\7\1\235\3\42"+ - "\1\236\1\237\1\240\1\241\1\242\7\42\1\235\3\45"+ - "\1\236\1\237\1\240\1\241\1\242\7\45\4\7\1\243"+ - "\1\244\1\245\2\7\1\246\4\42\1\243\1\244\1\245"+ - "\2\42\1\246\4\45\1\243\1\244\1\245\2\45\1\246"+ - "\2\7\1\247\1\250\1\7\1\251\2\42\1\247\1\250"+ - "\1\42\1\251\2\45\1\247\1\250\1\45\1\251\1\252"+ - "\1\253\1\7\1\252\1\253\1\42\1\252\1\253\1\45"+ - "\1\7\1\42\1\45\3\254"; + "\1\62\1\151\1\0\1\152\1\153\2\0\1\154\1\155"+ + "\1\156\3\0\1\103\1\157\1\160\1\111\1\161\1\0"+ + "\1\161\3\7\1\162\3\7\1\163\1\164\4\7\2\10"+ + "\3\7\1\165\1\166\4\14\1\131\2\0\1\167\23\7"+ + "\1\170\3\7\1\171\5\7\1\135\1\172\1\173\1\174"+ + "\1\175\1\0\3\42\1\162\3\42\1\163\1\164\32\42"+ + "\1\170\3\42\1\171\5\42\3\45\1\162\3\45\1\163"+ + "\1\164\32\45\1\170\3\45\1\171\5\45\1\47\2\0"+ + "\1\47\1\176\1\0\1\103\2\157\1\161\1\0\3\7"+ + "\1\177\6\7\1\200\1\7\1\201\2\0\2\7\1\202"+ + "\3\0\1\14\7\0\7\7\1\203\2\7\1\204\6\7"+ + "\1\205\1\7\1\206\2\7\1\207\2\7\1\210\1\7"+ + "\1\211\3\42\1\177\6\42\1\200\1\42\1\201\2\42"+ + "\1\202\7\42\1\203\2\42\1\204\6\42\1\205\1\42"+ + "\1\206\2\42\1\207\2\42\1\210\1\42\3\45\1\177"+ + "\6\45\1\200\1\45\1\201\2\45\1\202\7\45\1\203"+ + "\2\45\1\204\6\45\1\205\1\45\1\206\2\45\1\207"+ + "\2\45\1\210\1\45\1\47\1\0\1\53\1\103\1\0"+ + "\1\157\1\212\1\213\1\214\7\7\1\215\1\7\1\14"+ + "\1\0\1\14\5\0\6\7\1\216\1\217\1\7\1\220"+ + "\3\7\1\221\2\7\1\222\3\7\1\223\1\212\1\213"+ + "\1\214\7\42\1\215\7\42\1\216\1\217\1\42\1\220"+ + "\3\42\1\221\2\42\1\222\3\42\1\223\1\212\1\213"+ + "\1\214\7\45\1\215\7\45\1\216\1\217\1\45\1\220"+ + "\3\45\1\221\2\45\1\222\3\45\1\223\1\0\2\7"+ + "\1\224\3\7\1\225\2\7\2\0\1\226\4\7\1\227"+ + "\1\7\1\230\2\7\1\231\1\7\1\232\1\233\1\234"+ + "\1\7\2\42\1\224\3\42\1\225\2\42\1\226\4\42"+ + "\1\227\1\42\1\230\2\42\1\231\1\42\1\232\1\233"+ + "\1\234\1\42\2\45\1\224\3\45\1\225\2\45\1\226"+ + "\4\45\1\227\1\45\1\230\2\45\1\231\1\45\1\232"+ + "\1\233\1\234\1\45\1\235\3\7\1\236\1\237\1\240"+ + "\1\14\1\241\1\242\7\7\1\235\3\42\1\236\1\237"+ + "\1\240\1\241\1\242\7\42\1\235\3\45\1\236\1\237"+ + "\1\240\1\241\1\242\7\45\4\7\1\243\1\244\1\245"+ + "\2\7\1\246\4\42\1\243\1\244\1\245\2\42\1\246"+ + "\4\45\1\243\1\244\1\245\2\45\1\246\2\7\1\247"+ + "\1\250\1\7\1\251\2\42\1\247\1\250\1\42\1\251"+ + "\2\45\1\247\1\250\1\45\1\251\1\252\1\253\1\7"+ + "\1\252\1\253\1\42\1\252\1\253\1\45\1\7\1\42"+ + "\1\45\3\254"; private static int [] zzUnpackAction() { - int [] result = new int[964]; + int [] result = new int[960]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -281,89 +281,88 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { "\0\u4380\0\u43c8\0\u4410\0\u4458\0\u44a0\0\u44e8\0\u4530\0\u4578"+ "\0\u45c0\0\u4608\0\u4650\0\u4698\0\u46e0\0\u4728\0\u4770\0\u47b8"+ "\0\u4800\0\u4848\0\u4890\0\u48d8\0\u4920\0\u4968\0\u49b0\0\u49f8"+ - "\0\u4a40\0\u4a88\0\u4ad0\0\u0750\0\u1f80\0\u4b18\0\u0750\0\u4b60"+ - "\0\u4ba8\0\u20e8\0\u0750\0\u0750\0\u4bf0\0\u21c0\0\u4c38\0\u4c80"+ - "\0\u4cc8\0\u4d10\0\u0750\0\u0750\0\u4d58\0\u4da0\0\u4de8\0\u4e30"+ - "\0\u4e78\0\u4ec0\0\u0948\0\u4f08\0\u4f50\0\u4f98\0\u4fe0\0\u5028"+ + "\0\u4a40\0\u4a88\0\u4ad0\0\u0750\0\u1f80\0\u0750\0\u4b18\0\u4b60"+ + "\0\u20e8\0\u0750\0\u0750\0\u4ba8\0\u21c0\0\u4bf0\0\u4c38\0\u4c80"+ + "\0\u4cc8\0\u0750\0\u0750\0\u4d10\0\u4d58\0\u4da0\0\u4de8\0\u4e30"+ + "\0\u4e78\0\u0948\0\u4ec0\0\u4f08\0\u4f50\0\u4f98\0\u4fe0\0\u5028"+ "\0\u5070\0\u50b8\0\u5100\0\u5148\0\u5190\0\u51d8\0\u5220\0\u5268"+ - "\0\u52b0\0\u0750\0\u0750\0\u0750\0\u52f8\0\u5340\0\u5388\0\u0750"+ + "\0\u0750\0\u0750\0\u0750\0\u52b0\0\u52f8\0\u5340\0\u0750\0\u5388"+ "\0\u53d0\0\u5418\0\u5460\0\u54a8\0\u54f0\0\u5538\0\u5580\0\u55c8"+ "\0\u5610\0\u5658\0\u56a0\0\u56e8\0\u5730\0\u5778\0\u57c0\0\u5808"+ - "\0\u5850\0\u5898\0\u58e0\0\u5928\0\u5970\0\u59b8\0\u0948\0\u5a00"+ - "\0\u5a48\0\u5a90\0\u0948\0\u5ad8\0\u5b20\0\u5b68\0\u5bb0\0\u5bf8"+ - "\0\u0750\0\u0750\0\u0750\0\u0750\0\u0750\0\u5c40\0\u5c88\0\u5cd0"+ - "\0\u5d18\0\u1248\0\u5d60\0\u5da8\0\u5df0\0\u5e38\0\u5e80\0\u5ec8"+ + "\0\u5850\0\u5898\0\u58e0\0\u5928\0\u5970\0\u0948\0\u59b8\0\u5a00"+ + "\0\u5a48\0\u0948\0\u5a90\0\u5ad8\0\u5b20\0\u5b68\0\u5bb0\0\u0750"+ + "\0\u0750\0\u0750\0\u0750\0\u0750\0\u5bf8\0\u5c40\0\u5c88\0\u5cd0"+ + "\0\u1248\0\u5d18\0\u5d60\0\u5da8\0\u5df0\0\u5e38\0\u5e80\0\u5ec8"+ "\0\u5f10\0\u5f58\0\u5fa0\0\u5fe8\0\u6030\0\u6078\0\u60c0\0\u6108"+ "\0\u6150\0\u6198\0\u61e0\0\u6228\0\u6270\0\u62b8\0\u6300\0\u6348"+ "\0\u6390\0\u63d8\0\u6420\0\u6468\0\u64b0\0\u64f8\0\u6540\0\u6588"+ - "\0\u65d0\0\u1248\0\u6618\0\u6660\0\u66a8\0\u1248\0\u66f0\0\u6738"+ - "\0\u6780\0\u67c8\0\u6810\0\u6858\0\u68a0\0\u68e8\0\u16c8\0\u6930"+ + "\0\u1248\0\u65d0\0\u6618\0\u6660\0\u1248\0\u66a8\0\u66f0\0\u6738"+ + "\0\u6780\0\u67c8\0\u6810\0\u6858\0\u68a0\0\u16c8\0\u68e8\0\u6930"+ "\0\u6978\0\u69c0\0\u6a08\0\u6a50\0\u6a98\0\u6ae0\0\u6b28\0\u6b70"+ "\0\u6bb8\0\u6c00\0\u6c48\0\u6c90\0\u6cd8\0\u6d20\0\u6d68\0\u6db0"+ "\0\u6df8\0\u6e40\0\u6e88\0\u6ed0\0\u6f18\0\u6f60\0\u6fa8\0\u6ff0"+ - "\0\u7038\0\u7080\0\u70c8\0\u7110\0\u7158\0\u71a0\0\u16c8\0\u71e8"+ - "\0\u7230\0\u7278\0\u16c8\0\u72c0\0\u7308\0\u7350\0\u7398\0\u73e0"+ - "\0\u7428\0\u7470\0\u74b8\0\u7500\0\u0750\0\u1ef0\0\u1f38\0\u1f80"+ - "\0\u0750\0\u7548\0\u7590\0\u0750\0\u0750\0\u75d8\0\u7620\0\u7668"+ - "\0\u76b0\0\u0948\0\u76f8\0\u7740\0\u7788\0\u77d0\0\u7818\0\u7860"+ - "\0\u0948\0\u78a8\0\u0948\0\u78f0\0\u7938\0\u7980\0\u79c8\0\u0948"+ - "\0\u7a10\0\u7a58\0\u7aa0\0\u7ae8\0\u7b30\0\u7b78\0\u7bc0\0\u7c08"+ - "\0\u7c50\0\u7c98\0\u7ce0\0\u7d28\0\u7d70\0\u7db8\0\u7e00\0\u7e48"+ - "\0\u7e90\0\u7ed8\0\u0948\0\u7f20\0\u7f68\0\u0948\0\u7fb0\0\u7ff8"+ - "\0\u8040\0\u8088\0\u80d0\0\u8118\0\u0948\0\u8160\0\u0948\0\u81a8"+ - "\0\u81f0\0\u0948\0\u8238\0\u8280\0\u0948\0\u82c8\0\u0750\0\u8310"+ - "\0\u8358\0\u83a0\0\u1248\0\u83e8\0\u8430\0\u8478\0\u84c0\0\u8508"+ - "\0\u8550\0\u1248\0\u8598\0\u1248\0\u85e0\0\u8628\0\u1248\0\u8670"+ - "\0\u86b8\0\u8700\0\u8748\0\u8790\0\u87d8\0\u8820\0\u1248\0\u8868"+ - "\0\u88b0\0\u1248\0\u88f8\0\u8940\0\u8988\0\u89d0\0\u8a18\0\u8a60"+ - "\0\u1248\0\u8aa8\0\u1248\0\u8af0\0\u8b38\0\u1248\0\u8b80\0\u8bc8"+ - "\0\u1248\0\u8c10\0\u8c58\0\u8ca0\0\u8ce8\0\u16c8\0\u8d30\0\u8d78"+ - "\0\u8dc0\0\u8e08\0\u8e50\0\u8e98\0\u16c8\0\u8ee0\0\u16c8\0\u8f28"+ - "\0\u8f70\0\u16c8\0\u8fb8\0\u9000\0\u9048\0\u9090\0\u90d8\0\u9120"+ - "\0\u9168\0\u16c8\0\u91b0\0\u91f8\0\u16c8\0\u9240\0\u9288\0\u92d0"+ - "\0\u9318\0\u9360\0\u93a8\0\u16c8\0\u93f0\0\u16c8\0\u9438\0\u9480"+ - "\0\u16c8\0\u94c8\0\u9510\0\u16c8\0\u9558\0\u95a0\0\u95e8\0\u0750"+ - "\0\u0750\0\u7548\0\u9630\0\u0948\0\u9678\0\u0948\0\u96c0\0\u9708"+ - "\0\u9750\0\u9798\0\u97e0\0\u9828\0\u9870\0\u0948\0\u98b8\0\u9900"+ - "\0\u9948\0\u9990\0\u99d8\0\u9a20\0\u9a68\0\u9ab0\0\u9af8\0\u9b40"+ - "\0\u9b88\0\u9bd0\0\u9c18\0\u9c60\0\u9ca8\0\u0948\0\u0948\0\u9cf0"+ - "\0\u0948\0\u9d38\0\u9d80\0\u9dc8\0\u0948\0\u9e10\0\u9e58\0\u9ea0"+ - "\0\u9ee8\0\u9f30\0\u9f78\0\u0948\0\u1248\0\u9fc0\0\u1248\0\ua008"+ - "\0\ua050\0\ua098\0\ua0e0\0\ua128\0\ua170\0\ua1b8\0\u1248\0\ua200"+ - "\0\ua248\0\ua290\0\ua2d8\0\ua320\0\ua368\0\ua3b0\0\u1248\0\u1248"+ - "\0\ua3f8\0\u1248\0\ua440\0\ua488\0\ua4d0\0\u1248\0\ua518\0\ua560"+ - "\0\ua5a8\0\ua5f0\0\ua638\0\ua680\0\u1248\0\u16c8\0\ua6c8\0\u16c8"+ - "\0\ua710\0\ua758\0\ua7a0\0\ua7e8\0\ua830\0\ua878\0\ua8c0\0\u16c8"+ - "\0\ua908\0\ua950\0\ua998\0\ua9e0\0\uaa28\0\uaa70\0\uaab8\0\u16c8"+ - "\0\u16c8\0\uab00\0\u16c8\0\uab48\0\uab90\0\uabd8\0\u16c8\0\uac20"+ - "\0\uac68\0\uacb0\0\uacf8\0\uad40\0\uad88\0\u16c8\0\u9630\0\uadd0"+ - "\0\uae18\0\u0948\0\uae60\0\uaea8\0\uaef0\0\u0948\0\uaf38\0\uaf80"+ - "\0\uafc8\0\ub010\0\u0948\0\ub058\0\ub0a0\0\ub0e8\0\ub130\0\u0948"+ - "\0\ub178\0\u0948\0\ub1c0\0\ub208\0\u0948\0\ub250\0\u0948\0\u0948"+ - "\0\u0948\0\ub298\0\ub2e0\0\ub328\0\u1248\0\ub370\0\ub3b8\0\ub400"+ - "\0\u1248\0\ub448\0\ub490\0\u1248\0\ub4d8\0\ub520\0\ub568\0\ub5b0"+ - "\0\u1248\0\ub5f8\0\u1248\0\ub640\0\ub688\0\u1248\0\ub6d0\0\u1248"+ - "\0\u1248\0\u1248\0\ub718\0\ub760\0\ub7a8\0\u16c8\0\ub7f0\0\ub838"+ - "\0\ub880\0\u16c8\0\ub8c8\0\ub910\0\u16c8\0\ub958\0\ub9a0\0\ub9e8"+ - "\0\uba30\0\u16c8\0\uba78\0\u16c8\0\ubac0\0\ubb08\0\u16c8\0\ubb50"+ - "\0\u16c8\0\u16c8\0\u16c8\0\ubb98\0\u0948\0\ubbe0\0\ubc28\0\ubc70"+ - "\0\u0948\0\u0948\0\u0948\0\u99d8\0\u0948\0\u0948\0\ubcb8\0\ubd00"+ - "\0\ubd48\0\ubd90\0\ubdd8\0\ube20\0\ube68\0\u1248\0\ubeb0\0\ubef8"+ - "\0\ubf40\0\u1248\0\u1248\0\u1248\0\u1248\0\u1248\0\ubf88\0\ubfd0"+ - "\0\uc018\0\uc060\0\uc0a8\0\uc0f0\0\uc138\0\u16c8\0\uc180\0\uc1c8"+ - "\0\uc210\0\u16c8\0\u16c8\0\u16c8\0\u16c8\0\u16c8\0\uc258\0\uc2a0"+ - "\0\uc2e8\0\uc330\0\uc378\0\uc3c0\0\uc408\0\uc450\0\uc498\0\uc4e0"+ - "\0\uc528\0\u0948\0\u0948\0\u0948\0\uc570\0\uc5b8\0\u0948\0\uc600"+ - "\0\uc648\0\uc690\0\uc6d8\0\u1248\0\u1248\0\u1248\0\uc720\0\uc768"+ - "\0\u1248\0\uc7b0\0\uc7f8\0\uc840\0\uc888\0\u16c8\0\u16c8\0\u16c8"+ - "\0\uc8d0\0\uc918\0\u16c8\0\uc960\0\uc9a8\0\u0948\0\u0948\0\uc9f0"+ - "\0\u0948\0\uca38\0\uca80\0\u1248\0\u1248\0\ucac8\0\u1248\0\ucb10"+ - "\0\ucb58\0\u16c8\0\u16c8\0\ucba0\0\u16c8\0\u0948\0\u0948\0\ucbe8"+ - "\0\u1248\0\u1248\0\ucc30\0\u16c8\0\u16c8\0\ucc78\0\uccc0\0\ucd08"+ - "\0\ucd50\0\u0948\0\u1248\0\u16c8"; + "\0\u7038\0\u7080\0\u70c8\0\u7110\0\u7158\0\u16c8\0\u71a0\0\u71e8"+ + "\0\u7230\0\u16c8\0\u7278\0\u72c0\0\u7308\0\u7350\0\u7398\0\u73e0"+ + "\0\u7428\0\u7470\0\u74b8\0\u0750\0\u0750\0\u7500\0\u7548\0\u0750"+ + "\0\u0750\0\u7590\0\u75d8\0\u7620\0\u7668\0\u0948\0\u76b0\0\u76f8"+ + "\0\u7740\0\u7788\0\u77d0\0\u7818\0\u0948\0\u7860\0\u0948\0\u78a8"+ + "\0\u78f0\0\u7938\0\u7980\0\u0948\0\u79c8\0\u7a10\0\u7a58\0\u7aa0"+ + "\0\u7ae8\0\u7b30\0\u7b78\0\u7bc0\0\u7c08\0\u7c50\0\u7c98\0\u7ce0"+ + "\0\u7d28\0\u7d70\0\u7db8\0\u7e00\0\u7e48\0\u7e90\0\u0948\0\u7ed8"+ + "\0\u7f20\0\u0948\0\u7f68\0\u7fb0\0\u7ff8\0\u8040\0\u8088\0\u80d0"+ + "\0\u0948\0\u8118\0\u0948\0\u8160\0\u81a8\0\u0948\0\u81f0\0\u8238"+ + "\0\u0948\0\u8280\0\u0750\0\u82c8\0\u8310\0\u8358\0\u1248\0\u83a0"+ + "\0\u83e8\0\u8430\0\u8478\0\u84c0\0\u8508\0\u1248\0\u8550\0\u1248"+ + "\0\u8598\0\u85e0\0\u1248\0\u8628\0\u8670\0\u86b8\0\u8700\0\u8748"+ + "\0\u8790\0\u87d8\0\u1248\0\u8820\0\u8868\0\u1248\0\u88b0\0\u88f8"+ + "\0\u8940\0\u8988\0\u89d0\0\u8a18\0\u1248\0\u8a60\0\u1248\0\u8aa8"+ + "\0\u8af0\0\u1248\0\u8b38\0\u8b80\0\u1248\0\u8bc8\0\u8c10\0\u8c58"+ + "\0\u8ca0\0\u16c8\0\u8ce8\0\u8d30\0\u8d78\0\u8dc0\0\u8e08\0\u8e50"+ + "\0\u16c8\0\u8e98\0\u16c8\0\u8ee0\0\u8f28\0\u16c8\0\u8f70\0\u8fb8"+ + "\0\u9000\0\u9048\0\u9090\0\u90d8\0\u9120\0\u16c8\0\u9168\0\u91b0"+ + "\0\u16c8\0\u91f8\0\u9240\0\u9288\0\u92d0\0\u9318\0\u9360\0\u16c8"+ + "\0\u93a8\0\u16c8\0\u93f0\0\u9438\0\u16c8\0\u9480\0\u94c8\0\u16c8"+ + "\0\u9510\0\u9558\0\u95a0\0\u0750\0\u0750\0\u7500\0\u95e8\0\u0948"+ + "\0\u9630\0\u0948\0\u9678\0\u96c0\0\u9708\0\u9750\0\u9798\0\u97e0"+ + "\0\u9828\0\u0948\0\u9870\0\u98b8\0\u9900\0\u9948\0\u9990\0\u99d8"+ + "\0\u9a20\0\u9a68\0\u9ab0\0\u9af8\0\u9b40\0\u9b88\0\u9bd0\0\u9c18"+ + "\0\u9c60\0\u0948\0\u0948\0\u9ca8\0\u0948\0\u9cf0\0\u9d38\0\u9d80"+ + "\0\u0948\0\u9dc8\0\u9e10\0\u9e58\0\u9ea0\0\u9ee8\0\u9f30\0\u0948"+ + "\0\u1248\0\u9f78\0\u1248\0\u9fc0\0\ua008\0\ua050\0\ua098\0\ua0e0"+ + "\0\ua128\0\ua170\0\u1248\0\ua1b8\0\ua200\0\ua248\0\ua290\0\ua2d8"+ + "\0\ua320\0\ua368\0\u1248\0\u1248\0\ua3b0\0\u1248\0\ua3f8\0\ua440"+ + "\0\ua488\0\u1248\0\ua4d0\0\ua518\0\ua560\0\ua5a8\0\ua5f0\0\ua638"+ + "\0\u1248\0\u16c8\0\ua680\0\u16c8\0\ua6c8\0\ua710\0\ua758\0\ua7a0"+ + "\0\ua7e8\0\ua830\0\ua878\0\u16c8\0\ua8c0\0\ua908\0\ua950\0\ua998"+ + "\0\ua9e0\0\uaa28\0\uaa70\0\u16c8\0\u16c8\0\uaab8\0\u16c8\0\uab00"+ + "\0\uab48\0\uab90\0\u16c8\0\uabd8\0\uac20\0\uac68\0\uacb0\0\uacf8"+ + "\0\uad40\0\u16c8\0\u95e8\0\uad88\0\uadd0\0\u0948\0\uae18\0\uae60"+ + "\0\uaea8\0\u0948\0\uaef0\0\uaf38\0\uaf80\0\uafc8\0\u0948\0\ub010"+ + "\0\ub058\0\ub0a0\0\ub0e8\0\u0948\0\ub130\0\u0948\0\ub178\0\ub1c0"+ + "\0\u0948\0\ub208\0\u0948\0\u0948\0\u0948\0\ub250\0\ub298\0\ub2e0"+ + "\0\u1248\0\ub328\0\ub370\0\ub3b8\0\u1248\0\ub400\0\ub448\0\u1248"+ + "\0\ub490\0\ub4d8\0\ub520\0\ub568\0\u1248\0\ub5b0\0\u1248\0\ub5f8"+ + "\0\ub640\0\u1248\0\ub688\0\u1248\0\u1248\0\u1248\0\ub6d0\0\ub718"+ + "\0\ub760\0\u16c8\0\ub7a8\0\ub7f0\0\ub838\0\u16c8\0\ub880\0\ub8c8"+ + "\0\u16c8\0\ub910\0\ub958\0\ub9a0\0\ub9e8\0\u16c8\0\uba30\0\u16c8"+ + "\0\uba78\0\ubac0\0\u16c8\0\ubb08\0\u16c8\0\u16c8\0\u16c8\0\ubb50"+ + "\0\u0948\0\ubb98\0\ubbe0\0\ubc28\0\u0948\0\u0948\0\u0948\0\u9990"+ + "\0\u0948\0\u0948\0\ubc70\0\ubcb8\0\ubd00\0\ubd48\0\ubd90\0\ubdd8"+ + "\0\ube20\0\u1248\0\ube68\0\ubeb0\0\ubef8\0\u1248\0\u1248\0\u1248"+ + "\0\u1248\0\u1248\0\ubf40\0\ubf88\0\ubfd0\0\uc018\0\uc060\0\uc0a8"+ + "\0\uc0f0\0\u16c8\0\uc138\0\uc180\0\uc1c8\0\u16c8\0\u16c8\0\u16c8"+ + "\0\u16c8\0\u16c8\0\uc210\0\uc258\0\uc2a0\0\uc2e8\0\uc330\0\uc378"+ + "\0\uc3c0\0\uc408\0\uc450\0\uc498\0\uc4e0\0\u0948\0\u0948\0\u0948"+ + "\0\uc528\0\uc570\0\u0948\0\uc5b8\0\uc600\0\uc648\0\uc690\0\u1248"+ + "\0\u1248\0\u1248\0\uc6d8\0\uc720\0\u1248\0\uc768\0\uc7b0\0\uc7f8"+ + "\0\uc840\0\u16c8\0\u16c8\0\u16c8\0\uc888\0\uc8d0\0\u16c8\0\uc918"+ + "\0\uc960\0\u0948\0\u0948\0\uc9a8\0\u0948\0\uc9f0\0\uca38\0\u1248"+ + "\0\u1248\0\uca80\0\u1248\0\ucac8\0\ucb10\0\u16c8\0\u16c8\0\ucb58"+ + "\0\u16c8\0\u0948\0\u0948\0\ucba0\0\u1248\0\u1248\0\ucbe8\0\u16c8"+ + "\0\u16c8\0\ucc30\0\ucc78\0\uccc0\0\ucd08\0\u0948\0\u1248\0\u16c8"; private static int [] zzUnpackRowMap() { - int [] result = new int[964]; + int [] result = new int[960]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -550,824 +549,822 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { "\3\176\1\u014a\104\0\1\u014b\1\202\112\0\1\243\1\244"+ "\106\0\1\u014c\113\0\16\206\2\0\7\206\1\0\1\206"+ "\1\0\1\206\2\0\17\206\23\0\4\210\1\211\1\0"+ - "\34\210\1\u014d\51\210\1\211\35\210\1\u014e\45\210\11\u014f"+ - "\1\0\1\u014f\14\0\2\u014f\1\0\1\u014f\2\0\1\u014f"+ - "\2\0\1\u014f\1\0\1\u014f\1\0\2\u014f\20\0\22\u014f"+ - "\11\0\1\u0150\1\0\14\u0150\2\0\1\u0150\1\0\2\u0150"+ - "\1\0\2\u0150\1\0\1\u0150\1\0\1\u0150\2\0\17\u0150"+ + "\34\210\1\u014d\51\210\1\211\35\210\1\u014d\45\210\11\u014e"+ + "\1\0\1\u014e\14\0\2\u014e\1\0\1\u014e\2\0\1\u014e"+ + "\2\0\1\u014e\1\0\1\u014e\1\0\2\u014e\20\0\22\u014e"+ + "\11\0\1\u014f\1\0\14\u014f\2\0\1\u014f\1\0\2\u014f"+ + "\1\0\2\u014f\1\0\1\u014f\1\0\1\u014f\2\0\17\u014f"+ "\34\0\16\216\2\0\7\216\1\0\1\216\1\0\1\216"+ - "\2\0\17\216\23\0\5\220\1\u0151\34\220\1\u0152\52\220"+ - "\1\0\34\220\1\u0153\45\220\11\u0154\1\0\1\u0154\14\0"+ - "\2\u0154\1\0\1\u0154\2\0\1\u0154\2\0\1\u0154\1\0"+ - "\1\u0154\1\0\2\u0154\20\0\22\u0154\11\0\1\u0155\1\0"+ - "\14\u0155\2\0\1\u0155\1\0\2\u0155\1\0\2\u0155\1\0"+ - "\1\u0155\1\0\1\u0155\2\0\17\u0155\24\0\3\226\1\u0156"+ + "\2\0\17\216\23\0\5\220\1\u0150\34\220\1\u0151\52\220"+ + "\1\0\34\220\1\u0152\45\220\11\u0153\1\0\1\u0153\14\0"+ + "\2\u0153\1\0\1\u0153\2\0\1\u0153\2\0\1\u0153\1\0"+ + "\1\u0153\1\0\2\u0153\20\0\22\u0153\11\0\1\u0154\1\0"+ + "\14\u0154\2\0\1\u0154\1\0\2\u0154\1\0\2\u0154\1\0"+ + "\1\u0154\1\0\1\u0154\2\0\17\u0154\24\0\3\226\1\u0155"+ "\104\0\2\226\105\0\114\235\1\0\35\235\1\0\2\235"+ - "\1\u0157\42\235\45\0\1\u0158\43\0\2\34\107\0\1\35"+ - "\105\0\1\243\2\0\105\243\6\u0159\1\u015a\101\u0159\70\0"+ - "\1\u015b\17\0\1\251\2\0\105\251\70\0\1\u015c\31\0"+ - "\1\u015d\14\0\2\u015e\1\0\1\u015d\2\0\1\u015d\64\0"+ - "\1\44\16\0\1\261\1\44\2\0\1\44\64\0\1\u015f"+ - "\17\0\1\u015f\2\0\1\u015f\63\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\10\43\1\u0160\6\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\11\43\1\u0161\5\43"+ - "\34\0\6\43\1\u0162\7\43\2\0\7\43\1\0\3\43"+ + "\1\u0156\42\235\45\0\1\u0157\43\0\2\34\107\0\1\35"+ + "\105\0\1\243\2\0\105\243\6\u0158\1\u0159\101\u0158\70\0"+ + "\1\u015a\17\0\1\251\2\0\105\251\70\0\1\u015b\31\0"+ + "\1\u015c\14\0\2\u015d\1\0\1\u015c\2\0\1\u015c\64\0"+ + "\1\44\16\0\1\261\1\44\2\0\1\44\64\0\1\u015e"+ + "\17\0\1\u015e\2\0\1\u015e\63\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\10\43\1\u015f\6\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\11\43\1\u0160\5\43"+ + "\34\0\6\43\1\u0161\7\43\2\0\7\43\1\0\3\43"+ "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\6\43\1\u0163\10\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\11\43\1\u0164\5\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\1\u0165\16\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\4\43\1\u0166"+ - "\1\u0167\11\43\34\0\4\43\1\u0168\11\43\2\0\7\43"+ + "\2\0\6\43\1\u0162\10\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\11\43\1\u0163\5\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\1\u0164\16\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\4\43\1\u0165"+ + "\1\u0166\11\43\34\0\4\43\1\u0167\11\43\2\0\7\43"+ "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ - "\1\0\2\43\1\u0169\2\0\17\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\4\43\1\u016a\12\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u016b"+ - "\11\43\34\0\16\43\2\0\7\43\1\0\2\43\1\u016c"+ - "\2\0\17\43\55\0\1\u016d\2\0\1\u016d\63\0\2\u016e"+ - "\2\0\2\u016e\4\0\4\u016e\3\0\4\u016e\11\0\2\u016e"+ - "\50\0\14\43\1\u016f\1\43\2\0\7\43\1\0\3\43"+ + "\1\0\2\43\1\u0168\2\0\17\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\4\43\1\u0169\12\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u016a"+ + "\11\43\34\0\16\43\2\0\7\43\1\0\2\43\1\u016b"+ + "\2\0\17\43\55\0\1\u016c\2\0\1\u016c\63\0\2\u016d"+ + "\2\0\2\u016d\4\0\4\u016d\3\0\4\u016d\11\0\2\u016d"+ + "\50\0\14\43\1\u016e\1\43\2\0\7\43\1\0\3\43"+ "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\10\43\1\u0170\6\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\5\43\1\u0171\11\43\63\0\1\u0172"+ - "\36\0\1\u0173\10\0\1\315\2\0\1\315\1\316\37\315"+ - "\1\u0174\46\315\1\u0175\1\u0176\103\315\44\0\1\u0177\43\0"+ - "\1\320\2\0\1\320\1\321\35\320\1\0\2\320\1\u0178"+ - "\45\320\1\u0179\1\u017a\103\320\45\0\1\u017b\53\0\16\43"+ - "\2\0\2\43\1\u017c\4\43\1\0\3\43\2\0\17\43"+ + "\2\0\10\43\1\u016f\6\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\5\43\1\u0170\11\43\63\0\1\u0171"+ + "\36\0\1\u0172\10\0\1\315\2\0\1\315\1\316\37\315"+ + "\1\u0173\46\315\1\u0174\1\u0175\103\315\44\0\1\u0176\43\0"+ + "\1\320\2\0\1\320\1\321\35\320\1\0\2\320\1\u0177"+ + "\45\320\1\u0178\1\u0179\103\320\45\0\1\u017a\53\0\16\43"+ + "\2\0\2\43\1\u017b\4\43\1\0\3\43\2\0\17\43"+ "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\2\43"+ - "\1\u017d\14\43\34\0\10\43\1\u017e\5\43\2\0\7\43"+ - "\1\0\3\43\2\0\10\43\1\u017f\6\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\4\43\1\u0180\12\43"+ + "\1\u017c\14\43\34\0\10\43\1\u017d\5\43\2\0\7\43"+ + "\1\0\3\43\2\0\10\43\1\u017e\6\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\4\43\1\u017f\12\43"+ "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\4\43"+ - "\1\u0181\12\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\1\43\1\u0182\15\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\4\43\1\u0183\1\u0184\11\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\11\43\1\u0185"+ + "\1\u0180\12\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\1\43\1\u0181\15\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\4\43\1\u0182\1\u0183\11\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\11\43\1\u0184"+ "\5\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\1\43\1\u0186\15\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\1\u0187\16\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\1\43\1\u0188\4\43\1\u0189\10\43"+ + "\1\43\1\u0185\15\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\1\u0186\16\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\1\43\1\u0187\4\43\1\u0188\10\43"+ "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\11\43"+ - "\1\u018a\5\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\10\43\1\u018b\6\43\34\0\10\43\1\u018c\5\43"+ + "\1\u0189\5\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\10\43\1\u018a\6\43\34\0\10\43\1\u018b\5\43"+ "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\2\43\1\u018d\2\0\1\43\1\u018e"+ - "\11\43\1\u018f\3\43\34\0\10\43\1\u0190\5\43\2\0"+ - "\7\43\1\0\3\43\2\0\6\43\1\u0191\10\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u0192"+ + "\2\0\7\43\1\0\2\43\1\u018c\2\0\1\43\1\u018d"+ + "\11\43\1\u018e\3\43\34\0\10\43\1\u018f\5\43\2\0"+ + "\7\43\1\0\3\43\2\0\6\43\1\u0190\10\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u0191"+ "\11\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\16\43\1\u0193\34\0\6\43\1\u0194\7\43\2\0\7\43"+ + "\16\43\1\u0192\34\0\6\43\1\u0193\7\43\2\0\7\43"+ "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\5\43\1\u0195\11\43\34\0\6\43"+ - "\1\u0196\1\43\1\u0197\5\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\10\43\1\u0198\5\43\2\0\7\43"+ - "\1\0\3\43\2\0\17\43\113\0\1\u0199\10\0\1\u019a"+ - "\106\0\1\u019b\77\0\1\u019c\107\0\1\u019d\7\0\1\u019e"+ + "\1\0\3\43\2\0\5\43\1\u0194\11\43\34\0\6\43"+ + "\1\u0195\1\43\1\u0196\5\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\10\43\1\u0197\5\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\113\0\1\u0198\10\0\1\u0199"+ + "\106\0\1\u019a\77\0\1\u019b\107\0\1\u019c\7\0\1\u019d"+ "\20\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\10\117\1\u019f\6\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\11\117\1\u01a0\5\117"+ - "\34\0\6\117\1\u01a1\7\117\2\0\7\117\1\0\1\117"+ + "\2\0\10\117\1\u019e\6\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\11\117\1\u019f\5\117"+ + "\34\0\6\117\1\u01a0\7\117\2\0\7\117\1\0\1\117"+ "\1\0\1\117\2\0\17\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\6\117\1\u01a2\10\117"+ + "\1\0\1\117\1\0\1\117\2\0\6\117\1\u01a1\10\117"+ "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\11\117\1\u01a3\5\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\1\u01a4\16\117\34\0"+ + "\2\0\11\117\1\u01a2\5\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\1\u01a3\16\117\34\0"+ "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\4\117\1\u01a5\1\u01a6\11\117\34\0\4\117\1\u01a7\11\117"+ + "\4\117\1\u01a4\1\u01a5\11\117\34\0\4\117\1\u01a6\11\117"+ "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ - "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\u01a8"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\u01a7"+ "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\4\117\1\u01a9\12\117\34\0\16\117"+ + "\1\0\1\117\2\0\4\117\1\u01a8\12\117\34\0\16\117"+ "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\5\117"+ - "\1\u01aa\11\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\u01ab\2\0\17\117\34\0\14\117\1\u01ac\1\117"+ + "\1\u01a9\11\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\u01aa\2\0\17\117\34\0\14\117\1\u01ab\1\117"+ "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\10\117\1\u01ad\6\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\5\117\1\u01ae\11\117"+ - "\34\0\16\117\2\0\2\117\1\u01af\4\117\1\0\1\117"+ + "\2\0\10\117\1\u01ac\6\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\5\117\1\u01ad\11\117"+ + "\34\0\16\117\2\0\2\117\1\u01ae\4\117\1\0\1\117"+ "\1\0\1\117\2\0\17\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\2\117\1\u01b0\14\117"+ - "\34\0\10\117\1\u01b1\5\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\10\117\1\u01b2\6\117\34\0\16\117"+ + "\1\0\1\117\1\0\1\117\2\0\2\117\1\u01af\14\117"+ + "\34\0\10\117\1\u01b0\5\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\10\117\1\u01b1\6\117\34\0\16\117"+ "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\4\117"+ - "\1\u01b3\12\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\4\117\1\u01b4\12\117\34\0\16\117"+ + "\1\u01b2\12\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\4\117\1\u01b3\12\117\34\0\16\117"+ "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\1\117"+ - "\1\u01b5\15\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\4\117\1\u01b6\1\u01b7\11\117\34\0"+ + "\1\u01b4\15\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\4\117\1\u01b5\1\u01b6\11\117\34\0"+ "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\11\117\1\u01b8\5\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\1\117\1\u01b9\15\117\34\0"+ + "\11\117\1\u01b7\5\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\1\117\1\u01b8\15\117\34\0"+ "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\1\u01ba\16\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\1\117\1\u01bb\4\117\1\u01bc\10\117"+ + "\1\u01b9\16\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\1\117\1\u01ba\4\117\1\u01bb\10\117"+ "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\11\117\1\u01bd\5\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\10\117\1\u01be\6\117"+ - "\34\0\10\117\1\u01bf\5\117\2\0\7\117\1\0\1\117"+ + "\2\0\11\117\1\u01bc\5\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\10\117\1\u01bd\6\117"+ + "\34\0\10\117\1\u01be\5\117\2\0\7\117\1\0\1\117"+ "\1\0\1\117\2\0\17\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\u01c0\2\0\1\117\1\u01c1\11\117"+ - "\1\u01c2\3\117\34\0\10\117\1\u01c3\5\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\6\117\1\u01c4\10\117"+ + "\1\0\1\117\1\0\1\u01bf\2\0\1\117\1\u01c0\11\117"+ + "\1\u01c1\3\117\34\0\10\117\1\u01c2\5\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\6\117\1\u01c3\10\117"+ "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\5\117\1\u01c5\11\117\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\16\117\1\u01c6\34\0"+ - "\6\117\1\u01c7\7\117\2\0\7\117\1\0\1\117\1\0"+ + "\2\0\5\117\1\u01c4\11\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\16\117\1\u01c5\34\0"+ + "\6\117\1\u01c6\7\117\2\0\7\117\1\0\1\117\1\0"+ "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u01c8\11\117\34\0"+ - "\6\117\1\u01c9\1\117\1\u01ca\5\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\10\117\1\u01cb"+ + "\1\117\1\0\1\117\2\0\5\117\1\u01c7\11\117\34\0"+ + "\6\117\1\u01c8\1\117\1\u01c9\5\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\10\117\1\u01ca"+ "\5\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ "\17\117\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\10\141\1\u01cc\6\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\11\141\1\u01cd"+ - "\5\141\34\0\6\141\1\u01ce\7\141\2\0\7\141\1\0"+ + "\1\141\2\0\10\141\1\u01cb\6\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\11\141\1\u01cc"+ + "\5\141\34\0\6\141\1\u01cd\7\141\2\0\7\141\1\0"+ "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u01cf"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u01ce"+ "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\11\141\1\u01d0\5\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\1\u01d1\16\141"+ + "\1\141\2\0\11\141\1\u01cf\5\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\1\u01d0\16\141"+ "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\4\141\1\u01d2\1\u01d3\11\141\34\0\4\141\1\u01d4"+ + "\2\0\4\141\1\u01d1\1\u01d2\11\141\34\0\4\141\1\u01d3"+ "\11\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\u01d5\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\4\141\1\u01d6\12\141\34\0"+ + "\1\u01d4\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\4\141\1\u01d5\12\141\34\0"+ "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\5\141\1\u01d7\11\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\u01d8\2\0\17\141\34\0\14\141\1\u01d9"+ + "\5\141\1\u01d6\11\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\u01d7\2\0\17\141\34\0\14\141\1\u01d8"+ "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\10\141\1\u01da\6\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u01db"+ - "\11\141\34\0\16\141\2\0\2\141\1\u01dc\4\141\1\0"+ + "\1\141\2\0\10\141\1\u01d9\6\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u01da"+ + "\11\141\34\0\16\141\2\0\2\141\1\u01db\4\141\1\0"+ "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u01dd"+ - "\14\141\34\0\10\141\1\u01de\5\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\10\141\1\u01df\6\141\34\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u01dc"+ + "\14\141\34\0\10\141\1\u01dd\5\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\10\141\1\u01de\6\141\34\0"+ "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\4\141\1\u01e0\12\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\4\141\1\u01e1\12\141\34\0"+ + "\4\141\1\u01df\12\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\4\141\1\u01e0\12\141\34\0"+ "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\1\141\1\u01e2\15\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\4\141\1\u01e3\1\u01e4\11\141"+ + "\1\141\1\u01e1\15\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\4\141\1\u01e2\1\u01e3\11\141"+ "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\11\141\1\u01e5\5\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\1\141\1\u01e6\15\141"+ + "\2\0\11\141\1\u01e4\5\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\1\141\1\u01e5\15\141"+ "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\1\u01e7\16\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\1\141\1\u01e8\4\141\1\u01e9"+ + "\2\0\1\u01e6\16\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\1\141\1\u01e7\4\141\1\u01e8"+ "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\11\141\1\u01ea\5\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\10\141\1\u01eb"+ - "\6\141\34\0\10\141\1\u01ec\5\141\2\0\7\141\1\0"+ + "\1\141\2\0\11\141\1\u01e9\5\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\10\141\1\u01ea"+ + "\6\141\34\0\10\141\1\u01eb\5\141\2\0\7\141\1\0"+ "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\u01ed\2\0\1\141\1\u01ee"+ - "\11\141\1\u01ef\3\141\34\0\10\141\1\u01f0\5\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u01f1"+ + "\7\141\1\0\1\141\1\0\1\u01ec\2\0\1\141\1\u01ed"+ + "\11\141\1\u01ee\3\141\34\0\10\141\1\u01ef\5\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u01f0"+ "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\5\141\1\u01f2\11\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\16\141\1\u01f3"+ - "\34\0\6\141\1\u01f4\7\141\2\0\7\141\1\0\1\141"+ + "\1\141\2\0\5\141\1\u01f1\11\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\16\141\1\u01f2"+ + "\34\0\6\141\1\u01f3\7\141\2\0\7\141\1\0\1\141"+ "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\5\141\1\u01f5\11\141"+ - "\34\0\6\141\1\u01f6\1\141\1\u01f7\5\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\5\141\1\u01f4\11\141"+ + "\34\0\6\141\1\u01f5\1\141\1\u01f6\5\141\2\0\7\141"+ "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\10\141"+ - "\1\u01f8\5\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\17\141\24\0\2\163\105\0\3\162\1\u0144\1\u01f9"+ - "\35\162\1\0\2\162\1\0\43\162\1\u01fa\1\u01fb\1\162"+ + "\1\u01f7\5\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\24\0\2\163\105\0\3\162\1\u0144\1\u01f8"+ + "\35\162\1\0\2\162\1\0\43\162\1\u01f9\1\u01fa\1\162"+ "\1\164\35\162\1\0\2\162\1\0\42\162\4\167\1\0"+ - "\35\167\1\0\2\167\1\u01fc\46\167\1\0\35\167\1\0"+ - "\2\167\1\u01fd\42\167\11\0\16\u0148\2\0\7\u0148\1\0"+ + "\35\167\1\0\2\167\1\u01fb\46\167\1\0\35\167\1\0"+ + "\2\167\1\u01fc\42\167\11\0\16\u0148\2\0\7\u0148\1\0"+ "\1\u0148\1\0\1\u0148\2\0\17\u0148\34\0\16\u0149\2\0"+ "\7\u0149\1\0\1\u0149\1\0\1\u0149\2\0\17\u0149\24\0"+ - "\2\176\107\0\1\202\105\0\4\u01fe\1\u01ff\1\u014f\3\u01fe"+ - "\1\210\1\u01fe\14\210\2\u01fe\1\210\1\u01fe\2\210\1\u01fe"+ - "\2\210\1\u01fe\1\210\1\u0200\1\210\2\u01fe\20\210\22\u01fe"+ - "\11\0\16\u0150\2\0\7\u0150\1\0\1\u0150\1\0\1\u0150"+ - "\2\0\17\u0150\23\0\5\220\1\0\34\220\1\0\45\220"+ - "\11\0\16\u0155\2\0\7\u0155\1\0\1\u0155\1\0\1\u0155"+ - "\2\0\17\u0155\23\0\4\235\1\0\35\235\1\0\2\235"+ - "\1\0\42\235\45\0\1\u0201\42\0\6\u0159\1\u0202\101\u0159"+ - "\5\u0203\1\u0204\1\u015a\101\u0203\12\0\1\u015d\2\u0205\2\254"+ - "\4\0\2\257\4\0\1\u015e\1\u015d\2\0\1\u015d\64\0"+ - "\1\u015d\17\0\1\u015d\2\0\1\u015d\64\0\1\u015f\2\u0205"+ - "\2\254\4\0\2\257\2\260\2\0\1\u0206\1\u015f\2\0"+ - "\1\u015f\63\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\1\43\1\u0207\15\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\1\43\1\u0208\15\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\4\43\1\u0209\12\43\34\0"+ - "\2\43\1\u020a\13\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\6\43\1\u020b\7\43\2\0\7\43\1\0"+ - "\3\43\2\0\10\43\1\u020c\6\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\5\43\1\u020d\11\43\34\0"+ - "\14\43\1\u020e\1\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\1\43\1\u020f\15\43\34\0\16\43\2\0\2\43\1\u0210"+ - "\4\43\1\0\3\43\2\0\17\43\34\0\14\43\1\u0211"+ - "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ - "\14\43\1\u0212\1\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\7\43\1\u0213\7\43\36\0\2\253\2\0\2\255\2\256"+ - "\6\0\1\u0214\1\u016d\2\0\1\u016d\63\0\2\u016e\2\253"+ - "\2\u016e\2\255\2\256\4\u016e\2\0\1\u0215\4\u016e\11\0"+ - "\2\u016e\50\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\1\43\1\u0216\15\43\34\0\6\43\1\u0217\7\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\14\43\1\u0218"+ - "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\23\0"+ - "\3\315\1\u0175\1\u0219\37\315\1\u0174\44\315\1\u021a\1\u021b"+ - "\1\315\1\316\37\315\1\u0174\43\315\4\u0177\1\u021c\37\u0177"+ - "\1\u021d\43\u0177\3\320\1\u0179\1\u021e\35\320\1\0\2\320"+ - "\1\u0178\43\320\1\u021f\1\u0220\1\320\1\321\35\320\1\0"+ - "\2\320\1\u0178\42\320\4\u0221\1\u0222\35\u0221\1\0\2\u0221"+ - "\1\u0223\42\u0221\11\0\6\43\1\u0224\7\43\2\0\7\43"+ - "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\3\43\1\u0225\13\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\12\43\1\u0226\4\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\5\43"+ - "\1\u0227\11\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\5\43\1\u0228\11\43\34\0\14\43\1\u0229\1\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\4\43\1\u022a\12\43"+ - "\34\0\14\43\1\u022b\1\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\2\43\1\u022c\14\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\5\43\1\u022d\11\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\6\43\1\u022e\10\43"+ - "\34\0\14\43\1\u022f\1\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\5\43\1\u0230\11\43\34\0\10\43\1\u0231\5\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\2\43\1\u0232\14\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\6\43"+ - "\1\u0233\10\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\5\43\1\u0234\11\43\34\0\14\43\1\u0235\1\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\11\43\1\u0236\5\43"+ + "\2\176\107\0\1\202\116\0\16\u014f\2\0\7\u014f\1\0"+ + "\1\u014f\1\0\1\u014f\2\0\17\u014f\23\0\5\220\1\0"+ + "\34\220\1\0\45\220\11\0\16\u0154\2\0\7\u0154\1\0"+ + "\1\u0154\1\0\1\u0154\2\0\17\u0154\23\0\4\235\1\0"+ + "\35\235\1\0\2\235\1\0\42\235\45\0\1\u01fd\42\0"+ + "\6\u0158\1\u01fe\101\u0158\5\u01ff\1\u0200\1\u0159\101\u01ff\12\0"+ + "\1\u015c\2\u0201\2\254\4\0\2\257\4\0\1\u015d\1\u015c"+ + "\2\0\1\u015c\64\0\1\u015c\17\0\1\u015c\2\0\1\u015c"+ + "\64\0\1\u015e\2\u0201\2\254\4\0\2\257\2\260\2\0"+ + "\1\u0202\1\u015e\2\0\1\u015e\63\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\1\43\1\u0203\15\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\1\43\1\u0204\15\43"+ "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\4\43"+ - "\1\u0237\12\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\10\43\1\u0238\6\43\34\0\16\43\2\0\7\43"+ - "\1\0\2\43\1\u0239\2\0\17\43\34\0\6\43\1\u023a"+ - "\7\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ - "\10\43\1\u023b\5\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\1\43\1\u023c\15\43\34\0\12\43\1\u023d\3\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\6\43\1\u023e"+ - "\7\43\2\0\7\43\1\0\3\43\2\0\17\43\113\0"+ - "\1\u023f\30\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\1\117\1\u0240\15\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u0241"+ - "\15\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\4\117\1\u0242\12\117\34\0\2\117\1\u0243"+ - "\13\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\6\117\1\u0244\7\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\10\117\1\u0245\6\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\5\117\1\u0246\11\117\34\0\14\117\1\u0247\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\1\117\1\u0248\15\117\34\0\16\117\2\0\2\117\1\u0249"+ - "\4\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\14\117\1\u024a\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\14\117\1\u024b\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\7\117\1\u024c\7\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\1\117\1\u024d\15\117\34\0"+ - "\6\117\1\u024e\7\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\14\117\1\u024f\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\6\117\1\u0250\7\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\3\117\1\u0251\13\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\12\117\1\u0252\4\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u0253\11\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\5\117\1\u0254\11\117\34\0\14\117\1\u0255\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\4\117\1\u0256\12\117\34\0\14\117\1\u0257\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\2\117\1\u0258\14\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u0259\11\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\6\117\1\u025a\10\117\34\0\14\117\1\u025b\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\5\117\1\u025c\11\117\34\0\10\117\1\u025d\5\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\2\117\1\u025e\14\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\6\117\1\u025f\10\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\5\117\1\u0260\11\117\34\0\14\117\1\u0261\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\11\117\1\u0262\5\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\4\117\1\u0263\12\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\10\117\1\u0264\6\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\u0265\2\0\17\117\34\0\6\117\1\u0266"+ - "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\10\117\1\u0267\5\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u0268"+ - "\15\117\34\0\12\117\1\u0269\3\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\6\117\1\u026a"+ - "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\1\141\1\u026b\15\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u026c"+ - "\15\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\4\141\1\u026d\12\141\34\0\2\141\1\u026e"+ - "\13\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\6\141\1\u026f\7\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\10\141\1\u0270\6\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\5\141\1\u0271\11\141\34\0\14\141\1\u0272\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\1\141\1\u0273\15\141\34\0\16\141\2\0\2\141\1\u0274"+ - "\4\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\14\141\1\u0275\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\14\141\1\u0276\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\7\141\1\u0277\7\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\1\141\1\u0278\15\141\34\0"+ - "\6\141\1\u0279\7\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\14\141\1\u027a\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\6\141\1\u027b\7\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\3\141\1\u027c\13\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\12\141\1\u027d\4\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\5\141\1\u027e\11\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\5\141\1\u027f\11\141\34\0\14\141\1\u0280\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\4\141\1\u0281\12\141\34\0\14\141\1\u0282\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\2\141\1\u0283\14\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\5\141\1\u0284\11\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\6\141\1\u0285\10\141\34\0\14\141\1\u0286\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\5\141\1\u0287\11\141\34\0\10\141\1\u0288\5\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\2\141\1\u0289\14\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\6\141\1\u028a\10\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\5\141\1\u028b\11\141\34\0\14\141\1\u028c\1\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\11\141\1\u028d\5\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\4\141\1\u028e\12\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\10\141\1\u028f\6\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\u0290\2\0\17\141\34\0\6\141\1\u0291"+ - "\7\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\10\141\1\u0292\5\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u0293"+ - "\15\141\34\0\12\141\1\u0294\3\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\6\141\1\u0295"+ - "\7\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\23\0\1\162\1\u0296\2\u0144\1\u0145\103\162\1\0"+ - "\1\162\1\u0144\1\u01fb\1\u0297\104\0\2\162\1\u01fb\1\u0297"+ - "\103\0\4\167\1\0\35\167\1\0\2\167\1\u0298\42\167"+ - "\5\u0159\1\u0299\1\u029a\101\u0159\6\u0203\1\u029b\101\u0203\12\0"+ - "\1\u015f\16\0\1\u0206\1\u015f\2\0\1\u015f\63\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\5\43\1\u029c\11\43"+ - "\34\0\6\43\1\u029d\7\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\14\43\1\u029e\1\43\2\0\7\43"+ - "\1\0\3\43\2\0\17\43\34\0\14\43\1\u029f\1\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\6\43\1\u02a0\10\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\1\43"+ - "\1\u02a1\15\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\6\43\1\u02a2\10\43\34\0\16\43\2\0\7\43"+ - "\1\0\2\43\1\u02a3\2\0\17\43\34\0\6\43\1\u02a4"+ - "\7\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\11\43\1\u02a5"+ - "\5\43\54\0\1\u0214\1\u016d\2\0\1\u016d\63\0\2\u016e"+ - "\2\0\2\u016e\4\0\4\u016e\2\0\1\u0215\4\u016e\11\0"+ - "\2\u016e\50\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\3\43\1\u02a6\13\43\34\0\14\43\1\u02a7\1\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\23\0\1\315\1\u02a8"+ - "\2\u0175\1\u0176\103\315\1\0\1\315\1\u0175\1\u021b\1\u02a9"+ - "\104\0\2\315\1\u021b\1\u02a9\103\0\4\u0177\1\u021c\37\u0177"+ - "\1\u02aa\107\u0177\1\u02ab\43\u0177\1\320\1\u02ac\2\u0179\1\u017a"+ - "\103\320\1\0\1\320\1\u0179\1\u0220\1\u02ad\104\0\2\320"+ - "\1\u0220\1\u02ad\103\0\4\u0221\1\u0222\35\u0221\1\0\2\u0221"+ - "\1\u02ae\156\u0221\1\0\35\u0221\1\0\2\u0221\1\u02af\42\u0221"+ - "\11\0\10\43\1\u02b0\5\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\1\43\1\u02b1\15\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\1\43\1\u02b2\15\43\34\0\14\43"+ - "\1\u02b3\1\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\6\43"+ - "\1\u02b4\10\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\6\43\1\u02b5\10\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\4\43\1\u02b6\12\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\14\43\1\u02b7\2\43"+ - "\34\0\10\43\1\u02b8\5\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\6\43\1\u02b9\10\43\34\0\10\43\1\u02ba\5\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\2\43\1\u02bb\14\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\14\43"+ - "\1\u02bc\2\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\5\43\1\u02bd\11\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\2\43\1\u02be\14\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\4\43\1\u02bf\12\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\16\43"+ - "\1\u02c0\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\6\43\1\u02c1\10\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\12\43\1\u02c2\4\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\5\43\1\u02c3\11\43\34\0"+ - "\14\43\1\u02c4\1\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\5\117\1\u02c5\11\117\34\0\6\117\1\u02c6"+ - "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\14\117\1\u02c7\1\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\14\117\1\u02c8"+ - "\1\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\6\117\1\u02c9\10\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u02ca"+ - "\15\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\6\117\1\u02cb\10\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\u02cc\2\0\17\117\34\0"+ - "\6\117\1\u02cd\7\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\11\117\1\u02ce\5\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\3\117\1\u02cf\13\117\34\0\14\117\1\u02d0\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\10\117\1\u02d1\5\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\1\117\1\u02d2\15\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\1\117\1\u02d3\15\117\34\0\14\117\1\u02d4\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\6\117\1\u02d5\10\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\6\117\1\u02d6\10\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\4\117\1\u02d7\12\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\14\117\1\u02d8\2\117\34\0"+ - "\10\117\1\u02d9\5\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\6\117\1\u02da\10\117\34\0"+ - "\10\117\1\u02db\5\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\2\117\1\u02dc\14\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\14\117\1\u02dd\2\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u02de\11\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\2\117\1\u02df\14\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\4\117\1\u02e0\12\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\16\117\1\u02e1\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\6\117\1\u02e2\10\117\34\0\16\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\12\117"+ - "\1\u02e3\4\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\5\117\1\u02e4\11\117\34\0\14\117"+ - "\1\u02e5\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\17\117\34\0\16\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\5\141\1\u02e6\11\141\34\0\6\141"+ - "\1\u02e7\7\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\17\141\34\0\14\141\1\u02e8\1\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\14\141"+ - "\1\u02e9\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\6\141\1\u02ea\10\141\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\1\141"+ - "\1\u02eb\15\141\34\0\16\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\6\141\1\u02ec\10\141\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\u02ed\2\0\17\141"+ - "\34\0\6\141\1\u02ee\7\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\11\141\1\u02ef\5\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\3\141\1\u02f0\13\141\34\0\14\141\1\u02f1\1\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\10\141\1\u02f2\5\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\1\141\1\u02f3\15\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\1\141\1\u02f4\15\141\34\0\14\141\1\u02f5\1\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\6\141\1\u02f6\10\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\6\141\1\u02f7\10\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\4\141\1\u02f8\12\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\14\141\1\u02f9\2\141"+ - "\34\0\10\141\1\u02fa\5\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\6\141\1\u02fb\10\141"+ - "\34\0\10\141\1\u02fc\5\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\2\141\1\u02fd\14\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\14\141\1\u02fe\2\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\5\141\1\u02ff\11\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\2\141\1\u0300\14\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\4\141\1\u0301\12\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\16\141\1\u0302\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\6\141\1\u0303\10\141\34\0"+ - "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\12\141\1\u0304\4\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\5\141\1\u0305\11\141\34\0"+ - "\14\141\1\u0306\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\23\0\2\162\2\u0144\1\u01f9\35\162"+ - "\1\0\2\162\1\0\42\162\1\0\1\u01fa\1\u01fb\105\0"+ - "\5\u0203\1\u0204\1\u0307\101\u0203\11\0\6\43\1\u0308\7\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\7\43\1\u0309\7\43"+ + "\1\u0205\12\43\34\0\2\43\1\u0206\13\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\6\43\1\u0207\7\43"+ + "\2\0\7\43\1\0\3\43\2\0\10\43\1\u0208\6\43"+ "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\5\43"+ - "\1\u030a\11\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\11\43\1\u030b\5\43\34\0\4\43\1\u030c\11\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\6\43"+ - "\1\u030d\7\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\14\43\1\u030e\1\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\12\43\1\u030f\3\43\2\0\7\43"+ + "\1\u0209\11\43\34\0\14\43\1\u020a\1\43\2\0\7\43"+ "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\1\43\1\u0310\15\43\23\0\2\315"+ - "\2\u0175\1\u0219\37\315\1\u0174\43\315\1\0\1\u021a\1\u021b"+ - "\105\0\4\u0177\1\u021c\37\u0177\1\u0311\107\u0177\1\u0174\43\u0177"+ - "\2\320\2\u0179\1\u021e\35\320\1\0\2\320\1\u0178\42\320"+ - "\1\0\1\u021f\1\u0220\105\0\4\u0221\1\0\35\u0221\1\0"+ - "\2\u0221\1\u0312\46\u0221\1\0\35\u0221\1\0\2\u0221\1\0"+ - "\42\u0221\11\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\2\43\1\u0313\14\43\34\0\2\43\1\u0314\13\43\2\0"+ - "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\5\43\1\u0315\11\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\2\43\1\u0316"+ - "\14\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\1\43\1\u0317\15\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\5\43\1\u0318\11\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\11\43\1\u0319\5\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\2\43\1\u031a"+ - "\14\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\5\43\1\u031b\11\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\6\43\1\u031c\10\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\14\43\1\u031d\2\43\34\0"+ - "\10\43\1\u031e\5\43\2\0\7\43\1\0\3\43\2\0"+ + "\1\0\3\43\2\0\1\43\1\u020b\15\43\34\0\16\43"+ + "\2\0\2\43\1\u020c\4\43\1\0\3\43\2\0\17\43"+ + "\34\0\14\43\1\u020d\1\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\14\43\1\u020e\1\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\7\43\1\u020f\7\43\36\0\2\253"+ + "\2\0\2\255\2\256\6\0\1\u0210\1\u016c\2\0\1\u016c"+ + "\63\0\2\u016d\2\253\2\u016d\2\255\2\256\4\u016d\2\0"+ + "\1\u0211\4\u016d\11\0\2\u016d\50\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\1\43\1\u0212\15\43\34\0\6\43"+ + "\1\u0213\7\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\34\0\14\43\1\u0214\1\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\23\0\3\315\1\u0174\1\u0215\37\315\1\u0173"+ + "\44\315\1\u0216\1\u0217\1\315\1\316\37\315\1\u0173\43\315"+ + "\4\u0176\1\u0218\37\u0176\1\u0219\43\u0176\3\320\1\u0178\1\u021a"+ + "\35\320\1\0\2\320\1\u0177\43\320\1\u021b\1\u021c\1\320"+ + "\1\321\35\320\1\0\2\320\1\u0177\42\320\4\u021d\1\u021e"+ + "\35\u021d\1\0\2\u021d\1\u021f\42\u021d\11\0\6\43\1\u0220"+ + "\7\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\3\43\1\u0221"+ + "\13\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\12\43\1\u0222\4\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\5\43\1\u0223\11\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\5\43\1\u0224\11\43\34\0"+ + "\14\43\1\u0225\1\43\2\0\7\43\1\0\3\43\2\0"+ "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\4\43\1\u031f\12\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\11\43\1\u0320\5\43\34\0\14\43\1\u0321"+ - "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ - "\10\43\1\u0322\5\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\6\117\1\u0323\7\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\7\117\1\u0324"+ - "\7\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\5\117\1\u0325\11\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u0326"+ - "\5\117\34\0\4\117\1\u0327\11\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\6\117\1\u0328"+ - "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\14\117\1\u0329\1\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\12\117\1\u032a"+ - "\3\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\1\117\1\u032b\15\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\2\117\1\u032c"+ - "\14\117\34\0\2\117\1\u032d\13\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\5\117\1\u032e"+ - "\11\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\2\117\1\u032f\14\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\1\117\1\u0330"+ - "\15\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\5\117\1\u0331\11\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u0332"+ - "\5\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\2\117\1\u0333\14\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\5\117\1\u0334"+ - "\11\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\6\117\1\u0335\10\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\14\117\1\u0336"+ - "\2\117\34\0\10\117\1\u0337\5\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\4\117\1\u0338"+ - "\12\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\11\117\1\u0339\5\117\34\0\14\117\1\u033a"+ - "\1\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\10\117\1\u033b\5\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\6\141\1\u033c"+ - "\7\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\7\141\1\u033d\7\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u033e"+ - "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\11\141\1\u033f\5\141\34\0\4\141\1\u0340"+ - "\11\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\6\141\1\u0341\7\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\14\141\1\u0342"+ - "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\12\141\1\u0343\3\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u0344"+ - "\15\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\2\141\1\u0345\14\141\34\0\2\141\1\u0346"+ - "\13\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\5\141\1\u0347\11\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u0348"+ - "\14\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\1\141\1\u0349\15\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u034a"+ - "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\11\141\1\u034b\5\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\2\141\1\u034c"+ - "\14\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\5\141\1\u034d\11\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u034e"+ - "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\14\141\1\u034f\2\141\34\0\10\141\1\u0350"+ - "\5\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\4\141\1\u0351\12\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\11\141\1\u0352"+ - "\5\141\34\0\14\141\1\u0353\1\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\10\141\1\u0354"+ - "\5\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\13\43\1\u0355\3\43\34\0\14\43\1\u0356\1\43\2\0"+ + "\4\43\1\u0226\12\43\34\0\14\43\1\u0227\1\43\2\0"+ "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\2\43\1\u0357\14\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\1\43\1\u0358"+ - "\15\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ - "\5\43\1\u0359\11\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\4\43\1\u035a\12\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\11\43\1\u035b\5\43\23\0"+ - "\44\u0177\1\u035c\43\u0177\4\u0221\1\0\35\u0221\1\0\2\u0221"+ - "\1\u0178\42\u0221\11\0\14\43\1\u035d\1\43\2\0\7\43"+ - "\1\0\3\43\2\0\17\43\34\0\14\43\1\u035e\1\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\5\43\1\u035f\11\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\2\43"+ - "\1\u0360\14\43\34\0\16\43\2\0\7\43\1\0\2\43"+ - "\1\u0361\2\0\17\43\34\0\4\43\1\u0362\11\43\2\0"+ + "\7\43\1\0\3\43\2\0\2\43\1\u0228\14\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u0229"+ + "\11\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\6\43\1\u022a\10\43\34\0\14\43\1\u022b\1\43\2\0"+ "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ - "\7\43\1\0\3\43\2\0\10\43\1\u0363\6\43\34\0"+ - "\14\43\1\u0364\1\43\2\0\7\43\1\0\3\43\2\0"+ - "\17\43\34\0\6\43\1\u0365\7\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\13\117\1\u0366\3\117\34\0"+ - "\14\117\1\u0367\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\2\117\1\u0368\14\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\1\117\1\u0369\15\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\5\117\1\u036a\11\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\4\117\1\u036b\12\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\11\117\1\u036c\5\117\34\0"+ - "\14\117\1\u036d\1\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\17\117\34\0\14\117\1\u036e\1\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\5\117\1\u036f\11\117\34\0\16\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\2\117\1\u0370\14\117\34\0"+ - "\16\117\2\0\7\117\1\0\1\117\1\0\1\u0371\2\0"+ - "\17\117\34\0\4\117\1\u0372\11\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\10\117\1\u0373"+ - "\6\117\34\0\14\117\1\u0374\1\117\2\0\7\117\1\0"+ - "\1\117\1\0\1\117\2\0\17\117\34\0\6\117\1\u0375"+ - "\7\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\13\141\1\u0376\3\141\34\0\14\141\1\u0377"+ - "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\2\141\1\u0378\14\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\1\141\1\u0379"+ - "\15\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\5\141\1\u037a\11\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\4\141\1\u037b"+ - "\12\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\11\141\1\u037c\5\141\34\0\14\141\1\u037d"+ - "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\14\141\1\u037e\1\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u037f"+ - "\11\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\2\141\1\u0380\14\141\34\0\16\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\u0381\2\0\17\141\34\0"+ - "\4\141\1\u0382\11\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ - "\1\141\1\0\1\141\2\0\10\141\1\u0383\6\141\34\0"+ - "\14\141\1\u0384\1\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\17\141\34\0\6\141\1\u0385\7\141\2\0"+ - "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\11\43\1\u0386"+ - "\5\43\34\0\14\43\1\u0387\1\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\2\43\1\u0388\14\43\34\0\14\43\1\u0389"+ - "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ - "\16\43\2\0\7\43\1\0\3\43\2\0\5\43\1\u038a"+ - "\11\43\34\0\14\43\1\u038b\1\43\2\0\7\43\1\0"+ - "\3\43\2\0\17\43\34\0\16\43\2\0\7\43\1\0"+ - "\3\43\2\0\1\u038c\16\43\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\11\43\1\u038d\5\43\34\0\16\43"+ - "\2\0\7\43\1\0\3\43\2\0\11\43\1\u038e\5\43"+ - "\34\0\14\43\1\u038f\1\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\11\117\1\u0390\5\117\34\0\14\117"+ - "\1\u0391\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\2\117\1\u0392\14\117\34\0\14\117"+ - "\1\u0393\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\5\117\1\u0394\11\117\34\0\14\117"+ - "\1\u0395\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\1\u0396\16\117\34\0\16\117\2\0"+ - "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u0397"+ - "\5\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ - "\1\117\2\0\11\117\1\u0398\5\117\34\0\14\117\1\u0399"+ - "\1\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ - "\17\117\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\11\141\1\u039a\5\141\34\0\14\141\1\u039b"+ - "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\2\141\1\u039c\14\141\34\0\14\141\1\u039d"+ - "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\5\141\1\u039e\11\141\34\0\14\141\1\u039f"+ - "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ - "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ - "\1\141\2\0\1\u03a0\16\141\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\11\141\1\u03a1\5\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\11\141\1\u03a2\5\141\34\0\14\141\1\u03a3\1\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\5\43"+ - "\1\u03a4\11\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\10\43\1\u03a5\6\43\34\0\14\43\1\u03a6\1\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\12\43"+ - "\1\u03a7\3\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\10\43\1\u03a8\5\43\2\0\7\43\1\0\3\43"+ - "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ - "\2\0\5\43\1\u03a9\11\43\34\0\16\117\2\0\7\117"+ - "\1\0\1\117\1\0\1\117\2\0\5\117\1\u03aa\11\117"+ + "\7\43\1\0\3\43\2\0\5\43\1\u022c\11\43\34\0"+ + "\10\43\1\u022d\5\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\2\43\1\u022e\14\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\6\43\1\u022f\10\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\5\43\1\u0230\11\43\34\0"+ + "\14\43\1\u0231\1\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\11\43\1\u0232\5\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\4\43\1\u0233\12\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\10\43\1\u0234\6\43\34\0"+ + "\16\43\2\0\7\43\1\0\2\43\1\u0235\2\0\17\43"+ + "\34\0\6\43\1\u0236\7\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\10\43\1\u0237\5\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\1\43\1\u0238\15\43\34\0\12\43"+ + "\1\u0239\3\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\34\0\6\43\1\u023a\7\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\113\0\1\u023b\30\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\1\117\1\u023c\15\117"+ "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\10\117\1\u03ab\6\117\34\0\14\117\1\u03ac\1\117"+ - "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ - "\34\0\12\117\1\u03ad\3\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\17\117\34\0\10\117\1\u03ae\5\117"+ + "\2\0\1\117\1\u023d\15\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\4\117\1\u023e\12\117"+ + "\34\0\2\117\1\u023f\13\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\6\117\1\u0240\7\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\10\117"+ + "\1\u0241\6\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\5\117\1\u0242\11\117\34\0\14\117"+ + "\1\u0243\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\1\117\1\u0244\15\117\34\0\16\117"+ + "\2\0\2\117\1\u0245\4\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\14\117\1\u0246\1\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\14\117"+ + "\1\u0247\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\7\117\1\u0248\7\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\1\117"+ + "\1\u0249\15\117\34\0\6\117\1\u024a\7\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\14\117"+ + "\1\u024b\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\6\117\1\u024c\7\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\3\117"+ + "\1\u024d\13\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\12\117\1\u024e\4\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\5\117"+ + "\1\u024f\11\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\5\117\1\u0250\11\117\34\0\14\117"+ + "\1\u0251\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\4\117\1\u0252\12\117\34\0\14\117"+ + "\1\u0253\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\2\117\1\u0254\14\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\5\117"+ + "\1\u0255\11\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\6\117\1\u0256\10\117\34\0\14\117"+ + "\1\u0257\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\5\117\1\u0258\11\117\34\0\10\117"+ + "\1\u0259\5\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\2\117\1\u025a\14\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\6\117"+ + "\1\u025b\10\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\5\117\1\u025c\11\117\34\0\14\117"+ + "\1\u025d\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\11\117\1\u025e\5\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\4\117"+ + "\1\u025f\12\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\10\117\1\u0260\6\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\u0261\2\0\17\117"+ + "\34\0\6\117\1\u0262\7\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\10\117\1\u0263\5\117"+ "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\5\117\1\u03af\11\117\34\0\16\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\5\141\1\u03b0\11\141"+ + "\2\0\1\117\1\u0264\15\117\34\0\12\117\1\u0265\3\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\6\117\1\u0266\7\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\1\141\1\u0267\15\141"+ "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\10\141\1\u03b1\6\141\34\0\14\141\1\u03b2\1\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\12\141\1\u03b3\3\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\10\141\1\u03b4\5\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ - "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ - "\2\0\5\141\1\u03b5\11\141\34\0\16\43\2\0\7\43"+ - "\1\0\3\43\2\0\4\43\1\u03b6\12\43\34\0\4\43"+ - "\1\u03b7\11\43\2\0\7\43\1\0\3\43\2\0\17\43"+ - "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\15\43"+ - "\1\u03b8\1\43\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\4\117\1\u03b9\12\117\34\0\4\117"+ - "\1\u03ba\11\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ - "\1\0\1\117\2\0\15\117\1\u03bb\1\117\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\4\141"+ - "\1\u03bc\12\141\34\0\4\141\1\u03bd\11\141\2\0\7\141"+ + "\2\0\1\141\1\u0268\15\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\4\141\1\u0269\12\141"+ + "\34\0\2\141\1\u026a\13\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\6\141\1\u026b\7\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\10\141"+ + "\1\u026c\6\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\5\141\1\u026d\11\141\34\0\14\141"+ + "\1\u026e\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\1\141\1\u026f\15\141\34\0\16\141"+ + "\2\0\2\141\1\u0270\4\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\14\141\1\u0271\1\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\14\141"+ + "\1\u0272\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\7\141\1\u0273\7\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\1\141"+ + "\1\u0274\15\141\34\0\6\141\1\u0275\7\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\14\141"+ + "\1\u0276\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\6\141\1\u0277\7\141\2\0\7\141"+ "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\16\141"+ - "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\15\141"+ - "\1\u03be\1\141\34\0\14\43\1\u03bf\1\43\2\0\7\43"+ - "\1\0\3\43\2\0\17\43\34\0\14\117\1\u03c0\1\117"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\3\141"+ + "\1\u0278\13\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\12\141\1\u0279\4\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\5\141"+ + "\1\u027a\11\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\5\141\1\u027b\11\141\34\0\14\141"+ + "\1\u027c\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\4\141\1\u027d\12\141\34\0\14\141"+ + "\1\u027e\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\2\141\1\u027f\14\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\5\141"+ + "\1\u0280\11\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\6\141\1\u0281\10\141\34\0\14\141"+ + "\1\u0282\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\5\141\1\u0283\11\141\34\0\10\141"+ + "\1\u0284\5\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\2\141\1\u0285\14\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\6\141"+ + "\1\u0286\10\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\5\141\1\u0287\11\141\34\0\14\141"+ + "\1\u0288\1\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\11\141\1\u0289\5\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\4\141"+ + "\1\u028a\12\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\10\141\1\u028b\6\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\u028c\2\0\17\141"+ + "\34\0\6\141\1\u028d\7\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\10\141\1\u028e\5\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\1\141\1\u028f\15\141\34\0\12\141\1\u0290\3\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ + "\34\0\6\141\1\u0291\7\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\23\0\1\162\1\u0292\2\u0144"+ + "\1\u0145\103\162\1\0\1\162\1\u0144\1\u01fa\1\u0293\104\0"+ + "\2\162\1\u01fa\1\u0293\103\0\4\167\1\0\35\167\1\0"+ + "\2\167\1\u0294\42\167\5\u0158\1\u0295\1\u0296\101\u0158\6\u01ff"+ + "\1\u0297\101\u01ff\12\0\1\u015e\16\0\1\u0202\1\u015e\2\0"+ + "\1\u015e\63\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\5\43\1\u0298\11\43\34\0\6\43\1\u0299\7\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\14\43\1\u029a"+ + "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\14\43\1\u029b\1\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\6\43\1\u029c\10\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\1\43\1\u029d\15\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\6\43\1\u029e\10\43\34\0"+ + "\16\43\2\0\7\43\1\0\2\43\1\u029f\2\0\17\43"+ + "\34\0\6\43\1\u02a0\7\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\11\43\1\u02a1\5\43\54\0\1\u0210\1\u016c\2\0"+ + "\1\u016c\63\0\2\u016d\2\0\2\u016d\4\0\4\u016d\2\0"+ + "\1\u0211\4\u016d\11\0\2\u016d\50\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\3\43\1\u02a2\13\43\34\0\14\43"+ + "\1\u02a3\1\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\23\0\1\315\1\u02a4\2\u0174\1\u0175\103\315\1\0\1\315"+ + "\1\u0174\1\u0217\1\u02a5\104\0\2\315\1\u0217\1\u02a5\103\0"+ + "\4\u0176\1\u0218\37\u0176\1\u02a6\107\u0176\1\u02a7\43\u0176\1\320"+ + "\1\u02a8\2\u0178\1\u0179\103\320\1\0\1\320\1\u0178\1\u021c"+ + "\1\u02a9\104\0\2\320\1\u021c\1\u02a9\103\0\4\u021d\1\u021e"+ + "\35\u021d\1\0\2\u021d\1\u02aa\156\u021d\1\0\35\u021d\1\0"+ + "\2\u021d\1\u02ab\42\u021d\11\0\10\43\1\u02ac\5\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\1\43\1\u02ad\15\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\1\43\1\u02ae"+ + "\15\43\34\0\14\43\1\u02af\1\43\2\0\7\43\1\0"+ + "\3\43\2\0\17\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\6\43\1\u02b0\10\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\6\43\1\u02b1\10\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\4\43\1\u02b2"+ + "\12\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\14\43\1\u02b3\2\43\34\0\10\43\1\u02b4\5\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\6\43\1\u02b5\10\43\34\0"+ + "\10\43\1\u02b6\5\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\2\43\1\u02b7\14\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\14\43\1\u02b8\2\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\5\43\1\u02b9\11\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\2\43\1\u02ba"+ + "\14\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\4\43\1\u02bb\12\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\16\43\1\u02bc\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\6\43\1\u02bd\10\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\12\43\1\u02be\4\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\5\43"+ + "\1\u02bf\11\43\34\0\14\43\1\u02c0\1\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\5\117\1\u02c1\11\117"+ + "\34\0\6\117\1\u02c2\7\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\14\117\1\u02c3\1\117"+ "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ - "\34\0\14\141\1\u03c1\1\141\2\0\7\141\1\0\1\141"+ - "\1\0\1\141\2\0\17\141\34\0\12\43\1\u03c2\3\43"+ - "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\12\117"+ - "\1\u03c3\3\117\2\0\7\117\1\0\1\117\1\0\1\117"+ - "\2\0\17\117\34\0\12\141\1\u03c4\3\141\2\0\7\141"+ - "\1\0\1\141\1\0\1\141\2\0\17\141\23\0"; + "\34\0\14\117\1\u02c4\1\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\6\117\1\u02c5\10\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\1\117\1\u02c6\15\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\6\117\1\u02c7\10\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\u02c8"+ + "\2\0\17\117\34\0\6\117\1\u02c9\7\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\11\117"+ + "\1\u02ca\5\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\3\117\1\u02cb\13\117\34\0\14\117"+ + "\1\u02cc\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\10\117\1\u02cd\5\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\1\117"+ + "\1\u02ce\15\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\1\117\1\u02cf\15\117\34\0\14\117"+ + "\1\u02d0\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\6\117\1\u02d1\10\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\6\117"+ + "\1\u02d2\10\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\4\117\1\u02d3\12\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\14\117"+ + "\1\u02d4\2\117\34\0\10\117\1\u02d5\5\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\6\117"+ + "\1\u02d6\10\117\34\0\10\117\1\u02d7\5\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\2\117"+ + "\1\u02d8\14\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\14\117\1\u02d9\2\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\5\117"+ + "\1\u02da\11\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\2\117\1\u02db\14\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\4\117"+ + "\1\u02dc\12\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\16\117\1\u02dd\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\6\117\1\u02de"+ + "\10\117\34\0\16\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\12\117\1\u02df\4\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\5\117\1\u02e0"+ + "\11\117\34\0\14\117\1\u02e1\1\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\5\141\1\u02e2"+ + "\11\141\34\0\6\141\1\u02e3\7\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\14\141\1\u02e4"+ + "\1\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\14\141\1\u02e5\1\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\17\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u02e6"+ + "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\1\141\1\u02e7\15\141\34\0\16\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\6\141\1\u02e8"+ + "\10\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\u02e9\2\0\17\141\34\0\6\141\1\u02ea\7\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\11\141\1\u02eb\5\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\3\141\1\u02ec\13\141\34\0"+ + "\14\141\1\u02ed\1\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\10\141\1\u02ee\5\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\1\141\1\u02ef\15\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\1\141\1\u02f0\15\141\34\0"+ + "\14\141\1\u02f1\1\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\6\141\1\u02f2\10\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\6\141\1\u02f3\10\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\4\141\1\u02f4\12\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\14\141\1\u02f5\2\141\34\0\10\141\1\u02f6\5\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\6\141\1\u02f7\10\141\34\0\10\141\1\u02f8\5\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\2\141\1\u02f9\14\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\14\141\1\u02fa\2\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\5\141\1\u02fb\11\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\2\141\1\u02fc\14\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\4\141\1\u02fd\12\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\16\141\1\u02fe\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\6\141"+ + "\1\u02ff\10\141\34\0\16\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\12\141\1\u0300\4\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\5\141"+ + "\1\u0301\11\141\34\0\14\141\1\u0302\1\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\17\141\23\0\2\162"+ + "\2\u0144\1\u01f8\35\162\1\0\2\162\1\0\42\162\1\0"+ + "\1\u01f9\1\u01fa\105\0\5\u01ff\1\u0200\1\u0303\101\u01ff\11\0"+ + "\6\43\1\u0304\7\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\7\43\1\u0305\7\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\5\43\1\u0306\11\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\11\43\1\u0307\5\43\34\0"+ + "\4\43\1\u0308\11\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\6\43\1\u0309\7\43\2\0\7\43\1\0"+ + "\3\43\2\0\17\43\34\0\14\43\1\u030a\1\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\12\43\1\u030b"+ + "\3\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\1\43\1\u030c"+ + "\15\43\23\0\2\315\2\u0174\1\u0215\37\315\1\u0173\43\315"+ + "\1\0\1\u0216\1\u0217\105\0\4\u0176\1\u0218\37\u0176\1\u030d"+ + "\107\u0176\1\u0173\43\u0176\2\320\2\u0178\1\u021a\35\320\1\0"+ + "\2\320\1\u0177\42\320\1\0\1\u021b\1\u021c\105\0\4\u021d"+ + "\1\0\35\u021d\1\0\2\u021d\1\u030e\46\u021d\1\0\35\u021d"+ + "\1\0\2\u021d\1\0\42\u021d\11\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\2\43\1\u030f\14\43\34\0\2\43"+ + "\1\u0310\13\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\5\43"+ + "\1\u0311\11\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\2\43\1\u0312\14\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\1\43\1\u0313\15\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\5\43\1\u0314\11\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\11\43"+ + "\1\u0315\5\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\2\43\1\u0316\14\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\5\43\1\u0317\11\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\6\43\1\u0318\10\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\14\43"+ + "\1\u0319\2\43\34\0\10\43\1\u031a\5\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\4\43\1\u031b\12\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\11\43\1\u031c\5\43"+ + "\34\0\14\43\1\u031d\1\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\10\43\1\u031e\5\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\6\117\1\u031f\7\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\7\117\1\u0320\7\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\5\117\1\u0321\11\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\11\117\1\u0322\5\117\34\0\4\117\1\u0323\11\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\6\117\1\u0324\7\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\14\117\1\u0325\1\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\12\117\1\u0326\3\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\1\117\1\u0327\15\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\2\117\1\u0328\14\117\34\0\2\117\1\u0329\13\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\5\117\1\u032a\11\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\2\117\1\u032b\14\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\1\117\1\u032c\15\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\5\117\1\u032d\11\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\11\117\1\u032e\5\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\2\117\1\u032f\14\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\5\117\1\u0330\11\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\6\117\1\u0331\10\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\14\117\1\u0332\2\117\34\0\10\117\1\u0333\5\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\4\117\1\u0334\12\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\11\117\1\u0335\5\117"+ + "\34\0\14\117\1\u0336\1\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\10\117\1\u0337\5\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\6\141\1\u0338\7\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\7\141\1\u0339\7\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\5\141\1\u033a\11\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\11\141\1\u033b\5\141"+ + "\34\0\4\141\1\u033c\11\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\6\141\1\u033d\7\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ + "\34\0\14\141\1\u033e\1\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\12\141\1\u033f\3\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\1\141\1\u0340\15\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\2\141\1\u0341\14\141"+ + "\34\0\2\141\1\u0342\13\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\5\141\1\u0343\11\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\2\141\1\u0344\14\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\1\141\1\u0345\15\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\5\141\1\u0346\11\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\11\141\1\u0347\5\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\2\141\1\u0348\14\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\5\141\1\u0349\11\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\6\141\1\u034a\10\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\14\141\1\u034b\2\141"+ + "\34\0\10\141\1\u034c\5\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\4\141\1\u034d\12\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\11\141\1\u034e\5\141\34\0\14\141\1\u034f\1\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ + "\34\0\10\141\1\u0350\5\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\13\43\1\u0351\3\43\34\0\14\43"+ + "\1\u0352\1\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\2\43"+ + "\1\u0353\14\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\1\43\1\u0354\15\43\34\0\16\43\2\0\7\43"+ + "\1\0\3\43\2\0\5\43\1\u0355\11\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\4\43\1\u0356\12\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\11\43"+ + "\1\u0357\5\43\23\0\44\u0176\1\u0358\43\u0176\4\u021d\1\0"+ + "\35\u021d\1\0\2\u021d\1\u0177\42\u021d\11\0\14\43\1\u0359"+ + "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\14\43\1\u035a\1\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\5\43\1\u035b\11\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\2\43\1\u035c\14\43\34\0\16\43\2\0"+ + "\7\43\1\0\2\43\1\u035d\2\0\17\43\34\0\4\43"+ + "\1\u035e\11\43\2\0\7\43\1\0\3\43\2\0\17\43"+ + "\34\0\16\43\2\0\7\43\1\0\3\43\2\0\10\43"+ + "\1\u035f\6\43\34\0\14\43\1\u0360\1\43\2\0\7\43"+ + "\1\0\3\43\2\0\17\43\34\0\6\43\1\u0361\7\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\13\117"+ + "\1\u0362\3\117\34\0\14\117\1\u0363\1\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\2\117"+ + "\1\u0364\14\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\1\117\1\u0365\15\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\5\117"+ + "\1\u0366\11\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\4\117\1\u0367\12\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\11\117"+ + "\1\u0368\5\117\34\0\14\117\1\u0369\1\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\17\117\34\0\14\117"+ + "\1\u036a\1\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\17\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\5\117\1\u036b\11\117\34\0\16\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\2\117"+ + "\1\u036c\14\117\34\0\16\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\u036d\2\0\17\117\34\0\4\117\1\u036e\11\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\10\117\1\u036f\6\117\34\0\14\117\1\u0370\1\117"+ + "\2\0\7\117\1\0\1\117\1\0\1\117\2\0\17\117"+ + "\34\0\6\117\1\u0371\7\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\13\141\1\u0372\3\141"+ + "\34\0\14\141\1\u0373\1\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\2\141\1\u0374\14\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\1\141\1\u0375\15\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\5\141\1\u0376\11\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\4\141\1\u0377\12\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\11\141\1\u0378\5\141"+ + "\34\0\14\141\1\u0379\1\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\14\141\1\u037a\1\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\17\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\5\141\1\u037b\11\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\2\141\1\u037c\14\141"+ + "\34\0\16\141\2\0\7\141\1\0\1\141\1\0\1\u037d"+ + "\2\0\17\141\34\0\4\141\1\u037e\11\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\16\141"+ + "\2\0\7\141\1\0\1\141\1\0\1\141\2\0\10\141"+ + "\1\u037f\6\141\34\0\14\141\1\u0380\1\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\17\141\34\0\6\141"+ + "\1\u0381\7\141\2\0\7\141\1\0\1\141\1\0\1\141"+ + "\2\0\17\141\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\11\43\1\u0382\5\43\34\0\14\43\1\u0383\1\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\2\43\1\u0384\14\43"+ + "\34\0\14\43\1\u0385\1\43\2\0\7\43\1\0\3\43"+ + "\2\0\17\43\34\0\16\43\2\0\7\43\1\0\3\43"+ + "\2\0\5\43\1\u0386\11\43\34\0\14\43\1\u0387\1\43"+ + "\2\0\7\43\1\0\3\43\2\0\17\43\34\0\16\43"+ + "\2\0\7\43\1\0\3\43\2\0\1\u0388\16\43\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\11\43\1\u0389"+ + "\5\43\34\0\16\43\2\0\7\43\1\0\3\43\2\0"+ + "\11\43\1\u038a\5\43\34\0\14\43\1\u038b\1\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\11\117\1\u038c"+ + "\5\117\34\0\14\117\1\u038d\1\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\2\117\1\u038e"+ + "\14\117\34\0\14\117\1\u038f\1\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\5\117\1\u0390"+ + "\11\117\34\0\14\117\1\u0391\1\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\1\u0392\16\117"+ + "\34\0\16\117\2\0\7\117\1\0\1\117\1\0\1\117"+ + "\2\0\11\117\1\u0393\5\117\34\0\16\117\2\0\7\117"+ + "\1\0\1\117\1\0\1\117\2\0\11\117\1\u0394\5\117"+ + "\34\0\14\117\1\u0395\1\117\2\0\7\117\1\0\1\117"+ + "\1\0\1\117\2\0\17\117\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\11\141\1\u0396\5\141"+ + "\34\0\14\141\1\u0397\1\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\2\141\1\u0398\14\141"+ + "\34\0\14\141\1\u0399\1\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\5\141\1\u039a\11\141"+ + "\34\0\14\141\1\u039b\1\141\2\0\7\141\1\0\1\141"+ + "\1\0\1\141\2\0\17\141\34\0\16\141\2\0\7\141"+ + "\1\0\1\141\1\0\1\141\2\0\1\u039c\16\141\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\11\141\1\u039d\5\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\11\141\1\u039e\5\141\34\0"+ + "\14\141\1\u039f\1\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\5\43\1\u03a0\11\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\10\43\1\u03a1\6\43\34\0"+ + "\14\43\1\u03a2\1\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\12\43\1\u03a3\3\43\2\0\7\43\1\0"+ + "\3\43\2\0\17\43\34\0\10\43\1\u03a4\5\43\2\0"+ + "\7\43\1\0\3\43\2\0\17\43\34\0\16\43\2\0"+ + "\7\43\1\0\3\43\2\0\5\43\1\u03a5\11\43\34\0"+ + "\16\117\2\0\7\117\1\0\1\117\1\0\1\117\2\0"+ + "\5\117\1\u03a6\11\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\10\117\1\u03a7\6\117\34\0"+ + "\14\117\1\u03a8\1\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\12\117\1\u03a9\3\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\17\117\34\0"+ + "\10\117\1\u03aa\5\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\16\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\5\117\1\u03ab\11\117\34\0"+ + "\16\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\5\141\1\u03ac\11\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\10\141\1\u03ad\6\141\34\0"+ + "\14\141\1\u03ae\1\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\12\141\1\u03af\3\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\10\141\1\u03b0\5\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\17\141\34\0\16\141\2\0\7\141\1\0"+ + "\1\141\1\0\1\141\2\0\5\141\1\u03b1\11\141\34\0"+ + "\16\43\2\0\7\43\1\0\3\43\2\0\4\43\1\u03b2"+ + "\12\43\34\0\4\43\1\u03b3\11\43\2\0\7\43\1\0"+ + "\3\43\2\0\17\43\34\0\16\43\2\0\7\43\1\0"+ + "\3\43\2\0\15\43\1\u03b4\1\43\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\4\117\1\u03b5"+ + "\12\117\34\0\4\117\1\u03b6\11\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\16\117\2\0"+ + "\7\117\1\0\1\117\1\0\1\117\2\0\15\117\1\u03b7"+ + "\1\117\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\4\141\1\u03b8\12\141\34\0\4\141\1\u03b9"+ + "\11\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\34\0\16\141\2\0\7\141\1\0\1\141\1\0"+ + "\1\141\2\0\15\141\1\u03ba\1\141\34\0\14\43\1\u03bb"+ + "\1\43\2\0\7\43\1\0\3\43\2\0\17\43\34\0"+ + "\14\117\1\u03bc\1\117\2\0\7\117\1\0\1\117\1\0"+ + "\1\117\2\0\17\117\34\0\14\141\1\u03bd\1\141\2\0"+ + "\7\141\1\0\1\141\1\0\1\141\2\0\17\141\34\0"+ + "\12\43\1\u03be\3\43\2\0\7\43\1\0\3\43\2\0"+ + "\17\43\34\0\12\117\1\u03bf\3\117\2\0\7\117\1\0"+ + "\1\117\1\0\1\117\2\0\17\117\34\0\12\141\1\u03c0"+ + "\3\141\2\0\7\141\1\0\1\141\1\0\1\141\2\0"+ + "\17\141\23\0"; private static int [] zzUnpackTrans() { - int [] result = new int[52632]; + int [] result = new int[52560]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -1417,16 +1414,16 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { "\5\11\3\0\15\1\5\11\2\0\4\1\2\11\1\1"+ "\1\0\1\1\2\0\27\1\2\11\1\1\1\11\1\1"+ "\1\0\1\11\1\0\6\11\114\1\1\0\6\1\1\0"+ - "\1\1\1\11\1\0\1\1\1\11\1\1\2\0\2\11"+ - "\1\1\3\0\2\1\2\11\1\1\1\0\23\1\3\11"+ - "\3\1\1\11\2\0\36\1\5\11\1\0\133\1\2\0"+ - "\1\1\1\11\3\1\1\11\2\1\2\11\1\0\15\1"+ - "\2\0\3\1\3\0\1\1\7\0\33\1\1\11\127\1"+ - "\1\0\2\11\1\0\16\1\1\0\1\1\5\0\127\1"+ - "\1\0\11\1\2\0\262\1"; + "\1\1\1\11\1\0\1\11\1\1\2\0\2\11\1\1"+ + "\3\0\2\1\2\11\1\1\1\0\23\1\3\11\3\1"+ + "\1\11\2\0\36\1\5\11\1\0\133\1\2\0\1\1"+ + "\2\11\2\1\2\11\1\0\15\1\2\0\3\1\3\0"+ + "\1\1\7\0\33\1\1\11\127\1\1\0\2\11\1\0"+ + "\16\1\1\0\1\1\5\0\127\1\1\0\11\1\2\0"+ + "\262\1"; private static int [] zzUnpackAttribute() { - int [] result = new int[964]; + int [] result = new int[960]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -1755,148 +1752,167 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { zzMarkedPos = zzMarkedPosL; switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 58: - { yybegin(IN_DOLLAR_SLASH_REGEX_DOT); - return mIDENT; + case 70: + { yybegin(WAIT_FOR_REGEX); + return(mSPREAD_DOT); } case 173: break; - case 5: + case 27: { yybegin(WAIT_FOR_REGEX); - return(mSTAR); + return(mMOD); } case 174: break; - case 73: - { yybegin(WAIT_FOR_REGEX); - return(mNOT_EQUAL); + case 46: + { yybegin(NLS_AFTER_NLS); + afterComment = IN_TRIPLE_IDENT; + return mNLS; } case 175: break; - case 47: - { blockStack.push(mLCURLY); - braceCount.push(mLCURLY); - yybegin(NLS_AFTER_LBRACE); - return(mLCURLY); + case 112: + { yybegin(WAIT_FOR_REGEX); + return(mSTAR_STAR_ASSIGN); } case 176: break; case 133: { return( kTRUE ); } case 177: break; + case 122: + { yybegin(WAIT_FOR_REGEX); + return(mREGEX_MATCH); + } + case 178: break; + case 69: + { yybegin(WAIT_FOR_REGEX); + return(mSTAR_STAR); + } + case 179: break; case 135: { return( kNULL ); } - case 178: break; - case 23: - { yybegin(WAIT_FOR_REGEX); - return(mCOMMA); - } - case 179: break; + case 180: break; case 129: { return( kENUM ); } - case 180: break; - case 61: - { yybegin(IN_DOLLAR_SLASH_REGEX_DOLLAR); - return mDOLLAR; - } case 181: break; - case 83: - { yybegin(WAIT_FOR_REGEX); - return(mDEC); + case 53: + { blockStack.push(mDIV); + braceCount.push(mLCURLY); + yybegin(NLS_AFTER_LBRACE); + return mLCURLY; } case 182: break; - case 80: - { return( kDO ); - } - case 183: break; - case 86: - { yybegin(WAIT_FOR_REGEX); - return(mRANGE_INCLUSIVE); - } - case 184: break; - case 72: - { return mSH_COMMENT; - } - case 185: break; - case 125: - { yybegin(WAIT_FOR_REGEX); - return(mSR_ASSIGN); - } - case 186: break; - case 52: - { yybegin(IN_REGEX_DOT); - return mIDENT; - } - case 187: break; - case 105: - { yybegin(IN_DOLLAR_SLASH_REGEX); - gStringStack.push(mDOLLAR); - return mDOLLAR_SLASH_REGEX_BEGIN; - } - case 188: break; - case 49: - { yypushback(1); + case 55: + { if (!gStringStack.isEmpty()) { + gStringStack.pop(); + } if (blockStack.isEmpty()){ yybegin(YYINITIAL); } else { yybegin(IN_INNER_BLOCK); } + return mREGEX_END; } - case 189: break; + case 183: break; + case 62: + { yypushback(1); + yybegin(IN_DOLLAR_SLASH_REGEX); + } + case 184: break; + case 80: + { return( kDO ); + } + case 185: break; + case 65: + { yypushback(1); + yybegin(NLS_AFTER_COMMENT); + } + case 186: break; + case 72: + { return mSH_COMMENT; + } + case 187: break; + case 42: + { if (!gStringStack.isEmpty()) { + gStringStack.pop(); + } + if (blockStack.isEmpty()){ + yybegin(YYINITIAL); + } else { + yybegin(IN_INNER_BLOCK); + } + return mGSTRING_END; + } + case 188: break; case 7: { return mIDENT; } - case 190: break; - case 25: - { yybegin(WAIT_FOR_REGEX); - return(mGT); - } - case 191: break; + case 189: break; case 144: { return( kSUPER ); } - case 192: break; - case 119: - { yybegin(IN_TRIPLE_GSTRING); - gStringStack.push(mLBRACK); - return mGSTRING_BEGIN; - } - case 193: break; - case 68: + case 190: break; + case 94: { yybegin(WAIT_FOR_REGEX); - return(mDIV_ASSIGN); + return(mREGEX_FIND); } - case 194: break; + case 191: break; + case 99: + { yybegin(WAIT_FOR_REGEX); + return(mBOR_ASSIGN); + } + case 192: break; case 171: { return( kINSTANCEOF ); } + case 193: break; + case 35: + { blockStack.push(mLPAREN); + braceCount.push(mLCURLY); + yybegin(NLS_AFTER_LBRACE); + return mLCURLY; + } + case 194: break; + case 108: + { if (!gStringStack.isEmpty()) { + gStringStack.pop(); + } + if (blockStack.isEmpty()){ + yybegin(YYINITIAL); + } else { + yybegin(IN_INNER_BLOCK); + } + return mDOLLAR_SLASH_REGEX_END; + } case 195: break; - case 93: + case 73: { yybegin(WAIT_FOR_REGEX); - return(mEQUAL); + return(mNOT_EQUAL); } case 196: break; - case 18: - { yybegin(WAIT_FOR_REGEX); - braceCount.push(mLPAREN); - return(mLPAREN); + case 103: + // lookahead expression with fixed base length + zzMarkedPos = zzStartRead + 1; + { yybegin(IN_SINGLE_IDENT); + return mDOT; } case 197: break; - case 22: - { yybegin(WAIT_FOR_REGEX); - return(mCOLON); - } - case 198: break; case 152: { return( kSTATIC ); } + case 198: break; + case 100: + { yybegin(WAIT_FOR_REGEX); + return(mLOR); + } case 199: break; - case 143: - { return( kCATCH ); + case 57: + { yypushback(1); + yybegin(IN_REGEX); } case 200: break; - case 29: - { yybegin(WAIT_FOR_REGEX); - return(mBOR); + case 143: + { return( kCATCH ); } case 201: break; case 54: @@ -1909,104 +1925,304 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { { return mREGEX_CONTENT; } case 203: break; - case 27: + case 97: { yybegin(WAIT_FOR_REGEX); - return(mMOD); + return(mMOD_ASSIGN); } case 204: break; - case 24: - { yybegin(WAIT_FOR_REGEX); - return(mLT); - } - case 205: break; case 168: { return( kPROTECTED ); } + case 205: break; + case 86: + { yybegin(WAIT_FOR_REGEX); + return(mRANGE_INCLUSIVE); + } case 206: break; case 113: { return mNUM_BIG_DECIMAL; } case 207: break; - case 70: - { yybegin(WAIT_FOR_REGEX); - return(mSPREAD_DOT); + case 58: + { yybegin(IN_DOLLAR_SLASH_REGEX_DOT); + return mIDENT; } case 208: break; + case 25: + { yybegin(WAIT_FOR_REGEX); + return(mGT); + } + case 209: break; + case 33: + { yypushback(1); + yybegin(IN_SINGLE_GSTRING); + } + case 210: break; + case 125: + { yybegin(WAIT_FOR_REGEX); + return(mSR_ASSIGN); + } + case 211: break; case 149: { return( kDOUBLE ); } - case 209: break; - case 37: - { yybegin(IN_TRIPLE_DOT); - return mIDENT; + case 212: break; + case 119: + { yybegin(IN_TRIPLE_GSTRING); + gStringStack.push(mLBRACK); + return mGSTRING_BEGIN; } - case 210: break; - case 35: - { blockStack.push(mLPAREN); + case 213: break; + case 121: + { return( kNEW ); + } + case 214: break; + case 36: + { yypushback(1); + yybegin(IN_TRIPLE_GSTRING); + } + case 215: break; + case 17: + { yybegin(WAIT_FOR_REGEX); + return(mASSIGN); + } + case 216: break; + case 50: + { afterComment = YYINITIAL; + return(WHITE_SPACE); + } + case 217: break; + case 156: + { return( kNATIVE ); + } + case 218: break; + case 114: + { return( kFOR ); + } + case 219: break; + case 98: + { yybegin(WAIT_FOR_REGEX); + return(mBXOR_ASSIGN); + } + case 220: break; + case 132: + { return( kCHAR ); + } + case 221: break; + case 91: + { yybegin(WAIT_FOR_REGEX); + return(mOPTIONAL_DOT); + } + case 222: break; + case 24: + { yybegin(WAIT_FOR_REGEX); + return(mLT); + } + case 223: break; + case 148: + { return( kIMPORT ); + } + case 224: break; + case 159: + { return( kEXTENDS ); + } + case 225: break; + case 2: + { yybegin(NLS_AFTER_NLS); + afterComment = WAIT_FOR_REGEX; + return !braceCount.isEmpty() && + mLPAREN == braceCount.peek() ? WHITE_SPACE : mNLS; + } + case 226: break; + case 60: + { return mDOLLAR_SLASH_REGEX_CONTENT; + } + case 227: break; + case 109: + // lookahead expression with fixed lookahead length + yypushback(1); + { return mDOLLAR_SLASH_REGEX_CONTENT; + } + case 228: break; + case 63: + { yypushback(1); + yybegin(afterComment); + } + case 229: break; + case 157: + { return( kFINALLY ); + } + case 230: break; + case 82: + { yybegin(WAIT_FOR_REGEX); + return(mPLUS_ASSIGN); + } + case 231: break; + case 136: + { return( kVOID ); + } + case 232: break; + case 150: + { return( kPUBLIC ); + } + case 233: break; + case 128: + { return( kELSE ); + } + case 234: break; + case 12: + { return mSTRING_LITERAL; + } + case 235: break; + case 6: + { yybegin(WAIT_FOR_REGEX); + return(mLNOT); + } + case 236: break; + case 10: + { yybegin(WAIT_FOR_REGEX); + return(mMINUS); + } + case 237: break; + case 64: + { yypushback(1); + yybegin(WAIT_FOR_REGEX); + } + case 238: break; + case 59: + { blockStack.push(mDOLLAR); braceCount.push(mLCURLY); yybegin(NLS_AFTER_LBRACE); return mLCURLY; } - case 211: break; - case 126: - { if (!gStringStack.isEmpty()){ - gStringStack.pop(); - } + case 239: break; + case 30: + { yybegin(WAIT_FOR_REGEX); + return(mBAND); + } + case 240: break; + case 170: + { return( kIMPLEMENTS ); + } + case 241: break; + case 5: + { yybegin(WAIT_FOR_REGEX); + return(mSTAR); + } + case 242: break; + case 11: + { yybegin(WAIT_FOR_REGEX); + return(mDOT); + } + case 243: break; + case 8: + { return mNUM_INT; + } + case 244: break; + case 167: + { return( kINTERFACE ); + } + case 245: break; + case 81: + { yybegin(WAIT_FOR_REGEX); + return(mINC); + } + case 246: break; + case 161: + { return( kPACKAGE ); + } + case 247: break; + case 146: + { return( kTHROW ); + } + case 248: break; + case 92: + { yybegin(WAIT_FOR_REGEX); + return(mELVIS); + } + case 249: break; + case 79: + { return( kIN ); + } + case 250: break; + case 84: + { yybegin(WAIT_FOR_REGEX); + return(mMINUS_ASSIGN); + } + case 251: break; + case 66: + { return mSL_COMMENT; + } + case 252: break; + case 37: + { yybegin(IN_TRIPLE_DOT); + return mIDENT; + } + case 253: break; + case 20: + { yybegin(WAIT_FOR_REGEX); + braceCount.push(mLPAREN); + return(mLBRACK); + } + case 254: break; + case 130: + { return( kBYTE ); + } + case 255: break; + case 137: + { yybegin(WAIT_FOR_REGEX); + return(mBSR_ASSIGN); + } + case 256: break; + case 52: + { yybegin(IN_REGEX_DOT); + return mIDENT; + } + case 257: break; + case 44: + { yybegin(IN_TRIPLE_GSTRING_DOLLAR); + return mDOLLAR; + } + case 258: break; + case 49: + { yypushback(1); if (blockStack.isEmpty()){ yybegin(YYINITIAL); } else { yybegin(IN_INNER_BLOCK); } - return mGSTRING_END; } - case 212: break; - case 121: - { return( kNEW ); + case 259: break; + case 172: + { return( kSYNCHRONIZED ); } - case 213: break; - case 156: - { return( kNATIVE ); + case 260: break; + case 117: + { yybegin(WAIT_FOR_REGEX); + return(mTRIPLE_DOT); } - case 214: break; + case 261: break; + case 85: + { yybegin(WAIT_FOR_REGEX); + return(mCLOSABLE_BLOCK_OP); + } + case 262: break; case 87: { yybegin(WAIT_FOR_REGEX); return(mMEMBER_POINTER); } - case 215: break; - case 19: + case 263: break; + case 120: + { return( kTRY ); + } + case 264: break; + case 21: { if (!braceCount.isEmpty() && mLPAREN == braceCount.peek()) { braceCount.pop(); } - return(mRPAREN); + return(mRBRACK); } - case 216: break; - case 64: - { yypushback(1); - yybegin(WAIT_FOR_REGEX); - } - case 217: break; - case 114: - { return( kFOR ); - } - case 218: break; - case 132: - { return( kCHAR ); - } - case 219: break; - case 148: - { return( kIMPORT ); - } - case 220: break; - case 91: - { yybegin(WAIT_FOR_REGEX); - return(mOPTIONAL_DOT); - } - case 221: break; - case 101: - { yybegin(WAIT_FOR_REGEX); - return(mBAND_ASSIGN); - } - case 222: break; + case 265: break; case 48: { if (!blockStack.isEmpty()) { IElementType br = blockStack.pop(); @@ -2023,106 +2239,21 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { } return mRCURLY; } - case 223: break; - case 159: - { return( kEXTENDS ); + case 266: break; + case 131: + { return( kCASE ); } - case 224: break; - case 9: - { yybegin(WAIT_FOR_REGEX); - return(mPLUS); + case 267: break; + case 77: + { return mNUM_DOUBLE; } - case 225: break; - case 108: - { if (!gStringStack.isEmpty()) { - gStringStack.pop(); - } - if (blockStack.isEmpty()){ - yybegin(YYINITIAL); - } else { - yybegin(IN_INNER_BLOCK); - } - return mDOLLAR_SLASH_REGEX_END; + case 268: break; + case 158: + { return( kDEFAULT ); } - case 226: break; - case 94: - { yybegin(WAIT_FOR_REGEX); - return(mREGEX_FIND); - } - case 227: break; - case 26: - { yybegin(WAIT_FOR_REGEX); - return(mBNOT); - } - case 228: break; - case 60: - { return mDOLLAR_SLASH_REGEX_CONTENT; - } - case 229: break; - case 109: - // lookahead expression with fixed lookahead length - yypushback(1); - { return mDOLLAR_SLASH_REGEX_CONTENT; - } - case 230: break; - case 99: - { yybegin(WAIT_FOR_REGEX); - return(mBOR_ASSIGN); - } - case 231: break; - case 157: - { return( kFINALLY ); - } - case 232: break; - case 100: - { yybegin(WAIT_FOR_REGEX); - return(mLOR); - } - case 233: break; - case 71: - { yybegin(WAIT_FOR_REGEX); - return(mSTAR_ASSIGN); - } - case 234: break; - case 136: - { return( kVOID ); - } - case 235: break; - case 150: - { return( kPUBLIC ); - } - case 236: break; - case 128: - { return( kELSE ); - } - case 237: break; - case 38: - { blockStack.push(mLBRACK); - braceCount.push(mLCURLY); - yybegin(NLS_AFTER_LBRACE); - return mLCURLY; - } - case 238: break; - case 12: - { return mSTRING_LITERAL; - } - case 239: break; - case 84: - { yybegin(WAIT_FOR_REGEX); - return(mMINUS_ASSIGN); - } - case 240: break; - case 85: - { yybegin(WAIT_FOR_REGEX); - return(mCLOSABLE_BLOCK_OP); - } - case 241: break; - case 170: - { return( kIMPLEMENTS ); - } - case 242: break; - case 42: - { if (!gStringStack.isEmpty()) { + case 269: break; + case 126: + { if (!gStringStack.isEmpty()){ gStringStack.pop(); } if (blockStack.isEmpty()){ @@ -2132,91 +2263,24 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { } return mGSTRING_END; } - case 243: break; - case 97: - { yybegin(WAIT_FOR_REGEX); - return(mMOD_ASSIGN); + case 270: break; + case 169: + { return( kTRANSIENT ); } - case 244: break; + case 271: break; + case 111: + { return GROOVY_DOC_COMMENT; + } + case 272: break; case 16: { yybegin(WAIT_FOR_REGEX); return(mQUESTION); } - case 245: break; - case 8: - { return mNUM_INT; + case 273: break; + case 153: + { return( kSWITCH ); } - case 246: break; - case 167: - { return( kINTERFACE ); - } - case 247: break; - case 31: - { yybegin(WAIT_FOR_REGEX); - return(mSEMI); - } - case 248: break; - case 161: - { return( kPACKAGE ); - } - case 249: break; - case 146: - { return( kTHROW ); - } - case 250: break; - case 17: - { yybegin(WAIT_FOR_REGEX); - return(mASSIGN); - } - case 251: break; - case 79: - { return( kIN ); - } - case 252: break; - case 66: - { return mSL_COMMENT; - } - case 253: break; - case 88: - { yypushback(2); - yybegin(WAIT_FOR_REGEX); - } - case 254: break; - case 13: - { yybegin(IN_SINGLE_GSTRING); - gStringStack.push(mLPAREN); - return mGSTRING_BEGIN; - } - case 255: break; - case 130: - { return( kBYTE ); - } - case 256: break; - case 102: - { yybegin(WAIT_FOR_REGEX); - return(mLAND); - } - case 257: break; - case 33: - { yypushback(1); - yybegin(IN_SINGLE_GSTRING); - } - case 258: break; - case 28: - { yybegin(WAIT_FOR_REGEX); - return(mBXOR); - } - case 259: break; - case 57: - { yypushback(1); - yybegin(IN_REGEX); - } - case 260: break; - case 63: - { yypushback(1); - yybegin(afterComment); - } - case 261: break; + case 274: break; case 4: { if (zzStartRead == 0 || zzBuffer.subSequence(0, zzStartRead).toString().trim().length() == 0) { @@ -2226,363 +2290,295 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { return(mDIV); } } - case 262: break; - case 172: - { return( kSYNCHRONIZED ); - } - case 263: break; - case 124: - { yybegin(WAIT_FOR_REGEX); - return(mSL_ASSIGN); - } - case 264: break; - case 56: - { yybegin(IN_REGEX_DOLLAR); - return mDOLLAR; - } - case 265: break; - case 36: - { yypushback(1); - yybegin(IN_TRIPLE_GSTRING); - } - case 266: break; - case 120: - { return( kTRY ); - } - case 267: break; - case 10: - { yybegin(WAIT_FOR_REGEX); - return(mMINUS); - } - case 268: break; - case 11: - { yybegin(WAIT_FOR_REGEX); - return(mDOT); - } - case 269: break; - case 131: - { return( kCASE ); - } - case 270: break; - case 103: - // lookahead expression with fixed base length - zzMarkedPos = zzStartRead + 1; - { yybegin(IN_SINGLE_IDENT); - return mDOT; - } - case 271: break; - case 77: - { return mNUM_DOUBLE; - } - case 272: break; - case 158: - { return( kDEFAULT ); - } - case 273: break; - case 122: - { yybegin(WAIT_FOR_REGEX); - return(mREGEX_MATCH); - } - case 274: break; - case 50: - { afterComment = YYINITIAL; - return(WHITE_SPACE); - } case 275: break; - case 169: - { return( kTRANSIENT ); - } - case 276: break; - case 81: - { yybegin(WAIT_FOR_REGEX); - return(mINC); - } - case 277: break; - case 111: - { return GROOVY_DOC_COMMENT; - } - case 278: break; - case 2: - { yybegin(NLS_AFTER_NLS); - afterComment = WAIT_FOR_REGEX; - return !braceCount.isEmpty() && - mLPAREN == braceCount.peek() ? WHITE_SPACE : mNLS; - } - case 279: break; - case 59: - { blockStack.push(mDOLLAR); - braceCount.push(mLCURLY); - yybegin(NLS_AFTER_LBRACE); - return mLCURLY; - } - case 280: break; - case 153: - { return( kSWITCH ); - } - case 281: break; - case 15: - { while (!braceCount.isEmpty() && mLCURLY != braceCount.peek()) { - braceCount.pop(); - } - if (!braceCount.isEmpty() && mLCURLY == braceCount.peek()) { - braceCount.pop(); - } - return mRCURLY; - } - case 282: break; - case 89: - { return mGSTRING_LITERAL; - } - case 283: break; - case 20: - { yybegin(WAIT_FOR_REGEX); - braceCount.push(mLPAREN); - return(mLBRACK); - } - case 284: break; - case 45: - { yypushback(1); - yybegin(IN_TRIPLE_IDENT); - } - case 285: break; - case 138: - { return( kFLOAT ); - } - case 286: break; - case 137: - { yybegin(WAIT_FOR_REGEX); - return(mBSR_ASSIGN); - } - case 287: break; - case 78: - { return( kIF ); - } - case 288: break; - case 92: - { yybegin(WAIT_FOR_REGEX); - return(mELVIS); - } - case 289: break; - case 139: - { return( kFINAL ); - } - case 290: break; - case 34: - { yybegin(IN_SINGLE_DOT); - return mIDENT; - } - case 291: break; - case 96: - { yybegin(WAIT_FOR_REGEX); - return(mGE); - } - case 292: break; - case 154: - { return( kTHROWS ); - } - case 293: break; case 110: // lookahead expression with fixed base length zzMarkedPos = zzStartRead + 1; { yybegin(IN_DOLLAR_SLASH_REGEX_IDENT); return mDOT; } - case 294: break; + case 276: break; + case 89: + { return mGSTRING_LITERAL; + } + case 277: break; + case 124: + { yybegin(WAIT_FOR_REGEX); + return(mSL_ASSIGN); + } + case 278: break; + case 138: + { return( kFLOAT ); + } + case 279: break; + case 105: + { yybegin(IN_DOLLAR_SLASH_REGEX); + gStringStack.push(mDOLLAR); + return mDOLLAR_SLASH_REGEX_BEGIN; + } + case 280: break; + case 45: + { yypushback(1); + yybegin(IN_TRIPLE_IDENT); + } + case 281: break; + case 34: + { yybegin(IN_SINGLE_DOT); + return mIDENT; + } + case 282: break; + case 123: + { yybegin(WAIT_FOR_REGEX); + return(mCOMPARE_TO); + } + case 283: break; + case 88: + { yypushback(2); + yybegin(WAIT_FOR_REGEX); + } + case 284: break; + case 78: + { return( kIF ); + } + case 285: break; + case 139: + { return( kFINAL ); + } + case 286: break; + case 101: + { yybegin(WAIT_FOR_REGEX); + return(mBAND_ASSIGN); + } + case 287: break; + case 154: + { return( kTHROWS ); + } + case 288: break; case 75: { return mNUM_FLOAT; } - case 295: break; - case 117: - { yybegin(WAIT_FOR_REGEX); - return(mTRIPLE_DOT); + case 289: break; + case 38: + { blockStack.push(mLBRACK); + braceCount.push(mLCURLY); + yybegin(NLS_AFTER_LBRACE); + return mLCURLY; } - case 296: break; + case 290: break; + case 47: + { blockStack.push(mLCURLY); + braceCount.push(mLCURLY); + yybegin(NLS_AFTER_LBRACE); + return(mLCURLY); + } + case 291: break; case 115: { return( kINT ); } - case 297: break; + case 292: break; case 165: { return( kSTRICTFP ); } - case 298: break; - case 65: - { yypushback(1); - yybegin(NLS_AFTER_COMMENT); + case 293: break; + case 9: + { yybegin(WAIT_FOR_REGEX); + return(mPLUS); } - case 299: break; + case 294: break; case 163: { return( kABSTRACT ); } - case 300: break; + case 295: break; case 140: { return( kFALSE ); } - case 301: break; + case 296: break; + case 41: + { yybegin(IN_SINGLE_GSTRING_DOLLAR); + return mDOLLAR; + } + case 297: break; + case 26: + { yybegin(WAIT_FOR_REGEX); + return(mBNOT); + } + case 298: break; + case 13: + { yybegin(IN_SINGLE_GSTRING); + gStringStack.push(mLPAREN); + return mGSTRING_BEGIN; + } + case 299: break; case 90: { return( kAS ); } - case 302: break; - case 46: - { yybegin(NLS_AFTER_NLS); - afterComment = IN_TRIPLE_IDENT; - return mNLS; - } - case 303: break; - case 118: + case 300: break; + case 71: { yybegin(WAIT_FOR_REGEX); - return(mRANGE_EXCLUSIVE); + return(mSTAR_ASSIGN); } - case 304: break; + case 301: break; case 164: { return( kCONTINUE ); } - case 305: break; - case 32: - { yybegin(WAIT_FOR_REGEX); - return(mAT); + case 302: break; + case 40: + { clearStacks(); + yybegin(NLS_AFTER_NLS); + afterComment = YYINITIAL; + return mNLS; } - case 306: break; + case 303: break; case 127: { return( kLONG ); } - case 307: break; + case 304: break; case 76: { return mNUM_LONG; } - case 308: break; + case 305: break; case 141: { return( kBREAK ); } - case 309: break; - case 95: - { yybegin(WAIT_FOR_REGEX); - return(mLE); - } - case 310: break; + case 306: break; case 160: { return( kBOOLEAN ); } - case 311: break; + case 307: break; case 151: { return( kASSERT ); } - case 312: break; - case 107: - // lookahead expression with fixed base length - zzMarkedPos = zzStartRead + 1; - { yybegin(IN_REGEX_IDENT); - return mDOT; + case 308: break; + case 96: + { yybegin(WAIT_FOR_REGEX); + return(mGE); } - case 313: break; + case 309: break; + case 23: + { yybegin(WAIT_FOR_REGEX); + return(mCOMMA); + } + case 310: break; + case 93: + { yybegin(WAIT_FOR_REGEX); + return(mEQUAL); + } + case 311: break; case 3: { return WHITE_SPACE; } - case 314: break; + case 312: break; case 134: { return( kTHIS ); } - case 315: break; - case 51: - { yybegin(IN_REGEX); - gStringStack.push(mDIV); - return mREGEX_BEGIN; - } - case 316: break; + case 313: break; case 162: { return( kPRIVATE ); } - case 317: break; - case 44: - { yybegin(IN_TRIPLE_GSTRING_DOLLAR); - return mDOLLAR; + case 314: break; + case 18: + { yybegin(WAIT_FOR_REGEX); + braceCount.push(mLPAREN); + return(mLPAREN); } - case 318: break; - case 145: - { return( kSHORT ); - } - case 319: break; - case 21: - { if (!braceCount.isEmpty() && mLPAREN == braceCount.peek()) { - braceCount.pop(); - } - return(mRBRACK); - } - case 320: break; - case 14: - { yybegin(NLS_AFTER_LBRACE); - braceCount.push(mLCURLY); - return(mLCURLY); - } - case 321: break; - case 166: - { return( kVOLATILE ); - } - case 322: break; + case 315: break; case 104: // lookahead expression with fixed base length zzMarkedPos = zzStartRead + 1; { yybegin(IN_TRIPLE_NLS); return mDOT; } - case 323: break; - case 6: + case 316: break; + case 51: + { yybegin(IN_REGEX); + gStringStack.push(mDIV); + return mREGEX_BEGIN; + } + case 317: break; + case 145: + { return( kSHORT ); + } + case 318: break; + case 83: { yybegin(WAIT_FOR_REGEX); - return(mLNOT); + return(mDEC); + } + case 319: break; + case 31: + { yybegin(WAIT_FOR_REGEX); + return(mSEMI); + } + case 320: break; + case 61: + { yybegin(IN_DOLLAR_SLASH_REGEX_DOLLAR); + return mDOLLAR; + } + case 321: break; + case 166: + { return( kVOLATILE ); + } + case 322: break; + case 14: + { yybegin(NLS_AFTER_LBRACE); + braceCount.push(mLCURLY); + return(mLCURLY); + } + case 323: break; + case 32: + { yybegin(WAIT_FOR_REGEX); + return(mAT); } case 324: break; - case 69: - { yybegin(WAIT_FOR_REGEX); - return(mSTAR_STAR); - } - case 325: break; case 74: { return mNUM_BIG_INT; } - case 326: break; - case 55: - { if (!gStringStack.isEmpty()) { - gStringStack.pop(); - } - if (blockStack.isEmpty()){ - yybegin(YYINITIAL); - } else { - yybegin(IN_INNER_BLOCK); - } - return mREGEX_END; + case 325: break; + case 118: + { yybegin(WAIT_FOR_REGEX); + return(mRANGE_EXCLUSIVE); } - case 327: break; + case 326: break; case 142: { return( kCLASS ); } - case 328: break; - case 82: + case 327: break; + case 68: { yybegin(WAIT_FOR_REGEX); - return(mPLUS_ASSIGN); + return(mDIV_ASSIGN); + } + case 328: break; + case 95: + { yybegin(WAIT_FOR_REGEX); + return(mLE); } case 329: break; - case 30: - { yybegin(WAIT_FOR_REGEX); - return(mBAND); - } - case 330: break; - case 62: - { yypushback(1); - yybegin(IN_DOLLAR_SLASH_REGEX); - } - case 331: break; - case 123: - { yybegin(WAIT_FOR_REGEX); - return(mCOMPARE_TO); - } - case 332: break; - case 98: - { yybegin(WAIT_FOR_REGEX); - return(mBXOR_ASSIGN); - } - case 333: break; case 155: { return( kRETURN ); } + case 330: break; + case 22: + { yybegin(WAIT_FOR_REGEX); + return(mCOLON); + } + case 331: break; + case 107: + // lookahead expression with fixed base length + zzMarkedPos = zzStartRead + 1; + { yybegin(IN_REGEX_IDENT); + return mDOT; + } + case 332: break; + case 56: + { yybegin(IN_REGEX_DOLLAR); + return mDOLLAR; + } + case 333: break; + case 19: + { if (!braceCount.isEmpty() && mLPAREN == braceCount.peek()) { + braceCount.pop(); + } + return(mRPAREN); + } case 334: break; case 43: // general lookahead, find correct zzMarkedPos @@ -2612,32 +2608,33 @@ public class _GroovyLexer implements FlexLexer, GroovyTokenTypes, TokenType { { return mGSTRING_CONTENT; } case 336: break; - case 112: + case 102: { yybegin(WAIT_FOR_REGEX); - return(mSTAR_STAR_ASSIGN); + return(mLAND); } case 337: break; + case 29: + { yybegin(WAIT_FOR_REGEX); + return(mBOR); + } + case 338: break; case 116: { return( kDEF ); } - case 338: break; - case 41: - { yybegin(IN_SINGLE_GSTRING_DOLLAR); - return mDOLLAR; - } case 339: break; - case 40: - { clearStacks(); - yybegin(NLS_AFTER_NLS); - afterComment = YYINITIAL; - return mNLS; + case 28: + { yybegin(WAIT_FOR_REGEX); + return(mBXOR); } case 340: break; - case 53: - { blockStack.push(mDIV); - braceCount.push(mLCURLY); - yybegin(NLS_AFTER_LBRACE); - return mLCURLY; + case 15: + { while (!braceCount.isEmpty() && mLCURLY != braceCount.peek()) { + braceCount.pop(); + } + if (!braceCount.isEmpty() && mLCURLY == braceCount.peek()) { + braceCount.pop(); + } + return mRCURLY; } case 341: break; case 147: diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex index 274cafbfe68e..a119cb61949a 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/groovy.flex @@ -134,7 +134,7 @@ mIDENT_NOBUCKS = {mLETTER} ({mLETTER} | {mDIGIT})* mSTRING_NL = {mONE_NL} mSTRING_ESC = \\ [^] | \\ ({WHITE_SPACE})+ (\n|\r) -mREGEX_ESC = \\ "$" +mREGEX_ESC = \\ "/" | "\\""u"{mHEX_DIGIT}{4} | "\\" [0..3] ([0..7] ([0..7])?)? | "\\" [4..7] ([0..7])? @@ -142,8 +142,7 @@ mREGEX_ESC = \\ "$" /// Regexes //////////////////////////////////////////////////////////////// -ESCAPED_REGEX_SEP = \\ "/" -mREGEX_CONTENT = ({mREGEX_ESC} | {ESCAPED_REGEX_SEP} | [^"/""$"])+ +mREGEX_CONTENT = ({mREGEX_ESC} | [^"/""$"])+ mDOLLAR_SLASH_REGEX_CONTENT = ([^\/\$] | \/[^\/\$] )+ diff --git a/plugins/groovy/testdata/parsing/groovy/expressions/regex/regex10.test b/plugins/groovy/testdata/parsing/groovy/expressions/regex/regex10.test index a5b0daa2e1a4..3178dea9e9c5 100644 --- a/plugins/groovy/testdata/parsing/groovy/expressions/regex/regex10.test +++ b/plugins/groovy/testdata/parsing/groovy/expressions/regex/regex10.test @@ -1,4 +1,4 @@ -'bugaga' ==~ /abc \${do "def ${a+b}} fgh$st ${frg./sdf/(5)} / +'bugaga' ==~ /abc \${do "def ${a+b}"} fgh$st ${frg./sdf/(5)} / ----- Groovy script Logical expression @@ -9,21 +9,36 @@ Groovy script PsiWhiteSpace(' ') Compound regular expression PsiElement(regex begin)('/') - PsiElement(regex content)('abc \${do "def ') + PsiElement(regex content)('abc \') GString injection PsiElement($)('$') Closable block PsiElement({)('{') Parameter list - Additive expression - Reference expression - PsiElement(identifier)('a') - PsiElement(+)('+') - Reference expression - PsiElement(identifier)('b') + PsiErrorElement:Wrong statement + + PsiElement(do)('do') + PsiWhiteSpace(' ') + Compound Gstring + PsiElement(Gstring begin)('"') + PsiElement(Gstring content)('def ') + GString injection + PsiElement($)('$') + Closable block + PsiElement({)('{') + Parameter list + + Additive expression + Reference expression + PsiElement(identifier)('a') + PsiElement(+)('+') + Reference expression + PsiElement(identifier)('b') + PsiElement(})('}') + PsiElement(Gstring end)('"') PsiElement(})('}') - PsiElement(regex content)('} fgh') + PsiElement(regex content)(' fgh') GString injection PsiElement($)('$') Reference expression diff --git a/plugins/groovy/testdata/parsing/groovy/expressions/regex/regex20.test b/plugins/groovy/testdata/parsing/groovy/expressions/regex/regex20.test index 0bf2f1449f6c..bf293d8e14f4 100644 --- a/plugins/groovy/testdata/parsing/groovy/expressions/regex/regex20.test +++ b/plugins/groovy/testdata/parsing/groovy/expressions/regex/regex20.test @@ -7,9 +7,17 @@ Groovy script PsiWhiteSpace(' ') Arguments PsiElement(()('(') - Literal - GroovyASTPsiElementImpl(regex literal) - PsiElement(regex begin)('/') - PsiElement(regex content)('a\${2}') - PsiElement(regex end)('/') + Compound regular expression + PsiElement(regex begin)('/') + PsiElement(regex content)('a\') + GString injection + PsiElement($)('$') + Closable block + PsiElement({)('{') + Parameter list + + Literal + PsiElement(Integer)('2') + PsiElement(})('}') + PsiElement(regex end)('/') PsiElement())(')') \ No newline at end of file From 4704079522ad89a8ffb54c048dbc3d50e7b58b11 Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Sun, 18 Dec 2011 22:29:48 +0400 Subject: [PATCH 074/101] IDEA-78947 Groovy: bad code is green: dollar-slashy string literal passed to method with omitted parentheses --- .../jetbrains/plugins/groovy/GroovyBundle.properties | 2 +- .../plugins/groovy/annotator/GroovyAnnotator.java | 10 ++++++++-- .../plugins/groovy/lang/GroovyHighlightingTest.groovy | 2 ++ .../testdata/highlighting/RegexInCommandArg.groovy | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 plugins/groovy/testdata/highlighting/RegexInCommandArg.groovy diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.properties b/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.properties index cd7d12081c37..6d94d0a5290d 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.properties +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyBundle.properties @@ -295,7 +295,7 @@ default.initializers.are.not.allowed.in.abstract.method=Default initializers are groovy.does.not.support.constructor.type.arguments=Groovy does not support constructor type arguments illegal.escape.character.in.string.literal=Illegal escape character in string literal dollar.slash.end.expected=Dollar slash ending expected -regex.cannot.be.first.argument.of.command.method.call=Regex cannot be first argument of command method call +regex.cannot.be.first.argument.of.command.method.call=Dollar-slashy strings cannot be the first argument of a command method call add.parentheses=Add parentheses add.parentheses.to.command.method.call=Add parentheses to command method call dollar.slash.strings.are.not.allowed.in.0=Dollar-slash strings are not allowed in Groovy {0} \ No newline at end of file diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java index a6e251241bc7..c4ad23b92f7b 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java @@ -856,8 +856,14 @@ public class GroovyAnnotator extends GroovyElementVisitor implements Annotator { myHolder .createErrorAnnotation(regex, GroovyBundle.message("dollar.slash.strings.are.not.allowed.in.0", config.getSDKVersion(regex))); } - if (regex.getParent() instanceof GrCommandArgumentList && - ((GrCommandArgumentList)regex.getParent()).getAllArguments()[0] == regex) { + if (regex instanceof GrRegex && + regex.getParent() instanceof GrCommandArgumentList && + ((GrCommandArgumentList)regex.getParent()).getAllArguments()[0] == regex || + + !(regex instanceof GrRegex) && + regex.getParent().getParent() instanceof GrCommandArgumentList && + ((GrCommandArgumentList)regex.getParent().getParent()).getAllArguments()[0] == regex.getParent() + ) { final Annotation annotation = myHolder.createErrorAnnotation(regex, GroovyBundle.message("regex.cannot.be.first.argument.of.command.method.call")); annotation.registerFix(new AddParenthesesFix()); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.groovy index 3b76f85a3299..ac0ebb27ec2c 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.groovy @@ -535,6 +535,8 @@ class Bar {{ void testConstructorTypeArgs(){doTest()} void testIncorrectEscaping() {doTest()} + + void testRegexInCommandArg() {doTest()} void testOctalInspection() { doTest(new GroovyOctalIntegerInspection()) } diff --git a/plugins/groovy/testdata/highlighting/RegexInCommandArg.groovy b/plugins/groovy/testdata/highlighting/RegexInCommandArg.groovy new file mode 100644 index 000000000000..9187c7b0f411 --- /dev/null +++ b/plugins/groovy/testdata/highlighting/RegexInCommandArg.groovy @@ -0,0 +1,2 @@ +print $/abc/$ +print $/a$bc/$ \ No newline at end of file From 0d2d8b90206b0408215641b8885fe3f590162ad1 Mon Sep 17 00:00:00 2001 From: nik Date: Mon, 19 Dec 2011 10:09:15 +0400 Subject: [PATCH 075/101] changed scope to 'test' for test libraries --- platform/platform-tests/platform-tests.iml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/platform-tests/platform-tests.iml b/platform/platform-tests/platform-tests.iml index ded732970c68..f34a2887a335 100644 --- a/platform/platform-tests/platform-tests.iml +++ b/platform/platform-tests/platform-tests.iml @@ -7,11 +7,11 @@ - + - + - + From 680212b6339f64b1a68fd1f2e00227b5f33c5bc0 Mon Sep 17 00:00:00 2001 From: kirillk Date: Mon, 19 Dec 2011 11:30:14 +0300 Subject: [PATCH 076/101] TreeUi: when removing elements which are selected - do not try to recompute new selections except for last element --- .../ide/util/treeView/AbstractTreeUi.java | 2 + .../ide/util/treeView/TreeUiTest.java | 44 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java index e1878a216f26..cc49e35956f6 100644 --- a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java +++ b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java @@ -3054,6 +3054,8 @@ public class AbstractTreeUi { } private void adjustSelectionOnChildRemove(DefaultMutableTreeNode parentNode, int selectedIndex, Object disposedElement) { + if (selectedIndex >= 0 && getSelectedElements().size() > 0) return; + DefaultMutableTreeNode node = getNodeForElement(disposedElement, false); if (node != null && isValidForSelectionAdjusting(node)) { Object newElement = getElementFor(node); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java index 24810565cf08..1be19c58b50f 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java @@ -2059,6 +2059,50 @@ public class TreeUiTest extends AbstractTreeBuilderTest { public void testSelectionOnDeleteButKeepRef() throws Exception { doTestSelectionOnDelete(true); } + + public void testMultipleSelectionOnDelete() throws Exception { + buildStructure(myRoot); + select(new NodeElement("fabrique"), false); + select(new NodeElement("openapi"), true); + select(new NodeElement("runner"), true); + select(new NodeElement("eclipse"), true); + + assertTree("-/\n" + + " -com\n" + + " -intellij\n" + + " [openapi]\n" + + " -jetbrains\n" + + " +[fabrique]\n" + + " -org\n" + + " +[eclipse]\n" + + " -xunit\n" + + " [runner]\n"); + + myStructure.getNodeFor(new NodeElement("runner")).delete(); + myStructure.getNodeFor(new NodeElement("eclipse")).delete(); + myStructure.getNodeFor(new NodeElement("openapi")).delete(); + + updateFromRoot(); + + assertTree("-/\n" + + " -com\n" + + " intellij\n" + + " -jetbrains\n" + + " +[fabrique]\n" + + " org\n" + + " xunit\n"); + + myStructure.getNodeFor(new NodeElement("fabrique")).delete(); + + updateFromRoot(); + assertTree("-/\n" + + " -com\n" + + " intellij\n" + + " [jetbrains]\n" + + " org\n" + + " xunit\n"); + } + public void testRevalidateStructure() throws Exception { final NodeElement com = new NodeElement("com"); From 5c8b5e56b0f6e969fee841cfd7bb9ed528ad5925 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Fri, 16 Dec 2011 17:56:55 +0400 Subject: [PATCH 077/101] tag name completion for facelets fixed --- .../completion/ExtendedTagInsertHandler.java | 6 ++-- .../com/intellij/xml/DefaultXmlExtension.java | 31 ++++++++++++------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java b/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java index dc6dafe87453..f774f5c7a1fb 100644 --- a/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java +++ b/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java @@ -57,9 +57,9 @@ public class ExtendedTagInsertHandler extends XmlTagInsertHandler { public void handleInsert(final InsertionContext context, final LookupElement item) { - final XmlFile contextfile = (XmlFile)context.getFile(); - final XmlExtension extension = XmlExtension.getExtension(contextfile); - final XmlFile file = extension.getContainingFile(contextfile); + final XmlFile contextFile = (XmlFile)context.getFile(); + final XmlExtension extension = XmlExtension.getExtension(contextFile); + final XmlFile file = extension.getContainingFile(contextFile); final Project project = context.getProject(); assert file != null; diff --git a/xml/impl/src/com/intellij/xml/DefaultXmlExtension.java b/xml/impl/src/com/intellij/xml/DefaultXmlExtension.java index 5eb23b67699f..95137042f893 100644 --- a/xml/impl/src/com/intellij/xml/DefaultXmlExtension.java +++ b/xml/impl/src/com/intellij/xml/DefaultXmlExtension.java @@ -52,8 +52,8 @@ public class DefaultXmlExtension extends XmlExtension { public List> getAvailableTagNames(@NotNull final XmlFile file, @NotNull final XmlTag context) { final Set namespaces = new HashSet(Arrays.asList(context.knownNamespaces())); - final XmlSchemaProvider provider = XmlSchemaProvider.getAvailableProvider(file); - if (provider != null) { + final List providers = XmlSchemaProvider.getAvailableProviders(file); + for (XmlSchemaProvider provider : providers) { namespaces.addAll(provider.getAvailableNamespaces(file, null)); } final ArrayList nsInfo = new ArrayList(); @@ -70,11 +70,13 @@ public class DefaultXmlExtension extends XmlExtension { @NotNull public Set getNamespacesByTagName(@NotNull final String tagName, @NotNull final XmlFile context) { - final XmlSchemaProvider provider = XmlSchemaProvider.getAvailableProvider(context); - if (provider == null) { - return Collections.emptySet(); + final List providers = XmlSchemaProvider.getAvailableProviders(context); + + HashSet set = new HashSet(); + for (XmlSchemaProvider provider : providers) { + set.addAll(provider.getAvailableNamespaces(context, tagName)); } - return provider.getAvailableNamespaces(context, tagName); + return set; } public static Set filterNamespaces(final Set namespaces, final String tagName, final XmlFile context) { @@ -181,10 +183,17 @@ public class DefaultXmlExtension extends XmlExtension { } } - final XmlSchemaProvider provider = XmlSchemaProvider.getAvailableProvider(file); + final List providers = XmlSchemaProvider.getAvailableProviders(file); + XmlSchemaProvider prefixProvider = null; String prefix = nsPrefix; - if (prefix == null && provider != null) { - prefix = provider.getDefaultPrefix(namespace, file); + if (prefix == null) { + for (XmlSchemaProvider provider : providers) { + prefix = provider.getDefaultPrefix(namespace, file); + if (prefix != null) { + prefixProvider = provider; + break; + } + } } if (prefix == null) { prefix = ""; @@ -201,8 +210,8 @@ public class DefaultXmlExtension extends XmlExtension { String location = null; if (namespace.length() > 0) { - if (provider != null) { - final Set strings = provider.getLocations(namespace, file); + if (prefixProvider != null) { + final Set strings = prefixProvider.getLocations(namespace, file); if (strings != null && strings.size() > 0) { location = strings.iterator().next(); } From 7fbc063e89e52d7ef4cefbf7d92d1ffa03c8e2c2 Mon Sep 17 00:00:00 2001 From: "kirill.safonov" Date: Mon, 19 Dec 2011 12:46:21 +0400 Subject: [PATCH 078/101] Speed search in Select Font dialog (IDEA-79060) --- .../src/com/intellij/application/options/SelectFontDialog.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/application/options/SelectFontDialog.java b/platform/platform-impl/src/com/intellij/application/options/SelectFontDialog.java index 28285c55fa3b..6a255b5053cf 100644 --- a/platform/platform-impl/src/com/intellij/application/options/SelectFontDialog.java +++ b/platform/platform-impl/src/com/intellij/application/options/SelectFontDialog.java @@ -19,6 +19,7 @@ import com.intellij.openapi.application.ApplicationBundle; import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.ui.ListScrollingUtil; +import com.intellij.ui.ListSpeedSearch; import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.components.JBList; import com.intellij.util.containers.HashMap; @@ -52,6 +53,7 @@ public class SelectFontDialog extends DialogWrapper { final boolean useOnlyMonospacedFonts = EditorColorsManager.getInstance().isUseOnlyMonospacedFonts(); myShowMonospacedCheckbox.setSelected(useOnlyMonospacedFonts); myFontList = new JBList(); + new ListSpeedSearch(myFontList); myFontList.setModel(new DefaultListModel()); fillList(useOnlyMonospacedFonts); From 9648da64d7a620df5aad4588eb88fd6d1ab3c651 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 19 Dec 2011 13:46:13 +0400 Subject: [PATCH 079/101] XmlNoVariantsDelegator --- .../completion/JavaNoVariantsDelegator.java | 58 +++++--------- .../completion/NoVariantsDelegator.java | 48 +++++++++++ .../src/META-INF/XmlPlugin.xml | 2 + .../completion/XmlCompletionContributor.java | 79 ++++++++++--------- .../completion/XmlNoVariantsDelegator.java | 32 ++++++++ 5 files changed, 144 insertions(+), 75 deletions(-) create mode 100644 platform/lang-impl/src/com/intellij/codeInsight/completion/NoVariantsDelegator.java create mode 100644 xml/impl/src/com/intellij/codeInsight/completion/XmlNoVariantsDelegator.java diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaNoVariantsDelegator.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaNoVariantsDelegator.java index e3c81663a4fc..9dcfb4a9f016 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaNoVariantsDelegator.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaNoVariantsDelegator.java @@ -17,54 +17,38 @@ package com.intellij.codeInsight.completion; import com.intellij.codeInsight.lookup.AutoCompletionPolicy; import com.intellij.codeInsight.lookup.LookupElement; -import com.intellij.openapi.util.Ref; import com.intellij.util.Consumer; /** * @author peter */ -public class JavaNoVariantsDelegator extends CompletionContributor { +public class JavaNoVariantsDelegator extends NoVariantsDelegator { @Override - public void fillCompletionVariants(final CompletionParameters parameters, final CompletionResultSet result) { - final Ref empty = Ref.create(true); - Consumer passResult = new Consumer() { - public void consume(final CompletionResult lookupElement) { - empty.set(false); - result.passResult(lookupElement); - } - }; - result.runRemainingContributors(parameters, passResult); + protected void delegate(CompletionParameters parameters, CompletionResultSet result, Consumer passResult) { + if (parameters.getCompletionType() == CompletionType.BASIC && + parameters.getInvocationCount() <= 1 && + JavaCompletionContributor.mayStartClassName(result, false) && + JavaCompletionContributor.isClassNamePossible(parameters.getPosition())) { + final ClassByNameMerger merger = new ClassByNameMerger(parameters.getInvocationCount() == 0, result); - if (!empty.get() && parameters.getInvocationCount() == 0) { - result.restartCompletionWhenNothingMatches(); - } - - if (empty.get()) { - if (parameters.getCompletionType() == CompletionType.BASIC && - parameters.getInvocationCount() <= 1 && - JavaCompletionContributor.mayStartClassName(result, false) && - JavaCompletionContributor.isClassNamePossible(parameters.getPosition())) { - final ClassByNameMerger merger = new ClassByNameMerger(parameters.getInvocationCount() == 0, result); - - JavaClassNameCompletionContributor.addAllClasses(parameters, JavaCompletionSorting.addJavaSorting(parameters, result), - true, new Consumer() { - @Override - public void consume(LookupElement element) { - JavaPsiClassReferenceElement classElement = element.as(JavaPsiClassReferenceElement.CLASS_CONDITION_KEY); - if (classElement != null) { - classElement.setAutoCompletionPolicy(AutoCompletionPolicy.NEVER_AUTOCOMPLETE); - } - - merger.consume(classElement); + JavaClassNameCompletionContributor.addAllClasses(parameters, JavaCompletionSorting.addJavaSorting(parameters, result), + true, new Consumer() { + @Override + public void consume(LookupElement element) { + JavaPsiClassReferenceElement classElement = element.as(JavaPsiClassReferenceElement.CLASS_CONDITION_KEY); + if (classElement != null) { + classElement.setAutoCompletionPolicy(AutoCompletionPolicy.NEVER_AUTOCOMPLETE); } - }); - merger.finishedClassProcessing(); + merger.consume(classElement); + } + }); - } else if (parameters.getCompletionType() == CompletionType.SMART && parameters.getInvocationCount() == 2) { - result.runRemainingContributors(parameters.withInvocationCount(3), passResult); - } + merger.finishedClassProcessing(); + + } else if (parameters.getCompletionType() == CompletionType.SMART && parameters.getInvocationCount() == 2) { + result.runRemainingContributors(parameters.withInvocationCount(3), passResult); } } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/NoVariantsDelegator.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/NoVariantsDelegator.java new file mode 100644 index 000000000000..8830708d4dd9 --- /dev/null +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/NoVariantsDelegator.java @@ -0,0 +1,48 @@ +/* + * Copyright 2000-2011 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.intellij.codeInsight.completion; + +import com.intellij.openapi.util.Ref; +import com.intellij.util.Consumer; + +/** + * @author Dmitry Avdeev + * Date: 12/19/11 + */ +public abstract class NoVariantsDelegator extends CompletionContributor { + + @Override + public void fillCompletionVariants(final CompletionParameters parameters, final CompletionResultSet result) { + final Ref empty = Ref.create(true); + Consumer passResult = new Consumer() { + public void consume(final CompletionResult lookupElement) { + empty.set(false); + result.passResult(lookupElement); + } + }; + result.runRemainingContributors(parameters, passResult); + + if (!empty.get() && parameters.getInvocationCount() == 0) { + result.restartCompletionWhenNothingMatches(); + } + + if (empty.get()) { + delegate(parameters, result, passResult); + } + } + + protected abstract void delegate(CompletionParameters parameters, CompletionResultSet result, Consumer passResult); +} diff --git a/platform/platform-resources/src/META-INF/XmlPlugin.xml b/platform/platform-resources/src/META-INF/XmlPlugin.xml index 35e5c4d04628..678706f07a58 100644 --- a/platform/platform-resources/src/META-INF/XmlPlugin.xml +++ b/platform/platform-resources/src/META-INF/XmlPlugin.xml @@ -73,6 +73,8 @@ + + diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionContributor.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionContributor.java index 5e1c167394e0..cc1196429104 100644 --- a/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionContributor.java +++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionContributor.java @@ -28,6 +28,7 @@ import com.intellij.openapi.util.Key; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.patterns.PlatformPatterns; import com.intellij.patterns.XmlPatterns; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiReference; @@ -82,7 +83,7 @@ public class XmlCompletionContributor extends CompletionContributor { public XmlCompletionContributor() { extend(CompletionType.BASIC, - XmlPatterns.psiElement().inside(XmlPatterns.xmlAttributeValue()), + PlatformPatterns.psiElement().inside(XmlPatterns.xmlAttributeValue()), new CompletionProvider() { @Override protected void addCompletions(@NotNull CompletionParameters parameters, @@ -118,10 +119,7 @@ public class XmlCompletionContributor extends CompletionContributor { public static boolean isXmlNameCompletion(final CompletionParameters parameters) { final ASTNode node = parameters.getPosition().getNode(); - if (node == null || node.getElementType() != XmlTokenType.XML_NAME) { - return false; - } - return true; + return node != null && node.getElementType() == XmlTokenType.XML_NAME; } public void fillCompletionVariants(final CompletionParameters parameters, final CompletionResultSet result) { @@ -133,39 +131,7 @@ public class XmlCompletionContributor extends CompletionContributor { final PsiElement element = parameters.getPosition(); if (parameters.getCompletionType() == CompletionType.CLASS_NAME) { - if (!isXmlNameCompletion(parameters)) return; - result.stopHere(); - if (!(element.getParent() instanceof XmlTag)) { - return; - } - final XmlTag parent = (XmlTag)element.getParent(); - final String namespace = parent.getNamespace(); - final XmlElementDescriptor parentDescriptor = parent.getDescriptor(); - final String prefix = result.getPrefixMatcher().getPrefix(); - final int pos = prefix.indexOf(':'); - final String namespacePrefix = pos > 0 ? prefix.substring(0, pos) : null; - - final PsiReference reference = parent.getReference(); - if (reference != null && namespace.length() > 0 && parentDescriptor != null && !(parentDescriptor instanceof AnyXmlElementDescriptor)) { - final Set set = new HashSet(); - new XmlCompletionData().completeReference(reference, set, element, parameters.getOriginalFile(), parameters.getOffset()); - for (final LookupElement item : set) { - result.addElement(item); - } - } - else { - - final CompletionResultSet newResult = result.withPrefixMatcher(pos >= 0 ? prefix.substring(pos + 1) : prefix); - - final XmlFile file = (XmlFile)parameters.getOriginalFile(); - final List> names = XmlExtension.getExtension(file).getAvailableTagNames(file, parent); - for (Pair pair : names) { - final String name = pair.getFirst(); - final String ns = pair.getSecond(); - final LookupElement item = createLookupElement(name, ns, ns, namespacePrefix); - newResult.addElement(item); - } - } + completeTagName(parameters, result); } else if (parameters.getCompletionType() == CompletionType.SMART) { @@ -173,6 +139,43 @@ public class XmlCompletionContributor extends CompletionContributor { } } + static void completeTagName(CompletionParameters parameters, CompletionResultSet result) { + PsiElement element = parameters.getPosition(); + if (!isXmlNameCompletion(parameters)) return; + result.stopHere(); + if (!(element.getParent() instanceof XmlTag) || !(parameters.getOriginalFile() instanceof XmlFile)) { + return; + } + final XmlTag parent = (XmlTag)element.getParent(); + final String namespace = parent.getNamespace(); + final XmlElementDescriptor parentDescriptor = parent.getDescriptor(); + final String prefix = result.getPrefixMatcher().getPrefix(); + final int pos = prefix.indexOf(':'); + final String namespacePrefix = pos > 0 ? prefix.substring(0, pos) : null; + + final PsiReference reference = parent.getReference(); + if (reference != null && namespace.length() > 0 && parentDescriptor != null && !(parentDescriptor instanceof AnyXmlElementDescriptor)) { + final Set set = new HashSet(); + new XmlCompletionData().completeReference(reference, set, element, parameters.getOriginalFile(), parameters.getOffset()); + for (final LookupElement item : set) { + result.addElement(item); + } + } + else { + + final CompletionResultSet newResult = result.withPrefixMatcher(pos >= 0 ? prefix.substring(pos + 1) : prefix); + + final XmlFile file = (XmlFile)parameters.getOriginalFile(); + final List> names = XmlExtension.getExtension(file).getAvailableTagNames(file, parent); + for (Pair pair : names) { + final String name = pair.getFirst(); + final String ns = pair.getSecond(); + final LookupElement item = createLookupElement(name, ns, ns, namespacePrefix); + newResult.addElement(item); + } + } + } + public static LookupElement createLookupElement(final String name, final String namespace, final String tailText, @Nullable String namespacePrefix) { diff --git a/xml/impl/src/com/intellij/codeInsight/completion/XmlNoVariantsDelegator.java b/xml/impl/src/com/intellij/codeInsight/completion/XmlNoVariantsDelegator.java new file mode 100644 index 000000000000..eee41f147801 --- /dev/null +++ b/xml/impl/src/com/intellij/codeInsight/completion/XmlNoVariantsDelegator.java @@ -0,0 +1,32 @@ +/* + * Copyright 2000-2011 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.intellij.codeInsight.completion; + +import com.intellij.util.Consumer; + +/** + * @author Dmitry Avdeev + * Date: 12/19/11 + */ +public class XmlNoVariantsDelegator extends NoVariantsDelegator { + + @Override + protected void delegate(CompletionParameters parameters, CompletionResultSet result, Consumer passResult) { + if (parameters.getCompletionType() == CompletionType.BASIC) { + XmlCompletionContributor.completeTagName(parameters, result); + } + } +} From cc881112d153ac212962ed77b9dc94edbfb1da69 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 19 Dec 2011 13:49:39 +0400 Subject: [PATCH 080/101] using NoVariantsDelegator --- .../completion/GroovyNoVariantsDelegator.java | 53 +++++++------------ 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyNoVariantsDelegator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyNoVariantsDelegator.java index 034c164852fe..ef74cc4702e9 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyNoVariantsDelegator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyNoVariantsDelegator.java @@ -18,52 +18,35 @@ package org.jetbrains.plugins.groovy.lang.completion; import com.intellij.codeInsight.completion.*; import com.intellij.codeInsight.lookup.AutoCompletionPolicy; import com.intellij.codeInsight.lookup.LookupElement; -import com.intellij.openapi.util.Ref; import com.intellij.util.Consumer; /** * @author peter */ -public class GroovyNoVariantsDelegator extends CompletionContributor { +public class GroovyNoVariantsDelegator extends NoVariantsDelegator { @Override - public void fillCompletionVariants(final CompletionParameters parameters, final CompletionResultSet result) { - final Ref empty = Ref.create(true); - Consumer passResult = new Consumer() { - public void consume(final CompletionResult lookupElement) { - empty.set(false); - result.passResult(lookupElement); - } - }; - result.runRemainingContributors(parameters, passResult); + protected void delegate(CompletionParameters parameters, CompletionResultSet result, Consumer passResult) { + if (parameters.getCompletionType() == CompletionType.BASIC && + parameters.getInvocationCount() <= 1 && + JavaCompletionContributor.mayStartClassName(result, false) && + GroovyCompletionContributor.isClassNamePossible(parameters.getPosition())) { + final ClassByNameMerger merger = new ClassByNameMerger(parameters.getInvocationCount() == 0, result); - if (!empty.get() && parameters.getInvocationCount() == 0) { - result.restartCompletionWhenNothingMatches(); - } - - if (empty.get()) { - if (parameters.getCompletionType() == CompletionType.BASIC && - parameters.getInvocationCount() <= 1 && - JavaCompletionContributor.mayStartClassName(result, false) && - GroovyCompletionContributor.isClassNamePossible(parameters.getPosition())) { - final ClassByNameMerger merger = new ClassByNameMerger(parameters.getInvocationCount() == 0, result); - - GroovyCompletionContributor.addAllClasses(parameters, result, - new Consumer() { - @Override - public void consume(LookupElement element) { - JavaPsiClassReferenceElement classElement = element.as(JavaPsiClassReferenceElement.CLASS_CONDITION_KEY); - if (classElement != null) { - classElement.setAutoCompletionPolicy(AutoCompletionPolicy.NEVER_AUTOCOMPLETE); - } - merger.consume(classElement); + GroovyCompletionContributor.addAllClasses(parameters, result, + new Consumer() { + @Override + public void consume(LookupElement element) { + JavaPsiClassReferenceElement classElement = element.as(JavaPsiClassReferenceElement.CLASS_CONDITION_KEY); + if (classElement != null) { + classElement.setAutoCompletionPolicy(AutoCompletionPolicy.NEVER_AUTOCOMPLETE); } - }, new InheritorsHolder(parameters.getPosition(), result)); + merger.consume(classElement); + } + }, new InheritorsHolder(parameters.getPosition(), result)); - merger.finishedClassProcessing(); + merger.finishedClassProcessing(); - } } } - } From 043a5a8125c871034ce5e51bd44cfa487a3d84ab Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Mon, 19 Dec 2011 11:31:30 +0400 Subject: [PATCH 081/101] IDEA-79035 Incorrect stub generated for class which uses @Delegate --- .../ast/DelegatedMethodsContributor.java | 4 +- .../groovy/compiler/GeneratorTest.java | 1 + .../delegateWithStaticMethod.test | 67 +++++++++++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 plugins/groovy/testdata/groovy/stubGenerator/delegateWithStaticMethod.test diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/ast/DelegatedMethodsContributor.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/ast/DelegatedMethodsContributor.java index 2fc1c47ba350..ffbf5ce556a9 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/ast/DelegatedMethodsContributor.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/ast/DelegatedMethodsContributor.java @@ -55,8 +55,8 @@ public class DelegatedMethodsContributor extends AstTransformContributor { final PsiMethod[] methods = getMethodsFromClassWithoutAST(psiClass); for (PsiMethod method : methods) { - if (method.isConstructor()) continue; - if (!deprecated && PsiImplUtil.getAnnotation(method, "java.lang.Deprecated") != null) continue; + if (method.isConstructor() || method.hasModifierProperty(PsiModifier.STATIC)) continue; + if (!deprecated && PsiImplUtil.getAnnotation(method, CommonClassNames.JAVA_LANG_DEPRECATED) != null) continue; if (clazz.findCodeMethodsBySignature(method, false).length > 0) continue; collector.add(generateDelegateMethod(method, clazz, resolveResult.getSubstitutor())); } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GeneratorTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GeneratorTest.java index 2f1eff82df8f..3918a8600d08 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GeneratorTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GeneratorTest.java @@ -60,6 +60,7 @@ public class GeneratorTest extends LightGroovyTestCase { public void testSubclassProperty() throws Throwable { doTest(); } public void testFinalProperty() throws Throwable { doTest(); } public void testDefaultConstructorArguments() throws Throwable { doTest(); } + public void testDelegateWithStaticMethod() throws Throwable { doTest(); } public void testParameterReturnType() throws Throwable { myFixture.addClass("public interface GwtActionService {\n" + diff --git a/plugins/groovy/testdata/groovy/stubGenerator/delegateWithStaticMethod.test b/plugins/groovy/testdata/groovy/stubGenerator/delegateWithStaticMethod.test new file mode 100644 index 000000000000..92d886624771 --- /dev/null +++ b/plugins/groovy/testdata/groovy/stubGenerator/delegateWithStaticMethod.test @@ -0,0 +1,67 @@ +class Foo { + @Delegate Bar bar +} + +class Bar { + static void bar() {} +} +----- +public class Foo extends groovy.lang.GroovyObjectSupport implements groovy.lang.GroovyObject { +public Bar getBar() { +return null; +} + +public void setBar(Bar bar) { +return ; +} + +public java.lang.Object getProperty(java.lang.String property) { +return null; +} + +public void setProperty(java.lang.String property, java.lang.Object newValue) { +return ; +} + +public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args) { +return null; +} + +public groovy.lang.MetaClass getMetaClass() { +return null; +} + +public void setMetaClass(groovy.lang.MetaClass metaClass) { +return ; +} + +private Bar bar = null; +} +--- +public class Bar extends groovy.lang.GroovyObjectSupport implements groovy.lang.GroovyObject { +public static void bar() { +return ; +} + +public java.lang.Object getProperty(java.lang.String property) { +return null; +} + +public void setProperty(java.lang.String property, java.lang.Object newValue) { +return ; +} + +public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args) { +return null; +} + +public groovy.lang.MetaClass getMetaClass() { +return null; +} + +public void setMetaClass(groovy.lang.MetaClass metaClass) { +return ; +} + +} +--- \ No newline at end of file From 50839bb24973986eebbb74d91e76d4a314197e94 Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Mon, 19 Dec 2011 13:49:22 +0400 Subject: [PATCH 082/101] EA-31488 - assert: AbstractBlockAlignmentProcessor.applyAlignment --- .../plugins/groovy/formatter/GeeseUtil.java | 23 ++++++-- .../plugins/groovy/formatter/GroovyBlock.java | 56 ++++++++----------- .../formatter/GroovyBlockGenerator.java | 44 +++++++++------ .../GroovyFormattingModelBuilder.java | 10 ++-- .../groovy/formatter/GroovySimpleBlock.java | 43 ++++++++++++++ .../MethodCallWithoutQualifierBlock.java | 50 +++++++---------- .../lang/formatter/EnterActionTest.groovy | 15 +++++ 7 files changed, 152 insertions(+), 89 deletions(-) create mode 100644 plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovySimpleBlock.java diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GeeseUtil.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GeeseUtil.java index bb73d0f033b9..096776e53f78 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GeeseUtil.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GeeseUtil.java @@ -82,7 +82,7 @@ public class GeeseUtil { } @Nullable - static Alignment calculateRBraceAlignment(PsiElement rBrace, Map alignments) { + static Alignment calculateRBraceAlignment(PsiElement rBrace, Map alignments, Map blocks) { int leadingBraceCount = 0; PsiElement next; @@ -121,21 +121,36 @@ public class GeeseUtil { cur = PsiTreeUtil.getDeepestFirst(cur); while (!PsiUtil.isNewLine(next = PsiTreeUtil.prevLeaf(cur, true))) { if (next == null) break; - if (next.getNode().getElementType() == TokenType.WHITE_SPACE && PsiTreeUtil.prevLeaf(next) == null) break; //if cur is first word in the text, whitespace could be before it + if (next.getNode().getElementType() == TokenType.WHITE_SPACE && PsiTreeUtil.prevLeaf(next) == null) { + break; //if cur is first word in the text, whitespace could be before it + } cur = next; } int startOffset = cur.getTextRange().getStartOffset(); - int endOffset=rBrace.getTextRange().getStartOffset(); + int endOffset = rBrace.getTextRange().getStartOffset(); if (rBrace.getContainingFile().getText().substring(startOffset, endOffset).indexOf('\n') < 0) { return null; } - //PsiElement statement = PsiUtil.findEnclosingStatement(parent); + while (true) { + final PsiElement p = cur.getParent(); + if (p != null && p.getTextOffset() == cur.getTextOffset()) { + cur = p; + } + else { + break; + } + } + Alignment alignment = alignments.get(cur); if (alignment == null) { + final GroovyBlock block = blocks.get(cur); alignment = Alignment.createAlignment(true); + if (block != null) { + block.setAlignment(alignment); + } alignments.put(cur, alignment); } return alignment; diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyBlock.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyBlock.java index 22474d4d63c0..a0ad58d184f7 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyBlock.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyBlock.java @@ -25,7 +25,6 @@ import com.intellij.psi.PsiErrorElement; import com.intellij.psi.PsiWhiteSpace; import com.intellij.psi.codeStyle.CommonCodeStyleSettings; import com.intellij.psi.tree.ILazyParseableElementType; -import com.intellij.util.containers.CollectionFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.formatter.processors.GroovyIndentProcessor; @@ -56,48 +55,38 @@ import java.util.Map; * * @author ilyas */ -public class GroovyBlock implements Block, GroovyElementTypes, ASTBlock { - +public abstract class GroovyBlock implements Block, GroovyElementTypes, ASTBlock { final protected ASTNode myNode; - final protected Alignment myAlignment; + protected Alignment myAlignment; final protected Indent myIndent; final protected Wrap myWrap; final protected CommonCodeStyleSettings mySettings; final protected GroovyCodeStyleSettings myGroovySettings; final protected Map myInnerAlignments; + final protected Map myBlocks; protected List mySubBlocks = null; - public GroovyBlock(@NotNull final ASTNode node, - @Nullable final Alignment alignment, - @NotNull final Indent indent, - @Nullable final Wrap wrap, - final CommonCodeStyleSettings settings, - GroovyCodeStyleSettings groovySettings - ) { - this(node, alignment, indent, wrap, settings, groovySettings, CollectionFactory.hashMap()); - } - public GroovyBlock(@NotNull final ASTNode node, @Nullable Alignment alignment, @NotNull final Indent indent, @Nullable final Wrap wrap, final CommonCodeStyleSettings settings, GroovyCodeStyleSettings groovySettings, - @NotNull Map innerAlignments) { + @NotNull Map innerAlignments, Map blocks) { myNode = node; - if (groovySettings.USE_FLYING_GEESE_BRACES && isLeaf()) { + myBlocks = blocks; + if (groovySettings.USE_FLYING_GEESE_BRACES) { PsiElement psi = myNode.getPsi(); - if (alignment == null) alignment = innerAlignments.get(psi); - if (alignment == null) alignment = Alignment.createAlignment(true); - - myAlignment = alignment; - innerAlignments.put(psi, myAlignment); + myBlocks.put(psi, this); + if (alignment == null) { + alignment = innerAlignments.get(psi); + } + else { + innerAlignments.put(psi, alignment); + } } - else { - myAlignment = alignment; - } - + myAlignment = alignment; myIndent = indent; myWrap = wrap; @@ -131,9 +120,6 @@ public class GroovyBlock implements Block, GroovyElementTypes, ASTBlock { @NotNull public List getSubBlocks() { - if (mySubBlocks == null) { - mySubBlocks = new GroovyBlockGenerator(this).generateSubBlocks(); - } return mySubBlocks; } @@ -205,9 +191,9 @@ public class GroovyBlock implements Block, GroovyElementTypes, ASTBlock { if (BLOCK_SET.contains(astNode.getElementType()) || SWITCH_STATEMENT.equals(astNode.getElementType())) { // PsiElement psi = ((GroovyBlock)getSubBlocks().get(newChildIndex)).getNode().getPsi(); - // if (GeeseUtil.isClosureRBrace(psi)) { - // return new ChildAttributes(Indent.getNoneIndent(), GeeseUtil.calculateRBraceAlignment(psi, myInnerAlignments)); - // } + // if (GeeseUtil.isClosureRBrace(psi)) { + // return new ChildAttributes(Indent.getNoneIndent(), GeeseUtil.calculateRBraceAlignment(psi, myInnerAlignments)); + // } return new ChildAttributes(Indent.getNormalIndent(), null); } @@ -242,6 +228,10 @@ public class GroovyBlock implements Block, GroovyElementTypes, ASTBlock { return isIncomplete(myNode); } + public void setAlignment(Alignment alignment) { + myAlignment = alignment; + } + /** * @param node Tree node * @return true if node is incomplete @@ -250,8 +240,8 @@ public class GroovyBlock implements Block, GroovyElementTypes, ASTBlock { if (node.getElementType() instanceof ILazyParseableElementType) return false; ASTNode lastChild = node.getLastChildNode(); while (lastChild != null && - !(lastChild.getElementType() instanceof ILazyParseableElementType) && - (lastChild.getPsi() instanceof PsiWhiteSpace || lastChild.getPsi() instanceof PsiComment)) { + !(lastChild.getElementType() instanceof ILazyParseableElementType) && + (lastChild.getPsi() instanceof PsiWhiteSpace || lastChild.getPsi() instanceof PsiComment)) { lastChild = lastChild.getTreePrev(); } return lastChild != null && (lastChild.getPsi() instanceof PsiErrorElement || isIncomplete(lastChild)); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyBlockGenerator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyBlockGenerator.java index 24240437fcdb..d72d4a061660 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyBlockGenerator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyBlockGenerator.java @@ -82,16 +82,18 @@ public class GroovyBlockGenerator implements GroovyElementTypes { private final Wrap myWrap; private final CommonCodeStyleSettings mySettings; private final Map myInnerAlignments; + private final Map myBlocks; private final GroovyCodeStyleSettings myGroovySettings; public GroovyBlockGenerator(GroovyBlock block) { - this.myBlock = block; + myBlock = block; myNode = myBlock.getNode(); myAlignment = myBlock.getAlignment(); myWrap = myBlock.getWrap(); mySettings = myBlock.getSettings(); myInnerAlignments = myBlock.getInnerAlignments(); myGroovySettings = myBlock.getGroovySettings(); + myBlocks = myBlock.myBlocks; } @@ -134,7 +136,8 @@ public class GroovyBlockGenerator implements GroovyElementTypes { for (ASTNode childNode : children) { if (childNode.getTextRange().getLength() > 0) { final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode); - subBlocks.add(new GroovyBlock(childNode, myAlignment, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments)); + subBlocks.add(new GroovySimpleBlock(childNode, myAlignment, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments, + myBlocks)); } } return subBlocks; @@ -155,8 +158,8 @@ public class GroovyBlockGenerator implements GroovyElementTypes { final Alignment newAlignment = mustAlign(blockPsi, astNodes) ? Alignment.createAlignment() : null; for (ASTNode childNode : astNodes) { final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode); - subBlocks.add(new GroovyBlock(childNode, isKeyword(childNode) ? null : newAlignment, indent, myWrap, mySettings, myGroovySettings, - myInnerAlignments)); + subBlocks.add(new GroovySimpleBlock(childNode, isKeyword(childNode) ? null : newAlignment, indent, myWrap, mySettings, myGroovySettings, + myInnerAlignments, myBlocks)); } return subBlocks; } @@ -169,7 +172,8 @@ public class GroovyBlockGenerator implements GroovyElementTypes { for (ASTNode childNode : children) { final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode); Alignment alignmentToUse = classLevel ? myAlignment : myInnerAlignments.get(childNode.getPsi()); - subBlocks.add(new GroovyBlock(childNode, alignmentToUse, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments)); + subBlocks.add(new GroovySimpleBlock(childNode, alignmentToUse, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments, + myBlocks)); } return subBlocks; } @@ -178,8 +182,8 @@ public class GroovyBlockGenerator implements GroovyElementTypes { final ArrayList subBlocks = new ArrayList(); for (ASTNode childNode : visibleChildren(myNode)) { final Indent indent = GroovyIndentProcessor.getChildIndent(myBlock, childNode); - subBlocks.add(new GroovyBlock(childNode, myInnerAlignments.get(childNode.getPsi()), indent, myWrap, mySettings, myGroovySettings, - myInnerAlignments)); + subBlocks.add(new GroovySimpleBlock(childNode, myInnerAlignments.get(childNode.getPsi()), indent, myWrap, mySettings, myGroovySettings, + myInnerAlignments, myBlocks)); } return subBlocks; } @@ -229,7 +233,7 @@ public class GroovyBlockGenerator implements GroovyElementTypes { } } else if (GeeseUtil.isClosureRBrace(psi) && myGroovySettings.USE_FLYING_GEESE_BRACES) { - myInnerAlignments.put(psi, GeeseUtil.calculateRBraceAlignment(psi, myInnerAlignments)); + myInnerAlignments.put(psi, GeeseUtil.calculateRBraceAlignment(psi, myInnerAlignments, myBlocks)); } else { if (psi instanceof PsiComment) { @@ -321,19 +325,22 @@ public class GroovyBlockGenerator implements GroovyElementTypes { final int start = myNode.getTextRange().getStartOffset(); final int end = myNode.getTextRange().getEndOffset(); - subBlocks.add(new GroovyBlock(myNode, myAlignment, Indent.getNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments) { + subBlocks.add(new GroovySimpleBlock(myNode, myAlignment, Indent.getNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments, + myBlocks) { @NotNull public TextRange getTextRange() { return new TextRange(start, start + 3); } }); - subBlocks.add(new GroovyBlock(myNode, myAlignment, Indent.getAbsoluteNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments) { + subBlocks.add(new GroovySimpleBlock(myNode, myAlignment, Indent.getAbsoluteNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments, + myBlocks) { @NotNull public TextRange getTextRange() { return new TextRange(start + 3, end - 3); } }); - subBlocks.add(new GroovyBlock(myNode, myAlignment, Indent.getAbsoluteNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments) { + subBlocks.add(new GroovySimpleBlock(myNode, myAlignment, Indent.getAbsoluteNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments, + myBlocks) { @NotNull public TextRange getTextRange() { return new TextRange(end - 3, end); @@ -347,13 +354,15 @@ public class GroovyBlockGenerator implements GroovyElementTypes { final int start = myNode.getTextRange().getStartOffset(); final int end = myNode.getTextRange().getEndOffset(); - subBlocks.add(new GroovyBlock(myNode, myAlignment, Indent.getNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments) { + subBlocks.add(new GroovySimpleBlock(myNode, myAlignment, Indent.getNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments, + myBlocks) { @NotNull public TextRange getTextRange() { return new TextRange(start, start + 3); } }); - subBlocks.add(new GroovyBlock(myNode, myAlignment, Indent.getAbsoluteNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments) { + subBlocks.add(new GroovySimpleBlock(myNode, myAlignment, Indent.getAbsoluteNoneIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments, + myBlocks) { @NotNull public TextRange getTextRange() { return new TextRange(start + 3, end); @@ -435,7 +444,8 @@ public class GroovyBlockGenerator implements GroovyElementTypes { PsiElement psi = childNode.getPsi(); if (!(psi instanceof GrBinaryExpression)) { Alignment alignmentToUse = op == psi ? myInnerAlignments.get(op) : alignment; - list.add(new GroovyBlock(childNode, alignmentToUse, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments)); + list.add(new GroovySimpleBlock(childNode, alignmentToUse, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments, + myBlocks)); } } if (myExpr.getRightOperand() instanceof GrBinaryExpression) { @@ -465,7 +475,7 @@ public class GroovyBlockGenerator implements GroovyElementTypes { if (i < grandChildren.size()) { LOG.assertTrue(nameElement == grandChildren.get(i).getPsi()); list.add(new MethodCallWithoutQualifierBlock(nameElement, null, myWrap, mySettings, myGroovySettings, topLevel, children, elem, - myInnerAlignments)); + myInnerAlignments, myBlocks)); } return; } @@ -486,7 +496,7 @@ public class GroovyBlockGenerator implements GroovyElementTypes { else { Alignment alignmentToUse = myInnerAlignments.get(fst.getPsi()); Indent indent = Indent.getContinuationWithoutFirstIndent(); - list.add(new GroovyBlock(fst, alignmentToUse, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments)); + list.add(new GroovySimpleBlock(fst, alignmentToUse, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments, myBlocks)); } addNestedChildrenSuffix(list, alignment, topLevel, children, limit); } @@ -500,7 +510,7 @@ public class GroovyBlockGenerator implements GroovyElementTypes { Indent.getContinuationWithoutFirstIndent() : Indent.getNoneIndent(); Alignment alignmentToUse = TokenSets.DOTS.contains(type) ? alignment : myInnerAlignments.get(childNode.getPsi()); - list.add(new GroovyBlock(childNode, alignmentToUse, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments)); + list.add(new GroovySimpleBlock(childNode, alignmentToUse, indent, myWrap, mySettings, myGroovySettings, myInnerAlignments, myBlocks)); } } } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyFormattingModelBuilder.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyFormattingModelBuilder.java index 37062fe0d56a..c697f266a297 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyFormattingModelBuilder.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovyFormattingModelBuilder.java @@ -16,10 +16,7 @@ package org.jetbrains.plugins.groovy.formatter; -import com.intellij.formatting.Block; -import com.intellij.formatting.FormattingModel; -import com.intellij.formatting.FormattingModelBuilder; -import com.intellij.formatting.Indent; +import com.intellij.formatting.*; import com.intellij.lang.ASTNode; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; @@ -32,6 +29,7 @@ import com.intellij.psi.formatter.FormattingDocumentModelImpl; import com.intellij.psi.formatter.PsiBasedFormattingModel; import com.intellij.psi.impl.source.tree.TreeUtil; import com.intellij.psi.tree.IElementType; +import com.intellij.util.containers.CollectionFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.GroovyFileType; @@ -52,7 +50,9 @@ public class GroovyFormattingModelBuilder implements FormattingModelBuilder { assert astNode != null; CommonCodeStyleSettings groovySettings = settings.getCommonSettings(GroovyFileType.GROOVY_LANGUAGE); GroovyCodeStyleSettings customSettings = settings.getCustomSettings(GroovyCodeStyleSettings.class); - final GroovyBlock block = new GroovyBlock(astNode, null, Indent.getAbsoluteNoneIndent(), null, groovySettings, customSettings); + final GroovyBlock block = new GroovySimpleBlock(astNode, null, Indent.getAbsoluteNoneIndent(), null, groovySettings, customSettings, + CollectionFactory.hashMap(), + CollectionFactory.hashMap()); return new GroovyFormattingModel(containingFile, block, FormattingDocumentModelImpl.createOn(containingFile)); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovySimpleBlock.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovySimpleBlock.java new file mode 100644 index 000000000000..960c12d8a0e8 --- /dev/null +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/GroovySimpleBlock.java @@ -0,0 +1,43 @@ +/* + * Copyright 2000-2011 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 org.jetbrains.plugins.groovy.formatter; + +import com.intellij.formatting.Alignment; +import com.intellij.formatting.Indent; +import com.intellij.formatting.Wrap; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.codeStyle.CommonCodeStyleSettings; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; + +/** + * @author Max Medvedev + */ +public class GroovySimpleBlock extends GroovyBlock { + public GroovySimpleBlock(@NotNull ASTNode node, + @Nullable Alignment alignment, + @NotNull Indent indent, + @Nullable Wrap wrap, + CommonCodeStyleSettings settings, + GroovyCodeStyleSettings groovySettings, + @NotNull Map innerAlignments, Map blocks) { + super(node, alignment, indent, wrap, settings, groovySettings, innerAlignments, blocks); + mySubBlocks = new GroovyBlockGenerator(this).generateSubBlocks(); + } +} diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/MethodCallWithoutQualifierBlock.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/MethodCallWithoutQualifierBlock.java index 787878b408a4..51aa16d7887c 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/MethodCallWithoutQualifierBlock.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/MethodCallWithoutQualifierBlock.java @@ -33,42 +33,32 @@ import java.util.Map; * @author peter */ public class MethodCallWithoutQualifierBlock extends GroovyBlock { - private final PsiElement myNameElement; - private final boolean myTopLevel; - private final List myChildren; - private final PsiElement myElem; - - public MethodCallWithoutQualifierBlock(PsiElement nameElement, - Alignment alignment, - Wrap wrap, - CommonCodeStyleSettings settings, - GroovyCodeStyleSettings groovySettings, - boolean topLevel, - List children, - PsiElement elem, - Map innerAlignments) { - super(nameElement.getNode(), alignment, Indent.getContinuationWithoutFirstIndent(), wrap, settings, groovySettings, innerAlignments); - myNameElement = nameElement; - myTopLevel = topLevel; - myChildren = children; - myElem = elem; - } + private final TextRange myRange; - @NotNull - @Override - public List getSubBlocks() { - if (mySubBlocks == null) { - mySubBlocks = new ArrayList(); - mySubBlocks.add(new GroovyBlock(myNameElement.getNode(), myInnerAlignments.get(myNameElement), Indent.getContinuationWithoutFirstIndent(), myWrap, mySettings, myGroovySettings, myInnerAlignments)); - new GroovyBlockGenerator(this).addNestedChildrenSuffix(mySubBlocks, myAlignment, myTopLevel, myChildren, myChildren.size()); - } - return mySubBlocks; + protected MethodCallWithoutQualifierBlock(PsiElement nameElement, + Alignment alignment, + Wrap wrap, + CommonCodeStyleSettings settings, + GroovyCodeStyleSettings groovySettings, + boolean topLevel, + List children, + PsiElement elem, + Map innerAlignments, Map blocks) { + super(nameElement.getNode(), alignment, Indent.getContinuationWithoutFirstIndent(), wrap, settings, groovySettings, innerAlignments,blocks); + myRange = new TextRange(nameElement.getTextRange().getStartOffset(), elem.getTextRange().getEndOffset()); + + mySubBlocks = new ArrayList(); + final GroovySimpleBlock first = + new GroovySimpleBlock(nameElement.getNode(), myInnerAlignments.get(nameElement), Indent.getContinuationWithoutFirstIndent(), myWrap, + mySettings, myGroovySettings, myInnerAlignments, myBlocks); + mySubBlocks.add(first); + new GroovyBlockGenerator(this).addNestedChildrenSuffix(mySubBlocks, myAlignment, topLevel, children, children.size()); } @NotNull @Override public TextRange getTextRange() { - return new TextRange(myNameElement.getTextRange().getStartOffset(), myElem.getTextRange().getEndOffset()); + return myRange; } @Override diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/EnterActionTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/EnterActionTest.groovy index 1931ac16607e..b6360417d556 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/EnterActionTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/EnterActionTest.groovy @@ -273,6 +273,21 @@ def c = { a -> } } ''' } + + void testGeese3() { + myTempSettings.getCustomSettings(GroovyCodeStyleSettings).USE_FLYING_GEESE_BRACES = true + doTest '''\ +foo { + [1].bar {} +} +''', '''\ +foo { + [1].bar { + +} } +''' + + } } From 9667e6bcc23965e62c469bafee425381e0cb64af Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 19 Dec 2011 15:24:10 +0400 Subject: [PATCH 083/101] tests --- .../src/com/intellij/testFramework/PlatformTestCase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java index 2f9fb23f65f0..4bc0414fae23 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java @@ -676,7 +676,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro @Override public Object getData(String dataId) { - return new TestDataProvider(myProject).getData(dataId); + return myProject == null ? null : new TestDataProvider(myProject).getData(dataId); } public static File createTempDir(@NonNls final String prefix) throws IOException { From 4112a121a4aad1b431a01b27bc25b09969a1985c Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 19 Dec 2011 11:40:11 +0100 Subject: [PATCH 084/101] module language level: reload on commit only --- .../roots/LanguageLevelModuleExtension.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/java/openapi/src/com/intellij/openapi/roots/LanguageLevelModuleExtension.java b/java/openapi/src/com/intellij/openapi/roots/LanguageLevelModuleExtension.java index 16503c2be575..e6db187416a0 100644 --- a/java/openapi/src/com/intellij/openapi/roots/LanguageLevelModuleExtension.java +++ b/java/openapi/src/com/intellij/openapi/roots/LanguageLevelModuleExtension.java @@ -57,16 +57,6 @@ public class LanguageLevelModuleExtension extends ModuleExtension Date: Mon, 19 Dec 2011 12:33:14 +0100 Subject: [PATCH 085/101] fix test --- .../refactoring/rename/inplace/VariableInplaceRenamer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java index 3d55f6b6d605..8bfcb777245d 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java @@ -836,7 +836,7 @@ public class VariableInplaceRenamer { if (templateState != null) { final TextRange range = templateState.getCurrentVariableRange(); if (range != null) { - myEditor.getDocument().replaceString(range.getStartOffset(), range.getEndOffset(), suggestion); + topLevelEditor.getDocument().replaceString(range.getStartOffset(), range.getEndOffset(), suggestion); } } } From 09c0ca15d8a7c8246a4ad2b9e7c76c06b4eb709e Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 19 Dec 2011 12:37:02 +0100 Subject: [PATCH 086/101] IDEA-78031 diamonds with new qualifiers --- .../com/intellij/psi/PsiDiamondTypeImpl.java | 25 ++++++++++++++++++- .../advHighlighting7/DiamondMisc.java | 23 +++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/java/java-psi-impl/src/com/intellij/psi/PsiDiamondTypeImpl.java b/java/java-psi-impl/src/com/intellij/psi/PsiDiamondTypeImpl.java index fad4772ca4b1..53277ce348e8 100644 --- a/java/java-psi-impl/src/com/intellij/psi/PsiDiamondTypeImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/PsiDiamondTypeImpl.java @@ -169,9 +169,32 @@ public class PsiDiamondTypeImpl extends PsiDiamondType { final Project project = newExpression.getProject(); final JavaPsiFacade facade = JavaPsiFacade.getInstance(project); final PsiResolveHelper resolveHelper = facade.getResolveHelper(); + final PsiExpression newExpressionQualifier = newExpression.getQualifier(); final PsiElement qualifierElement = classReference.getQualifier(); final String qualifier = qualifierElement != null ? qualifierElement.getText() : ""; - return resolveHelper.resolveReferencedClass(StringUtil.getQualifiedName(qualifier, text), newExpression); + final String qualifiedName = StringUtil.getQualifiedName(qualifier, text); + if (newExpressionQualifier != null) { + final String newExpressionQualifierText = newExpressionQualifier.getText(); + if (newExpressionQualifier instanceof PsiReferenceExpression) { + final PsiVariable variable = resolveHelper.resolveReferencedVariable(newExpressionQualifierText, newExpression); + if (variable != null) { + final PsiClass aClass = PsiUtil.resolveClassInType(variable.getType()); + if (aClass != null) { + return aClass.findInnerClassByName(qualifiedName, false); + } + } + } else if (newExpressionQualifier instanceof PsiCallExpression) { + final JavaResolveResult resolveResult = ((PsiCallExpression)newExpressionQualifier).resolveMethodGenerics(); + final PsiElement method = resolveResult.getElement(); + if (method instanceof PsiMethod) { + final PsiClass aClass = PsiUtil.resolveClassInType(resolveResult.getSubstitutor().substitute(((PsiMethod)method).getReturnType())); + if (aClass != null) { + return aClass.findInnerClassByName(qualifiedName, false); + } + } + } + } + return resolveHelper.resolveReferencedClass(qualifiedName, newExpression); } else { return null; } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/DiamondMisc.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/DiamondMisc.java index 4c808e765eb9..7755d35f0c84 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/DiamondMisc.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/DiamondMisc.java @@ -181,3 +181,26 @@ class PredefinedErrorsOverRaw { PredefinedErrorsOverRaw mc = new PredefinedErrorsOverRaw<>(""); } } + +class Outer { + class Inner {} +} +class Outer1 {} + +class Another { + public static void main(String[] args) { + Outer o = new Outer(); + Outer.Inner i = o.new Inner<>(); + Outer.Inner i1 = m().new Inner<>(); + Outer.Inner i2 = m1().new Inner<>(); + + Outer.Inner i3 = m2().new Inner<>(); + + System.out.println(i); + } + + static Outer m() {return null;} + static T m1() {return null;} + static T m2() {return null;} + +} \ No newline at end of file From 3300cd7900f7a07c350f175c9e5198c8d1aab8d1 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 19 Dec 2011 12:26:51 +0100 Subject: [PATCH 087/101] VFS tests moved to platform-tests --- .../openapi/vfs/DummyFileSystemTest.java | 25 ++++++++--- .../openapi/vfs/GetPathPerformanceTest.java | 19 +++++++- .../openapi/vfs/RefreshChildrenTest.java | 39 ++++++++++++----- .../com/intellij/openapi/vfs/VfsUtilTest.java | 43 +++++++++++++------ .../openapi/vfs/VirtualFilePointerTest.java | 19 +++++++- .../vfs/local}/LocalFileSystemTest.java | 25 +++++++---- .../vfs/local/SymLinkHandlingTest.java | 2 + .../LightPlatformLangTestCase.java | 23 ++++++++++ .../testFramework/PlatformLangTestCase.java | 23 ++++++++++ .../testFramework/PlatformTestUtil.java | 6 +-- 10 files changed, 179 insertions(+), 45 deletions(-) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java (58%) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java (63%) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java (54%) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java (83%) rename {java/java-tests => platform/platform-tests}/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java (96%) rename {java/java-tests/testSrc/com/intellij/openapi/vfs => platform/platform-tests/testSrc/com/intellij/openapi/vfs/local}/LocalFileSystemTest.java (94%) create mode 100644 platform/testFramework/src/com/intellij/testFramework/LightPlatformLangTestCase.java create mode 100644 platform/testFramework/src/com/intellij/testFramework/PlatformLangTestCase.java diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java similarity index 58% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java index 17014f94662b..179b7dc68bb2 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java @@ -1,12 +1,27 @@ +/* + * Copyright 2000-2011 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.intellij.openapi.vfs; import com.intellij.openapi.application.Result; import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.vfs.ex.dummy.DummyFileSystem; -import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PlatformLangTestCase; -public class DummyFileSystemTest extends IdeaTestCase { - DummyFileSystem fs; +public class DummyFileSystemTest extends PlatformLangTestCase { + private DummyFileSystem fs; @Override protected void setUp() throws Exception { @@ -19,7 +34,7 @@ public class DummyFileSystemTest extends IdeaTestCase { VirtualFile f = new WriteAction() { @Override protected void run(Result result) throws Throwable { - VirtualFile res = root.createChildData(null, "f"); + VirtualFile res = root.createChildData(this, "f"); result.setResult(res); } }.execute().getResultObject(); @@ -37,7 +52,7 @@ public class DummyFileSystemTest extends IdeaTestCase { } }); - f.delete(null); + f.delete(this); for (int i = 0; i < 2; i++) { assertNotNull(events[i]); diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java similarity index 63% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java index c3270eddb929..1dab0f73b0f2 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java @@ -1,16 +1,31 @@ +/* + * Copyright 2000-2011 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.intellij.openapi.vfs; import com.intellij.openapi.Disposable; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.testFramework.LightPlatformTestCase; +import com.intellij.testFramework.LightPlatformLangTestCase; import com.intellij.testFramework.PlatformTestUtil; import com.intellij.util.ThrowableRunnable; import java.io.File; import java.io.IOException; -public class GetPathPerformanceTest extends LightPlatformTestCase { +public class GetPathPerformanceTest extends LightPlatformLangTestCase { public void testGetPath() throws IOException, InterruptedException { final File dir = FileUtil.createTempDirectory("GetPath",""); disposeOnTearDown(new Disposable() { diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java similarity index 54% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java index dedc483a8e89..03804fdc56cd 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java @@ -1,21 +1,34 @@ +/* + * Copyright 2000-2011 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.intellij.openapi.vfs; import com.intellij.openapi.util.io.FileUtil; -import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PlatformLangTestCase; import java.io.*; /** * @author yole */ -public class RefreshChildrenTest extends IdeaTestCase { +public class RefreshChildrenTest extends PlatformLangTestCase { private File testDir; @Override protected void setUp() throws Exception { - - // the superclass sets tmpdir on every run and cleans up, but we want to do it our way - + // the superclass sets tmp. dir on every run and cleans up, but we want to do it our way String baseTempDir = FileUtil.getTempDirectory(); testDir = new File(baseTempDir, "RefreshChildrenTest." + getName()); @@ -30,12 +43,13 @@ public class RefreshChildrenTest extends IdeaTestCase { public void testRefreshSeesLatestDirectoryContents() throws Exception { assertFalse(testDir.exists()); - testDir.mkdir(); + assert testDir.exists() || testDir.mkdir() : testDir; assertTrue(testDir.isDirectory()); writeFile(testDir, "Foo.java", ""); LocalFileSystem local = LocalFileSystem.getInstance(); VirtualFile virtualDir = local.findFileByIoFile(testDir); + assert virtualDir != null : virtualDir; virtualDir.getChildren(); virtualDir.refresh(false, true); @@ -47,13 +61,17 @@ public class RefreshChildrenTest extends IdeaTestCase { checkChildCount(virtualDir, 2); } - private void writeFile(File dir, String filename, String contents) throws IOException { + private static void writeFile(File dir, String filename, String contents) throws IOException { Writer writer = new OutputStreamWriter(new FileOutputStream(new File(dir, filename)), "UTF-8"); - writer.write(contents); - writer.close(); + try { + writer.write(contents); + } + finally { + writer.close(); + } } - private void checkChildCount(VirtualFile virtualDir, int expectedCount) { + private static void checkChildCount(VirtualFile virtualDir, int expectedCount) { VirtualFile[] children = virtualDir.getChildren(); if (children.length != expectedCount) { System.err.println("children:"); @@ -63,5 +81,4 @@ public class RefreshChildrenTest extends IdeaTestCase { } assertEquals(expectedCount, children.length); } - } diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java similarity index 83% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java index c9f857b36418..0b34c40a2d8b 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2011 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.intellij.openapi.vfs; import com.intellij.concurrency.JobUtil; @@ -6,8 +21,9 @@ import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.application.ex.PathManagerEx; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.util.io.FileUtil; -import com.intellij.testFramework.IdeaTestCase; -import com.intellij.testFramework.IdeaTestUtil; +import com.intellij.testFramework.PlatformLangTestCase; +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.testFramework.UsefulTestCase; import com.intellij.util.Processor; import com.intellij.util.ui.UIUtil; @@ -22,7 +38,7 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -public class VfsUtilTest extends IdeaTestCase { +public class VfsUtilTest extends PlatformLangTestCase { @Override protected void runBareRunnable(Runnable runnable) throws Throwable { runnable.run(); @@ -82,7 +98,7 @@ public class VfsUtilTest extends IdeaTestCase { final VirtualFileFilter fileFilter = new VirtualFileFilter() { @Override public boolean accept(VirtualFile file) { - return IdeaTestUtil.CVS_FILE_FILTER.accept(file) && !file.getName().endsWith(".new"); + return PlatformTestUtil.CVS_FILE_FILTER.accept(file) && !file.getName().endsWith(".new"); } }; for (VirtualFile child : children) { @@ -156,8 +172,8 @@ public class VfsUtilTest extends IdeaTestCase { } }.execute().getResultObject(); LocalFileSystem fs = LocalFileSystem.getInstance(); - VirtualFile vtemp = fs.findFileByIoFile(temp); - assert vtemp != null; + VirtualFile vTemp = fs.findFileByIoFile(temp); + assert vTemp != null; VirtualFile[] children = new VirtualFile[N]; long[] timestamp = new long[N]; @@ -170,7 +186,7 @@ public class VfsUtilTest extends IdeaTestCase { timestamp[i] = file.lastModified(); } - vtemp.refresh(false,true); + vTemp.refresh(false, true); for (int i=0;i< N;i++) { File file = new File(temp, i + ".txt"); @@ -183,7 +199,8 @@ public class VfsUtilTest extends IdeaTestCase { assertNotNull(child); long mod = child.getTimeStamp(); - assertEquals("File:"+child.getPath()+"; mod:"+ new Date(mod)+"; io:"+new File(child.getPath()).lastModified(),timestamp[i], mod); + assertEquals("File:" + child.getPath() + "; mod:" + new Date(mod) + "; io:" + new File(child.getPath()).lastModified(), + timestamp[i], mod); } Thread.sleep(2000); // todo[r.sh] find a way to get timestamps with millisecond granularity on Linux ? @@ -231,13 +248,13 @@ public class VfsUtilTest extends IdeaTestCase { result.setResult(res); } }.execute().getResultObject(); - VirtualFile vdir = LocalFileSystem.getInstance().findFileByIoFile(tempDir); - assertNotNull(vdir); - assertTrue(vdir.isDirectory()); + VirtualFile vDir = LocalFileSystem.getInstance().findFileByIoFile(tempDir); + assertNotNull(vDir); + assertTrue(vDir.isDirectory()); - VirtualFile child = vdir.findChild(" "); + VirtualFile child = vDir.findChild(" "); assertNull(child); - assertEmpty(vdir.getChildren()); + UsefulTestCase.assertEmpty(vDir.getChildren()); } } diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java similarity index 96% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java index eee42b232161..bef72829f97d 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2011 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.intellij.openapi.vfs; import com.intellij.concurrency.JobUtil; @@ -11,7 +26,7 @@ import com.intellij.openapi.vfs.impl.VirtualFilePointerImpl; import com.intellij.openapi.vfs.pointers.VirtualFilePointer; import com.intellij.openapi.vfs.pointers.VirtualFilePointerListener; import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager; -import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PlatformLangTestCase; import com.intellij.testFramework.PlatformTestUtil; import com.intellij.testFramework.Timings; import com.intellij.util.IncorrectOperationException; @@ -28,7 +43,7 @@ import java.util.Collections; /** * @author dsl */ -public class VirtualFilePointerTest extends IdeaTestCase { +public class VirtualFilePointerTest extends PlatformLangTestCase { private VirtualFilePointerManager myVirtualFilePointerManager; @Override diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/LocalFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java similarity index 94% rename from java/java-tests/testSrc/com/intellij/openapi/vfs/LocalFileSystemTest.java rename to platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java index 016c2dc0b8de..c6669ea819b3 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/LocalFileSystemTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java @@ -13,25 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.openapi.vfs; +package com.intellij.openapi.vfs.local; import com.intellij.execution.util.ExecUtil; import com.intellij.ide.GeneralSettings; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.SafeWriteRequestor; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.newvfs.ManagingFS; import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS; -import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.PlatformLangTestCase; import com.intellij.testFramework.PlatformTestUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.Nullable; -import java.io.*; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; import java.nio.charset.Charset; import java.util.Arrays; -public class LocalFileSystemTest extends IdeaTestCase{ +public class LocalFileSystemTest extends PlatformLangTestCase { public static void setContentOnDisk(File file, byte[] bom, String content, Charset charset) throws IOException { FileOutputStream stream = new FileOutputStream(file); if (bom != null) { @@ -161,11 +168,11 @@ public class LocalFileSystemTest extends IdeaTestCase{ VirtualFile toVDir = LocalFileSystem.getInstance().findFileByPath(toDir.getPath().replace(File.separatorChar, '/')); assertNotNull(fromVDir); assertNotNull(toVDir); - final VirtualFile fileToCopy = fromVDir.createChildData(null, "temp_file"); + final VirtualFile fileToCopy = fromVDir.createChildData(this, "temp_file"); final byte[] byteContent = {0, 1, 2, 3}; fileToCopy.setBinaryContent(byteContent); final String newName = "new_temp_file"; - final VirtualFile copy = fileToCopy.copy(null, toVDir, newName); + final VirtualFile copy = fileToCopy.copy(this, toVDir, newName); assertEquals(newName, copy.getName()); assertTrue(Arrays.equals(byteContent, copy.contentsToByteArray())); } @@ -190,11 +197,11 @@ public class LocalFileSystemTest extends IdeaTestCase{ VirtualFile toVDir = LocalFileSystem.getInstance().findFileByPath(toDir.getPath().replace(File.separatorChar, '/')); assertNotNull(fromVDir); assertNotNull(toVDir); - final VirtualFile dirToCopy = fromVDir.createChildDirectory(null, "dir"); - final VirtualFile file = dirToCopy.createChildData(null, "temp_file"); + final VirtualFile dirToCopy = fromVDir.createChildDirectory(this, "dir"); + final VirtualFile file = dirToCopy.createChildData(this, "temp_file"); file.setBinaryContent(new byte[]{0, 1, 2, 3}); final String newName = "dir"; - final VirtualFile dirCopy = dirToCopy.copy(null, toVDir, newName); + final VirtualFile dirCopy = dirToCopy.copy(this, toVDir, newName); assertEquals(newName, dirCopy.getName()); PlatformTestUtil.assertDirectoriesEqual(toVDir, fromVDir, null); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java index 0dfcf29017a3..41afb77e8246 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymLinkHandlingTest.java @@ -23,6 +23,7 @@ import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.LightPlatformTestCase; import com.intellij.testFramework.PlatformTestCase; +import org.jetbrains.annotations.Nullable; import java.io.File; import java.io.IOException; @@ -158,6 +159,7 @@ public class SymLinkHandlingTest extends LightPlatformTestCase { return linkFile; } + @Nullable private VirtualFile refreshAndFind(final File ioFile) { refresh(); return myFileSystem.findFileByPath(ioFile.getAbsolutePath()); diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformLangTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformLangTestCase.java new file mode 100644 index 000000000000..aa070a93137d --- /dev/null +++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformLangTestCase.java @@ -0,0 +1,23 @@ +/* + * Copyright 2000-2011 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.intellij.testFramework; + +public abstract class LightPlatformLangTestCase extends LightPlatformTestCase { + @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors") + protected LightPlatformLangTestCase() { + PlatformTestCase.initPlatformLangPrefix(); + } +} diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformLangTestCase.java b/platform/testFramework/src/com/intellij/testFramework/PlatformLangTestCase.java new file mode 100644 index 000000000000..34d276e0a2b3 --- /dev/null +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformLangTestCase.java @@ -0,0 +1,23 @@ +/* + * Copyright 2000-2011 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.intellij.testFramework; + +public abstract class PlatformLangTestCase extends PlatformTestCase { + @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors") + protected PlatformLangTestCase() { + initPlatformLangPrefix(); + } +} diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java index c155d4ebe703..ac396c20fef1 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -579,7 +579,7 @@ public class PlatformTestUtil { } } - private static HashMap buildNameToFileMap(VirtualFile[] files, VirtualFileFilter filter) { + private static HashMap buildNameToFileMap(VirtualFile[] files, @Nullable VirtualFileFilter filter) { HashMap map = new HashMap(); for (VirtualFile file : files) { if (filter != null && !filter.accept(file)) continue; @@ -588,7 +588,7 @@ public class PlatformTestUtil { return map; } - public static void assertDirectoriesEqual(VirtualFile dirAfter, VirtualFile dirBefore, VirtualFileFilter fileFilter) throws IOException { + public static void assertDirectoriesEqual(VirtualFile dirAfter, VirtualFile dirBefore, @Nullable VirtualFileFilter fileFilter) throws IOException { FileDocumentManager.getInstance().saveAllDocuments(); VirtualFile[] childrenAfter = dirAfter.getChildren(); if (dirAfter.isInLocalFileSystem()) { From d5d02c0ca87130241f5eeffc90b6f39aa7b73a3c Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Fri, 16 Dec 2011 16:24:38 +0400 Subject: [PATCH 088/101] Added check for consistence of the white space strategies added in a single bulk --- .../CompositeWhiteSpaceFormattingStrategy.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/formatter/CompositeWhiteSpaceFormattingStrategy.java b/platform/lang-impl/src/com/intellij/psi/formatter/CompositeWhiteSpaceFormattingStrategy.java index c00986e54832..3d18061beac2 100644 --- a/platform/lang-impl/src/com/intellij/psi/formatter/CompositeWhiteSpaceFormattingStrategy.java +++ b/platform/lang-impl/src/com/intellij/psi/formatter/CompositeWhiteSpaceFormattingStrategy.java @@ -37,8 +37,12 @@ public class CompositeWhiteSpaceFormattingStrategy implements WhiteSpaceFormatti private final List myStrategies = new ArrayList(); private boolean myReplaceDefaultStrategy; - public CompositeWhiteSpaceFormattingStrategy(@NotNull Collection strategies) { - myStrategies.addAll(strategies); + public CompositeWhiteSpaceFormattingStrategy(@NotNull Collection strategies) + throws IllegalArgumentException + { + for (WhiteSpaceFormattingStrategy strategy : strategies) { + addStrategy(strategy); + } } @Override @@ -64,9 +68,9 @@ public class CompositeWhiteSpaceFormattingStrategy implements WhiteSpaceFormatti return myReplaceDefaultStrategy; } - public void addStrategy(@NotNull WhiteSpaceFormattingStrategy strategy) throws IllegalStateException { + public void addStrategy(@NotNull WhiteSpaceFormattingStrategy strategy) throws IllegalArgumentException { if (myReplaceDefaultStrategy && strategy.replaceDefaultStrategy()) { - throw new IllegalStateException(String.format( + throw new IllegalArgumentException(String.format( "Can't combine strategy '%s' with already registered strategies (%s). Reason: given strategy is marked to replace " + "all existing strategies but strategy with such characteristics is already registered", strategy, myStrategies )); From 8fc7a2c0919e77aaeb2dd3c8abdcd8ea5b59bf41 Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Mon, 19 Dec 2011 15:33:54 +0400 Subject: [PATCH 089/101] IDEA-51747 Ability to reformat changed lines only Added ability to define that only changed text should be reformatted --- .../psi/codeStyle/CodeStyleManager.java | 21 +- .../actions/AbstractLayoutCodeProcessor.java | 59 +++-- .../actions/FormatChangedTextUtil.java | 211 ++++++++++++++++++ .../actions/LayoutCodeConstants.java | 31 +++ .../codeInsight/actions/LayoutCodeDialog.java | 74 ++++-- .../actions/LayoutProjectCodeDialog.java | 62 +++-- .../actions/OptimizeImportsAction.java | 7 +- .../actions/OptimizeImportsProcessor.java | 16 +- .../ReformatAndOptimizeImportsProcessor.java | 42 ++-- .../actions/ReformatCodeAction.java | 38 ++-- .../actions/ReformatCodeProcessor.java | 62 +++-- .../actions/ReformatFilesDialog.form | 30 +-- .../actions/ReformatFilesDialog.java | 31 ++- .../checkin/ReformatBeforeCheckinHandler.java | 4 +- .../codeStyle/CodeStyleManagerImpl.java | 91 +++++--- .../src/messages/CodeInsightBundle.properties | 1 + .../mvc/MvcModuleStructureSynchronizer.java | 5 +- 17 files changed, 607 insertions(+), 178 deletions(-) create mode 100644 platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java create mode 100644 platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeConstants.java diff --git a/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java b/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java index 19196becf9a2..5bc78abbac36 100644 --- a/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java +++ b/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -30,6 +30,8 @@ import com.intellij.util.ThrowableRunnable; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Collection; + /** * Service for reformatting code fragments, getting names for elements * according to the user's code style and working with import statements and full-qualified names. @@ -123,9 +125,7 @@ public abstract class CodeStyleManager { boolean canChangeWhiteSpacesOnly) throws IncorrectOperationException; /** - * Reformats a range of text in the specified file. This method works faster than - * {@link #reformatRange(com.intellij.psi.PsiElement, int, int)} but invalidates the - * PSI structure for the file. + * Delegates to the {@link #reformatText(PsiFile, Collection)} with the single range defined by the given offsets. * * @param element the file to reformat. * @param startOffset the start of the text range to reformat. @@ -135,7 +135,18 @@ public abstract class CodeStyleManager { public abstract void reformatText(@NotNull PsiFile element, int startOffset, int endOffset) throws IncorrectOperationException; /** - * Reformats the specified range of a file, modifying only line indents and leaving + * Re-formats a ranges of text in the specified file. This method works faster than + * {@link #reformatRange(com.intellij.psi.PsiElement, int, int)} but invalidates the + * PSI structure for the file. + * + * @param element the file to reformat + * @param ranges ranges to process + * @throws IncorrectOperationException if the file to reformat is read-only. + */ + public abstract void reformatText(@NotNull PsiFile element, @NotNull Collection ranges) throws IncorrectOperationException; + + /** + * Re-formats the specified range of a file, modifying only line indents and leaving * all other whitespace intact. * * @param file the file to reformat. diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/AbstractLayoutCodeProcessor.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/AbstractLayoutCodeProcessor.java index 492abf905aae..1be1f4e83413 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/AbstractLayoutCodeProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/AbstractLayoutCodeProcessor.java @@ -66,18 +66,18 @@ public abstract class AbstractLayoutCodeProcessor { private final String myProgressText; private final String myCommandName; private final Runnable myPostRunnable; + private final boolean myProcessChangedTextOnly; - protected AbstractLayoutCodeProcessor(Project project, String commandName, String progressText) { - myProject = project; - myModule = null; - myDirectory = null; - myIncludeSubdirs = true; - myCommandName = commandName; - myProgressText = progressText; - myPostRunnable = null; + protected AbstractLayoutCodeProcessor(Project project, String commandName, String progressText, boolean processChangedTextOnly) { + this(project, (Module)null, commandName, progressText, processChangedTextOnly); } - protected AbstractLayoutCodeProcessor(Project project, Module module, String commandName, String progressText) { + protected AbstractLayoutCodeProcessor(Project project, + @Nullable Module module, + String commandName, + String progressText, + boolean processChangedTextOnly) + { myProject = project; myModule = module; myDirectory = null; @@ -85,9 +85,16 @@ public abstract class AbstractLayoutCodeProcessor { myCommandName = commandName; myProgressText = progressText; myPostRunnable = null; + myProcessChangedTextOnly = processChangedTextOnly; } - protected AbstractLayoutCodeProcessor(Project project, PsiDirectory directory, boolean includeSubdirs, String progressText, String commandName) { + protected AbstractLayoutCodeProcessor(Project project, + PsiDirectory directory, + boolean includeSubdirs, + String progressText, + String commandName, + boolean processChangedTextOnly) + { myProject = project; myModule = null; myDirectory = directory; @@ -95,24 +102,38 @@ public abstract class AbstractLayoutCodeProcessor { myProgressText = progressText; myCommandName = commandName; myPostRunnable = null; + myProcessChangedTextOnly = processChangedTextOnly; } - protected AbstractLayoutCodeProcessor(Project project, PsiFile file, String progressText, String commandName) { + protected AbstractLayoutCodeProcessor(Project project, + PsiFile file, + String progressText, + String commandName, + boolean processChangedTextOnly) + { myProject = project; myModule = null; myFile = file; myProgressText = progressText; myCommandName = commandName; myPostRunnable = null; + myProcessChangedTextOnly = processChangedTextOnly; } - protected AbstractLayoutCodeProcessor(Project project, PsiFile[] files, String progressText, String commandName, Runnable postRunnable) { + protected AbstractLayoutCodeProcessor(Project project, + PsiFile[] files, + String progressText, + String commandName, + @Nullable Runnable postRunnable, + boolean processChangedTextOnly) + { myProject = project; myModule = null; myFiles = filterFiles(files); myProgressText = progressText; myCommandName = commandName; myPostRunnable = postRunnable; + myProcessChangedTextOnly = processChangedTextOnly; } private static PsiFile[] filterFiles(PsiFile[] files){ @@ -128,13 +149,15 @@ public abstract class AbstractLayoutCodeProcessor { /** * Ensures that given file is ready to reformatting and prepares it if necessary. * - * @param file file to process + * @param file file to process + * @param processChangedTextOnly flag that defines is only the changed text (in terms of VCS change) should be processed * @return task that triggers formatting of the given file. Returns value of that task indicates whether formatting * is finished correctly or not (exception occurred, user cancelled formatting etc) * @throws IncorrectOperationException if unexpected exception occurred during formatting */ @NotNull - protected abstract FutureTask preprocessFile(PsiFile file) throws IncorrectOperationException; + protected abstract FutureTask preprocessFile(@NotNull PsiFile file, boolean processChangedTextOnly) + throws IncorrectOperationException; public void run() { if (myDirectory != null){ @@ -154,7 +177,7 @@ public abstract class AbstractLayoutCodeProcessor { } } - private void runProcessFile(final PsiFile file) { + private void runProcessFile(@NotNull final PsiFile file) { Document document = PsiDocumentManager.getInstance(myProject).getDocument(file); if (document == null) { @@ -174,7 +197,7 @@ public abstract class AbstractLayoutCodeProcessor { public void run() { if (!checkFileWritable(file)) return; try{ - resultRunnable[0] = preprocessFile(file); + resultRunnable[0] = preprocessFile(file, myProcessChangedTextOnly); } catch(IncorrectOperationException e){ LOG.error(e); @@ -223,7 +246,7 @@ public abstract class AbstractLayoutCodeProcessor { } if (file.isWritable()){ try{ - tasks.add(preprocessFile(file)); + tasks.add(preprocessFile(file, myProcessChangedTextOnly)); } catch(IncorrectOperationException e){ LOG.error(e); @@ -487,7 +510,7 @@ public abstract class AbstractLayoutCodeProcessor { } public void runWithoutProgress() throws IncorrectOperationException { - final Runnable runnable = preprocessFile(myFile); + final Runnable runnable = preprocessFile(myFile, myProcessChangedTextOnly); runnable.run(); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java new file mode 100644 index 000000000000..6dd5c90dc51d --- /dev/null +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java @@ -0,0 +1,211 @@ +/* + * Copyright 2000-2011 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.intellij.codeInsight.actions; + +import com.intellij.openapi.application.ReadAction; +import com.intellij.openapi.application.Result; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.markup.RangeHighlighter; +import com.intellij.openapi.module.ModifiableModuleModel; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.util.TextRange; +import com.intellij.openapi.vcs.changes.Change; +import com.intellij.openapi.vcs.changes.ChangeListManager; +import com.intellij.openapi.vcs.ex.LineStatusTracker; +import com.intellij.openapi.vcs.ex.Range; +import com.intellij.openapi.vcs.impl.LineStatusTrackerManager; +import com.intellij.openapi.vcs.impl.LineStatusTrackerManagerI; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.PsiDirectory; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.psi.PsiFile; +import org.jetbrains.annotations.NotNull; + +import java.util.*; + +/** + * Contains utility methods for 'format only changed text' (in terms of VCS changes). + * + * @author Denis Zhdanov + * @since 12/19/11 10:55 AM + */ +public class FormatChangedTextUtil { + + private FormatChangedTextUtil() { + } + + /** + * Allows to answer if given file has changes in comparison with VCS. + * + * @param file target file + * @return true if given file has changes; false otherwise + */ + public static boolean hasChanges(@NotNull PsiFile file) { + final Project project = file.getProject(); + final VirtualFile virtualFile = file.getVirtualFile(); + if (virtualFile != null) { + final Change change = ChangeListManager.getInstance(project).getChange(virtualFile); + if (change != null && change.getType() == Change.Type.NEW) { + return true; + } + } + + final LineStatusTrackerManagerI manager = LineStatusTrackerManager.getInstance(project); + if (manager == null) { + return false; + } + + final Document document = PsiDocumentManager.getInstance(project).getDocument(file); + if (document == null) { + return false; + } + final LineStatusTracker lineStatusTracker = manager.getLineStatusTracker(document); + if (lineStatusTracker == null) { + return false; + } + final List ranges = lineStatusTracker.getRanges(); + if (ranges == null || ranges.isEmpty()) { + return false; + } + for (Range range : ranges) { + if (range.getType() != Range.DELETED) { + return true; + } + } + return false; + } + + /** + * Allows to answer if any file below the given directory (any level of nesting) has changes in comparison with VCS. + * + * @param directory target directory to check + * @return true if any file below the given directory has changes in comparison with VCS; + * false otherwise + */ + public static boolean hasChanges(@NotNull PsiDirectory directory) { + return hasChanges(directory.getVirtualFile(), directory.getProject()); + } + + /** + * Allows to answer if given file or any file below the given directory (any level of nesting) has changes in comparison with VCS. + * + * @param file target directory to check + * @param project target project + * @return true if given file or any file below the given directory has changes in comparison with VCS; + * false otherwise + */ + public static boolean hasChanges(@NotNull VirtualFile file, @NotNull Project project) { + final Collection changes = ChangeListManager.getInstance(project).getChangesIn(file); + for (Change change : changes) { + if (change.getType() == Change.Type.NEW || change.getType() == Change.Type.MODIFICATION) { + return true; + } + } + return false; + } + + /** + * Allows to answer if any file that belongs to the given module has changes in comparison with VCS. + * + * @param module target module to check + * @return true if any file that belongs to the given module has changes in comparison with VCS + * false otherwise + */ + public static boolean hasChanges(@NotNull Module module) { + final ModuleRootManager rootManager = ModuleRootManager.getInstance(module); + for (VirtualFile root : rootManager.getSourceRoots()) { + if (hasChanges(root, module.getProject())) { + return true; + } + } + return false; + } + + /** + * Allows to answer if any file that belongs to the given project has changes in comparison with VCS. + * + * @param project target project to check + * @return true if any file that belongs to the given project has changes in comparison with VCS + * false otherwise + */ + public static boolean hasChanges(@NotNull final Project project) { + final ModifiableModuleModel moduleModel = new ReadAction() { + protected void run(Result result) throws Throwable { + result.setResult(ModuleManager.getInstance(project).getModifiableModel()); + } + }.execute().getResultObject(); + try { + for (Module module : moduleModel.getModules()) { + if (hasChanges(module)) { + return true; + } + } + return false; + } + finally { + moduleModel.dispose(); + } + } + + /** + * Allows to ask for the changed text of the given file (in comparison with VCS). + * + * @param file target file + * @return collection of changed regions for the given file + */ + @NotNull + public static Collection getChanges(@NotNull PsiFile file) { + final Set defaultResult = Collections.singleton(file.getTextRange()); + final VirtualFile virtualFile = file.getVirtualFile(); + if (virtualFile != null) { + final Change change = ChangeListManager.getInstance(file.getProject()).getChange(virtualFile); + if (change != null && change.getType() == Change.Type.NEW) { + return defaultResult; + } + } + + final LineStatusTrackerManagerI manager = LineStatusTrackerManager.getInstance(file.getProject()); + if (manager == null) { + return defaultResult; + } + final Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file); + if (document == null) { + return defaultResult; + } + final LineStatusTracker lineStatusTracker = manager.getLineStatusTracker(document); + if (lineStatusTracker == null) { + return defaultResult; + } + final List ranges = lineStatusTracker.getRanges(); + if (ranges == null || ranges.isEmpty()) { + return defaultResult; + } + + List result = new ArrayList(); + for (Range range : ranges) { + if (range.getType() != Range.DELETED) { + final RangeHighlighter highlighter = range.getHighlighter(); + if (highlighter != null) { + result.add(new TextRange(highlighter.getStartOffset(), highlighter.getEndOffset())); + } + } + } + return result; + } +} diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeConstants.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeConstants.java new file mode 100644 index 000000000000..06c5a4b840c2 --- /dev/null +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeConstants.java @@ -0,0 +1,31 @@ +/* + * Copyright 2000-2011 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.intellij.codeInsight.actions; + +import org.jetbrains.annotations.NonNls; + +/** + * @author Denis Zhdanov + * @since 12/16/11 6:10 PM + */ +public class LayoutCodeConstants { + + public static final @NonNls String OPTIMIZE_IMPORTS_KEY = "LayoutCode.optimizeImports"; + public static final @NonNls String PROCESS_CHANGED_TEXT_KEY = "LayoutCode.processChangedText"; + + private LayoutCodeConstants() { + } +} diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java index 5b23d6f2a2cf..cfbc5907b75d 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -26,7 +26,7 @@ import com.intellij.openapi.ui.DialogWrapper; import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiFile; import com.intellij.util.ui.OptionsDialog; -import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -37,23 +37,23 @@ import java.awt.event.ItemEvent; import java.awt.event.ItemListener; public class LayoutCodeDialog extends DialogWrapper { - private final PsiFile myFile; + private final PsiFile myFile; @Nullable private final PsiDirectory myDirectory; - private final Boolean myTextSelected; + private final Boolean myTextSelected; private JRadioButton myRbFile; private JRadioButton myRbSelectedText; private JRadioButton myRbDirectory; - private JCheckBox myCbIncludeSubdirs; - private JCheckBox myCbOptimizeImports; - private JCheckBox myDoNotAskMeCheckBox; + private JCheckBox myCbIncludeSubdirs; + private JCheckBox myCbOptimizeImports; + private JCheckBox myCbOnlyVcsChangedRegions; + private JCheckBox myDoNotAskMeCheckBox; - public static final @NonNls String OPTIMIZE_IMPORTS_KEY = "LayoutCode.optimizeImports"; private final String myHelpId; - public LayoutCodeDialog(Project project, - String title, - PsiFile file, + public LayoutCodeDialog(@NotNull Project project, + @NotNull String title, + @Nullable PsiFile file, @Nullable PsiDirectory directory, Boolean isTextSelected, final String helpId) { @@ -84,7 +84,7 @@ public class LayoutCodeDialog extends DialogWrapper { } myCbIncludeSubdirs.setSelected(true); - myCbOptimizeImports.setSelected(isOptmizeImportsOptionOn()); + myCbOptimizeImports.setSelected(PropertiesComponent.getInstance().getBoolean(LayoutCodeConstants.OPTIMIZE_IMPORTS_KEY, false)); ItemListener listener = new ItemListener() { public void itemStateChanged(ItemEvent e) { @@ -99,18 +99,17 @@ public class LayoutCodeDialog extends DialogWrapper { updateState(); } - private static boolean isOptmizeImportsOptionOn() { - return Boolean.toString(true).equals(PropertiesComponent.getInstance().getValue(OPTIMIZE_IMPORTS_KEY)); - } - - private static void setOptimizeImportsOption(boolean state) { - PropertiesComponent.getInstance().setValue(OPTIMIZE_IMPORTS_KEY, Boolean.toString(state)); - } - private void updateState() { myCbIncludeSubdirs.setEnabled(myRbDirectory.isSelected()); myCbOptimizeImports.setEnabled( - !myRbSelectedText.isSelected() && !(myFile != null && LanguageImportStatements.INSTANCE.forFile(myFile) == null && myRbFile.isSelected())); + !myRbSelectedText.isSelected() && + !(myFile != null && LanguageImportStatements.INSTANCE.forFile(myFile) == null && myRbFile.isSelected())); + + final boolean canTargetVcsChanges = canTargetVcsRegions(); + myCbOnlyVcsChangedRegions.setEnabled(canTargetVcsChanges); + myCbOnlyVcsChangedRegions.setSelected( + canTargetVcsChanges && PropertiesComponent.getInstance().getBoolean(LayoutCodeConstants.PROCESS_CHANGED_TEXT_KEY, false) + ); myDoNotAskMeCheckBox.setEnabled(!myRbDirectory.isSelected()); myRbDirectory.setEnabled(!myDoNotAskMeCheckBox.isSelected()); @@ -163,6 +162,10 @@ public class LayoutCodeDialog extends DialogWrapper { panel.add(myCbOptimizeImports, gbConstraints); } + myCbOnlyVcsChangedRegions = new JCheckBox(CodeInsightBundle.message("reformat.option.vcs.changed.region")); + gbConstraints.gridy++; + panel.add(myCbOnlyVcsChangedRegions, gbConstraints); + ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(myRbFile); buttonGroup.add(myRbSelectedText); @@ -201,7 +204,7 @@ public class LayoutCodeDialog extends DialogWrapper { public boolean isProcessWholeFile() { return myRbFile.isSelected(); } - + public boolean isProcessDirectory() { return myRbDirectory.isSelected(); } @@ -214,12 +217,35 @@ public class LayoutCodeDialog extends DialogWrapper { return myCbOptimizeImports.isSelected(); } + public boolean isProcessOnlyChangedText() { + return myCbOnlyVcsChangedRegions.isEnabled() && myCbOnlyVcsChangedRegions.isSelected(); + } + boolean isDoNotAskMe() { - return myDoNotAskMeCheckBox.isSelected(); + return myDoNotAskMeCheckBox.isSelected(); } protected void doOKAction() { super.doOKAction(); - setOptimizeImportsOption(isOptimizeImports()); + PropertiesComponent.getInstance().setValue(LayoutCodeConstants.OPTIMIZE_IMPORTS_KEY, Boolean.toString(isOptimizeImports())); + PropertiesComponent.getInstance().setValue(LayoutCodeConstants.PROCESS_CHANGED_TEXT_KEY, Boolean.toString(isProcessOnlyChangedText())); + } + + private boolean canTargetVcsRegions() { + if (isProcessSelectedText()) { + return false; + } + + if (isProcessWholeFile()) { + return FormatChangedTextUtil.hasChanges(myFile); + } + + if (isProcessDirectory()) { + if (myDirectory == null) { + return false; + } + return FormatChangedTextUtil.hasChanges(myDirectory); + } + return false; } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutProjectCodeDialog.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutProjectCodeDialog.java index f4242a821fc2..0cdc67c67574 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutProjectCodeDialog.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutProjectCodeDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -19,9 +19,12 @@ package com.intellij.codeInsight.actions; import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.ide.util.PropertiesComponent; import com.intellij.openapi.help.HelpManager; +import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; @@ -30,36 +33,51 @@ import java.awt.*; * @author max */ public class LayoutProjectCodeDialog extends DialogWrapper { - private static @NonNls final String OPTIMIZE_IMPORTS_KEY = "LayoutCode.optimizeImports"; private static @NonNls final String HELP_ID = "editing.codeReformatting"; - private final String myText; - private final boolean mySuggestOptmizeImports; + private final String myText; + private final boolean mySuggestOptimizeImports; + private final Project myProject; + private final Module myModule; + private JCheckBox myCbOptimizeImports; + private JCheckBox myCbOnlyVcsChangedRegions; - public LayoutProjectCodeDialog(Project project, String title, String text, boolean suggestOptmizeImports) { + public LayoutProjectCodeDialog(@NotNull Project project, + @Nullable Module module, + String title, + String text, + boolean suggestOptimizeImports) + { super(project, false); myText = text; - mySuggestOptmizeImports = suggestOptmizeImports; + mySuggestOptimizeImports = suggestOptimizeImports; + myProject = project; + myModule = module; + setOKButtonText(CodeInsightBundle.message("reformat.code.accept.button.text")); setTitle(title); init(); } protected JComponent createCenterPanel() { - if (!mySuggestOptmizeImports) return new JLabel(myText); - JPanel panel = new JPanel(new GridLayout(2, 1)); + if (!mySuggestOptimizeImports) return new JLabel(myText); + JPanel panel = new JPanel(new GridLayout(3, 1)); panel.add(new JLabel(myText)); myCbOptimizeImports = new JCheckBox(CodeInsightBundle.message("reformat.option.optimize.imports")); panel.add(myCbOptimizeImports); - myCbOptimizeImports.setSelected(Boolean.toString(true).equals(PropertiesComponent.getInstance().getValue(OPTIMIZE_IMPORTS_KEY))); + myCbOptimizeImports.setSelected(PropertiesComponent.getInstance().getBoolean(LayoutCodeConstants.OPTIMIZE_IMPORTS_KEY, false)); + + myCbOnlyVcsChangedRegions = new JCheckBox(CodeInsightBundle.message("reformat.option.vcs.changed.region")); + panel.add(myCbOnlyVcsChangedRegions); + final boolean canTargetVcsRegions = canTargetVcsRegions(); + myCbOnlyVcsChangedRegions.setEnabled(canTargetVcsRegions); + myCbOnlyVcsChangedRegions.setSelected( + canTargetVcsRegions && PropertiesComponent.getInstance().getBoolean(LayoutCodeConstants.PROCESS_CHANGED_TEXT_KEY, false) + ); return panel; } - - private void setOptimizeImportsOption(boolean state) { - PropertiesComponent.getInstance().setValue(OPTIMIZE_IMPORTS_KEY, Boolean.toString(state)); - } - + protected Action[] createActions() { return new Action[]{getOKAction(), getCancelAction(), getHelpAction()}; } @@ -70,12 +88,24 @@ public class LayoutProjectCodeDialog extends DialogWrapper { protected void doOKAction() { super.doOKAction(); - if (mySuggestOptmizeImports) { - setOptimizeImportsOption(isOptimizeImports()); + if (mySuggestOptimizeImports) { + PropertiesComponent.getInstance().setValue(LayoutCodeConstants.OPTIMIZE_IMPORTS_KEY, Boolean.toString(isOptimizeImports())); } } public boolean isOptimizeImports() { return myCbOptimizeImports.isSelected(); } + + public boolean isProcessOnlyChangedText() { + return myCbOnlyVcsChangedRegions.isEnabled() && myCbOnlyVcsChangedRegions.isSelected(); + } + + private boolean canTargetVcsRegions() { + if (myModule != null) { + return FormatChangedTextUtil.hasChanges(myModule); + } + + return FormatChangedTextUtil.hasChanges(myProject); + } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java index 59c18bc50d72..951dbecd7c3c 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -54,7 +54,7 @@ public class OptimizeImportsAction extends AnAction { if (file == null) return; dir = file.getContainingDirectory(); } - else if (ReformatCodeAction.areFiles(files)) { + else if (files != null && ReformatCodeAction.areFiles(files)) { final ReadonlyStatusHandler.OperationStatus operationStatus = ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(files); if (!operationStatus.hasReadonlyFiles()) { new OptimizeImportsProcessor(project, ReformatCodeAction.convertToPsiFiles(files, project), null).run(); @@ -73,7 +73,8 @@ public class OptimizeImportsAction extends AnAction { else { text = CodeInsightBundle.message("process.scope.project", projectContext.getPresentableUrl()); } - LayoutProjectCodeDialog dialog = new LayoutProjectCodeDialog(project, CodeInsightBundle.message("process.optimize.imports"), text, false); + LayoutProjectCodeDialog dialog + = new LayoutProjectCodeDialog(project, null, CodeInsightBundle.message("process.optimize.imports"), text, false); dialog.show(); if (!dialog.isOK()) return; if (moduleContext != null) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsProcessor.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsProcessor.java index 34a66346aead..d16b9dcf3b46 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -34,19 +34,19 @@ public class OptimizeImportsProcessor extends AbstractLayoutCodeProcessor { private static final String COMMAND_NAME = CodeInsightBundle.message("process.optimize.imports"); public OptimizeImportsProcessor(Project project) { - super(project, COMMAND_NAME, PROGRESS_TEXT); + super(project, COMMAND_NAME, PROGRESS_TEXT, false); } public OptimizeImportsProcessor(Project project, Module module) { - super(project, module, COMMAND_NAME, PROGRESS_TEXT); + super(project, module, COMMAND_NAME, PROGRESS_TEXT, false); } public OptimizeImportsProcessor(Project project, PsiDirectory directory, boolean includeSubdirs) { - super(project, directory, includeSubdirs, PROGRESS_TEXT, COMMAND_NAME); + super(project, directory, includeSubdirs, PROGRESS_TEXT, COMMAND_NAME, false); } public OptimizeImportsProcessor(Project project, PsiFile file) { - super(project, file, PROGRESS_TEXT, COMMAND_NAME); + super(project, file, PROGRESS_TEXT, COMMAND_NAME, false); } public OptimizeImportsProcessor(Project project, PsiFile[] files, Runnable postRunnable) { @@ -54,11 +54,13 @@ public class OptimizeImportsProcessor extends AbstractLayoutCodeProcessor { } public OptimizeImportsProcessor(Project project, PsiFile[] files, String commandName, Runnable postRunnable) { - super(project, files, PROGRESS_TEXT, commandName, postRunnable); + super(project, files, PROGRESS_TEXT, commandName, postRunnable, false); } @NotNull - protected FutureTask preprocessFile(final PsiFile file) throws IncorrectOperationException { + protected FutureTask preprocessFile(@NotNull final PsiFile file, boolean processChangedTextOnly) + throws IncorrectOperationException + { final ImportOptimizer optimizer = LanguageImportStatements.INSTANCE.forFile(file); Runnable runnable = optimizer != null ? optimizer.processFile(file) : EmptyRunnable.getInstance(); return new FutureTask(runnable, true); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatAndOptimizeImportsProcessor.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatAndOptimizeImportsProcessor.java index 41bf48a3e5e6..cfef35956d5b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatAndOptimizeImportsProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatAndOptimizeImportsProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -38,40 +38,44 @@ public class ReformatAndOptimizeImportsProcessor extends AbstractLayoutCodeProce private final OptimizeImportsProcessor myOptimizeImportsProcessor; private final ReformatCodeProcessor myReformatCodeProcessor; - public ReformatAndOptimizeImportsProcessor(Project project) { - super(project, COMMAND_NAME, PROGRESS_TEXT); + public ReformatAndOptimizeImportsProcessor(Project project, boolean processChangedTextOnly) { + super(project, COMMAND_NAME, PROGRESS_TEXT, processChangedTextOnly); myOptimizeImportsProcessor = new OptimizeImportsProcessor(project); - myReformatCodeProcessor = new ReformatCodeProcessor(project); + myReformatCodeProcessor = new ReformatCodeProcessor(project, processChangedTextOnly); } - public ReformatAndOptimizeImportsProcessor(Project project, Module module) { - super(project, module, COMMAND_NAME, PROGRESS_TEXT); + public ReformatAndOptimizeImportsProcessor(Project project, Module module, boolean processChangedTextOnly) { + super(project, module, COMMAND_NAME, PROGRESS_TEXT, processChangedTextOnly); myOptimizeImportsProcessor = new OptimizeImportsProcessor(project, module); - myReformatCodeProcessor = new ReformatCodeProcessor(project, module); + myReformatCodeProcessor = new ReformatCodeProcessor(project, module, processChangedTextOnly); } - public ReformatAndOptimizeImportsProcessor(Project project, PsiFile[] files) { - super(project, files, PROGRESS_TEXT, COMMAND_NAME, null); + public ReformatAndOptimizeImportsProcessor(Project project, PsiFile[] files, boolean processChangedTextOnly) { + super(project, files, PROGRESS_TEXT, COMMAND_NAME, null, processChangedTextOnly); myOptimizeImportsProcessor = new OptimizeImportsProcessor(project); - myReformatCodeProcessor = new ReformatCodeProcessor(project); + myReformatCodeProcessor = new ReformatCodeProcessor(project, processChangedTextOnly); } - public ReformatAndOptimizeImportsProcessor(Project project, PsiDirectory directory, boolean includeSubdirs) { - super(project, directory, includeSubdirs, PROGRESS_TEXT, COMMAND_NAME); + public ReformatAndOptimizeImportsProcessor(Project project, + PsiDirectory directory, + boolean includeSubdirs, + boolean processChangedTextOnly) + { + super(project, directory, includeSubdirs, PROGRESS_TEXT, COMMAND_NAME, processChangedTextOnly); myOptimizeImportsProcessor = new OptimizeImportsProcessor(project, directory, includeSubdirs); - myReformatCodeProcessor = new ReformatCodeProcessor(project, directory, includeSubdirs); + myReformatCodeProcessor = new ReformatCodeProcessor(project, directory, includeSubdirs, processChangedTextOnly); } - public ReformatAndOptimizeImportsProcessor(Project project, PsiFile file) { - super(project, file, PROGRESS_TEXT, COMMAND_NAME); + public ReformatAndOptimizeImportsProcessor(Project project, PsiFile file, boolean processChangedTextOnly) { + super(project, file, PROGRESS_TEXT, COMMAND_NAME, processChangedTextOnly); myOptimizeImportsProcessor = new OptimizeImportsProcessor(project, file); - myReformatCodeProcessor = new ReformatCodeProcessor(project, file, null); + myReformatCodeProcessor = new ReformatCodeProcessor(project, file, null, processChangedTextOnly); } @NotNull - protected FutureTask preprocessFile(PsiFile file) throws IncorrectOperationException { - final FutureTask reformatTask = myReformatCodeProcessor.preprocessFile(file); - final FutureTask optimizeImportsTask = myOptimizeImportsProcessor.preprocessFile(file); + protected FutureTask preprocessFile(@NotNull PsiFile file, boolean processChangedTextOnly) throws IncorrectOperationException { + final FutureTask reformatTask = myReformatCodeProcessor.preprocessFile(file, processChangedTextOnly); + final FutureTask optimizeImportsTask = myOptimizeImportsProcessor.preprocessFile(file, false); return new FutureTask(new Callable() { @Override public Boolean call() throws Exception { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java index 918f2f22451f..dfbc027222fb 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -75,20 +75,22 @@ public class ReformatCodeAction extends AnAction implements DumbAware { else if (areFiles(files)) { final ReadonlyStatusHandler.OperationStatus operationStatus = ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(files); if (!operationStatus.hasReadonlyFiles()) { - final ReformatFilesDialog reformatFilesDialog = new ReformatFilesDialog(project); + final ReformatFilesDialog reformatFilesDialog = new ReformatFilesDialog(project, files); reformatFilesDialog.show(); if (!reformatFilesDialog.isOK()) return; if (reformatFilesDialog.optimizeImports() && !DumbService.getInstance(project).isDumb()) { - new ReformatAndOptimizeImportsProcessor(project, convertToPsiFiles(files, project)).run(); + new ReformatAndOptimizeImportsProcessor( + project, convertToPsiFiles(files, project), reformatFilesDialog.isProcessOnlyChangedText() + ).run(); } else { - new ReformatCodeProcessor(project, convertToPsiFiles(files, project), null).run(); + new ReformatCodeProcessor(project, convertToPsiFiles(files, project), null, reformatFilesDialog.isProcessOnlyChangedText()).run(); } } return; } - else{ + else { Project projectContext = PlatformDataKeys.PROJECT_CONTEXT.getData(dataContext); Module moduleContext = LangDataKeys.MODULE_CONTEXT.getData(dataContext); @@ -98,26 +100,27 @@ public class ReformatCodeAction extends AnAction implements DumbAware { text = CodeInsightBundle.message("process.scope.module", moduleContext.getModuleFilePath()); } else { - text = CodeInsightBundle.message("process.scope.project", projectContext.getPresentableUrl()); + text = CodeInsightBundle.message("process.scope.project", project.getPresentableUrl()); } - LayoutProjectCodeDialog dialog = new LayoutProjectCodeDialog(project, CodeInsightBundle.message("process.reformat.code"), text, true); + LayoutProjectCodeDialog dialog + = new LayoutProjectCodeDialog(project, moduleContext, CodeInsightBundle.message("process.reformat.code"), text, true); dialog.show(); if (!dialog.isOK()) return; if (dialog.isOptimizeImports() && !DumbService.getInstance(project).isDumb()) { if (moduleContext != null) { - new ReformatAndOptimizeImportsProcessor(project, moduleContext).run(); + new ReformatAndOptimizeImportsProcessor(project, moduleContext, dialog.isProcessOnlyChangedText()).run(); } else { - new ReformatAndOptimizeImportsProcessor(projectContext).run(); + new ReformatAndOptimizeImportsProcessor(project, dialog.isProcessOnlyChangedText()).run(); } } else { if (moduleContext != null) { - new ReformatCodeProcessor(project, moduleContext).run(); + new ReformatCodeProcessor(project, moduleContext, dialog.isProcessOnlyChangedText()).run(); } else { - new ReformatCodeProcessor(projectContext).run(); + new ReformatCodeProcessor(project, dialog.isProcessOnlyChangedText()).run(); } } return; @@ -140,6 +143,7 @@ public class ReformatCodeAction extends AnAction implements DumbAware { boolean optimizeImports = ReformatFilesDialog.isOptmizeImportsOptionOn(); boolean processWholeFile = false; + boolean processChangedTextOnly = false; if (EditorSettingsExternalizable.getInstance().getOptions().SHOW_REFORMAT_DIALOG || (file == null && dir != null)) { final LayoutCodeDialog dialog = new LayoutCodeDialog(project, CodeInsightBundle.message("process.reformat.code"), file, dir, hasSelection ? Boolean.TRUE : Boolean.FALSE, HELP_ID); @@ -149,12 +153,14 @@ public class ReformatCodeAction extends AnAction implements DumbAware { updateShowDialogSetting(dialog, "\"Reformat Code\" dialog disabled"); optimizeImports = dialog.isOptimizeImports(); processWholeFile = dialog.isProcessWholeFile(); + processChangedTextOnly = dialog.isProcessOnlyChangedText(); + if (dialog.isProcessDirectory()){ if (optimizeImports) { - new ReformatAndOptimizeImportsProcessor(project, dir, dialog.isIncludeSubdirectories()).run(); + new ReformatAndOptimizeImportsProcessor(project, dir, dialog.isIncludeSubdirectories(), processChangedTextOnly).run(); } else { - new ReformatCodeProcessor(project, dir, dialog.isIncludeSubdirectories()).run(); + new ReformatCodeProcessor(project, dir, dialog.isIncludeSubdirectories(), processChangedTextOnly).run(); } return; } @@ -170,14 +176,14 @@ public class ReformatCodeAction extends AnAction implements DumbAware { if (optimizeImports && range == null) { if (file != null || dir == null) { - new ReformatAndOptimizeImportsProcessor(project, file).run(); + new ReformatAndOptimizeImportsProcessor(project, file, processChangedTextOnly).run(); } else { - new ReformatAndOptimizeImportsProcessor(project, dir, true).run(); + new ReformatAndOptimizeImportsProcessor(project, dir, true, processChangedTextOnly).run(); } } else { - new ReformatCodeProcessor(project, file, range).run(); + new ReformatCodeProcessor(project, file, range, processChangedTextOnly).run(); } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeProcessor.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeProcessor.java index 4aadcbfdb8f3..f75a4c36d6e2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -27,7 +27,10 @@ import com.intellij.psi.PsiFile; import com.intellij.psi.codeStyle.CodeStyleManager; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; +import java.util.Collection; import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; @@ -37,53 +40,66 @@ public class ReformatCodeProcessor extends AbstractLayoutCodeProcessor { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.actions.ReformatCodeProcessor"); - private final TextRange myRange; + private final Collection myRanges = new ArrayList(); private static final String PROGRESS_TEXT = CodeInsightBundle.message("reformat.progress.common.text"); - public ReformatCodeProcessor(Project project) { - super(project, COMMAND_NAME, PROGRESS_TEXT); - myRange = null; + public ReformatCodeProcessor(Project project, boolean processChangedTextOnly) { + super(project, COMMAND_NAME, PROGRESS_TEXT, processChangedTextOnly); } - public ReformatCodeProcessor(Project project, Module module) { - super(project, module, COMMAND_NAME, PROGRESS_TEXT); - myRange = null; + public ReformatCodeProcessor(Project project, Module module, boolean processChangedTextOnly) { + super(project, module, COMMAND_NAME, PROGRESS_TEXT, processChangedTextOnly); } - public ReformatCodeProcessor(Project project, PsiDirectory directory, boolean includeSubdirs) { - super(project, directory, includeSubdirs, PROGRESS_TEXT, COMMAND_NAME); - myRange = null; + public ReformatCodeProcessor(Project project, PsiDirectory directory, boolean includeSubdirs, boolean processChangedTextOnly) { + super(project, directory, includeSubdirs, PROGRESS_TEXT, COMMAND_NAME, processChangedTextOnly); } - public ReformatCodeProcessor(Project project, PsiFile file, TextRange range) { - super(project, file, PROGRESS_TEXT, COMMAND_NAME); - myRange = range; + public ReformatCodeProcessor(Project project, PsiFile file, @Nullable TextRange range, boolean processChangedTextOnly) { + super(project, file, PROGRESS_TEXT, COMMAND_NAME, processChangedTextOnly); + if (range != null) { + myRanges.add(range); + } } - public ReformatCodeProcessor(Project project, PsiFile[] files, Runnable postRunnable) { - this(project, files, COMMAND_NAME, postRunnable); + public ReformatCodeProcessor(Project project, PsiFile[] files, Runnable postRunnable, boolean processChangedTextOnly) { + this(project, files, COMMAND_NAME, postRunnable, processChangedTextOnly); } - - public ReformatCodeProcessor(Project project, PsiFile[] files, String commandName, Runnable postRunnable) { - super(project, files, PROGRESS_TEXT, commandName, postRunnable); - myRange = null; + + public ReformatCodeProcessor(Project project, + PsiFile[] files, + String commandName, + Runnable postRunnable, + boolean processChangedTextOnly) + { + super(project, files, PROGRESS_TEXT, commandName, postRunnable, processChangedTextOnly); } @NotNull - protected FutureTask preprocessFile(final PsiFile file) throws IncorrectOperationException { + protected FutureTask preprocessFile(@NotNull final PsiFile file, final boolean processChangedTextOnly) + throws IncorrectOperationException + { return new FutureTask(new Callable() { @Override public Boolean call() throws Exception { FormattingProgressTask.FORMATTING_CANCELLED_FLAG.set(false); try { - TextRange range = myRange == null ? file.getTextRange() : myRange; - CodeStyleManager.getInstance(myProject).reformatText(file, range.getStartOffset(), range.getEndOffset()); + if (myRanges.isEmpty() && processChangedTextOnly) { + myRanges.addAll(FormatChangedTextUtil.getChanges(file)); + } + if (myRanges.isEmpty()) { + myRanges.add(file.getTextRange()); + } + CodeStyleManager.getInstance(myProject).reformatText(file, myRanges); return !FormattingProgressTask.FORMATTING_CANCELLED_FLAG.get(); } catch (IncorrectOperationException e) { LOG.error(e); return false; } + finally { + myRanges.clear(); + } } }); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatFilesDialog.form b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatFilesDialog.form index 5b069fca7cda..d5f043e108ab 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatFilesDialog.form +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatFilesDialog.form @@ -1,27 +1,24 @@

- + - - + - + - - + - - + @@ -29,8 +26,7 @@ - - + @@ -38,16 +34,22 @@ - - + + + + + + + + + - - + diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatFilesDialog.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatFilesDialog.java index 9e22ffa8977b..61af5d4e709b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatFilesDialog.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatFilesDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -20,17 +20,34 @@ import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.ide.util.PropertiesComponent; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; import javax.swing.*; public class ReformatFilesDialog extends DialogWrapper { private JPanel myPanel; private JCheckBox myOptimizeImports; + private JCheckBox myOnlyChangedText; + private final VirtualFile[] myFiles; - public ReformatFilesDialog(Project project) { + public ReformatFilesDialog(@NotNull Project project, @NotNull VirtualFile[] files) { super(project, true); + myFiles = files; setTitle(CodeInsightBundle.message("dialog.reformat.files.title")); myOptimizeImports.setSelected(isOptmizeImportsOptionOn()); + boolean canTargetVcsChanges = false; + for (VirtualFile file : files) { + if (FormatChangedTextUtil.hasChanges(file, project)) { + canTargetVcsChanges = true; + break; + } + } + myOnlyChangedText.setEnabled(canTargetVcsChanges); + myOnlyChangedText.setSelected( + canTargetVcsChanges && PropertiesComponent.getInstance().getBoolean(LayoutCodeConstants.PROCESS_CHANGED_TEXT_KEY, false) + ); + myOptimizeImports.setSelected(isOptmizeImportsOptionOn()); init(); } @@ -42,13 +59,19 @@ public class ReformatFilesDialog extends DialogWrapper { return myOptimizeImports.isSelected(); } + public boolean isProcessOnlyChangedText() { + return myOnlyChangedText.isEnabled() && myOnlyChangedText.isSelected(); + } + protected void doOKAction() { - PropertiesComponent.getInstance().setValue(LayoutCodeDialog.OPTIMIZE_IMPORTS_KEY, Boolean.toString(myOptimizeImports.isSelected())); super.doOKAction(); + PropertiesComponent.getInstance().setValue(LayoutCodeConstants.OPTIMIZE_IMPORTS_KEY, Boolean.toString(myOptimizeImports.isSelected())); + PropertiesComponent.getInstance().setValue(LayoutCodeConstants.PROCESS_CHANGED_TEXT_KEY, + Boolean.toString(myOnlyChangedText.isSelected())); } static boolean isOptmizeImportsOptionOn() { - return Boolean.valueOf(PropertiesComponent.getInstance().getValue(LayoutCodeDialog.OPTIMIZE_IMPORTS_KEY)); + return PropertiesComponent.getInstance().getBoolean(LayoutCodeConstants.OPTIMIZE_IMPORTS_KEY, false); } } diff --git a/platform/lang-impl/src/com/intellij/openapi/vcs/checkin/ReformatBeforeCheckinHandler.java b/platform/lang-impl/src/com/intellij/openapi/vcs/checkin/ReformatBeforeCheckinHandler.java index 05578cce4fae..e1a07cef088d 100644 --- a/platform/lang-impl/src/com/intellij/openapi/vcs/checkin/ReformatBeforeCheckinHandler.java +++ b/platform/lang-impl/src/com/intellij/openapi/vcs/checkin/ReformatBeforeCheckinHandler.java @@ -84,7 +84,9 @@ public class ReformatBeforeCheckinHandler extends CheckinHandler implements Chec }; if (reformat(configuration, true)) { - new ReformatCodeProcessor(myProject, BeforeCheckinHandlerUtil.getPsiFiles(myProject, files), COMMAND_NAME, performCheckoutAction).run(); + new ReformatCodeProcessor( + myProject, BeforeCheckinHandlerUtil.getPsiFiles(myProject, files), COMMAND_NAME, performCheckoutAction, false + ).run(); } else { performCheckoutAction.run(); diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java index 4426aa2acfbf..c0d69b38c25c 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -48,6 +48,10 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; import java.util.concurrent.TimeUnit; public class CodeStyleManagerImpl extends CodeStyleManager { @@ -137,6 +141,14 @@ public class CodeStyleManagerImpl extends CodeStyleManager { @Override public void reformatText(@NotNull PsiFile file, int startOffset, int endOffset) throws IncorrectOperationException { + reformatText(file, Collections.singleton(new TextRange(startOffset, endOffset))); + } + + @Override + public void reformatText(@NotNull PsiFile file, @NotNull Collection ranges) throws IncorrectOperationException { + if (ranges.isEmpty()) { + return; + } ApplicationManager.getApplication().assertWriteAccessAllowed(); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); @@ -150,17 +162,9 @@ public class CodeStyleManagerImpl extends CodeStyleManager { final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(getSettings()); LOG.assertTrue(file.isValid()); - final PsiElement start = findElementInTreeWithFormatterEnabled(file, startOffset); - final PsiElement end = findElementInTreeWithFormatterEnabled(file, endOffset); - if (start != null && !start.isValid()) { - LOG.error("start=" + start + "; file=" + file); - } - if (end != null && !end.isValid()) { - LOG.error("end=" + start + "; end=" + file); - } Editor editor = PsiUtilBase.findEditor(file); - + // There is a possible case that cursor is located at the end of the line that contains only white spaces. For example: // public void foo() { // @@ -168,7 +172,7 @@ public class CodeStyleManagerImpl extends CodeStyleManager { // Formatter removes such white spaces, i.e. keeps only line feed symbol. But we want to preserve caret position then. // So, we check if it should be preserved and restore it after formatting if necessary int visualColumnToRestore = -1; - + if (editor != null) { Document document = editor.getDocument(); int caretOffset = editor.getCaretModel().getOffset(); @@ -189,23 +193,40 @@ public class CodeStyleManagerImpl extends CodeStyleManager { visualColumnToRestore = editor.getCaretModel().getVisualPosition().column; } } - - - boolean formatFromStart = startOffset == 0; - boolean formatToEnd = endOffset == file.getTextLength(); final SmartPointerManager smartPointerManager = SmartPointerManager.getInstance(getProject()); - final SmartPsiElementPointer startPointer = start == null ? null : smartPointerManager.createSmartPsiElementPointer(start); - - final SmartPsiElementPointer endPointer = end == null ? null : smartPointerManager.createSmartPsiElementPointer(end); - - codeFormatter.processText(file, new FormatTextRanges(new TextRange(startOffset, endOffset), true), true); - final PsiElement startElement = startPointer == null ? null : startPointer.getElement(); - final PsiElement endElement = endPointer == null ? null : endPointer.getElement(); - - if ((startElement != null || formatFromStart) && (endElement != null || formatToEnd)) { - postProcessText(file, new TextRange(formatFromStart ? 0 : startElement.getTextRange().getStartOffset(), - formatToEnd ? file.getTextLength() : endElement.getTextRange().getEndOffset())); + List infos = new ArrayList(); + for (TextRange range : ranges) { + final PsiElement start = findElementInTreeWithFormatterEnabled(file, range.getStartOffset()); + final PsiElement end = findElementInTreeWithFormatterEnabled(file, range.getEndOffset()); + if (start != null && !start.isValid()) { + LOG.error("start=" + start + "; file=" + file); + } + if (end != null && !end.isValid()) { + LOG.error("end=" + start + "; end=" + file); + } + boolean formatFromStart = range.getStartOffset() == 0; + boolean formatToEnd = range.getEndOffset() == file.getTextLength(); + infos.add(new RangeFormatInfo( + start == null ? null : smartPointerManager.createSmartPsiElementPointer(start), + end == null ? null : smartPointerManager.createSmartPsiElementPointer(end), + formatFromStart, + formatToEnd + )); + } + + FormatTextRanges formatRanges = new FormatTextRanges(); + for (TextRange range : ranges) { + formatRanges.add(range, true); + } + codeFormatter.processText(file, formatRanges, true); + for (RangeFormatInfo info : infos) { + final PsiElement startElement = info.startPointer == null ? null : info.startPointer.getElement(); + final PsiElement endElement = info.endPointer == null ? null : info.endPointer.getElement(); + if ((startElement != null || info.fromStart) && (endElement != null || info.toEnd)) { + postProcessText(file, new TextRange(info.fromStart ? 0 : startElement.getTextRange().getStartOffset(), + info.toEnd ? file.getTextLength() : endElement.getTextRange().getEndOffset())); + } } if (visualColumnToRestore < 0) { @@ -758,5 +779,23 @@ public class CodeStyleManagerImpl extends CodeStyleManager { } }); } + + private static class RangeFormatInfo{ + public final SmartPsiElementPointer startPointer; + public final SmartPsiElementPointer endPointer; + public final boolean fromStart; + public final boolean toEnd; + + RangeFormatInfo(@Nullable SmartPsiElementPointer startPointer, + @Nullable SmartPsiElementPointer endPointer, + boolean fromStart, + boolean toEnd) + { + this.startPointer = startPointer; + this.endPointer = endPointer; + this.fromStart = fromStart; + this.toEnd = toEnd; + } + } } diff --git a/platform/platform-resources-en/src/messages/CodeInsightBundle.properties b/platform/platform-resources-en/src/messages/CodeInsightBundle.properties index 649bcf59210d..3fa41abf3020 100644 --- a/platform/platform-resources-en/src/messages/CodeInsightBundle.properties +++ b/platform/platform-resources-en/src/messages/CodeInsightBundle.properties @@ -12,6 +12,7 @@ reformat.option.selected.text=&Selected text reformat.option.all.files.in.directory=&All files in directory {0} reformat.option.include.subdirectories=&Include subdirectories reformat.option.optimize.imports=&Optimize imports +reformat.option.vcs.changed.region=Only text changed to &VCS reformat.progress.file.with.known.name.text=Reformatting {0} reformat.and.optimize.progress.common.text=Preparing imports... reformat.progress.common.text=Reformatting code... diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureSynchronizer.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureSynchronizer.java index 72f259a6ec60..2cdb96c9d68a 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureSynchronizer.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureSynchronizer.java @@ -1,5 +1,6 @@ /* - * Copyright 2000-2008 JetBrains s.r.o. + * Copyright 2000-2011 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 @@ -169,7 +170,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent { for (VirtualFile virtualFile : files) { PsiFile psiFile = manager.findFile(virtualFile); if (psiFile != null) { - new ReformatCodeProcessor(myProject, psiFile, null).run(); + new ReformatCodeProcessor(myProject, psiFile, null, false).run(); } } } From 840f74164146015b7193572295fe3f75d0a892ff Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Mon, 19 Dec 2011 15:57:49 +0400 Subject: [PATCH 090/101] EA-32642 - IAE: LogicalPosition. 1. Added check to avoid negative column; 2. Green code policy is partly applied; --- .../openapi/wm/impl/status/PositionPanel.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PositionPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PositionPanel.java index ef32f9619a01..cc6e397f8e86 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PositionPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PositionPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2011 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. @@ -152,9 +152,18 @@ public class PositionPanel extends EditorBasedWidget implements StatusBarWidget. if (selectionModel.hasBlockSelection()) { LogicalPosition start = selectionModel.getBlockStart(); LogicalPosition end = selectionModel.getBlockEnd(); + if (start == null || end == null) { + throw new IllegalStateException(String.format( + "Invalid selection model state detected: 'blockSelection' property is 'true' but selection start position (%s) or " + + "selection end position (%s) is undefined", start, end + )); + } appendLogicalPosition(start, message); message.append("-"); - appendLogicalPosition(new LogicalPosition(Math.abs(end.line - start.line), Math.abs(end.column - start.column) - 1), message); + appendLogicalPosition( + new LogicalPosition(Math.abs(end.line - start.line), Math.max(0, Math.abs(end.column - start.column) - 1)), + message + ); } else { LogicalPosition caret = editor.getCaretModel().getLogicalPosition(); From 4e613f7284281cc2ea140957c20bc0bce32f10b9 Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Thu, 15 Dec 2011 16:51:18 +0400 Subject: [PATCH 091/101] android execution: show usb devices in device chooser --- .../src/org/jetbrains/android/run/AndroidRunningState.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/android/src/org/jetbrains/android/run/AndroidRunningState.java b/plugins/android/src/org/jetbrains/android/run/AndroidRunningState.java index 7e59f24e7716..4f6233148d6f 100644 --- a/plugins/android/src/org/jetbrains/android/run/AndroidRunningState.java +++ b/plugins/android/src/org/jetbrains/android/run/AndroidRunningState.java @@ -312,7 +312,7 @@ public abstract class AndroidRunningState implements RunProfileState, AndroidDeb return EMPTY_DEVICE_ARRAY; } IDevice[] devices = bridge.getDevices(); - + boolean showChooserDialog = false; IDevice targetDevice = null; for (IDevice device : devices) { @@ -335,7 +335,7 @@ public abstract class AndroidRunningState implements RunProfileState, AndroidDeb devicesWrapper[0] = chooseDevicesManually(new Condition() { @Override public boolean value(IDevice device) { - return device.isEmulator() && isCompatibleDevice(device) != Boolean.FALSE; + return isCompatibleDevice(device) != Boolean.FALSE; } }); } From 8d95242dabd8a834d2465e42460e2729585a5143 Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Thu, 15 Dec 2011 18:50:10 +0400 Subject: [PATCH 092/101] cosmetics: capitalize dialog titles --- plugins/android/resources/messages/AndroidBundle.properties | 2 ++ .../android/actions/CreateResourceDirectoryAction.java | 2 +- .../org/jetbrains/android/actions/CreateResourceFileAction.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/android/resources/messages/AndroidBundle.properties b/plugins/android/resources/messages/AndroidBundle.properties index e0090ed58cf1..98a38158b568 100644 --- a/plugins/android/resources/messages/AndroidBundle.properties +++ b/plugins/android/resources/messages/AndroidBundle.properties @@ -61,7 +61,9 @@ new.resource.action.title=Android resource file new.resource.dir.action.title=Android resource directory new.resource.action.description=Create new resource file new.resource.command.name=New resource file +new.resource.dialog.title=New Resource File new.resource.dir.command.name=New resource directory +new.resource.dir.dialog.title=New Resource Directory no.android.targets.error=Cannot find any Android targets in this SDK android.choose.color=Choose color android.run.configuration.type.name=Android Application diff --git a/plugins/android/src/org/jetbrains/android/actions/CreateResourceDirectoryAction.java b/plugins/android/src/org/jetbrains/android/actions/CreateResourceDirectoryAction.java index cd69a83b7d9a..40283fc74e11 100644 --- a/plugins/android/src/org/jetbrains/android/actions/CreateResourceDirectoryAction.java +++ b/plugins/android/src/org/jetbrains/android/actions/CreateResourceDirectoryAction.java @@ -36,7 +36,7 @@ public class CreateResourceDirectoryAction extends CreateElementActionBase { return CreateResourceDirectoryAction.this.createValidator(project, directory); } }; - dialog.setTitle(getCommandName()); + dialog.setTitle(AndroidBundle.message("new.resource.dir.dialog.title")); dialog.show(); final InputValidator validator = dialog.getValidator(); if (validator == null) { diff --git a/plugins/android/src/org/jetbrains/android/actions/CreateResourceFileAction.java b/plugins/android/src/org/jetbrains/android/actions/CreateResourceFileAction.java index 588c6811fcac..2ef70b3d4666 100644 --- a/plugins/android/src/org/jetbrains/android/actions/CreateResourceFileAction.java +++ b/plugins/android/src/org/jetbrains/android/actions/CreateResourceFileAction.java @@ -108,7 +108,7 @@ public class CreateResourceFileAction extends CreateElementActionBase { return CreateResourceFileAction.this.createValidator(project, directory, subdirName); } }; - dialog.setTitle(getCommandName()); + dialog.setTitle(AndroidBundle.message("new.resource.dialog.title")); dialog.show(); InputValidator validator = dialog.getValidator(); if (validator == null) { From 3d6751b299aad850e803fceebb96dfecff291209 Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Thu, 15 Dec 2011 19:34:57 +0400 Subject: [PATCH 093/101] IDEA-78239 android: support missing resource qualifiers --- .../uipreview/DeviceConfiguratorPanel.java | 286 +++++++++++++++++- .../uipreview/EditConfigurationDialog.java | 10 + 2 files changed, 289 insertions(+), 7 deletions(-) diff --git a/plugins/android/src/org/jetbrains/android/uipreview/DeviceConfiguratorPanel.java b/plugins/android/src/org/jetbrains/android/uipreview/DeviceConfiguratorPanel.java index e7bbcb7b5e3c..2d96e18b13ca 100644 --- a/plugins/android/src/org/jetbrains/android/uipreview/DeviceConfiguratorPanel.java +++ b/plugins/android/src/org/jetbrains/android/uipreview/DeviceConfiguratorPanel.java @@ -75,13 +75,7 @@ public abstract class DeviceConfiguratorPanel extends JPanel { createUIComponents(); - myAvailableQualifiersConfig.createDefault(); - - myAvailableQualifiersConfig.setLanguageQualifier(null); - myAvailableQualifiersConfig.setVersionQualifier(null); - myAvailableQualifiersConfig.setNightModeQualifier(null); - myAvailableQualifiersConfig.setUiModeQualifier(null); - myAvailableQualifiersConfig.setRegionQualifier(null); + createDefaultConfig(myAvailableQualifiersConfig); myChosenQualifiersConfig.reset(); @@ -123,6 +117,30 @@ public abstract class DeviceConfiguratorPanel extends JPanel { else if (qualifier instanceof TouchScreenQualifier) { myEditors.put(name, new MyTouchScreenEditor()); } + else if (qualifier instanceof VersionQualifier) { + myEditors.put(name, new MyVersionEditor()); + } + else if (qualifier instanceof NightModeQualifier) { + myEditors.put(name, new MyNightModeEditor()); + } + else if (qualifier instanceof UiModeQualifier) { + myEditors.put(name, new MyUiModeEditor()); + } + else if (qualifier instanceof LanguageQualifier) { + myEditors.put(name, new MyLanguageEditor()); + } + else if (qualifier instanceof RegionQualifier) { + myEditors.put(name, new MyRegionEditor()); + } + else if (qualifier instanceof SmallestScreenWidthQualifier) { + myEditors.put(name, new MySmallestScreenWidthEditor()); + } + else if (qualifier instanceof ScreenWidthQualifier) { + myEditors.put(name, new MyScreenWidthEditor()); + } + else if (qualifier instanceof ScreenHeightQualifier) { + myEditors.put(name, new MyScreenHeightEditor()); + } } for (String name : myEditors.keySet()) { @@ -221,6 +239,10 @@ public abstract class DeviceConfiguratorPanel extends JPanel { }); } + protected void createDefaultConfig(FolderConfiguration config) { + config.createDefault(); + } + public abstract void applyEditors(); public void updateAll() { @@ -858,4 +880,254 @@ public abstract class DeviceConfiguratorPanel extends JPanel { } } } + + private class MyVersionEditor extends MyQualifierEditor { + private final JTextField myTextField = new JTextField(3); + + @Override + JComponent getComponent() { + final JPanel panel = new JPanel(new VerticalFlowLayout()); + final JBLabel label = new JBLabel("Platform API level:"); + panel.add(label); + label.setLabelFor(myTextField); + myTextField.getDocument().addDocumentListener(myUpdatingDocumentListener); + panel.add(myTextField); + return panel; + } + + @Override + void reset(@NotNull VersionQualifier qualifier) { + myTextField.setText(Integer.toString(qualifier.getVersion())); + } + + @NotNull + @Override + VersionQualifier apply() throws InvalidOptionValueException { + try { + final int apiLevel = Integer.parseInt(myTextField.getText().trim()); + if (apiLevel < 0) { + throw new InvalidOptionValueException("Incorrect API level"); + } + return new VersionQualifier(apiLevel); + } + catch (NumberFormatException e) { + throw new InvalidOptionValueException("Incorrect API level"); + } + } + } + + private class MyNightModeEditor extends MyEnumBasedEditor { + protected MyNightModeEditor() { + super(NightMode.class); + } + + @NotNull + @Override + protected String getCaption() { + return "Night mode:"; + } + + @Override + protected NightMode getValue(@NotNull NightModeQualifier qualifier) { + return qualifier.getValue(); + } + + @NotNull + @Override + protected NightModeQualifier getQualifier(@NotNull NightMode value) { + return new NightModeQualifier(value); + } + + @NotNull + @Override + protected String getErrorMessage() { + return "Specify night mode"; + } + } + + private class MyUiModeEditor extends MyEnumBasedEditor { + private MyUiModeEditor() { + super(UiMode.class); + } + + @NotNull + @Override + protected String getCaption() { + return "UI mode:"; + } + + @Override + protected UiMode getValue(@NotNull UiModeQualifier qualifier) { + return qualifier.getValue(); + } + + @NotNull + @Override + protected UiModeQualifier getQualifier(@NotNull UiMode value) { + return new UiModeQualifier(value); + } + + @NotNull + @Override + protected String getErrorMessage() { + return "Specify UI mode"; + } + } + + private class MyLanguageEditor extends MyQualifierEditor { + private final JTextField myTextField = new JTextField(2); + + @Override + JComponent getComponent() { + final JPanel panel = new JPanel(new VerticalFlowLayout()); + final JBLabel label = new JBLabel("Language
(2 letter code):"); + panel.add(label); + label.setLabelFor(myTextField); + myTextField.getDocument().addDocumentListener(myUpdatingDocumentListener); + panel.add(myTextField); + return panel; + } + + @Override + void reset(@NotNull LanguageQualifier qualifier) { + myTextField.setText(qualifier.getValue()); + } + + @NotNull + @Override + LanguageQualifier apply() throws InvalidOptionValueException { + final String languageCode = myTextField.getText().trim(); + if (languageCode.length() != 2) { + throw new InvalidOptionValueException("Incorrect language code"); + } + return new LanguageQualifier(languageCode); + } + } + + private class MyRegionEditor extends MyQualifierEditor { + private final JTextField myTextField = new JTextField(2); + + @Override + JComponent getComponent() { + final JPanel panel = new JPanel(new VerticalFlowLayout()); + final JBLabel label = new JBLabel("Region
(2 letter code):"); + panel.add(label); + label.setLabelFor(myTextField); + myTextField.getDocument().addDocumentListener(myUpdatingDocumentListener); + panel.add(myTextField); + return panel; + } + + @Override + void reset(@NotNull RegionQualifier qualifier) { + myTextField.setText(qualifier.getValue()); + } + + @NotNull + @Override + RegionQualifier apply() throws InvalidOptionValueException { + final String languageCode = myTextField.getText().trim(); + if (languageCode.length() != 2) { + throw new InvalidOptionValueException("Incorrect region code"); + } + return new RegionQualifier(languageCode); + } + } + + private abstract class MySizeEditorBase extends MyQualifierEditor { + private final JTextField myTextField = new JTextField(3); + + @Override + JComponent getComponent() { + final JPanel panel = new JPanel(new VerticalFlowLayout()); + final JBLabel label = new JBLabel("Smallest screen width:"); + panel.add(label); + label.setLabelFor(myTextField); + myTextField.getDocument().addDocumentListener(myUpdatingDocumentListener); + panel.add(myTextField); + return panel; + } + + @Override + void reset(@NotNull T qualifier) { + myTextField.setText(Integer.toString(getValue(qualifier))); + } + + protected abstract int getValue(@NotNull T qualifier); + + @NotNull + protected abstract T createQualifier(int value); + + protected abstract String getErrorMessage(); + + @NotNull + @Override + T apply() throws InvalidOptionValueException { + try { + final int value = Integer.parseInt(myTextField.getText().trim()); + if (value < 0) { + throw new InvalidOptionValueException(getErrorMessage()); + } + return createQualifier(value); + } + catch (NumberFormatException e) { + throw new InvalidOptionValueException(getErrorMessage()); + } + } + } + + private class MySmallestScreenWidthEditor extends MySizeEditorBase { + @Override + protected int getValue(@NotNull SmallestScreenWidthQualifier qualifier) { + return qualifier.getValue(); + } + + @NotNull + @Override + protected SmallestScreenWidthQualifier createQualifier(int value) { + return new SmallestScreenWidthQualifier(value); + } + + @Override + protected String getErrorMessage() { + return "Incorrect smallest screen width"; + } + } + + private class MyScreenWidthEditor extends MySizeEditorBase { + @Override + protected int getValue(@NotNull ScreenWidthQualifier qualifier) { + return qualifier.getValue(); + } + + @NotNull + @Override + protected ScreenWidthQualifier createQualifier(int value) { + return new ScreenWidthQualifier(value); + } + + @Override + protected String getErrorMessage() { + return "Incorrect screen width"; + } + } + + private class MyScreenHeightEditor extends MySizeEditorBase { + @Override + protected int getValue(@NotNull ScreenHeightQualifier qualifier) { + return qualifier.getValue(); + } + + @NotNull + @Override + protected ScreenHeightQualifier createQualifier(int value) { + return new ScreenHeightQualifier(); + } + + @Override + protected String getErrorMessage() { + return "Incorrect screen height"; + } + } } + \ No newline at end of file diff --git a/plugins/android/src/org/jetbrains/android/uipreview/EditConfigurationDialog.java b/plugins/android/src/org/jetbrains/android/uipreview/EditConfigurationDialog.java index 768952ae3895..f16ffc153a0f 100644 --- a/plugins/android/src/org/jetbrains/android/uipreview/EditConfigurationDialog.java +++ b/plugins/android/src/org/jetbrains/android/uipreview/EditConfigurationDialog.java @@ -73,6 +73,16 @@ public class EditConfigurationDialog extends DialogWrapper { myConfigurationTextPane.setText("Configuration: " + getConfiguration().toDisplayString()); setOKActionEnabled(true); } + + @Override + protected void createDefaultConfig(FolderConfiguration config) { + super.createDefaultConfig(config); + config.setLanguageQualifier(null); + config.setVersionQualifier(null); + config.setNightModeQualifier(null); + config.setUiModeQualifier(null); + config.setRegionQualifier(null); + } }; myDeviceConfiguratorPanelWrapper.add(myDeviceConfiguratorPanel, BorderLayout.CENTER); From 61d8ff610f6c19822def50d5223d231df8824249 Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Thu, 15 Dec 2011 20:19:59 +0400 Subject: [PATCH 094/101] android works with JDK 1.7 --- plugins/android/resources/messages/AndroidBundle.properties | 4 ++-- .../src/org/jetbrains/android/sdk/AndroidSdkUtils.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/android/resources/messages/AndroidBundle.properties b/plugins/android/resources/messages/AndroidBundle.properties index 98a38158b568..325558bc4faa 100644 --- a/plugins/android/resources/messages/AndroidBundle.properties +++ b/plugins/android/resources/messages/AndroidBundle.properties @@ -220,8 +220,8 @@ android.restart.logcat.action.description=Restart logging android.new.component.dialog.application.item=Application android.sdk.presentable.name=Android SDK android.sdk.configure.jdk.error=Please configure internal JDK -no.jdk.for.android.found.error=No Java SDK of appropriate version found. In addition to the Android SDK, you need to define a JSDK 1.5 or 1.6 -no.jdk.error=You need to create at least one JSDK of versions 1.5 or 1.6 +no.jdk.for.android.found.error=No Java SDK of appropriate version found. In addition to the Android SDK, you need to define a JSDK 1.5, 1.6 or 1.7 +no.jdk.error=You need to create at least one JSDK of versions 1.5, 1.6 or 1.7 cannot.parse.sdk.error=Cannot parse Android SDK android.add.sdk.tooltip=Add SDK android.console.tool.window.title=Android Console diff --git a/plugins/android/src/org/jetbrains/android/sdk/AndroidSdkUtils.java b/plugins/android/src/org/jetbrains/android/sdk/AndroidSdkUtils.java index fac151d5c6a5..7f422a5134b1 100644 --- a/plugins/android/src/org/jetbrains/android/sdk/AndroidSdkUtils.java +++ b/plugins/android/src/org/jetbrains/android/sdk/AndroidSdkUtils.java @@ -215,7 +215,7 @@ public class AndroidSdkUtils { return false; } JavaSdkVersion version = JavaSdk.getInstance().getVersion(jdk); - return version == JavaSdkVersion.JDK_1_5 || version == JavaSdkVersion.JDK_1_6; + return version == JavaSdkVersion.JDK_1_5 || version == JavaSdkVersion.JDK_1_6 || version == JavaSdkVersion.JDK_1_7; } public static boolean targetHasId(@NotNull IAndroidTarget target, @NotNull String id) { From 3b672e3c4d7b74a949f7560bcf343c8db9772d2e Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Thu, 15 Dec 2011 20:31:34 +0400 Subject: [PATCH 095/101] IDEA-78833 android: update version string when internal jdk changed --- .../src/org/jetbrains/android/sdk/AndroidSdkConfigurable.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/android/src/org/jetbrains/android/sdk/AndroidSdkConfigurable.java b/plugins/android/src/org/jetbrains/android/sdk/AndroidSdkConfigurable.java index 6a55c277b1d2..677e291a257e 100644 --- a/plugins/android/src/org/jetbrains/android/sdk/AndroidSdkConfigurable.java +++ b/plugins/android/src/org/jetbrains/android/sdk/AndroidSdkConfigurable.java @@ -54,9 +54,11 @@ public class AndroidSdkConfigurable implements AdditionalDataConfigurable { @Override public void apply() throws ConfigurationException { - AndroidSdkAdditionalData newData = new AndroidSdkAdditionalData(mySdk, myForm.getSelectedSdk()); + final Sdk javaSdk = myForm.getSelectedSdk(); + AndroidSdkAdditionalData newData = new AndroidSdkAdditionalData(mySdk, javaSdk); newData.setBuildTarget(myForm.getSelectedBuildTarget()); final SdkModificator modificator = mySdk.getSdkModificator(); + modificator.setVersionString(javaSdk != null ? javaSdk.getVersionString() : null); modificator.setSdkAdditionalData(newData); ApplicationManager.getApplication().runWriteAction(new Runnable() { public void run() { From 10f3d1b980bc391d14824df0acd23ec1e77dc279 Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Thu, 15 Dec 2011 21:10:06 +0400 Subject: [PATCH 096/101] android: validation of non-reference attribute values --- .../jetbrains/android/dom/AndroidDomUtil.java | 7 ++++++- .../ResourceReferenceConverter.java | 9 +++++++-- .../dom/color/stateListHighlighting.xml | 2 +- .../dom/drawable/stateListHighlighting.xml | 2 +- plugins/android/testData/dom/layout/hl2.xml | 20 +++++++++++++++++++ .../android/testData/dom/layout/integers.xml | 3 +++ .../android/dom/AndroidLayoutDomTest.java | 5 +++++ 7 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 plugins/android/testData/dom/layout/hl2.xml create mode 100644 plugins/android/testData/dom/layout/integers.xml diff --git a/plugins/android/src/org/jetbrains/android/dom/AndroidDomUtil.java b/plugins/android/src/org/jetbrains/android/dom/AndroidDomUtil.java index 196279c8b7ba..2ef27684c52c 100644 --- a/plugins/android/src/org/jetbrains/android/dom/AndroidDomUtil.java +++ b/plugins/android/src/org/jetbrains/android/dom/AndroidDomUtil.java @@ -185,11 +185,16 @@ public class AndroidDomUtil { Set formats = attr.getFormats(); CompositeConverter composite = new CompositeConverter(); String[] values = attr.getValues(); + boolean containsUnsupportedFormats = false; + for (AttributeFormat format : formats) { ResolvingConverter converter = getStringConverter(format, values); if (converter != null) { composite.addConverter(converter); } + else { + containsUnsupportedFormats = true; + } } ResourceReferenceConverter resConverter = getResourceReferenceConverter(attr); if (formats.contains(AttributeFormat.Flag)) { @@ -200,7 +205,7 @@ public class AndroidDomUtil { } ResolvingConverter stringConverter = simplify(composite); if (resConverter != null) { - resConverter.setAdditionalConverter(simplify(composite)); + resConverter.setAdditionalConverter(simplify(composite), containsUnsupportedFormats); return resConverter; } return stringConverter; diff --git a/plugins/android/src/org/jetbrains/android/dom/converters/ResourceReferenceConverter.java b/plugins/android/src/org/jetbrains/android/dom/converters/ResourceReferenceConverter.java index 245b6e25f223..55c070b6fcd7 100644 --- a/plugins/android/src/org/jetbrains/android/dom/converters/ResourceReferenceConverter.java +++ b/plugins/android/src/org/jetbrains/android/dom/converters/ResourceReferenceConverter.java @@ -58,6 +58,7 @@ public class ResourceReferenceConverter extends ResolvingConverter myResourceTypes; private ResolvingConverter myAdditionalConverter; + private boolean myAdditionalConverterSoft = false; private boolean myWithPrefix = true; private boolean myWithExplicitResourceType = true; @@ -75,8 +76,9 @@ public class ResourceReferenceConverter extends ResolvingConverter additionalConverter) { + public void setAdditionalConverter(ResolvingConverter additionalConverter, boolean soft) { myAdditionalConverter = additionalConverter; + myAdditionalConverterSoft = soft; } @NotNull @@ -207,11 +209,14 @@ public class ResourceReferenceConverter extends ResolvingConverter - + <item android:state_middle="true"/> diff --git a/plugins/android/testData/dom/drawable/stateListHighlighting.xml b/plugins/android/testData/dom/drawable/stateListHighlighting.xml index da2f5046df18..1caff7ec01db 100644 --- a/plugins/android/testData/dom/drawable/stateListHighlighting.xml +++ b/plugins/android/testData/dom/drawable/stateListHighlighting.xml @@ -2,7 +2,7 @@ - + diff --git a/plugins/android/testData/dom/layout/hl2.xml b/plugins/android/testData/dom/layout/hl2.xml new file mode 100644 index 000000000000..26b4bc6d2728 --- /dev/null +++ b/plugins/android/testData/dom/layout/hl2.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/plugins/android/testData/dom/layout/integers.xml b/plugins/android/testData/dom/layout/integers.xml new file mode 100644 index 000000000000..5db353653531 --- /dev/null +++ b/plugins/android/testData/dom/layout/integers.xml @@ -0,0 +1,3 @@ + + 10 + \ No newline at end of file diff --git a/plugins/android/testSrc/org/jetbrains/android/dom/AndroidLayoutDomTest.java b/plugins/android/testSrc/org/jetbrains/android/dom/AndroidLayoutDomTest.java index ab688c5a7ece..75d73a68b32b 100644 --- a/plugins/android/testSrc/org/jetbrains/android/dom/AndroidLayoutDomTest.java +++ b/plugins/android/testSrc/org/jetbrains/android/dom/AndroidLayoutDomTest.java @@ -60,6 +60,11 @@ public class AndroidLayoutDomTest extends AndroidDomTest { doTestHighlighting("hl.xml"); } + public void testHighlighting2() throws Throwable { + copyFileToProject("integers.xml", "res/values/integers.xml"); + doTestHighlighting("hl2.xml"); + } + public void testCheckLayoutAttrs() throws Throwable { doTestHighlighting("layoutAttrs.xml"); } From 5dafa4d52eedda5a1f45af8fd5b960f92428c2fe Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 19 Dec 2011 16:22:15 +0400 Subject: [PATCH 097/101] optimize imports for template languages (JSP, JSPX, Facelets) --- .../lang/LanguageImportStatements.java | 20 ++++++++++++++----- .../actions/OptimizeImportsAction.java | 2 +- .../XmlUnusedNamespaceInspection.java | 16 +++++++++------ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/platform/lang-api/src/com/intellij/lang/LanguageImportStatements.java b/platform/lang-api/src/com/intellij/lang/LanguageImportStatements.java index 5fe4acefa9ce..cf7ae42ea17a 100644 --- a/platform/lang-api/src/com/intellij/lang/LanguageImportStatements.java +++ b/platform/lang-api/src/com/intellij/lang/LanguageImportStatements.java @@ -20,7 +20,11 @@ package com.intellij.lang; import com.intellij.psi.PsiFile; -import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; public class LanguageImportStatements extends LanguageExtension { public static final LanguageImportStatements INSTANCE = new LanguageImportStatements(); @@ -29,9 +33,15 @@ public class LanguageImportStatements extends LanguageExtension super("com.intellij.lang.importOptimizer"); } - @Nullable - public ImportOptimizer forFile(PsiFile file) { - ImportOptimizer optimizer = forLanguage(file.getLanguage()); - return optimizer != null && optimizer.supports(file) ? optimizer : null; + public List forFile(PsiFile file) { + List runnables = new ArrayList(); + Set optimizers = new HashSet(); + for (PsiFile psiFile : file.getViewProvider().getAllFiles()) { + ImportOptimizer optimizer = forLanguage(psiFile.getLanguage()); + if (optimizer != null && optimizer.supports(psiFile) && optimizers.add(optimizer)) { + runnables.add(optimizer.processFile(psiFile)); + } + } + return runnables; } } \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java index 951dbecd7c3c..416e2e4bc09b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsAction.java @@ -193,6 +193,6 @@ public class OptimizeImportsAction extends AnAction { } private static boolean isOptimizeImportsAvailable(final PsiFile file) { - return LanguageImportStatements.INSTANCE.forFile(file) != null; + return !LanguageImportStatements.INSTANCE.forFile(file).isEmpty(); } } diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnusedNamespaceInspection.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnusedNamespaceInspection.java index e1acc34b9356..009a89b175cd 100644 --- a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnusedNamespaceInspection.java +++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnusedNamespaceInspection.java @@ -73,21 +73,21 @@ public class XmlUnusedNamespaceInspection extends XmlSuppressableInspectionTool XmlAttributeValue value = attribute.getValueElement(); assert value != null; holder.registerProblem(attribute, "Namespace declaration is never used", ProblemHighlightType.LIKE_UNUSED_SYMBOL, - new RemoveNamespaceDeclarationFix(declaredPrefix)); + new RemoveNamespaceDeclarationFix(declaredPrefix, false)); XmlTag parent = attribute.getParent(); if (declaredPrefix.length() == 0) { XmlAttribute location = getDefaultLocation(parent); if (location != null) { holder.registerProblem(location, NAMESPACE_LOCATION_IS_NEVER_USED, ProblemHighlightType.LIKE_UNUSED_SYMBOL, - new RemoveNamespaceDeclarationFix(declaredPrefix)); + new RemoveNamespaceDeclarationFix(declaredPrefix, true)); } } else { for (PsiReference reference : getLocationReferences(namespace, parent)) { if (!XmlHighlightVisitor.hasBadResolve(reference, false)) holder.registerProblemForReference(reference, ProblemHighlightType.LIKE_UNUSED_SYMBOL, NAMESPACE_LOCATION_IS_NEVER_USED, - new RemoveNamespaceDeclarationFix(declaredPrefix)); + new RemoveNamespaceDeclarationFix(declaredPrefix, true)); } } } @@ -234,9 +234,11 @@ public class XmlUnusedNamespaceInspection extends XmlSuppressableInspectionTool public static final String NAME = "Remove unused namespace declaration"; protected final String myPrefix; + private final boolean myLocationFix; - private RemoveNamespaceDeclarationFix(@Nullable String prefix) { + private RemoveNamespaceDeclarationFix(@Nullable String prefix, boolean locationFix) { myPrefix = prefix; + myLocationFix = locationFix; } @NotNull @@ -328,7 +330,9 @@ public class XmlUnusedNamespaceInspection extends XmlSuppressableInspectionTool @Override public boolean equals(Object obj) { - return obj instanceof RemoveNamespaceDeclarationFix && Comparing.equal(myPrefix, ((RemoveNamespaceDeclarationFix)obj).myPrefix); + return obj instanceof RemoveNamespaceDeclarationFix && + Comparing.equal(myPrefix, ((RemoveNamespaceDeclarationFix)obj).myPrefix) && + (myLocationFix || ((RemoveNamespaceDeclarationFix)obj).myLocationFix); } @Override @@ -342,7 +346,7 @@ public class XmlUnusedNamespaceInspection extends XmlSuppressableInspectionTool public static final String NAME = "Remove unused namespace location"; private RemoveNamespaceLocationFix(String namespace) { - super(namespace); + super(namespace, true); } @NotNull From 5339ae5a1397f016e06bf0d9290781c5dcc43432 Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Mon, 19 Dec 2011 16:26:31 +0400 Subject: [PATCH 098/101] EA-32634 - assert: AbstractMappingStrategy.processFoldRegion Debug info is added --- .../com/intellij/diagnostic/LogMessageEx.java | 6 +-- .../mapping/SoftWrapApplianceManager.java | 43 +++++++++++++------ 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/diagnostic/LogMessageEx.java b/platform/platform-impl/src/com/intellij/diagnostic/LogMessageEx.java index f299f783b408..41d17cba65b9 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/LogMessageEx.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/LogMessageEx.java @@ -130,12 +130,12 @@ public class LogMessageEx extends LogMessage { }; } - public static void error(@NotNull Logger logger, @NotNull String message, @NotNull String... details) { + public static void error(@NotNull Logger logger, @NotNull String message, @NotNull String... attachmentText) { StringBuilder detailsBuffer = new StringBuilder(); - for (String detail : details) { + for (String detail : attachmentText) { detailsBuffer.append(detail).append(","); } - if (details.length > 0 && detailsBuffer.length() > 0) { + if (attachmentText.length > 0 && detailsBuffer.length() > 0) { detailsBuffer.setLength(detailsBuffer.length() - 1); } Attachment attachment = detailsBuffer.length() > 0 ? new Attachment("current-context.txt", detailsBuffer.toString()) : null; diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java index b9d800cbafb8..cb7e9f51571f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java @@ -15,7 +15,9 @@ */ package com.intellij.openapi.editor.impl.softwrap.mapping; +import com.intellij.diagnostic.LogMessageEx; import com.intellij.openapi.application.ex.ApplicationManagerEx; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.editor.event.DocumentListener; @@ -24,10 +26,7 @@ import com.intellij.openapi.editor.event.VisibleAreaListener; import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.openapi.editor.ex.ScrollingModelEx; import com.intellij.openapi.editor.ex.util.EditorUtil; -import com.intellij.openapi.editor.impl.EditorTextRepresentationHelper; -import com.intellij.openapi.editor.impl.FontInfo; -import com.intellij.openapi.editor.impl.IterationState; -import com.intellij.openapi.editor.impl.TextChangeImpl; +import com.intellij.openapi.editor.impl.*; import com.intellij.openapi.editor.impl.softwrap.*; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.util.text.StringUtil; @@ -54,7 +53,9 @@ import java.util.List; * @since Jul 5, 2010 10:01:27 AM */ public class SoftWrapApplianceManager implements SoftWrapFoldingListener, DocumentListener { - + + private static final Logger LOG = Logger.getInstance("#" + SoftWrapApplianceManager.class.getName()); + /** Enumerates possible type of soft wrap indents to use. */ enum IndentType { /** Don't apply special indent to soft-wrapped line at all. */ @@ -90,14 +91,15 @@ public class SoftWrapApplianceManager implements SoftWrapFoldingListener, Docume */ private int myLastTopLeftCornerOffset = -1; - private VisibleAreaWidthProvider myWidthProvider; - private LineWrapPositionStrategy myLineWrapPositionStrategy; - private boolean myVisualAreaListenerAttached; - private boolean myCustomIndentUsedLastTime; - private int myCustomIndentValueUsedLastTime; - private int myVisibleAreaWidth; - private boolean myInProgress; - private boolean myHasLinesWithFailedWrap; + private VisibleAreaWidthProvider myWidthProvider; + private LineWrapPositionStrategy myLineWrapPositionStrategy; + private IncrementalCacheUpdateEvent myEventBeingProcessed; + private boolean myVisualAreaListenerAttached; + private boolean myCustomIndentUsedLastTime; + private int myCustomIndentValueUsedLastTime; + private int myVisibleAreaWidth; + private boolean myInProgress; + private boolean myHasLinesWithFailedWrap; public SoftWrapApplianceManager(@NotNull SoftWrapsStorage storage, @NotNull EditorEx editor, @@ -172,16 +174,28 @@ public class SoftWrapApplianceManager implements SoftWrapFoldingListener, Docume List events = new ArrayList(myEventsStorage.getEvents()); myActiveEvents.addAll(events); myEventsStorage.release(); + if (myInProgress && !events.isEmpty()) { + String state = ""; + if (myEditor instanceof EditorImpl) { + state = ((EditorImpl)myEditor).dumpState(); + } + LogMessageEx.error(LOG, "Detected race condition at soft wraps recalculation", String.format( + "Current events: %s. Concurrent events: %s, event being processed: %s%n%s", + events, myActiveEvents, myEventBeingProcessed, state + )); + } myInProgress = true; myHasLinesWithFailedWrap = false; try { for (IncrementalCacheUpdateEvent event : events) { + myEventBeingProcessed = event; recalculateSoftWraps(event); } } finally { myInProgress = false; myActiveEvents.clear(); + myEventBeingProcessed = null; } updateLastTopLeftCornerOffset(); return true; @@ -896,7 +910,8 @@ public class SoftWrapApplianceManager implements SoftWrapFoldingListener, Docume @Override public String toString() { return String.format( - "recalculation in progress: %b; stored update events: %s; active update events: %s", myInProgress, myEventsStorage, myActiveEvents + "recalculation in progress: %b; stored update events: %s; active update events: %s, event being processed: %s", + myInProgress, myEventsStorage, myActiveEvents, myEventBeingProcessed ); } From 6dca2d11de4715120623a66362a0bd0c195ca030 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 19 Dec 2011 16:30:11 +0400 Subject: [PATCH 099/101] optimize imports for template languages (JSP, JSPX, Facelets) --- .../codeInsight/actions/LayoutCodeDialog.java | 2 +- .../actions/OptimizeImportsProcessor.java | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java index cfbc5907b75d..4e1f6f7deccb 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java @@ -103,7 +103,7 @@ public class LayoutCodeDialog extends DialogWrapper { myCbIncludeSubdirs.setEnabled(myRbDirectory.isSelected()); myCbOptimizeImports.setEnabled( !myRbSelectedText.isSelected() && - !(myFile != null && LanguageImportStatements.INSTANCE.forFile(myFile) == null && myRbFile.isSelected())); + !(myFile != null && LanguageImportStatements.INSTANCE.forFile(myFile).isEmpty() && myRbFile.isSelected())); final boolean canTargetVcsChanges = canTargetVcsRegions(); myCbOnlyVcsChangedRegions.setEnabled(canTargetVcsChanges); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsProcessor.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsProcessor.java index d16b9dcf3b46..f6ce2f44134e 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsProcessor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/OptimizeImportsProcessor.java @@ -17,7 +17,6 @@ package com.intellij.codeInsight.actions; import com.intellij.codeInsight.CodeInsightBundle; -import com.intellij.lang.ImportOptimizer; import com.intellij.lang.LanguageImportStatements; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; @@ -27,6 +26,7 @@ import com.intellij.psi.PsiFile; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; +import java.util.List; import java.util.concurrent.FutureTask; public class OptimizeImportsProcessor extends AbstractLayoutCodeProcessor { @@ -58,11 +58,16 @@ public class OptimizeImportsProcessor extends AbstractLayoutCodeProcessor { } @NotNull - protected FutureTask preprocessFile(@NotNull final PsiFile file, boolean processChangedTextOnly) - throws IncorrectOperationException - { - final ImportOptimizer optimizer = LanguageImportStatements.INSTANCE.forFile(file); - Runnable runnable = optimizer != null ? optimizer.processFile(file) : EmptyRunnable.getInstance(); + protected FutureTask preprocessFile(@NotNull final PsiFile file, boolean processChangedTextOnly) throws IncorrectOperationException { + final List optimizers = LanguageImportStatements.INSTANCE.forFile(file); + Runnable runnable = optimizers.isEmpty() ? EmptyRunnable.getInstance() : new Runnable() { + @Override + public void run() { + for (Runnable optimizer : optimizers) { + optimizer.run(); + } + } + }; return new FutureTask(runnable, true); } } From 78647aba0975780a527048f57a19fa7bd09f6f6d Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Mon, 19 Dec 2011 17:06:19 +0400 Subject: [PATCH 100/101] use toolwindow title tabs instead of tabbed component inside structure view --- .../ide/impl/StructureViewWrapperImpl.java | 87 ++++++++++++------- .../impl/StructureViewComposite.java | 18 +--- .../impl/StructureViewFactoryImpl.java | 9 +- 3 files changed, 59 insertions(+), 55 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java index fd367547323d..911ec07db1db 100644 --- a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java @@ -22,6 +22,7 @@ import com.intellij.ide.projectView.impl.ProjectRootsUtil; import com.intellij.ide.structureView.StructureView; import com.intellij.ide.structureView.StructureViewBuilder; import com.intellij.ide.structureView.StructureViewWrapper; +import com.intellij.ide.structureView.impl.StructureViewComposite; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ModalityState; @@ -43,6 +44,9 @@ import com.intellij.openapi.wm.ToolWindowId; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; import com.intellij.psi.PsiDocumentManager; +import com.intellij.ui.content.Content; +import com.intellij.ui.content.ContentFactory; +import com.intellij.ui.content.ContentManager; import com.intellij.util.ui.UIUtil; import com.intellij.util.ui.update.MergingUpdateQueue; import com.intellij.util.ui.update.Update; @@ -59,13 +63,14 @@ import java.awt.event.HierarchyListener; */ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposable { private final Project myProject; + private final ToolWindow myToolWindow; private VirtualFile myFile; private StructureView myStructureView; private ModuleStructureComponent myModuleStructureComponent; - private final JPanel myPanel; + private JPanel[] myPanels = new JPanel[0]; private final MergingUpdateQueue myUpdateQueue; private final String myKey = new String("DATA_SELECTOR"); @@ -75,17 +80,16 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl private Runnable myPendingSelection; - public StructureViewWrapperImpl(Project project) { + public StructureViewWrapperImpl(Project project, ToolWindow toolWindow) { myProject = project; - myPanel = new ContentPanel(); - myPanel.setBackground(UIUtil.getTreeTextBackground()); - - myUpdateQueue = new MergingUpdateQueue("StructureView", Registry.intValue("structureView.coalesceTime"), false, myPanel, this, myPanel, true); + myToolWindow = toolWindow; + + myUpdateQueue = new MergingUpdateQueue("StructureView", Registry.intValue("structureView.coalesceTime"), false, myToolWindow.getComponent(), this, myToolWindow.getComponent(), true); myUpdateQueue.setRestartTimerOnAdd(true); ActionManager.getInstance().addTimerListener(500, new TimerListener() { public ModalityState getModalityState() { - return ModalityState.stateForComponent(myPanel); + return ModalityState.stateForComponent(myToolWindow.getComponent()); } public void run() { @@ -93,20 +97,21 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl } }); - getComponent().addHierarchyListener(new HierarchyListener() { + myToolWindow.getComponent().addHierarchyListener(new HierarchyListener() { public void hierarchyChanged(HierarchyEvent e) { if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) { scheduleRebuild(); } } }); + Disposer.register(myToolWindow.getContentManager(), this); } private void checkUpdate() { if (myProject.isDisposed()) return; final Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); - if (SwingUtilities.isDescendingFrom(myPanel, owner) || JBPopupFactory.getInstance().isPopupActive()) return; + if (SwingUtilities.isDescendingFrom(myToolWindow.getComponent(), owner) || JBPopupFactory.getInstance().isPopupActive()) return; final DataContext dataContext = DataManager.getInstance().getDataContext(owner); if (dataContext.getData(myKey) == this) return; @@ -133,10 +138,6 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl // StructureView interface implementation // ------------------------------------------------------------------------- - public JComponent getComponent() { - return myPanel; - } - public void dispose() { rebuild(); } @@ -202,8 +203,8 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl myModuleStructureComponent = null; } - myPanel.removeAll(); - + final ContentManager contentManager = myToolWindow.getContentManager(); + contentManager.removeAllContents(true); if (!isStructureViewShowing()) { return; } @@ -216,19 +217,16 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl } } + String[] names = new String[] {""}; + JComponent focusedComponent = null; if (file != null && file.isValid()) { if (file.isDirectory()) { if (ProjectRootsUtil.isModuleContentRoot(file, myProject)) { Module module = ModuleUtil.findModuleForFile(file, myProject); if (module != null) { myModuleStructureComponent = new ModuleStructureComponent(module); - myPanel.add(myModuleStructureComponent, BorderLayout.CENTER); - if (hadFocus) { - JComponent focusedComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myModuleStructureComponent); - if (focusedComponent != null) { - IdeFocusManager.getInstance(myProject).requestFocus(focusedComponent, true); - } - } + focusedComponent = hadFocus ? IdeFocusTraversalPolicy.getPreferredFocusedComponent(myModuleStructureComponent) : null; + createSinglePanel(myModuleStructureComponent.getComponent()); } } } @@ -246,13 +244,22 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl if (myStructureView instanceof StructureView.Scrollable) { ((StructureView.Scrollable)myStructureView).setReferenceSizeWhileInitializing(referenceSize); } - myPanel.add(myStructureView.getComponent(), BorderLayout.CENTER); - if (hadFocus) { - JComponent focusedComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myStructureView.getComponent()); - if (focusedComponent != null) { - IdeFocusManager.getInstance(myProject).requestFocus(focusedComponent, true); + + final StructureViewComposite.StructureViewDescriptor[] views; + + if (myStructureView instanceof StructureViewComposite) { + final StructureViewComposite composite = (StructureViewComposite)myStructureView; + views = composite.getStructureViews(); + myPanels = new JPanel[views.length]; + names = new String[views.length]; + for (int i = 0; i < myPanels.length; i++) { + myPanels[i] = createContentPanel(views[i].structureView.getComponent()); + names[i] = views[i].title; } + } else { + createSinglePanel(myStructureView.getComponent()); } + focusedComponent = hadFocus ? IdeFocusTraversalPolicy.getPreferredFocusedComponent(myStructureView.getComponent()) : null; myStructureView.restoreState(); myStructureView.centerSelectedRow(); } @@ -264,11 +271,19 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl } if (myModuleStructureComponent == null && myStructureView == null) { - myPanel.add(new JLabel(IdeBundle.message("message.nothing.to.show.in.structure.view"), SwingConstants.CENTER), BorderLayout.CENTER); + createSinglePanel(new JLabel(IdeBundle.message("message.nothing.to.show.in.structure.view"), SwingConstants.CENTER)); } - myPanel.validate(); - myPanel.repaint(); + for (int i = 0; i < myPanels.length; i++) { + final Content content = ContentFactory.SERVICE.getInstance().createContent(myPanels[i], names[i], false); + contentManager.addContent(content); + if (i == 0 && myStructureView != null) { + Disposer.register(content, myStructureView); + } + } + if (hadFocus && focusedComponent != null) { + IdeFocusManager.getInstance(myProject).requestFocus(focusedComponent, true); + } if (myPendingSelection != null) { Runnable selection = myPendingSelection; @@ -277,6 +292,18 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl } } + private void createSinglePanel(final JComponent component) { + myPanels = new JPanel[1]; + myPanels[0] = createContentPanel(component); + } + + private ContentPanel createContentPanel(JComponent component) { + final ContentPanel panel = new ContentPanel(); + panel.setBackground(UIUtil.getTreeTextBackground()); + panel.add(component, BorderLayout.CENTER); + return panel; + } + @Nullable private FileEditor createTempFileEditor(VirtualFile file) { FileEditorProviderManager editorProviderManager = FileEditorProviderManager.getInstance(); diff --git a/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewComposite.java b/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewComposite.java index 2928ac34fcce..dcf277dac1ca 100644 --- a/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewComposite.java +++ b/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewComposite.java @@ -20,12 +20,9 @@ import com.intellij.ide.structureView.StructureView; import com.intellij.ide.structureView.StructureViewModel; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.util.Disposer; -import com.intellij.ui.TabbedPaneWrapper; import org.jetbrains.annotations.NotNull; import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; /** * @author cdr @@ -33,8 +30,6 @@ import javax.swing.event.ChangeListener; public class StructureViewComposite implements StructureView { @NotNull private final StructureViewDescriptor[] myStructureViews; @NotNull private StructureViewDescriptor mySelectedViewDescriptor; - @NotNull private final TabbedPaneWrapper myTabbedPaneWrapper; - public static class StructureViewDescriptor { public final String title; public final StructureView structureView; @@ -53,17 +48,6 @@ public class StructureViewComposite implements StructureView { Disposer.register(this, descriptor.structureView); } mySelectedViewDescriptor = views[0]; - myTabbedPaneWrapper = new TabbedPaneWrapper(this); - for (StructureViewDescriptor descriptor : views) { - myTabbedPaneWrapper.addTab(descriptor.title, descriptor.icon, descriptor.structureView.getComponent(), null); - } - myTabbedPaneWrapper.setSelectedIndex(0); - myTabbedPaneWrapper.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - int index = myTabbedPaneWrapper.getSelectedIndex(); - mySelectedViewDescriptor = myStructureViews[index]; - } - }); } public StructureView getSelectedStructureView() { @@ -84,7 +68,7 @@ public class StructureViewComposite implements StructureView { } public JComponent getComponent() { - return myTabbedPaneWrapper.getComponent(); + return mySelectedViewDescriptor.structureView.getComponent(); } public void dispose() { diff --git a/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewFactoryImpl.java b/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewFactoryImpl.java index 18f50d1dca1c..4cd736adca3d 100644 --- a/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewFactoryImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewFactoryImpl.java @@ -25,14 +25,11 @@ import com.intellij.openapi.components.Storage; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.MultiValuesMap; import com.intellij.openapi.util.NotNullLazyValue; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.wm.ToolWindow; import com.intellij.psi.PsiElement; -import com.intellij.ui.content.Content; -import com.intellij.ui.content.ContentFactory; import com.intellij.util.ReflectionCache; import org.jetbrains.annotations.NotNull; @@ -96,11 +93,7 @@ public final class StructureViewFactoryImpl extends StructureViewFactoryEx imple } public void initToolWindow(ToolWindow toolWindow) { - myStructureViewWrapperImpl = new StructureViewWrapperImpl(myProject); - final Content content = ContentFactory.SERVICE.getInstance().createContent(myStructureViewWrapperImpl.getComponent(), "", false); - Disposer.register(content, myStructureViewWrapperImpl); - toolWindow.getContentManager().addContent(content); - + myStructureViewWrapperImpl = new StructureViewWrapperImpl(myProject, toolWindow); if (myRunWhenInitialized != null) { myRunWhenInitialized.run(); myRunWhenInitialized = null; From 35162f1f3ed19a4d8a20bf1ca214ae3117032d71 Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Mon, 19 Dec 2011 17:11:04 +0400 Subject: [PATCH 101/101] remove view from structure view tabs --- .../platform-resources-en/src/messages/IdeBundle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index e58fb3eac2e1..0f0ffb142a7a 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -565,8 +565,8 @@ action.structureview.show.non.public=Show non-public node.structureview.invalid= action.structureview.group.methods.by.defining.type=Group Methods by Defining Type action.structureview.sort.by.visibility=Sort by Visibility -tab.structureview.jsp.view=JSP View -tab.structureview.baselanguage.view={0} View +tab.structureview.jsp.view=JSP +tab.structureview.baselanguage.view={0} action.next.todo=Next TODO action.previous.todo=Previous TODO action.filter.todo.items=Filter TODO Items