Projects >> Pydev >>a18600b7fa33740d3dd46f0fe8e45e3b430e149c

Chunk
Conflicting content
     * @param stringToAddToDecoration the string that should be drawn over the image
     */
    public Image getStringDecorated(String key, String stringToAddToDecoration) {
<<<<<<< HEAD
        synchronized (lock) {
            Tuple3 cacheKey = new Tuple3(key, stringToAddToDecoration,
                    "stringDecoration");

            Image image = imageHash.get(cacheKey);
            if (image == null) {
                Display display = Display.getCurrent();
                image = new Image(display, get(key), SWT.IMAGE_COPY);
                imageHash.put(cacheKey, image); //put it there (even though it'll still be changed).

                int base = 10;
                GC gc = new GC(image);

                //		        Color color = new Color(display, 0, 0, 0);
                //		        Color color2 = new Color(display, 255, 255, 255);
                //		        gc.setForeground(color2); 
                //		        gc.setBackground(color2); 
                //		        gc.setFillRule(SWT.FILL_WINDING);
                //		        gc.fillRoundRectangle(2, 1, base-1, base, 2, 2);
                //		        gc.setForeground(color); 
                //		        gc.drawRoundRectangle(6, 0, base, base+1, 2, 2);
                //		        color2.dispose();
                //		        color.dispose();

                Color colorBackground = new Color(display, 255, 255, 255);
                Color colorForeground = new Color(display, 0, 83, 41);
                Font font = new Font(display, new FontData("Courier New", base - 1, SWT.BOLD));

                try {
                    gc.setForeground(colorForeground);
                    gc.setBackground(colorBackground);
                    gc.setTextAntialias(SWT.ON);
                    gc.setFont(font);
                    gc.drawText(stringToAddToDecoration, 5, 0, true);
                } catch (Exception e) {
                    Log.log(e);
                } finally {
                    colorBackground.dispose();
                    colorForeground.dispose();
                    font.dispose();
                    gc.dispose();
                }

            }
            return image;
        }
=======
    	synchronized(lock){
	    	Tuple3 cacheKey = new Tuple3(key, stringToAddToDecoration, "stringDecoration");
	    	
	    	Image image = imageHash.get(cacheKey);
	    	if(image == null){
		    	Display display = Display.getCurrent();
				image = new Image(display, get(key), SWT.IMAGE_COPY);
				imageHash.put(cacheKey, image); //put it there (even though it'll still be changed).
				
		        Tuple codeFontDetails = FontUtils.getCodeFontNameAndHeight(IFontUsage.IMAGECACHE);
		        String fontName = codeFontDetails.o1;
		        int base = codeFontDetails.o2.intValue();
				
		        GC gc = new GC(image);
		        
//		        Color color = new Color(display, 0, 0, 0);
//		        Color color2 = new Color(display, 255, 255, 255);
//		        gc.setForeground(color2); 
//		        gc.setBackground(color2); 
//		        gc.setFillRule(SWT.FILL_WINDING);
//		        gc.fillRoundRectangle(2, 1, base-1, base, 2, 2);
//		        gc.setForeground(color); 
//		        gc.drawRoundRectangle(6, 0, base, base+1, 2, 2);
//		        color2.dispose();
//		        color.dispose();
		        
		        Color colorBackground = new Color(display, 255, 255, 255);
		        Color colorForeground = new Color(display, 0, 83, 41);
		        
                FontData labelFontData;
                
                // get TextFont from preferences
                FontData[] textFontData = JFaceResources.getTextFont().getFontData();
                if (textFontData.length == 1) {
                	labelFontData = textFontData[0];
                } else {
                	labelFontData = new FontData(fontName, base, SWT.BOLD);                    	
                }
                
		        Font font = new Font(display, labelFontData);
		        
		        try {
					gc.setForeground(colorForeground); 
					gc.setBackground(colorBackground); 
					gc.setTextAntialias(SWT.ON);
					gc.setFont(font);
					gc.drawText(stringToAddToDecoration, 5, 0, true);
				} catch (Exception e) {
					Log.log(e);
				}finally{
			        colorBackground.dispose();
			        colorForeground.dispose();
			        font.dispose();
			        gc.dispose();
				}
		        
	    	}
	    	return image;
    	}
>>>>>>> b5fccf994a51539d1b71fe359a0e1d7dbb706904
    }

    /**
Solution content
     * @param stringToAddToDecoration the string that should be drawn over the image
     */
    public Image getStringDecorated(String key, String stringToAddToDecoration) {
        synchronized (lock) {
            Tuple3 cacheKey = new Tuple3(key, stringToAddToDecoration,
                    "stringDecoration");

            Image image = imageHash.get(cacheKey);
            if (image == null) {
                Display display = Display.getCurrent();
                image = new Image(display, get(key), SWT.IMAGE_COPY);
                imageHash.put(cacheKey, image); //put it there (even though it'll still be changed).

                Tuple codeFontDetails = FontUtils.getCodeFontNameAndHeight(IFontUsage.IMAGECACHE);
                String fontName = codeFontDetails.o1;
                int base = codeFontDetails.o2.intValue();

                GC gc = new GC(image);

                //		        Color color = new Color(display, 0, 0, 0);
                //		        Color color2 = new Color(display, 255, 255, 255);
                //		        gc.setForeground(color2); 
                //		        gc.setBackground(color2); 
                //		        gc.setFillRule(SWT.FILL_WINDING);
                //		        gc.fillRoundRectangle(2, 1, base-1, base, 2, 2);
                //		        gc.setForeground(color); 
                //		        gc.drawRoundRectangle(6, 0, base, base+1, 2, 2);
                //		        color2.dispose();
                //		        color.dispose();

                Color colorBackground = new Color(display, 255, 255, 255);
                Color colorForeground = new Color(display, 0, 83, 41);

                FontData labelFontData;

                // get TextFont from preferences
                FontData[] textFontData = JFaceResources.getTextFont().getFontData();
                if (textFontData.length == 1) {
                    labelFontData = textFontData[0];
                } else {
                    labelFontData = new FontData(fontName, base, SWT.BOLD);
                }

                Font font = new Font(display, labelFontData);

                try {
                    gc.setForeground(colorForeground);
                    gc.setBackground(colorBackground);
                    gc.setTextAntialias(SWT.ON);
                    gc.setFont(font);
                    gc.drawText(stringToAddToDecoration, 5, 0, true);
                } catch (Exception e) {
                    Log.log(e);
                } finally {
                    colorBackground.dispose();
                    colorForeground.dispose();
                    font.dispose();
                    gc.dispose();
                }

            }
            return image;
        }
    }

    /**
File
ImageCache.java
Developer's decision
Version 2
Kind of conflict
Synchronized statement
Chunk
Conflicting content
    }

<<<<<<< HEAD
    public static final String EMPTY = "";
=======
    public static final Object EMPTY = "";
    
    private static final boolean DEBUG = false;

    /**
     * 

Find the last position of a character which matches a given regex.

* *

This method is similar to {@link java.lang.String#lastIndexOf(String)} * except it allows for comparing characters akin to wildcard searches, i.e. * find the position of the last character classified as alphanumeric, without * the need to implement dozens of method variations where each method takes the * same parameters but does a slightly different search.

* * @param string - the string to search through, e.g. the haystack * @param regex - a string containing a compilable {@link java.util.regex.Pattern}. * @return the last position of the character that matches the pattern
* or -1 if no match or some of the parameters are invalid. * @note the string is iterated over one char at a time, so the pattern will be * compared at most to one character strings. */ public static int lastIndexOf(final String string, final String regex) { int index = -1; if (null == string || null == regex || string.isEmpty() || regex.isEmpty()) { return index; } Pattern pat; try { pat = Pattern.compile(regex); } catch (PatternSyntaxException pse) { return index; } >>>>>>> b5fccf994a51539d1b71fe359a0e1d7dbb706904 int len = string.length(); int i = len-1;
Solution content
    }

    public static final String EMPTY = "";

    private static final boolean DEBUG = false;

    /**
     * 

Find the last position of a character which matches a given regex.

* *

This method is similar to {@link java.lang.String#lastIndexOf(String)} * except it allows for comparing characters akin to wildcard searches, i.e. * find the position of the last character classified as alphanumeric, without * the need to implement dozens of method variations where each method takes the * same parameters but does a slightly different search.

* * @param string - the string to search through, e.g. the haystack * @param regex - a string containing a compilable {@link java.util.regex.Pattern}. * @return the last position of the character that matches the pattern
* or -1 if no match or some of the parameters are invalid. * @note the string is iterated over one char at a time, so the pattern will be * compared at most to one character strings. */ public static int lastIndexOf(final String string, final String regex) { int index = -1; if (null == string || null == regex || string.length() == 0 || regex.length() == 0) { return index; } Pattern pat; try { pat = Pattern.compile(regex); } catch (PatternSyntaxException pse) { return index; } int len = string.length();
File
StringUtils.java
Developer's decision
Manual
Kind of conflict
Attribute
Comment
If statement
Method signature
Try statement
Variable
Chunk
Conflicting content
            "    ",
            e.printStackTrace();
        }
    }
