Merge remote-tracking branch 'origin/master'

This commit is contained in:
Alexander Lobas
2012-04-11 14:17:57 +04:00
49 changed files with 1235 additions and 650 deletions
@@ -414,7 +414,7 @@ public class PostHighlightingPass extends TextEditorHighlightingPass {
HighlightInfo highlightInfo = suggestionsToMakeFieldUsed(field, identifier, message);
if (!field.hasInitializer()) {
QuickFixAction.registerQuickFixAction(highlightInfo, HighlightMethodUtil.getFixRange(field), new CreateConstructorParameterFromFieldFix(field), null);
QuickFixAction.registerQuickFixAction(highlightInfo, HighlightMethodUtil.getFixRange(field), new CreateConstructorParameterFromFieldFix(field));
}
return highlightInfo;
}
@@ -434,7 +434,7 @@ public class PostHighlightingPass extends TextEditorHighlightingPass {
final HighlightInfo info = createUnusedSymbolInfo(identifier, message, HighlightInfoType.UNUSED_SYMBOL);
QuickFixAction.registerQuickFixAction(info, new CreateGetterOrSetterFix(false, true, field), myUnusedSymbolKey);
QuickFixAction.registerQuickFixAction(info, HighlightMethodUtil.getFixRange(field), new CreateConstructorParameterFromFieldFix(field), null);
QuickFixAction.registerQuickFixAction(info, HighlightMethodUtil.getFixRange(field), new CreateConstructorParameterFromFieldFix(field));
SpecialAnnotationsUtil.createAddToSpecialAnnotationFixes(field, new Processor<String>() {
@Override
public boolean process(final String annoName) {
@@ -287,7 +287,7 @@ public class HighlightControlFlowUtil {
String description = JavaErrorMessages.message("variable.not.initialized", field.getName());
TextRange range = HighlightNamesUtil.getFieldDeclarationTextRange(field);
final HighlightInfo highlightInfo = HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, range.getStartOffset(), range.getEndOffset(), description);
QuickFixAction.registerQuickFixAction(highlightInfo, HighlightMethodUtil.getFixRange(field), new CreateConstructorParameterFromFieldFix(field), null);
QuickFixAction.registerQuickFixAction(highlightInfo, HighlightMethodUtil.getFixRange(field), new CreateConstructorParameterFromFieldFix(field));
final PsiClass containingClass = field.getContainingClass();
if (containingClass != null && !containingClass.isInterface()) {
IntentionAction fix = QUICK_FIX_FACTORY.createModifierListFix(field, PsiModifier.FINAL, false, false);
@@ -359,9 +359,9 @@ public class HighlightMethodUtil {
}
else {
TextRange range = getFixRange(methodCall);
QuickFixAction.registerQuickFixAction(highlightInfo, range, new CreateMethodFromUsageFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, range, new CreateAbstractMethodFromUsageFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, range, new CreatePropertyFromUsageFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, range, new CreateMethodFromUsageFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, range, new CreateAbstractMethodFromUsageFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, range, new CreatePropertyFromUsageFix(methodCall));
}
}
}
@@ -487,11 +487,11 @@ public class HighlightMethodUtil {
PsiMethodCallExpression methodCall,
PsiExpressionList list, PsiResolveHelper resolveHelper) {
TextRange fixRange = getFixRange(methodCall);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreateMethodFromUsageFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreateAbstractMethodFromUsageFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreateConstructorFromSuperFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreateConstructorFromThisFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreatePropertyFromUsageFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreateMethodFromUsageFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreateAbstractMethodFromUsageFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreateConstructorFromSuperFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreateConstructorFromThisFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new CreatePropertyFromUsageFix(methodCall));
CandidateInfo[] methodCandidates = resolveHelper.getReferencedMethodCandidates(methodCall, false);
CastMethodArgumentFix.REGISTRAR.registerCastActions(methodCandidates, methodCall, highlightInfo, fixRange);
PermuteArgumentsFix.registerFix(highlightInfo, methodCall, methodCandidates, fixRange);
@@ -502,11 +502,11 @@ public class HighlightMethodUtil {
WrapExpressionFix.registerWrapAction(methodCandidates, list.getExpressions(), highlightInfo);
ChangeParameterClassFix.registerQuickFixActions(methodCall, list, highlightInfo);
if (methodCandidates.length == 0) {
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new StaticImportMethodFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new StaticImportMethodFix(methodCall));
}
VariableTypeFromCallFix.registerQuickFixActions(methodCall, list, highlightInfo);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new ReplaceAddAllArrayToCollectionFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new SurroundWithArrayFix(methodCall), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new ReplaceAddAllArrayToCollectionFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new SurroundWithArrayFix(methodCall));
QualifyThisArgumentFix.registerQuickFixAction(methodCandidates, methodCall, highlightInfo, fixRange);
CandidateInfo[] candidates = resolveHelper.getReferencedMethodCandidates(methodCall, true);
@@ -1209,7 +1209,7 @@ public class HighlightMethodUtil {
String description = JavaErrorMessages.message("wrong.constructor.arguments", constructorName+"()", argTypes);
String tooltip = createMismatchedArgumentsHtmlTooltip(list, PsiParameter.EMPTY_ARRAY, constructorName, PsiSubstitutor.EMPTY, aClass);
HighlightInfo info = HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, list, description, tooltip);
QuickFixAction.registerQuickFixAction(info, constructorCall.getTextRange(), new CreateConstructorFromCallFix(constructorCall), null);
QuickFixAction.registerQuickFixAction(info, constructorCall.getTextRange(), new CreateConstructorFromCallFix(constructorCall));
if (classReference != null) {
ConstructorParametersFixer.registerFixActions(classReference, constructorCall, info,getFixRange(list));
}
@@ -1247,7 +1247,7 @@ public class HighlightMethodUtil {
name += buildArgTypesList(list);
String description = JavaErrorMessages.message("cannot.resolve.constructor", name);
HighlightInfo info = HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, list, description, XmlStringUtil.escapeString(description));
QuickFixAction.registerQuickFixAction(info, constructorCall.getTextRange(), new CreateConstructorFromCallFix(constructorCall), null);
QuickFixAction.registerQuickFixAction(info, constructorCall.getTextRange(), new CreateConstructorFromCallFix(constructorCall));
if (classReference != null) {
ConstructorParametersFixer.registerFixActions(classReference, constructorCall, info,getFixRange(list));
PermuteArgumentsFix.registerFix(info, constructorCall, toMethodCandidates(results), getFixRange(list));
@@ -1270,14 +1270,14 @@ public class HighlightMethodUtil {
String toolTip = createMismatchedArgumentsHtmlTooltip(result, list);
PsiElement infoElement = list.getTextLength() > 0 ? list : constructorCall;
HighlightInfo info = HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, infoElement, description, toolTip);
QuickFixAction.registerQuickFixAction(info, constructorCall.getTextRange(), new CreateConstructorFromCallFix(constructorCall), null);
QuickFixAction.registerQuickFixAction(info, constructorCall.getTextRange(), new CreateConstructorFromCallFix(constructorCall));
if (classReference != null) {
ConstructorParametersFixer.registerFixActions(classReference, constructorCall, info, getFixRange(infoElement));
ChangeMethodSignatureFromUsageFix.registerIntentions(results, list, info, null);
ConvertDoubleToFloatFix.registerIntentions(results, list, info, null);
PermuteArgumentsFix.registerFix(info, constructorCall, toMethodCandidates(results), getFixRange(list));
ChangeParameterClassFix.registerQuickFixActions(constructorCall, list, info);
QuickFixAction.registerQuickFixAction(info, getFixRange(list), new SurroundWithArrayFix(constructorCall), null);
QuickFixAction.registerQuickFixAction(info, getFixRange(list), new SurroundWithArrayFix(constructorCall));
}
info.navigationShift = +1;
holder.add(info);
@@ -288,7 +288,7 @@ public class HighlightUtil {
if (ref != null) {
fixRange = fixRange.union(ref.getTextRange());
}
QuickFixAction.registerQuickFixAction(errorResult, fixRange, fix, null);
QuickFixAction.registerQuickFixAction(errorResult, fixRange, fix);
}
}
}
@@ -145,7 +145,7 @@ public class AddTypeArgumentsConditionalFix implements IntentionAction {
if (substitutedType != null && TypeConversionUtil.isAssignable(lType, substitutedType)) {
QuickFixAction.registerQuickFixAction(highlightInfo,
thenExpression.getTextRange(),
new AddTypeArgumentsConditionalFix(substitutor, (PsiMethodCallExpression)thenExpression, method), null);
new AddTypeArgumentsConditionalFix(substitutor, (PsiMethodCallExpression)thenExpression, method));
}
}
}
@@ -99,7 +99,7 @@ public abstract class ArgumentFixerActionFactory {
JavaResolveResult resolveResult = newCall.resolveMethodGenerics();
if (resolveResult.getElement() != null && resolveResult.isValidResult()) {
suggestedCasts.add(parameterType.getCanonicalText());
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, createFix(list, i, parameterType),null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, createFix(list, i, parameterType));
}
}
}
@@ -479,8 +479,8 @@ public class ChangeMethodSignatureFromUsageFix implements IntentionAction, HighP
PsiSubstitutor substitutor = candidate.getSubstitutor();
if (method != null && context.getManager().isInProject(method)) {
ChangeMethodSignatureFromUsageFix fix = new ChangeMethodSignatureFromUsageFix(method, expressions, substitutor, context, false, 2);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, fix, null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new ChangeMethodSignatureFromUsageReverseOrderFix(method, expressions, substitutor, context, false, 2), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, fix);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new ChangeMethodSignatureFromUsageReverseOrderFix(method, expressions, substitutor, context, false, 2));
}
}
@@ -105,7 +105,7 @@ public class ConvertDoubleToFloatFix implements IntentionAction {
PsiParameter parameter = parameters[i];
final PsiExpression expression = expressions[i];
if (expression instanceof PsiLiteralExpression && PsiType.FLOAT.equals(parameter.getType()) && PsiType.DOUBLE.equals(expression.getType())) {
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new ConvertDoubleToFloatFix(expression), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new ConvertDoubleToFloatFix(expression));
}
}
}
@@ -114,7 +114,7 @@ public class PermuteArgumentsFix implements IntentionAction {
}
if (permutations.size() == 1) {
PermuteArgumentsFix fix = new PermuteArgumentsFix(callExpression, permutations.get(0));
QuickFixAction.registerQuickFixAction(info, fixRange, fix, null);
QuickFixAction.registerQuickFixAction(info, fixRange, fix);
}
}
@@ -111,7 +111,7 @@ public class QualifyThisArgumentFix extends PsiElementBaseIntentionAction {
if (!TypeConversionUtil.isAssignable(parameterType, exprType)) {
final PsiClass psiClass = PsiUtil.resolveClassInClassTypeOnly(parameterType);
if (psiClass != null && containingClasses.contains(psiClass)) {
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new QualifyThisArgumentFix((PsiThisExpression)expression, psiClass), null);
QuickFixAction.registerQuickFixAction(highlightInfo, fixRange, new QualifyThisArgumentFix((PsiThisExpression)expression, psiClass));
}
}
}
@@ -158,7 +158,7 @@ public class WrapExpressionFix implements IntentionAction {
}
if (expectedType != null) {
QuickFixAction.registerQuickFixAction(highlightInfo, expr.getTextRange(), new WrapExpressionFix(expectedType, expr), null);
QuickFixAction.registerQuickFixAction(highlightInfo, expr.getTextRange(), new WrapExpressionFix(expectedType, expr));
}
}
@@ -373,6 +373,7 @@ public class UnusedDeclarationInspection extends FilteringInspectionTool {
@Override public void visitClass(RefClass aClass) {
final PsiClass psiClass = aClass.getElement();
if (psiClass == null) return;
if (
isAddAppletEnabled() && aClass.isApplet() ||
isAddServletEnabled() && aClass.isServlet()) {
@@ -0,0 +1,9 @@
Compiling files:
src/Util.java
End of files
Cleaning output files:
out/production/addClass/Client.class
End of files
Compiling files:
src/Client.java
End of files
@@ -0,0 +1 @@
addClass
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<defaultAnt bundledAnt="true" />
</component>
</project>
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="?*.properties" />
<entry name="?*.xml" />
<entry name="?*.gif" />
<entry name="?*.png" />
<entry name="?*.jpeg" />
<entry name="?*.jpg" />
<entry name="?*.html" />
<entry name="?*.dtd" />
<entry name="?*.tld" />
<entry name="?*.ftl" />
</wildcardResourcePatterns>
<annotationProcessing enabled="false" useClasspath="true" />
</component>
</project>
@@ -0,0 +1,5 @@
<component name="CopyrightManager">
<settings default="">
<module2copyright />
</settings>
</component>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA jdk" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/addClass.iml" filepath="$PROJECT_DIR$/addClass.iml" />
<module fileurl="file://$PROJECT_DIR$/common/common.iml" filepath="$PROJECT_DIR$/common/common.iml" />
</modules>
</component>
</project>
@@ -0,0 +1,5 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>
@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
</component>
</project>
@@ -0,0 +1,559 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="be875bae-1db2-477c-abf6-574af12c7ca3" name="Default" comment="" />
<ignored path="addClass.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DebuggerManager">
<breakpoint_any>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
<breakpoint_rules />
<ui_properties />
</component>
<component name="FavoritesManager">
<favorites_list name="addClass" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="Util.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/common/src/Util.java">
<provider selected="true" editor-type-id="text-editor">
<state line="8" column="18" selection-start="187" selection-end="187" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Client.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Client.java">
<provider selected="true" editor-type-id="text-editor">
<state line="9" column="12" selection-start="189" selection-end="189" vertical-scroll-proportion="0.16605166">
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager>
</component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/common/src/Util.java" />
<option value="$PROJECT_DIR$/src/Client.java" />
<option value="$PROJECT_DIR$/src/Util.java" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="25" />
<option name="width" value="1280" />
<option name="height" value="974" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="Scope">
<subPane subId="Project Files">
<PATH>
<PATH_ELEMENT USER_OBJECT="Root">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="addClass" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="addClass" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="addClass" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="addClass" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="addClass" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="addClass" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="addClass" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="common" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="addClass" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="addClass" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="common" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.0" />
<property name="options.splitter.main.proportions" value="0.3" />
<property name="MemberChooser.sorted" value="false" />
<property name="options.lastSelected" value="project.propCompiler" />
<property name="project.structure.side.proportion" value="0.0" />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
<property name="options.splitter.details.proportions" value="0.2" />
<property name="options.searchVisible" value="true" />
</component>
<component name="RunManager">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m" />
<option name="PROGRAM_PARAMETERS" />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<list size="0" />
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="mySSHConnectionTimeout" value="30000" />
<option name="mySSHReadTimeout" value="30000" />
<option name="LAST_MERGED_REVISION" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="DETECT_NESTED_COPIES" value="true" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<option name="FORCE_UPDATE" value="false" />
<configuration useDefault="false">$USER_HOME$/.subversion_IDEA</configuration>
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<created>1334130093404</created>
<updated>1334130093404</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="25" width="1280" height="974" extended-state="0" />
<editor active="false" />
<layout>
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="JetGradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32897863" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.6710214" order="0" side_tool="false" content_ui="combo" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="CHECK_NEW_TODO" value="true" />
<option name="myTodoPanelSettings">
<value>
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="false" />
</value>
</option>
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
<option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
<option name="SHORT_DIFF_HORISONTALLY" value="true" />
<option name="SHORT_DIFF_EXTRA_LINES" value="2" />
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
<option name="CREATE_PATCH_EXPAND_DETAILS_DEFAULT" value="true" />
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
<option name="LAST_COMMIT_MESSAGE" />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
<option name="ACTIVE_VCS_NAME" />
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/common/src/Util.java">
<provider selected="true" editor-type-id="text-editor">
<state line="8" column="18" selection-start="187" selection-end="187" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Client.java">
<provider selected="true" editor-type-id="text-editor">
<state line="9" column="12" selection-start="189" selection-end="189" vertical-scroll-proportion="0.16605166">
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>No facets are configured</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<last-edited>Gant</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>IDEA jdk</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>addClass</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
<option value="0.5" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>IDEA jdk</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.20000002" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
@@ -0,0 +1,5 @@
public class Util {
public static void foo (int x) {
}
}
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="IDEA jdk" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="common" />
</component>
</module>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
@@ -0,0 +1,12 @@
/**
* Created with IntelliJ IDEA.
* User: db
* Date: 11.04.12
* Time: 11:43
* To change this template use File | Settings | File Templates.
*/
public class Util {
public static void foo () {
}
}
@@ -0,0 +1,12 @@
/**
* Created with IntelliJ IDEA.
* User: db
* Date: 11.04.12
* Time: 11:43
* To change this template use File | Settings | File Templates.
*/
public class Client {
{
Util.foo();
}
}
@@ -77,6 +77,10 @@ public class CommonTest extends IncrementalTestCase {
}
public void testDeleteClass4() throws Exception {
doTest();
doTest();
}
public void testAddClass() throws Exception {
doTest();
}
}
@@ -4,7 +4,6 @@ import com.intellij.ant.InstrumentationUtil
import com.intellij.ant.InstrumentationUtil.FormInstrumenter
import com.intellij.ant.PrefixedPath
import com.intellij.compiler.instrumentation.InstrumentationClassFinder
import org.jetbrains.jps.builders.javacApi.Java16ApiCompilerRunner
import org.jetbrains.jps.*
/**
@@ -26,17 +25,6 @@ class JavacBuilder implements ModuleBuilder, ModuleCycleBuilder {
String sourceLevel = module.languageLevel
String targetLevel = module.languageLevel
String customArgs = module["javac_args"]; // it seems javac_args property is not set, can we drop it?
if (projectBuilder.useInProcessJavac) {
String version = System.getProperty("java.version")
if (true) {
if (Java16ApiCompilerRunner.compile(module, projectBuilder, state, sourceLevel, targetLevel, customArgs)) {
return
}
}
else {
projectBuilder.info("In-process Javac won't be used for '${module.name}', because Java version ($version) doesn't match to source level ($sourceLevel)")
}
}
def params = [:]
params.destdir = state.targetFolder
@@ -1,112 +0,0 @@
package org.jetbrains.jps.builders.javacApi
import org.jetbrains.jps.ModuleBuildState
import org.jetbrains.jps.ModuleChunk
import org.jetbrains.jps.ProjectBuilder
import org.jetbrains.jps.Sdk
import org.jetbrains.jps.builders.JavaFileCollector
import javax.tools.JavaCompiler
import javax.tools.JavaCompiler.CompilationTask
import javax.tools.JavaFileObject
import javax.tools.StandardLocation
import javax.tools.ToolProvider
/**
* @author nik
*/
class Java16ApiCompiler {
private static instance
private OptimizedFileManager fileManager
private JavaCompiler compiler
static Java16ApiCompiler getInstance() {
if (instance == null) {
instance = new Java16ApiCompiler()
}
return instance
}
def Java16ApiCompiler() {
compiler = ToolProvider.getSystemJavaCompiler()
fileManager = new OptimizedFileManager();
}
def compile(ModuleChunk chunk, ProjectBuilder projectBuilder, ModuleBuildState state, String sourceLevel, String targetLevel, String customArgs) {
List<String> options = []
if (customArgs != null) {
options << customArgs
}
if (sourceLevel != null) {
options << "-source"
options << sourceLevel
}
if (targetLevel != null) {
options << "-target"
options << targetLevel
}
options << "-g"
options << "-nowarn"
List<File> filesToCompile = []
Set<File> excluded = state.excludes.collect { new File(it.toString()) }
state.sourceRoots.each {
JavaFileCollector.collectRecursively(new File(it.toString()), filesToCompile, excluded)
}
if (filesToCompile.size() > 0) {
fileManager.setLocation(StandardLocation.CLASS_OUTPUT, [new File(state.targetFolder)])
List<File> classpath = []
List<File> bootclasspath = []
StringBuilder cp = new StringBuilder()
Sdk sdk = chunk.getSdk()
if (sdk != null) {
sdk.classpath.each { bootclasspath << new File(String.valueOf(it)) }
fileManager.setLocation(StandardLocation.PLATFORM_CLASS_PATH, bootclasspath)
}
state.classpath.each {
classpath << new File(String.valueOf(it))
cp.append(String.valueOf(it))
cp.append(File.pathSeparator)
}
cp.append(state.targetFolder)
fileManager.setLocation(StandardLocation.CLASS_PATH, classpath)
fileManager.setProperties(state.callback, toURLs(cp.toString()))
Iterable<? extends JavaFileObject> toCompile = fileManager.getJavaFileObjectsFromFiles(filesToCompile)
StringWriter out = new StringWriter()
CompilationTask task = compiler.getTask(new PrintWriter(out), fileManager, null, options, null, toCompile)
if (!task.call()) {
projectBuilder.buildInfoPrinter.printCompilationErrors(projectBuilder, "javac", out.toString())
projectBuilder.error("Compilation failed")
}
else {
System.out.println(out.toString());
}
projectBuilder.listeners*.onJavaFilesCompiled(chunk, filesToCompile.size())
}
else {
projectBuilder.info("No java source files found in '${chunk.name}', skipping compilation")
}
}
private URL[] toURLs(final String classPath) {
final List urls = new ArrayList();
for (StringTokenizer tokenizer = new StringTokenizer(classPath, File.pathSeparator); tokenizer.hasMoreTokens();) {
final String s = tokenizer.nextToken();
urls.add(new File(s).toURL());
}
return (URL[])urls.toArray(new URL[urls.size()]);
}
}
@@ -1,34 +0,0 @@
package org.jetbrains.jps.builders.javacApi
import org.jetbrains.jps.ModuleBuildState
import org.jetbrains.jps.ModuleChunk
import org.jetbrains.jps.ProjectBuilder
/**
* @author nik
*/
class Java16ApiCompilerRunner {
private static boolean notAvailable
static boolean compile(ModuleChunk chunk, ProjectBuilder projectBuilder, ModuleBuildState state, String sourceLevel, String targetLevel, String customArgs) {
if (notAvailable) {
return false
}
try {
Java16ApiCompiler compiler = Java16ApiCompiler.getInstance()
compiler.compile(chunk, projectBuilder, state, sourceLevel, targetLevel, customArgs)
return true
}
catch (NoClassDefFoundError error) {
projectBuilder.warning("Java 1.6 API compiler is not available")
notAvailable = true
}
catch (Exception e) {
e.printStackTrace()
projectBuilder.warning("Compilation failed with exception for '${chunk.name}'")
throw e
}
return false
}
}
@@ -1,257 +0,0 @@
package org.jetbrains.jps.builders.javacApi;
import com.intellij.ant.InstrumentationUtil;
import com.intellij.compiler.instrumentation.InstrumentationClassFinder;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.DefaultFileManager;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.ListBuffer;
import org.jetbrains.asm4.ClassReader;
import org.jetbrains.ether.dependencyView.Callbacks;
import org.jetbrains.jps.PathUtil;
import javax.lang.model.SourceVersion;
import javax.tools.*;
import java.io.*;
import java.lang.reflect.Field;
import java.net.URL;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* @author nik
*/
public class OptimizedFileManager extends DefaultFileManager {
private interface DelayedClassFileWriter {
public void commit() throws IOException;
}
private java.util.List<DelayedClassFileWriter> myWriters = new ArrayList<DelayedClassFileWriter>();
private boolean myUseZipFileIndex;
private final Map<File, Archive> myArchives;
private final Map<File, Boolean> myIsFile = new ConcurrentHashMap<File, Boolean>();
private Callbacks.Backend callback;
private InstrumentationClassFinder classFinder;
private Map<String, byte[]> myCompiledClasses = new HashMap<String, byte[]>();
public void setProperties(final Callbacks.Backend c, final URL[] classpath) {
callback = c;
classFinder = new InstrumentationClassFinder(classpath) {
protected InputStream lookupClassBeforeClasspath(String internalClassName) {
final byte[] bytes = myCompiledClasses.get(internalClassName);
return bytes != null? new ByteArrayInputStream(bytes) : null;
}
};
}
public OptimizedFileManager() {
super(new Context(), true, null);
try {
final Field archivesField = DefaultFileManager.class.getDeclaredField("archives");
archivesField.setAccessible(true);
myArchives = (Map<File, Archive>) archivesField.get(this);
} catch (Exception e) {
throw new RuntimeException(e);
}
try {
final Field useZipFileIndexField = DefaultFileManager.class.getDeclaredField("useZipFileIndex");
useZipFileIndexField.setAccessible(true);
myUseZipFileIndex = (Boolean) useZipFileIndexField.get(this);
} catch (Exception e) {
myUseZipFileIndex = false;
}
}
@Override
public Iterable<JavaFileObject> list(Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse) throws IOException {
Iterable<? extends File> path = getLocation(location);
if (path == null) return Collections.emptyList();
String relativePath = packageName.replace('.', File.separatorChar);
ListBuffer<JavaFileObject> results = new ListBuffer<JavaFileObject>();
for (File root : path) {
Archive archive = myArchives.get(root);
final boolean isFile;
if (archive != null) {
isFile = true;
} else {
Boolean cachedIsFile = myIsFile.get(root);
if (cachedIsFile == null) {
cachedIsFile = root.isFile();
myIsFile.put(root, cachedIsFile);
}
isFile = cachedIsFile.booleanValue();
}
if (isFile) {
collectFromArchive(root, archive, relativePath, kinds, recurse, results);
} else {
File directory = relativePath.length() != 0 ? new File(root, relativePath) : root;
collectFromDirectory(directory, kinds, recurse, results);
}
}
return results.toList();
}
private void collectFromArchive(File root, Archive archive, String relativePath, Set<JavaFileObject.Kind> kinds, boolean recurse, ListBuffer<JavaFileObject> result) {
if (archive == null) {
try {
archive = openArchive(root);
} catch (IOException ex) {
log.error("error.reading.file", root, ex.getLocalizedMessage());
return;
}
}
String separator = myUseZipFileIndex ? File.separator : "/";
if (relativePath.length() != 0) {
if (!myUseZipFileIndex) {
relativePath = relativePath.replace('\\', '/');
}
if (!relativePath.endsWith(separator)) relativePath = relativePath + separator;
}
collectArchiveFiles(archive, relativePath, kinds, result);
if (recurse) {
for (String s : archive.getSubdirectories()) {
if (s.startsWith(relativePath) && !s.equals(relativePath)) {
if (!s.endsWith(separator)) {
s += separator;
}
collectArchiveFiles(archive, s, kinds, result);
}
}
}
}
private void collectFromDirectory(File directory, Set<JavaFileObject.Kind> fileKinds,
boolean recurse, ListBuffer<JavaFileObject> result) {
File[] children = directory.listFiles();
if (children == null) return;
for (File child : children) {
String name = child.getName();
if (child.isDirectory()) {
if (recurse && SourceVersion.isIdentifier(name)) {
collectFromDirectory(directory, fileKinds, recurse, result);
}
} else {
if (isValidFile(name, fileKinds)) {
JavaFileObject fe = getRegularFile(child);
result.append(fe);
}
}
}
}
private void collectArchiveFiles(Archive archive, String relativePath, Set<JavaFileObject.Kind> fileKinds, ListBuffer<JavaFileObject> result) {
List<String> files = archive.getFiles(relativePath);
if (files != null) {
for (String file; !files.isEmpty(); files = files.tail) {
file = files.head;
if (isValidFile(file, fileKinds)) {
result.append(archive.getFileObject(relativePath, file));
}
}
}
}
private boolean isValidFile(String name, Set<JavaFileObject.Kind> fileKinds) {
int dot = name.lastIndexOf(".");
JavaFileObject.Kind kind = getKind(dot == -1 ? name : name.substring(dot));
return fileKinds.contains(kind);
}
//actually Javac doesn't check if this method returns null. It always get substring of the returned string starting from the last dot.
@Override
public String inferBinaryName(Location location, JavaFileObject file) {
final String name = file.getName();
int dot = name.lastIndexOf('.');
final String relativePath = dot != -1 ? name.substring(0, dot) : name;
return relativePath.replace(File.separatorChar, '.');
}
@Override
public JavaFileObject getJavaFileForOutput(Location location, final String className, final JavaFileObject.Kind kind, FileObject fileObject) throws IOException {
final JavaFileObject result = super.getJavaFileForOutput(location, className, kind, fileObject);
final String classFileName = PathUtil.toPath(result.toUri());
final String sourceFileName = PathUtil.toPath(fileObject.toUri());
return new ForwardingJavaFileObject<JavaFileObject>(result) {
private OutputStream superOpenOutputStream() throws IOException {
return super.openOutputStream();
}
@Override
public OutputStream openOutputStream() throws IOException {
return new OutputStream() {
public void flush() throws IOException {
}
public void close() throws IOException {
}
public void write(int b) throws IOException {
assert (false);
}
public void write(byte[] b) throws IOException {
assert (false);
}
public void write(final byte[] b, final int off, final int len) throws IOException {
final byte[] buffer = Arrays.copyOfRange(b, off, len);
if (kind.equals(JavaFileObject.Kind.CLASS)) {
myCompiledClasses.put(className.replace('.', '/'), buffer);
if (callback != null) {
final ClassReader reader = new ClassReader(buffer);
callback.associate(classFileName, sourceFileName, reader);
}
myWriters.add(new DelayedClassFileWriter() {
public void commit() throws IOException {
final OutputStream result = superOpenOutputStream();
final byte[] instrumented = InstrumentationUtil.instrumentNotNull(buffer, classFinder);
if (instrumented != null) {
result.write(instrumented);
} else {
result.write(buffer);
}
result.close();
}
});
} else {
final OutputStream result = superOpenOutputStream();
result.write(buffer);
result.close();
}
}
};
}
};
}
@Override
public void flush() {
super.flush();
for (DelayedClassFileWriter f : myWriters) {
try {
f.commit();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
myWriters.clear();
if (classFinder != null) {
classFinder.releaseResources();
}
}
}
@@ -62,8 +62,6 @@ public final class Annotation implements Segment {
public final IntentionAction quickFix;
public final TextRange textRange;
public final List<IntentionAction> options;
@Deprecated
public final String displayName;
public final HighlightDisplayKey key;
@Deprecated
@@ -71,7 +69,6 @@ public final class Annotation implements Segment {
key = null;
this.quickFix = quickFix;
this.textRange = textRange;
this.displayName = quickFix.getText();
this.options = options;
}
@@ -79,7 +76,6 @@ public final class Annotation implements Segment {
this.key = key;
quickFix = fix;
textRange = range;
displayName = key != null ? HighlightDisplayKey.getDisplayNameByKey(key) : fix.getText();
options = null;
}
@@ -468,11 +468,6 @@ public class HighlightInfo implements Segment {
private final String myDisplayName;
private final Icon myIcon;
public IntentionActionDescriptor(@NotNull IntentionAction action, final HighlightDisplayKey key) {
this(action, null, HighlightDisplayKey.getDisplayNameByKey(key), null);
myKey = key;
}
public IntentionActionDescriptor(@NotNull IntentionAction action, final List<IntentionAction> options, final String displayName) {
this(action, options, displayName, null);
}
@@ -50,7 +50,7 @@ public final class QuickFixAction {
}
public static void registerQuickFixAction(HighlightInfo info, IntentionAction action) {
registerQuickFixAction(info, null, action, null);
registerQuickFixAction(info, null, action);
}
public static void registerQuickFixActions(final HighlightInfo info, final Collection<? extends IntentionAction> actions) {
@@ -59,6 +59,7 @@ public final class QuickFixAction {
}
}
/** This is used by TeamCity plugin */
@Deprecated
public static void registerQuickFixAction(HighlightInfo info, IntentionAction action, List<IntentionAction> options, String displayName) {
doRegister(info, action, options, displayName, null, null);
@@ -88,6 +89,10 @@ public final class QuickFixAction {
doRegister(info, action, null, HighlightDisplayKey.getDisplayNameByKey(key), fixRange, key);
}
public static void registerQuickFixAction(HighlightInfo info, TextRange fixRange, IntentionAction action) {
doRegister(info, action, null, null, fixRange, null);
}
public static void unregisterQuickFixAction(HighlightInfo info, Condition<IntentionAction> condition) {
for (Iterator<Pair<HighlightInfo.IntentionActionDescriptor, TextRange>> it = info.quickFixActionRanges.iterator(); it.hasNext();) {
Pair<HighlightInfo.IntentionActionDescriptor, TextRange> pair = it.next();
@@ -45,16 +45,13 @@ import org.jetbrains.annotations.NotNull;
*/
public class RunInspectionIntention implements IntentionAction, HighPriorityAction {
private final String myShortName;
private final String myDisplayName;
public RunInspectionIntention(final InspectionProfileEntry tool) {
myShortName = tool.getShortName();
myDisplayName = tool.getDisplayName();
}
public RunInspectionIntention(final HighlightDisplayKey key) {
myShortName = key.toString();
myDisplayName = HighlightDisplayKey.getDisplayNameByKey(key);
}
@NotNull
@@ -0,0 +1,47 @@
/*
* Copyright 2000-2012 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.ui.components;
import javax.swing.*;
/**
* @author Konstantin Bulenkov
*/
public class FixedColumnsModel extends MultiColumnListModel {
private final int myMaxColumns;
public FixedColumnsModel(ListModel model, int maxColumns) {
super(model);
myMaxColumns = maxColumns;
}
@Override
public int getRowCount() {
final int columns = getColumnCount();
return columns == 0 ? 0 : getSize() / columns + 1;
}
@Override
public int getColumnCount() {
return Math.min(myMaxColumns, getSize());
}
@Override
public int toListIndex(int row, int column) {
final int columns = getColumnCount();
return columns == 0 ? -1 : row * columns + column;
}
}
@@ -0,0 +1,47 @@
/*
* Copyright 2000-2012 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.ui.components;
import javax.swing.*;
/**
* @author Konstantin Bulenkov
*/
class FixedRowsModel extends MultiColumnListModel {
private final int myMaxRows;
public FixedRowsModel(ListModel model, int rows) {
super(model);
myMaxRows = rows;
}
@Override
public int getRowCount() {
return Math.min(myMaxRows, getSize());
}
@Override
public int getColumnCount() {
final int rows = getRowCount();
return rows == 0 ? 0 : getSize() / rows + 1;
}
@Override
public int toListIndex(int row, int column) {
final int rows = getRowCount();
return rows == 0 ? -1 : column * rows + row;
}
}
@@ -0,0 +1,162 @@
/*
* Copyright 2000-2012 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.ui.components;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
/**
* @author Konstantin Bulenkov
*/
public class MultiColumnList extends JTable {
private final ListModel myModel;
private ListCellRenderer myRenderer;
private JList myList;
private Dimension myPrefSize;
public MultiColumnList(ListModel model) {
super(new FixedRowsModel(model, 25));
myModel = model;
setRowHeight(20);
setShowGrid(false);
setCellSelectionEnabled(true);
setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
//noinspection UndesirableClassUsage
myList = new JList(model) {
@Override
public void setBorder(Border border) {
super.setBorder(border);
MultiColumnList.this.setBorder(border);
}
@Override
public void repaint() {
MultiColumnList.this.repaint();
}
@Override
public void setCellRenderer(ListCellRenderer cellRenderer) {
super.setCellRenderer(cellRenderer);
if (myRenderer != cellRenderer) {
MultiColumnList.this.setCellRenderer(cellRenderer);
}
}
};
getColumnModel().setColumnMargin(0);
}
public MultiColumnList(Object...elements) {
this(createListModel(elements));
}
private static ListModel createListModel(Object...elements) {
final DefaultListModel model = new DefaultListModel();
for (Object element : elements) {
model.addElement(element);
}
return model;
}
public void setCellRenderer(ListCellRenderer renderer) {
myRenderer = renderer;
setDefaultRenderer(Object.class, new TableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
final int index = getModel().toListIndex(row, column);
if (isSelected) {
myList.addSelectionInterval(index, index);
} else {
myList.removeSelectionInterval(index, index);
}
return myRenderer.getListCellRendererComponent(myList, value, index, isSelected, hasFocus);
}
});
}
public void setFixedRowsMode(int maxRows) {
if (maxRows < 1) {
throw new IllegalArgumentException("Should be greater than 0");
}
setModel(new FixedRowsModel(myModel, maxRows));
getModel().fireTableStructureChanged();
}
@Override
public MultiColumnListModel getModel() {
return (MultiColumnListModel)super.getModel();
}
public void setFixedColumnsMode(int maxColumns) {
if (maxColumns < 1) {
throw new IllegalArgumentException("Should be greater than 0");
}
setModel(new FixedColumnsModel(myModel, maxColumns));
getModel().fireTableStructureChanged();
}
public JList getDelegate() {
return myList;
}
@Override
public Dimension getPreferredSize() {
if (myPrefSize == null) {
Dimension dimension = new Dimension();
int rowHeight = 0;
for (int column = 0; column < getColumnCount(); column++) {
int columnWidth = 0;
for (int row = 0; row < getRowCount(); row++) {
final TableCellRenderer renderer = getCellRenderer(row, column);
if (renderer != null) {
final Object value = getValueAt(row, column);
final Component component = renderer.getTableCellRendererComponent(this, value, true, true, row, column);
if (component != null) {
final Dimension size = component.getPreferredSize();
rowHeight = Math.max(size.height, rowHeight);
columnWidth = Math.max(size.width, columnWidth);
}
}
}
getColumnModel().getColumn(column).setWidth(columnWidth + 5);
dimension.width += columnWidth + 5;
}
dimension.height = getRowCount() * rowHeight;
myPrefSize = dimension;
}
return myPrefSize;
}
public static void main(String[] args) {
final JFrame frame = new JFrame("Test");
frame.setSize(300, 300);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
final MultiColumnList list = new MultiColumnList("1", 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
list.setFixedColumnsMode(5);
frame.getContentPane().add(list);
frame.setVisible(true);
}
}
@@ -0,0 +1,47 @@
/*
* Copyright 2000-2012 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.ui.components;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableModel;
/**
* @author Konstantin Bulenkov
*/
public abstract class MultiColumnListModel extends AbstractTableModel implements TableModel {
private final ListModel myModel;
public MultiColumnListModel(ListModel model) {
myModel = model;
}
public abstract int toListIndex(int row, int column);
public int getSize() {
return myModel.getSize();
}
@Nullable
@Override
public Object getValueAt(int row, int column) {
final int index = toListIndex(row, column);
return index == -1 || index >= myModel.getSize() ? null
: myModel.getElementAt(index);
}
}
@@ -381,15 +381,18 @@ public abstract class AbstractVcsTestCase {
}
protected VirtualFile copyFileInCommand(final VirtualFile file, final VirtualFile newParent) {
return copyFileInCommand(myProject, file, newParent);
return copyFileInCommand(myProject, file, newParent, file.getName());
}
public static VirtualFile copyFileInCommand(final Project project, final VirtualFile file, final VirtualFile newParent) {
public static VirtualFile copyFileInCommand(final Project project,
final VirtualFile file,
final VirtualFile newParent,
final String newName) {
return new WriteCommandAction<VirtualFile>(project) {
@Override
protected void run(Result<VirtualFile> result) throws Throwable {
try {
result.setResult(file.copy(this, newParent, file.getName()));
result.setResult(file.copy(this, newParent, newName));
}
catch (IOException e) {
throw new RuntimeException(e);
@@ -16,44 +16,26 @@
package com.intellij.openapi.util;
import com.intellij.util.SmartFMap;
import com.intellij.util.concurrency.AtomicFieldUpdater;
import com.intellij.util.containers.StripedLockConcurrentHashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import java.util.ConcurrentModificationException;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
public class UserDataHolderBase implements UserDataHolderEx, Cloneable {
private static final Key<Map<Key, Object>> COPYABLE_USER_MAP_KEY = Key.create("COPYABLE_USER_MAP_KEY");
private static final Key<SmartFMap<Key, Object>> COPYABLE_USER_MAP_KEY = Key.create("COPYABLE_USER_MAP_KEY");
/**
* Concurrent writes to this field are via CASes only, using the {@link #updater}
* When map becomes empty, this field set to null atomically
*
* Basic state transitions are as follows:
*
* (adding keyvalue) (putUserData(key,value))
* [myUserMap=null] -> [myUserMap=(key->value)]
*
* (adding another) (putUserData(key2,value2))
* [myUserMap=(key->value)] -> [myUserMap=(key->value, key2->value2)]
*
* (removing keyvalue) (putUserData(k2,null))
* [myUserMap=(key->value, k2->v2)] -> [myUserMap=(key->value)]
*
* (removing last entry) (putUserData(key,null))
* [myUserMap=(key->value)] -> [myUserMap=null]
*
*/
private volatile ConcurrentMap<Key, Object> myUserMap = null;
@NotNull private volatile SmartFMap<Key, Object> myUserMap = SmartFMap.emptyMap();
protected Object clone() {
try {
UserDataHolderBase clone = (UserDataHolderBase)super.clone();
clone.myUserMap = null;
clone.myUserMap = SmartFMap.emptyMap();
copyCopyableDataTo(clone);
return clone;
}
@@ -65,207 +47,86 @@ public class UserDataHolderBase implements UserDataHolderEx, Cloneable {
@TestOnly
public String getUserDataString() {
final ConcurrentMap<Key, Object> userMap = myUserMap;
if (userMap == null) {
return "";
}
final SmartFMap<Key, Object> userMap = myUserMap;
final Map copyableMap = getUserData(COPYABLE_USER_MAP_KEY);
return userMap.toString() + (copyableMap == null ? "" : copyableMap.toString());
}
public void copyUserDataTo(UserDataHolderBase other) {
ConcurrentMap<Key, Object> map = myUserMap;
if (map == null) {
other.myUserMap = null;
}
else {
ConcurrentMap<Key, Object> fresh = createDataMap(map.size());
fresh.putAll(map);
other.myUserMap = fresh;
}
other.myUserMap = myUserMap;
}
public <T> T getUserData(@NotNull Key<T> key) {
final Map<Key, Object> map = myUserMap;
//noinspection unchecked
return map == null ? null : (T)map.get(key);
return (T)myUserMap.get(key);
}
public <T> void putUserData(@NotNull Key<T> key, @Nullable T value) {
while (true) {
try {
if (value == null) {
ConcurrentMap<Key, Object> map = myUserMap;
if (map == null) break;
@SuppressWarnings("unchecked")
T previous = (T)map.remove(key);
boolean removed = previous != null;
if (removed) {
nullifyMapFieldIfEmpty();
}
}
else {
getOrCreateMap().put(key, value);
}
break;
}
catch (ConcurrentModificationException ignored) {
SmartFMap<Key, Object> map = myUserMap;
SmartFMap<Key, Object> newMap = value == null ? map.minus(key) : map.plus(key, value);
if (newMap == map || updater.compareAndSet(this, map, newMap)) {
return;
}
}
}
private static ConcurrentMap<Key, Object> createDataMap(int initialCapacity) {
return new StripedLockConcurrentHashMap<Key, Object>(initialCapacity);
}
public <T> T getCopyableUserData(Key<T> key) {
return getCopyableUserDataImpl(key);
}
protected final <T> T getCopyableUserDataImpl(Key<T> key) {
Map map = getUserData(COPYABLE_USER_MAP_KEY);
//noinspection unchecked
SmartFMap<Key, Object> map = getUserData(COPYABLE_USER_MAP_KEY);
//noinspection unchecked,ConstantConditions
return map == null ? null : (T)map.get(key);
}
public <T> void putCopyableUserData(Key<T> key, T value) {
putCopyableUserDataImpl(key, value);
}
private Map<Key, Object> getOrCreateCopyableMap(boolean create) {
Map<Key, Object> copyMap = getUserData(COPYABLE_USER_MAP_KEY);
if (copyMap == null && create) {
copyMap = createDataMap(1);
copyMap = putUserDataIfAbsent(COPYABLE_USER_MAP_KEY, copyMap);
}
return copyMap;
}
protected final <T> void putCopyableUserDataImpl(Key<T> key, T value) {
while (true) {
try {
Map<Key, Object> copyMap = getOrCreateCopyableMap(value != null);
if (copyMap == null) break;
if (value == null) {
copyMap.remove(key);
if (copyMap.isEmpty()) {
((StripedLockConcurrentHashMap<Key, Object>)copyMap).blockModification();
ConcurrentMap<Key, Object> newCopyMap;
if (copyMap.isEmpty()) {
newCopyMap = null;
}
else {
newCopyMap = createDataMap(copyMap.size());
newCopyMap.putAll(copyMap);
}
boolean replaced = replace(COPYABLE_USER_MAP_KEY, copyMap, newCopyMap);
if (!replaced) continue;
}
}
else {
copyMap.put(key, value);
}
break;
SmartFMap<Key, Object> map = myUserMap;
@SuppressWarnings("unchecked") SmartFMap<Key, Object> copyableMap = (SmartFMap<Key, Object>)map.get(COPYABLE_USER_MAP_KEY);
if (copyableMap == null) {
copyableMap = SmartFMap.emptyMap();
}
catch (ConcurrentModificationException ignored) {
// someone blocked modification, retry
}
}
}
private ConcurrentMap<Key, Object> getOrCreateMap() {
while (true) {
ConcurrentMap<Key, Object> map = myUserMap;
if (map != null) return map;
map = createDataMap(2);
boolean updated = updater.compareAndSet(this, null, map);
if (updated) {
return map;
SmartFMap<Key, Object> newCopyableMap = value == null ? copyableMap.minus(key) : copyableMap.plus(key, value);
SmartFMap<Key, Object> newMap = newCopyableMap.isEmpty() ? map.minus(COPYABLE_USER_MAP_KEY) : map.plus(COPYABLE_USER_MAP_KEY, newCopyableMap);
if (newMap == map || updater.compareAndSet(this, map, newMap)) {
return;
}
}
}
public <T> boolean replace(@NotNull Key<T> key, @Nullable T oldValue, @Nullable T newValue) {
while (true) {
try {
ConcurrentMap<Key, Object> map = getOrCreateMap();
if (oldValue == null) {
return newValue == null || map.putIfAbsent(key, newValue) == null;
}
if (newValue == null) {
boolean removed = map.remove(key, oldValue);
if (removed) {
nullifyMapFieldIfEmpty();
}
return removed;
}
return map.replace(key, oldValue, newValue);
SmartFMap<Key, Object> map = myUserMap;
if (map.get(key) != oldValue) {
return false;
}
catch (ConcurrentModificationException ignored) {
// someone blocked modification, retry
SmartFMap<Key, Object> newMap = newValue == null ? map.minus(key) : map.plus(key, newValue);
if (newMap == map || updater.compareAndSet(this, map, newMap)) {
return true;
}
}
}
@NotNull
public <T> T putUserDataIfAbsent(@NotNull final Key<T> key, @NotNull final T value) {
Object v = getOrCreateMap().get(key);
if (v != null) {
//noinspection unchecked
return (T)v;
}
while (true) {
try {
@SuppressWarnings("unchecked")
T prev = (T)getOrCreateMap().putIfAbsent(key, value);
return prev == null ? value : prev;
SmartFMap<Key, Object> map = myUserMap;
@SuppressWarnings("unchecked") T oldValue = (T)map.get(key);
if (oldValue != null) {
return oldValue;
}
catch (ConcurrentModificationException ignored) {
// someone blocked modification, retry
SmartFMap<Key, Object> newMap = map.plus(key, value);
if (newMap == map || updater.compareAndSet(this, map, newMap)) {
return value;
}
}
}
public void copyCopyableDataTo(@NotNull UserDataHolderBase clone) {
Map<Key, Object> copyableMap = getUserData(COPYABLE_USER_MAP_KEY);
if (copyableMap != null) {
ConcurrentMap<Key, Object> copy = createDataMap(copyableMap.size());
copy.putAll(copyableMap);
copyableMap = copy;
}
clone.putUserData(COPYABLE_USER_MAP_KEY, copyableMap);
clone.putUserData(COPYABLE_USER_MAP_KEY, getUserData(COPYABLE_USER_MAP_KEY));
}
protected void clearUserData() {
myUserMap = null;
myUserMap = SmartFMap.emptyMap();
}
private static final AtomicFieldUpdater<UserDataHolderBase, ConcurrentMap> updater = AtomicFieldUpdater.forFieldOfType(UserDataHolderBase.class, ConcurrentMap.class);
private void nullifyMapFieldIfEmpty() {
try {
while (true) {
StripedLockConcurrentHashMap<Key, Object> map = (StripedLockConcurrentHashMap<Key, Object>)myUserMap;
if (map == null || !map.isEmpty()) break;
map.blockModification(); // we block the map and either replace it with null or fail with replace, in both cases the map is thrown away
ConcurrentMap<Key, Object> newMap;
if (map.isEmpty()) {
newMap = null;
}
else {
// someone managed to add something in the meantime
// atomically replace the blocked map with newly created map filled with the data sneaked in
newMap = createDataMap(map.size());
newMap.putAll(map);
}
boolean replaced = updater.compareAndSet(this, map, newMap);
if (replaced) break;
// else someone has replaced map already and pushing back the changes is his responsibility
}
}
catch (ConcurrentModificationException ignored) {
// somebody has already blocked the map, back off
}
}
private static final AtomicFieldUpdater<UserDataHolderBase, SmartFMap> updater = AtomicFieldUpdater.forFieldOfType(UserDataHolderBase.class, SmartFMap.class);
}
@@ -164,6 +164,10 @@ class UpdatingChangeListBuilder implements ChangelistBuilder {
checkIfDisposed();
if (isExcluded(file)) return;
if (myScope.belongsTo(new FilePathImpl(file))) {
if (ChangeListManagerImpl.DEBUG) {
System.out.println("UpdatingChangeListBuilder.processModifiedWithoutCheckout");
System.out.println("file = " + file);
}
myComposite.getVFHolder(FileHolder.HolderType.MODIFIED_WITHOUT_EDITING).addFile(file);
}
}
@@ -21,6 +21,8 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.PathsList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.config.AbstractConfigUtils;
@@ -46,13 +48,13 @@ public class DefaultGroovyShellRunner extends GroovyShellRunner {
@Override
public JavaParameters createJavaParameters(@NotNull Module module) throws ExecutionException {
JavaParameters res = GroovyScriptRunConfiguration.createJavaParametersWithSdk(module);
DefaultGroovyScriptRunner.configureGenericGroovyRunner(res, module, "groovy.ui.GroovyMain", true);
DefaultGroovyScriptRunner.configureGenericGroovyRunner(res, module, "groovy.ui.GroovyMain", !hasGroovyAll(module));
PathsList list = GroovyScriptRunner.getClassPathFromRootModel(module, true, res, true);
if (list != null) {
res.getClassPath().addAll(list.getPathList());
}
res.getProgramParametersList().addAll("-p", GroovyScriptRunner.getPathInConf("console.txt"));
//javaParameters.getVMParametersList().add("-Xdebug"); javaParameters.getVMParametersList().add("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5239");
//res.getVMParametersList().add("-Xdebug"); res.getVMParametersList().add("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5239");
res.setWorkingDirectory(getWorkingDirectory(module));
return res;
@@ -69,7 +71,7 @@ public class DefaultGroovyShellRunner extends GroovyShellRunner {
public String getTitle(@NotNull Module module) {
String homePath = LibrariesUtil.getGroovyHomePath(module);
boolean bundled = false;
if (homePath == null) {
if (homePath == null || !hasGroovyAll(module)) {
homePath = GroovyUtils.getBundledGroovyJar().getParentFile().getParent();
bundled = true;
}
@@ -77,6 +79,13 @@ public class DefaultGroovyShellRunner extends GroovyShellRunner {
return version == AbstractConfigUtils.UNDEFINED_VERSION ? "" : " (" + (bundled ? "Bundled " : "") + "Groovy " + version + ")";
}
private static boolean hasGroovyAll(Module module) {
GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module);
JavaPsiFacade facade = JavaPsiFacade.getInstance(module.getProject());
return facade.findClass("org.apache.commons.cli.CommandLineParser", scope) != null &&
facade.findClass("groovy.ui.GroovyMain", scope) != null;
}
@NotNull
@Override
public String transformUserInput(@NotNull String userInput) {
@@ -81,21 +81,20 @@ public class DefaultGroovyScriptRunner extends GroovyScriptRunner {
params.getProgramParametersList().addParametersString(configuration.getScriptParameters());
}
public static void configureGenericGroovyRunner(@NotNull JavaParameters params, @NotNull Module module, @NotNull String mainClass, boolean mayUseBundled) {
public static void configureGenericGroovyRunner(@NotNull JavaParameters params, @NotNull Module module, @NotNull String mainClass, boolean useBundled) {
final VirtualFile groovyJar = findGroovyJar(module);
if (groovyJar != null) {
params.getClassPath().add(groovyJar);
} else if (mayUseBundled) {
if (useBundled) {
params.getClassPath().add(GroovyUtils.getBundledGroovyJar());
}
else if (groovyJar != null) {
params.getClassPath().add(groovyJar);
}
setToolsJar(params);
String groovyHome = LibrariesUtil.getGroovyHomePath(module);
String groovyHome = useBundled ? FileUtil.toCanonicalPath(GroovyUtils.getBundledGroovyJar().getParentFile().getParent()) : LibrariesUtil.getGroovyHomePath(module);
if (groovyHome != null) {
groovyHome = FileUtil.toSystemDependentName(groovyHome);
} else if (mayUseBundled) {
groovyHome = FileUtil.toCanonicalPath(GroovyUtils.getBundledGroovyJar().getParentFile().getParent());
}
setGroovyHome(params, groovyHome);
@@ -242,7 +242,7 @@ public class XmlHighlightVisitor extends XmlElementVisitor implements HighlightV
for (final IntentionAction quickFixAction : quickFixActions) {
if (quickFixAction == null) continue;
QuickFixAction.registerQuickFixAction(highlightInfo, textRange, quickFixAction, null);
QuickFixAction.registerQuickFixAction(highlightInfo, textRange, quickFixAction);
}
addToResults(highlightInfo);
}
@@ -42,7 +42,7 @@ import org.kohsuke.rngom.ast.builder.BuildException;
import org.kohsuke.rngom.ast.builder.IncludedGrammar;
import org.kohsuke.rngom.ast.builder.SchemaBuilder;
import org.kohsuke.rngom.ast.om.ParsedPattern;
import org.kohsuke.rngom.ast.util.CheckingSchemaBuilder;
import org.kohsuke.rngom.binary.SchemaBuilderImpl;
import org.kohsuke.rngom.digested.DPattern;
import org.kohsuke.rngom.digested.DSchemaBuilderImpl;
import org.kohsuke.rngom.parse.IllegalSchemaException;
@@ -90,9 +90,11 @@ public class RngParser {
public static DPattern parsePattern(final PsiFile file, final ErrorHandler eh, boolean checking) {
try {
final Parseable p = createParsable(file, eh);
final SchemaBuilder sb = new DSchemaBuilderImpl();
return (DPattern)p.parse(checking ? new CheckingSchemaBuilder(sb, eh) : sb);
if (checking) {
p.parse(new SchemaBuilderImpl(eh));
} else {
return p.parse(new DSchemaBuilderImpl());
}
} catch (BuildException e) {
LOG.info(e);
} catch (IllegalSchemaException e) {