wmyywm / eclipse-code-formatter-intellij-plugin

Automatically exported from code.google.com/p/eclipse-code-formatter-intellij-plugin
0 stars 0 forks source link

Bug with import order from file #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install plugin
2. Configure using a file exported from eclipse
3. Try to organize imports

What is the expected output? What do you see instead?
Imports being in order. Instead is occurring an exception

What version of the product are you using? On what operating system?
IntelliJ 12.0.1
Plugin version 3.3
Windows 7

Please provide any additional information below.

See attachment to see files.

Stack trace:
imports: import org.junit.BeforeClass;import org.junit.Test;import 
java.io.IOException;, settings: java;javax;org;com;: imports: import 
org.junit.BeforeClass;import org.junit.Test;import java.io.IOException;, 
settings: java;javax;org;com;
krasa.formatter.plugin.ImportSorterException: imports: import 
org.junit.BeforeClass;import org.junit.Test;import java.io.IOException;, 
settings: java;javax;org;com;
    at krasa.formatter.plugin.processor.ImportOrderProcessor.process(ImportOrderProcessor.java:50)
    at krasa.formatter.plugin.EclipseCodeFormatter.postProcess(EclipseCodeFormatter.java:91)
    at krasa.formatter.plugin.EclipseCodeFormatter.formatWhenEditorIsOpen(EclipseCodeFormatter.java:84)
    at krasa.formatter.plugin.EclipseCodeFormatter.format(EclipseCodeFormatter.java:52)
    at krasa.formatter.plugin.EclipseCodeStyleManager.formatWithEclipse(EclipseCodeStyleManager.java:124)
    at krasa.formatter.plugin.EclipseCodeStyleManager.reformatText(EclipseCodeStyleManager.java:76)
    at krasa.formatter.plugin.DelegatingCodeStyleManager.reformatText(DelegatingCodeStyleManager.java:157)
    at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:94)
    at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:83)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$2.run(AbstractLayoutCodeProcessor.java:210)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:986)
    at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$9$1$1.run(AbstractLayoutCodeProcessor.java:489)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:122)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:97)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:83)
    at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$9$1.run(AbstractLayoutCodeProcessor.java:484)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:333)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:682)
    at java.awt.EventQueue$3.run(EventQueue.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:673)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:498)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:333)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
Caused by: krasa.formatter.plugin.InvalidPropertyFile: Property 
org.eclipse.jdt.ui.importorder does not exists in 
D:\workspaces\bacen\bcjur2\Modelos_e_Implementacao\Implementacao\config\bcjur2.i
mportorder
    at krasa.formatter.settings.provider.ImportOrderProvider.readFile(ImportOrderProvider.java:29)
    at krasa.formatter.settings.provider.ImportOrderProvider.readFile(ImportOrderProvider.java:16)
    at krasa.formatter.settings.provider.CachedProvider.get(CachedProvider.java:25)
    at krasa.formatter.plugin.processor.ImportOrderProcessor.getImportSorter(ImportOrderProcessor.java:61)
    at krasa.formatter.plugin.processor.ImportOrderProcessor.process(ImportOrderProcessor.java:38)
    ... 35 more

Original issue reported on code.google.com by VictorDFB on 16 Jan 2013 at 8:36

Attachments:

GoogleCodeExporter commented 9 years ago
hmm interesting, different format of import settings...

Original comment by vojta.kr...@gmail.com on 16 Jan 2013 at 10:19

GoogleCodeExporter commented 9 years ago
Wanna help to implement this? I can help if needed.

Original comment by VictorDFB on 16 Jan 2013 at 10:38

GoogleCodeExporter commented 9 years ago
no need, it is really simple.

just tell me if "br.gov.bcb" should be before "com", or after.

Original comment by vojta.kr...@gmail.com on 16 Jan 2013 at 10:42

GoogleCodeExporter commented 9 years ago
Try it

Original comment by vojta.kr...@gmail.com on 16 Jan 2013 at 11:35

GoogleCodeExporter commented 9 years ago
Oh sorry, I'm late. The order is defined by the keys...

Original comment by VictorDFB on 17 Jan 2013 at 12:13

GoogleCodeExporter commented 9 years ago
good, I thought so.

Original comment by vojta.kr...@gmail.com on 17 Jan 2013 at 8:02