<<<<<<< HEAD
=======
        
    /**
     * Test method for {@link StringUtils#joinIterable(Iterable, String)}.
     */
    public void testJoinIterable() {

        List strings = new ArrayList(3);
        strings.add("test");
        strings.add("fest");
        strings.add("zest");

        List integers = new ArrayList(3);
        integers.add(Integer.valueOf(1));
        integers.add(Integer.valueOf(2));
        integers.add(Integer.valueOf(3));

        Iterable[] inputs = {
            strings,
            integers
        };

        String[] delimiters = {
            "\\n",
            "+"
        };

        String[] expectedResults = {
            "test\\nfest\\nzest",
            "1+2+3"
        };

        int i = 0;
        for (Iterable input : inputs) {
            String delim = delimiters[i];
            String expectedResult = expectedResults[i];
            String result = StringUtils.joinIterable(delim, input);

            assertEquals(result, expectedResult);
            i++;
        }
    }

    /**
     * Test method for {@link StringUtils#joinIterable(Iterable, String)}
     * using bogus input.
     * 
     * @throws Exception
     */
    public void testJoinIterableBogus() throws Exception {

        List inputs = new ArrayList(3);
        inputs.add("nominal");
        inputs.add(null);
        inputs.add("nominal");

        String delimiter = "\\r\\n";

        try {
            String result = StringUtils.joinIterable(delimiter, null);
            System.out.println("result = " + result);
            fail("The exception java.lang.IllegalArgumentException should have been thrown if 'objs' is null.");
        } catch (java.lang.IllegalArgumentException exception) {
            // The test succeeded by throwing the expected exception
        }
        try {
            String result = StringUtils.joinIterable(null, inputs);
            System.out.println("result = " + result);
            fail("The exception java.lang.IllegalArgumentException should have been thrown if 'delimiter' is null.");
        } catch (java.lang.IllegalArgumentException exception) {
            // The test succeeded by throwing the expected exception
        }
    }

    /**
     * Test method for {@link StringUtils#repeatString(String, int)}.
     * Already includes some bogus value coverage.
     */
    public void testRepeatString() {
        
        String[] inputs = {"Sun", "Java", "*", " ", "-", "André", null};
        int[] timesList = {  -20,      3,   5,   4,   3,       2,    1};
        
        String[] expectedResults = {
            "",
            "JavaJavaJava",
            "*****",
            "---",
            "AndréAndré",
            "null"
        };
        
        int len = inputs.length;
        for (int i = 0; i < len; i++) {
            String input = inputs[i];
            int times = timesList[i];
            
            String expectedResult = expectedResults[i];
            String result = StringUtils.repeatString(input, times);
            
            assertEquals(expectedResult, result);
        }
    }
    
    /**
     * Test method for {@link StringUtils#lastIndexOf(String, String)}. 
     */
    public void testLastIndexOf() {
        
        String[] inputs = {
            "if ((method(\"test %s\" % name))):\n    print \"True\"",
            "\"\"\"test \\\"%s\"\"\" % \"\"\"fest\"\"\") # comment",
            "\"\"\"test \\\"%s\"\"\" % \"\"\"fest\"\"\") # comment # another comment?!",
            null,
            "André",
            "André",
            "for (Enumeration el=v.elements(); el.hasMoreElements(); ) {"
        };
        
        String[] regexes = {
            "\\%",
            "\\\\\"",
            "#",
            "\\B",
            null,
            "\u00e9",
            "\\;"
        };
        
        int[] expectedResults = { 22, -1, 40, -1, -1, 4, 54 };
        
        int len = inputs.length;
        for (int i = 0; i < len; i++) {
            String input = inputs[i];
            String regex = regexes[i];
            
            int expectedResult = expectedResults[i];
            int result = StringUtils.lastIndexOf(input, regex);
            
            assertEquals(expectedResult, result);
        }
    }
    
    /**
     * Test method for {@link StringUtils#indexOf(String, char, boolean)}. 
     * @throws Exception
     */
    public void testIndexOf() throws Exception {
        
        String[] inputs = {
            "if ((method(\"test %s\" % name))):\n    print \"True\"",
            "if ((method(\"test %s\" % name))):\n    print \"True\"",
            "\"\"\"test #\\\"%s\"\"\" % \"\"\"fest\"\"\") # comment # another comment?!",
            null,
            "André",
            "André",
            "for (Enumeration el=v.elements(); el.hasMoreElements(); ) {",
            "\"whitespace =     \"# the string has ended"
        };
        
        char[] chars = {
            '%',
            '"',
            '#',
            '\0',
            (char)-1,
            '\u00e9',
            ';',
            ' '
        };
        
        // results for ignoreInStringLiteral == true
        int[] expectedResults1 = { 22, 12, 31, -1, -1, 4, 32, 20 };
        
        // results for ignoreInStringLiteral == false
        int[] expectedResults2 = { 18, 12, 8, -1, -1, 4, 32, 11 };
        
        int len = inputs.length;
        for (int i = 0; i < len; i++) {
            String input = inputs[i];
            char character = chars[i];
            
            int expectedResult1 = expectedResults1[i];
            int result = StringUtils.indexOf(input, character, true);
            assertEquals(expectedResult1, result);
            
            result = StringUtils.indexOf(input, character, false);
            int expectedResult2 = expectedResults2[i];
            assertEquals(expectedResult2, result);
        }
    }

    /**
     * Test method for {@link StringUtils#findSubstring(String, char, boolean)}. 
     * @throws Exception
     */
    public void testFindSubstring() throws Exception {
        
        String[] inputs = {
            "if ((method(\"test %s\" % name))):\n    print \"True\"",
            "if ((method(\"test %s\" % name))):\n    print \"True\"",
            "\"\"\"test #\\\"%s\"\"\" % \"\"\"fest\"\"\") # comment # another comment?!",
            null,
            "André",
            "André",
            "for (Enumeration el=v.elements(); el.hasMoreElements(); ) {",
            "\"whitespace =     \"# the string has ended"
        };
        
        char[] chars = {
            '%',
            '"',
            '#',
            '\0',
            (char)-1,
            '\u00e9',
            ';',
            ' '
        };
        
        // results for ignoreInStringLiteral == true
        String[] expectedResults1 = {
            " name))):\n    print \"True\"",
            "test %s\" % name))):\n    print \"True\"",
            " comment # another comment?!",
            null,
            null,
            "",
            " el.hasMoreElements(); ) {",
            "the string has ended"
        };
        
        // results for ignoreInStringLiteral == false
        String[] expectedResults2 = {
            "s\" % name))):\n    print \"True\"",
            "test %s\" % name))):\n    print \"True\"",
            "\\\"%s\"\"\" % \"\"\"fest\"\"\") # comment # another comment?!",
            null,
            null,
            "",
            " el.hasMoreElements(); ) {",
            "=     \"# the string has ended"
        };
        
        int len = inputs.length;
        for (int i = 0; i < len; i++) {
            String input = inputs[i];
            char character = chars[i];
            
            String expectedResult1 = expectedResults1[i];
            String result = StringUtils.findSubstring(input, character, true);
            assertEquals(expectedResult1, result);
            
            result = StringUtils.findSubstring(input, character, false);
            String expectedResult2 = expectedResults2[i];
            assertEquals(expectedResult2, result);
        }
    }
