Boo0ns / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Adding a file throws Exception and deletes file #488

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open a sketch
2. Sketch->Add File
3. Select a previoulsly created .h file in your skecth folder

What is the expected output? 
I expected to appear the .h in an editor tab

What do you see instead?
.h file is deleted.
Exception in output window:

Could not createInput() for C:\Users\Elsni\Documents\Arduino\miditest\seqlib.h
java.io.FileNotFoundException: 
C:\Users\Elsni\Documents\Arduino\miditest\seqlib.h (Das System kann die 
angegebene Datei nicht finden)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at processing.core.PApplet.createInput(Unknown Source)
    at processing.core.PApplet.loadStrings(Unknown Source)
    at processing.app.Base.loadFile(Base.java:2149)
    at processing.app.SketchCode.load(SketchCode.java:251)
    at processing.app.SketchCode.<init>(SketchCode.java:79)
    at processing.app.Sketch.addFile(Sketch.java:1024)
    at processing.app.Sketch.handleAddFile(Sketch.java:918)
    at processing.app.Editor$17.actionPerformed(Editor.java:649)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
    at java.awt.Component.processMouseEvent(Component.java:6263)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at processing.app.SketchCode.load(SketchCode.java:253)
    at processing.app.SketchCode.<init>(SketchCode.java:79)
    at processing.app.Sketch.addFile(Sketch.java:1024)
    at processing.app.Sketch.handleAddFile(Sketch.java:918)
    at processing.app.Editor$17.actionPerformed(Editor.java:649)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
    at java.awt.Component.processMouseEvent(Component.java:6263)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

What version of the Arduino software are you using? 
0022

On what operating system?  
Windows 7 (german) 32 bit 

Which Arduino board are you using?
Duemilanove

Please provide any additional information below.
I wanto to put classes and headers from a previously created scratch in 
seperate files. Maybe I did something wrong, but adding c files to your project 
ist not very intentional if you know full featured IDEs like Visual Studio or 
Eclipse.

I tried to add a an empty .h file - exception (see above)
I tried to create a new .h file by typing a name in the Add File selector 
dialog - exception (see above)

Original issue reported on code.google.com by TheEl...@gmail.com on 3 Mar 2011 at 8:46

GoogleCodeExporter commented 9 years ago
This is still an issue, and exists in Windows 7(64bit) and OSX(Snow Leopard).  
In both, it does provide a warning to 'Replace existing file?', and on 'okay', 
deletes the file, and since the file is now deleted, it throws and error, since 
obviously it can't find the file.

Original comment by alan.chatham@gmail.com on 8 May 2012 at 4:51

GoogleCodeExporter commented 9 years ago
I confirm the issue as described: adding a file that's in the sketchbook 
directory  deletes it and causes the exception. To have it working, the file 
must first be outside the sketchbook.

Original comment by eric.voi...@gmail.com on 29 Jan 2013 at 7:22