>>>>>>> b5fccf994a51539d1b71fe359a0e1d7dbb706904

    public void testFormat() {
        assertEquals("teste", StringUtils.format("%s", new Object[] { "teste" }));
Solution content
     */

            e.printStackTrace();
        }
    }

    /**
     * Test method for {@link StringUtils#joinIterable(Iterable, String)}.
     */
    public void testJoinIterable() {

        List strings = new ArrayList(3);
        strings.add("test");
        strings.add("fest");
        strings.add("zest");

        List integers = new ArrayList(3);
        integers.add(Integer.valueOf(1));
        integers.add(Integer.valueOf(2));
        integers.add(Integer.valueOf(3));

        Iterable[] inputs = {
                strings,
                integers
        };

        String[] delimiters = {
                "\\n",
                "+"
        };

        String[] expectedResults = {
                "test\\nfest\\nzest",
                "1+2+3"
        };

        int i = 0;
        for (Iterable input : inputs) {
            String delim = delimiters[i];
            String expectedResult = expectedResults[i];
            String result = StringUtils.joinIterable(delim, input);

            assertEquals(result, expectedResult);
            i++;
        }
    }

    /**
     * Test method for {@link StringUtils#joinIterable(Iterable, String)}
     * using bogus input.
     * 
     * @throws Exception
     */
    public void testJoinIterableBogus() throws Exception {

        List inputs = new ArrayList(3);
        inputs.add("nominal");
        inputs.add(null);
        inputs.add("nominal");

        String delimiter = "\\r\\n";

        try {
            String result = StringUtils.joinIterable(delimiter, null);
            System.out.println("result = " + result);
            fail("The exception java.lang.IllegalArgumentException should have been thrown if 'objs' is null.");
        } catch (java.lang.IllegalArgumentException exception) {
            // The test succeeded by throwing the expected exception
        }
        try {
            String result = StringUtils.joinIterable(null, inputs);
            System.out.println("result = " + result);
            fail("The exception java.lang.IllegalArgumentException should have been thrown if 'delimiter' is null.");
        } catch (java.lang.IllegalArgumentException exception) {
            // The test succeeded by throwing the expected exception
        }
    }

    /**
     * Test method for {@link StringUtils#repeatString(String, int)}.
     * Already includes some bogus value coverage.
    public void testRepeatString() {

        String[] inputs = { "Sun", "Java", "*", " ", "-", "André", null };
        int[] timesList = { -20, 3, 5, 4, 3, 2, 1 };

        String[] expectedResults = {
                "",
                "JavaJavaJava",
                "*****",
                "    ",
                "---",
                "AndréAndré",
                "null"
        };

        int len = inputs.length;
        for (int i = 0; i < len; i++) {
            String input = inputs[i];
            int times = timesList[i];

            String expectedResult = expectedResults[i];
            String result = StringUtils.repeatString(input, times);

            assertEquals(expectedResult, result);
        }
    }

    /**
     * Test method for {@link StringUtils#lastIndexOf(String, String)}. 
     */
    public void testLastIndexOf() {

        String[] inputs = {
                "if ((method(\"test %s\" % name))):\n    print \"True\"",
                "\"\"\"test \\\"%s\"\"\" % \"\"\"fest\"\"\") # comment",
                "\"\"\"test \\\"%s\"\"\" % \"\"\"fest\"\"\") # comment # another comment?!",
                null,
                "André",
                "André",
                "for (Enumeration el=v.elements(); el.hasMoreElements(); ) {"
        };

        String[] regexes = {
                "\\%",
                "\\\\\"",
                "#",
                "\\B",
                null,
                "\u00e9",
                "\\;"
        };

        int[] expectedResults = { 22, -1, 40, -1, -1, 4, 54 };

        int len = inputs.length;
        for (int i = 0; i < len; i++) {
            String input = inputs[i];
            String regex = regexes[i];

            int expectedResult = expectedResults[i];
            int result = StringUtils.lastIndexOf(input, regex);

            assertEquals(expectedResult, result);
        }
    }

    /**
     * Test method for {@link StringUtils#indexOf(String, char, boolean)}. 
     * @throws Exception
     */
    public void testIndexOf() throws Exception {

        String[] inputs = {
                "if ((method(\"test %s\" % name))):\n    print \"True\"",
                "if ((method(\"test %s\" % name))):\n    print \"True\"",
                "\"\"\"test #\\\"%s\"\"\" % \"\"\"fest\"\"\") # comment # another comment?!",
                null,
                "André",
                "André",
                "for (Enumeration el=v.elements(); el.hasMoreElements(); ) {",
                "\"whitespace =     \"# the string has ended"
        };

        char[] chars = {
                '%',
                '"',
                '#',
                '\0',
                (char) -1,
                '\u00e9',
                ';',
                ' '
        };

        // results for ignoreInStringLiteral == true
        int[] expectedResults1 = { 22, 12, 31, -1, -1, 4, 32, 20 };

        // results for ignoreInStringLiteral == false
        int[] expectedResults2 = { 18, 12, 8, -1, -1, 4, 32, 11 };

        int len = inputs.length;
        for (int i = 0; i < len; i++) {
            String input = inputs[i];
            char character = chars[i];
            int expectedResult1 = expectedResults1[i];
            int result = StringUtils.indexOf(input, character, true);
            assertEquals(expectedResult1, result);

            result = StringUtils.indexOf(input, character, false);
            int expectedResult2 = expectedResults2[i];
            assertEquals(expectedResult2, result);
        }
    }

    /**
     * Test method for {@link StringUtils#findSubstring(String, char, boolean)}. 
     * @throws Exception
     */
    public void testFindSubstring() throws Exception {

        String[] inputs = {
                "if ((method(\"test %s\" % name))):\n    print \"True\"",
                "if ((method(\"test %s\" % name))):\n    print \"True\"",
                "\"\"\"test #\\\"%s\"\"\" % \"\"\"fest\"\"\") # comment # another comment?!",
                null,
                "André",
                "André",
                "for (Enumeration el=v.elements(); el.hasMoreElements(); ) {",
                "\"whitespace =     \"# the string has ended"
        };

        char[] chars = {
                '%',
                '"',
                '#',
                '\0',
                (char) -1,
                '\u00e9',
                ';',
                ' '
        };

        // results for ignoreInStringLiteral == true
        String[] expectedResults1 = {
                " name))):\n    print \"True\"",
                "test %s\" % name))):\n    print \"True\"",
                " comment # another comment?!",
                null,
                null,
                "",
                " el.hasMoreElements(); ) {",
                "the string has ended"
        };

        // results for ignoreInStringLiteral == false
        String[] expectedResults2 = {
                "s\" % name))):\n    print \"True\"",
                "test %s\" % name))):\n    print \"True\"",
                "\\\"%s\"\"\" % \"\"\"fest\"\"\") # comment # another comment?!",
                null,
                null,
                "",
                " el.hasMoreElements(); ) {",
                "=     \"# the string has ended"
        };

        int len = inputs.length;
        for (int i = 0; i < len; i++) {
            String input = inputs[i];
            char character = chars[i];

            String expectedResult1 = expectedResults1[i];
            String result = StringUtils.findSubstring(input, character, true);
            assertEquals(expectedResult1, result);

            result = StringUtils.findSubstring(input, character, false);
            String expectedResult2 = expectedResults2[i];
            assertEquals(expectedResult2, result);
        }
    }

    public void testFormat() {
        assertEquals("teste", StringUtils.format("%s", new Object[] { "teste" }));
File
StringUtilsTest.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
    private static DjPartitionerSwitchStrategy instance;

<<<<<<< HEAD
    private static final String[][] DJANGO_TEMPLATES_PAIRS = new String[][] { { "{%", "%}" }, { "{{", "}}" } };

=======
    private static final String[][] DJANGO_TEMPLATES_PAIRS = new String[][] { 
        { "{%", "%}" }, 
        { "{{", "}}" }
    };
    
>>>>>>> b5fccf994a51539d1b71fe359a0e1d7dbb706904
    /**
     * 
     */
Solution content
    private static DjPartitionerSwitchStrategy instance;

    private static final String[][] DJANGO_TEMPLATES_PAIRS = new String[][] { { "{%", "%}" }, { "{{", "}}" } };

    /**
     * 
     */
File
DjPartitionerSwitchStrategy.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
        

    public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext invocationContext) {
        int offset = invocationContext.getOffset();
<<<<<<< HEAD
=======
                PySelection base = edit.createPySelection();
                if(!(this.edit instanceof PyEdit) || base == null){
                    return new ICompletionProposal[0];
                }
                PyEdit editor = (PyEdit) this.edit;
        
                List results = new ArrayList();
                String sel = PyAction.getLineWithoutComments(base);
        
                List assists = new ArrayList();
                synchronized (PythonCorrectionProcessor.additionalAssists) {
                    for (IAssistProps prop : additionalAssists.values()) {
                        assists.add(prop);
                    }
                }
                assists.add(new AssistSurroundWith());
                assists.add(new AssistImport());
                assists.add(new AssistDocString());
                assists.add(new AssistAssign());
                assists.add(new AssistPercentToFormat());
        //        assists.add(new AssistOverride()); -- Not ready!
        
                assists.addAll(ExtensionHelper.getParticipants(ExtensionHelper.PYDEV_CTRL_1));
                ImageCache imageCache = PydevPlugin.getImageCache();
                File editorFile = edit.getEditorFile();
                IPythonNature pythonNature = null;
                try {
                    pythonNature = edit.getPythonNature();
                } catch (MisconfigurationException e1) {
                    Log.log(e1);
                }
        
                for (IAssistProps assist : assists) {
                    //Always create a new for each assist, as any given assist may change it.
                    PySelection ps = new PySelection(base);
                    try {
                        if (assist.isValid(ps, sel, editor, offset)) {
                            try {
                                results.addAll(assist.getProps(
                                        ps, 
                                        imageCache, 
                                        editorFile, 
                                        pythonNature, 
                                        editor, 
                                        offset)
                                );
                            } catch (Exception e) {
                                Log.log(e);
                            }
                        }
                    } catch (Exception e) {
                        Log.log(e);
                    }
                }
        
                Collections.sort(results, IPyCodeCompletion.PROPOSAL_COMPARATOR);
        
                
                try{
                    //handling spelling... (we only want to show spelling fixes if a spell problem annotation is found at the current location).
                    //we'll only show some spelling proposal if there's some spelling problem (so, we don't have to check the preferences at this place,
                    //as no annotations on spelling will be here if the spelling is not enabled). 
                    ICompletionProposal[] spellProps = null;
                    
                    IAnnotationModel annotationModel = editor.getPySourceViewer().getAnnotationModel();
                    Iterator it = annotationModel.getAnnotationIterator();
                    while(it.hasNext()){
                        Object annotation = it.next();
                        if(annotation instanceof SpellingAnnotation){
                            SpellingAnnotation spellingAnnotation = (SpellingAnnotation) annotation;
                            SpellingProblem spellingProblem = spellingAnnotation.getSpellingProblem();
                            
                            int problemOffset = spellingProblem.getOffset();
                            int problemLen = spellingProblem.getLength();
                            if(problemOffset <= offset && problemOffset+problemLen >= offset){
                                SpellingCorrectionProcessor spellingCorrectionProcessor = new SpellingCorrectionProcessor();
                                spellProps = spellingCorrectionProcessor.computeQuickAssistProposals(invocationContext);
                                break;
                            }
                        }
                    }
                    
                    
            
                    if(spellProps == null || (spellProps.length == 1 && spellProps[0] instanceof NoCompletionsProposal)){
                        //no proposals from the spelling
                        return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]);
                    }
                    
                    //ok, add the spell problems and return...
                    ICompletionProposal[] ret = (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()+spellProps.length]);
                    System.arraycopy(spellProps, 0, ret, results.size(), spellProps.length);
                    return ret;
                }catch(Throwable e){ 
                    if(e instanceof ClassNotFoundException || e instanceof LinkageError || e instanceof NoSuchMethodException || 
                            e instanceof NoSuchMethodError || e instanceof NoClassDefFoundError){
                        //Eclipse 3.2 support
                        return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]);
                    }
                    throw new RuntimeException(e);
                }
    }
    
    @SuppressWarnings("unchecked")
    private ICompletionProposal[] onComputeQuickAssistProposals(IQuickAssistInvocationContext invocationContext) {
        int offset = invocationContext.getOffset();
>>>>>>> b5fccf994a51539d1b71fe359a0e1d7dbb706904
        PySelection base = edit.createPySelection();
        if (!(this.edit instanceof PyEdit) || base == null) {
            return new ICompletionProposal[0];
Solution content
    public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext invocationContext) {
        int offset = invocationContext.getOffset();
        PySelection base = edit.createPySelection();
        if (!(this.edit instanceof PyEdit) || base == null) {
            return new ICompletionProposal[0];
File
PythonCorrectionProcessor.java
Developer's decision
Version 1
Kind of conflict
Annotation
Cast expression
Comment
For statement
If statement
Method invocation
Method signature
Synchronized statement
Try statement
Variable
Chunk
Conflicting content
        assists.add(new AssistImport());
        assists.add(new AssistDocString());
        assists.add(new AssistAssign());
<<<<<<< HEAD
=======
        assists.add(new AssistPercentToFormat());
//        assists.add(new AssistOverride()); -- Not ready!
>>>>>>> b5fccf994a51539d1b71fe359a0e1d7dbb706904

        assists.addAll(ExtensionHelper.getParticipants(ExtensionHelper.PYDEV_CTRL_1));
        ImageCache imageCache = PydevPlugin.getImageCache();
Solution content
        assists.add(new AssistImport());
        assists.add(new AssistDocString());
        assists.add(new AssistAssign());
        assists.add(new AssistPercentToFormat());

        assists.addAll(ExtensionHelper.getParticipants(ExtensionHelper.PYDEV_CTRL_1));
        ImageCache imageCache = PydevPlugin.getImageCache();
File
PythonCorrectionProcessor.java
Developer's decision
Combination
Kind of conflict
Comment
Method invocation
Chunk
Conflicting content
    }

    protected Control createAppearancePage(Composite parent) {
<<<<<<< HEAD
        Composite appearanceComposite = new Composite(parent, SWT.NONE);
        GridLayout layout = new GridLayout();
        layout.numColumns = 2;
=======
        Composite appearanceComposite= new Composite(parent, SWT.NONE);
        GridLayout layout= new GridLayout(); 
        layout.numColumns= 1;
>>>>>>> b5fccf994a51539d1b71fe359a0e1d7dbb706904
        appearanceComposite.setLayout(layout);

        addTextField(appearanceComposite, "Tab length:", TAB_WIDTH, 3, 0, true);
Solution content
    }

    protected Control createAppearancePage(Composite parent) {
        Composite appearanceComposite = new Composite(parent, SWT.NONE);
        GridLayout layout = new GridLayout();
        layout.numColumns = 1;
        appearanceComposite.setLayout(layout);

        addTextField(appearanceComposite, "Tab length:", TAB_WIDTH, 3, 0, true);
File
PydevEditorPrefs.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
        gd.horizontalSpan = 2;
        l.setLayoutData(gd);

<<<<<<< HEAD
        Composite editorComposite = new Composite(appearanceComposite, SWT.NONE);
        layout = new GridLayout();
        layout.numColumns = 2;
        layout.marginHeight = 0;
        layout.marginWidth = 0;
        editorComposite.setLayout(layout);
        gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
        gd.horizontalSpan = 2;
        editorComposite.setLayoutData(gd);
=======
        Composite editorComposite= new Composite(appearanceComposite, SWT.NONE);
        layout= new GridLayout();
        layout.numColumns= 2;
        layout.marginHeight= 2;
        layout.marginWidth= 0;
        editorComposite.setLayout(layout);
        gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
        gd.horizontalSpan= 2;
        editorComposite.setLayoutData(gd);        
>>>>>>> b5fccf994a51539d1b71fe359a0e1d7dbb706904

        fAppearanceColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
        gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
Solution content
        gd.horizontalSpan = 2;
        l.setLayoutData(gd);

        Composite editorComposite = new Composite(appearanceComposite, SWT.NONE);
        layout = new GridLayout();
        layout.numColumns = 2;
        layout.marginHeight = 2;
        layout.marginWidth = 0;
        editorComposite.setLayout(layout);
        gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
        gd.horizontalSpan = 2;
        editorComposite.setLayoutData(gd);

        fAppearanceColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
        gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
File
PydevEditorPrefs.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
        InputDialog d = new InputDialog(PyAction.getShell(), "Parameters for 2to3.py", msg, "", null) {
            int averageCharWidth;
            int height;
<<<<<<< HEAD

            protected Control createDialogArea(Composite parent) {

=======
            protected boolean isResizable() {
                return true;
            }
            protected Control createDialogArea(Composite parent) {
>>>>>>> b5fccf994a51539d1b71fe359a0e1d7dbb706904
                try {
                    Tuple codeFontDetails = FontUtils.getCodeFontNameAndHeight(IFontUsage.DIALOG);
                    String fontName = codeFontDetails.o1;
Solution content
        InputDialog d = new InputDialog(PyAction.getShell(), "Parameters for 2to3.py", msg, "", null) {
            int averageCharWidth;
            int height;

            protected boolean isResizable() {
                return true;
            }

            protected Control createDialogArea(Composite parent) {
                try {
                    Tuple codeFontDetails = FontUtils.getCodeFontNameAndHeight(IFontUsage.DIALOG);
                    String fontName = codeFontDetails.o1;
File
Py2To3.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Method signature