| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -327,7 +327,9 @@ static public void logf(String message, Object... args) { | |||
| 327 | 327 | ||
| 328 | 328 | static public void loge(String message, Throwable e) { | |
| 329 | 329 | if (Base.DEBUG) { | |
| 330 | - System.err.println(message); | ||
| 330 | + if (message != null) { | ||
| 331 | + System.err.println(message); | ||
| 332 | + } | ||
| 331 | 333 | e.printStackTrace(); | |
| 332 | 334 | } | |
| 333 | 335 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,21 +1,22 @@ | |||
| 1 | 1 | /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ | |
| 2 | 2 | ||
| 3 | 3 | /* | |
| 4 | - Part of the Processing project - http://processing.org | ||
| 5 | - Copyright (c) 2012-15 The Processing Foundation | ||
| 4 | + Part of the Processing project - http://processing.org | ||
| 6 | 5 | ||
| 7 | - This program is free software; you can redistribute it and/or modify | ||
| 8 | - it under the terms of the GNU General Public License version 2 | ||
| 9 | - as published by the Free Software Foundation. | ||
| 6 | + Copyright (c) 2012-16 The Processing Foundation | ||
| 10 | 7 | ||
| 11 | - This program is distributed in the hope that it will be useful, | ||
| 12 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | - GNU General Public License for more details. | ||
| 8 | + This program is free software; you can redistribute it and/or | ||
| 9 | + modify it under the terms of the GNU General Public License | ||
| 10 | + version 2, as published by the Free Software Foundation. | ||
| 15 | 11 | ||
| 16 | - You should have received a copy of the GNU General Public License | ||
| 17 | - along with this program; if not, write to the Free Software Foundation, Inc. | ||
| 18 | - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 12 | + This program is distributed in the hope that it will be useful, | ||
| 13 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | + GNU General Public License for more details. | ||
| 16 | + | ||
| 17 | + You should have received a copy of the GNU General Public License | ||
| 18 | + along with this program; if not, write to the Free Software Foundation, | ||
| 19 | + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | 20 | */ | |
| 20 | 21 | ||
| 21 | 22 | package processing.mode.java.debug; | |
@@ -24,45 +25,38 @@ | |||
| 24 | 25 | import com.sun.jdi.ClassNotLoadedException; | |
| 25 | 26 | import com.sun.jdi.InvalidTypeException; | |
| 26 | 27 | import com.sun.jdi.Value; | |
| 27 | - import java.util.logging.Level; | ||
| 28 | - import java.util.logging.Logger; | ||
| 28 | + | ||
| 29 | + import processing.app.Messages; | ||
| 29 | 30 | ||
| 30 | 31 | /** | |
| 31 | 32 | * Specialized {@link VariableNode} for representing single fields in an array. | |
| 32 | 33 | * Overrides {@link #setValue} to properly change the value of the encapsulated | |
| 33 | 34 | * array field. | |
| 34 | - * | ||
| 35 | - * @author Martin Leopold <m@martinleopold.com> | ||
| 36 | 35 | */ | |
| 37 | 36 | public class ArrayFieldNode extends VariableNode { | |
| 38 | - | ||
| 39 | - protected ArrayReference array; | ||
| 40 | - protected int index; | ||
| 41 | - | ||
| 42 | - /** | ||
| 43 | - * Construct an {@link ArrayFieldNode}. | ||
| 44 | - * | ||
| 45 | - * @param name the name | ||
| 46 | - * @param type the type | ||
| 47 | - * @param value the value | ||
| 48 | - * @param array a reference to the array | ||
| 49 | - * @param index the index inside the array | ||
| 50 | - */ | ||
| 51 | - public ArrayFieldNode(String name, String type, Value value, ArrayReference array, int index) { | ||
| 52 | - super(name, type, value); | ||
| 53 | - this.array = array; | ||
| 54 | - this.index = index; | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - @Override | ||
| 58 | - public void setValue(Value value) { | ||
| 59 | - try { | ||
| 60 | - array.setValue(index, value); | ||
| 61 | - } catch (InvalidTypeException ex) { | ||
| 62 | - Logger.getLogger(ArrayFieldNode.class.getName()).log(Level.SEVERE, null, ex); | ||
| 63 | - } catch (ClassNotLoadedException ex) { | ||
| 64 | - Logger.getLogger(ArrayFieldNode.class.getName()).log(Level.SEVERE, null, ex); | ||
| 65 | - } | ||
| 66 | - this.value = value; | ||
| 37 | + protected ArrayReference array; | ||
| 38 | + protected int index; | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * Construct an {@link ArrayFieldNode}. | ||
| 43 | + */ | ||
| 44 | + public ArrayFieldNode(String name, String type, Value value, ArrayReference array, int index) { | ||
| 45 | + super(name, type, value); | ||
| 46 | + this.array = array; | ||
| 47 | + this.index = index; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + | ||
| 51 | + @Override | ||
| 52 | + public void setValue(Value value) { | ||
| 53 | + try { | ||
| 54 | + array.setValue(index, value); | ||
| 55 | + } catch (InvalidTypeException ex) { | ||
| 56 | + Messages.loge(null, ex); | ||
| 57 | + } catch (ClassNotLoadedException ex) { | ||
| 58 | + Messages.loge(null, ex); | ||
| 67 | 59 | } | |
| 60 | + this.value = value; | ||
| 61 | + } | ||
| 68 | 62 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,40 +1,38 @@ | |||
| 1 | 1 | /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ | |
| 2 | 2 | ||
| 3 | 3 | /* | |
| 4 | - Part of the Processing project - http://processing.org | ||
| 5 | - Copyright (c) 2012-15 The Processing Foundation | ||
| 4 | + Part of the Processing project - http://processing.org | ||
| 6 | 5 | ||
| 7 | - This program is free software; you can redistribute it and/or modify | ||
| 8 | - it under the terms of the GNU General Public License version 2 | ||
| 9 | - as published by the Free Software Foundation. | ||
| 6 | + Copyright (c) 2012-16 The Processing Foundation | ||
| 10 | 7 | ||
| 11 | - This program is distributed in the hope that it will be useful, | ||
| 12 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | - GNU General Public License for more details. | ||
| 8 | + This program is free software; you can redistribute it and/or | ||
| 9 | + modify it under the terms of the GNU General Public License | ||
| 10 | + version 2, as published by the Free Software Foundation. | ||
| 15 | 11 | ||
| 16 | - You should have received a copy of the GNU General Public License | ||
| 17 | - along with this program; if not, write to the Free Software Foundation, Inc. | ||
| 18 | - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 12 | + This program is distributed in the hope that it will be useful, | ||
| 13 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | + GNU General Public License for more details. | ||
| 16 | + | ||
| 17 | + You should have received a copy of the GNU General Public License | ||
| 18 | + along with this program; if not, write to the Free Software Foundation, | ||
| 19 | + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | 20 | */ | |
| 20 | 21 | ||
| 21 | 22 | package processing.mode.java.debug; | |
| 22 | 23 | ||
| 23 | 24 | import com.sun.jdi.ReferenceType; | |
| 24 | 25 | ||
| 26 | + | ||
| 25 | 27 | /** | |
| 26 | 28 | * Listener to be notified when a class is loaded in the debugger. Used by | |
| 27 | 29 | * {@link LineBreakpoint}s to activate themselves as soon as the respective | |
| 28 | 30 | * class is loaded. | |
| 29 | - * | ||
| 30 | - * @author Martin Leopold <m@martinleopold.com> | ||
| 31 | 31 | */ | |
| 32 | 32 | public interface ClassLoadListener { | |
| 33 | 33 | ||
| 34 | - /** | ||
| 35 | - * Event handler called when a class is loaded. | ||
| 36 | - * | ||
| 37 | - * @param theClass the class | ||
| 38 | - */ | ||
| 39 | - public void classLoaded(ReferenceType theClass); | ||
| 34 | + /** | ||
| 35 | + * Event handler called when a class is loaded. | ||
| 36 | + */ | ||
| 37 | + public void classLoaded(ReferenceType theClass); | ||
| 40 | 38 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,20 +2,21 @@ | |||
| 2 | 2 | ||
| 3 | 3 | /* | |
| 4 | 4 | Part of the Processing project - http://processing.org | |
| 5 | - Copyright (c) 2012-15 The Processing Foundation | ||
| 6 | 5 | ||
| 7 | - This program is free software; you can redistribute it and/or modify | ||
| 8 | - it under the terms of the GNU General Public License version 2 | ||
| 9 | - as published by the Free Software Foundation. | ||
| 6 | + Copyright (c) 2012-16 The Processing Foundation | ||
| 7 | + | ||
| 8 | + This program is free software; you can redistribute it and/or | ||
| 9 | + modify it under the terms of the GNU General Public License | ||
| 10 | + version 2, as published by the Free Software Foundation. | ||
| 10 | 11 | ||
| 11 | 12 | This program is distributed in the hope that it will be useful, | |
| 12 | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | 15 | GNU General Public License for more details. | |
| 15 | 16 | ||
| 16 | 17 | You should have received a copy of the GNU General Public License | |
| 17 | - along with this program; if not, write to the Free Software Foundation, Inc. | ||
| 18 | - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 18 | + along with this program; if not, write to the Free Software Foundation, | ||
| 19 | + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | 20 | */ | |
| 20 | 21 | ||
| 21 | 22 | package processing.mode.java.debug; | |
@@ -25,46 +26,40 @@ | |||
| 25 | 26 | import com.sun.jdi.InvalidTypeException; | |
| 26 | 27 | import com.sun.jdi.ObjectReference; | |
| 27 | 28 | import com.sun.jdi.Value; | |
| 28 | - import java.util.logging.Level; | ||
| 29 | - import java.util.logging.Logger; | ||
| 29 | + | ||
| 30 | + import processing.app.Messages; | ||
| 30 | 31 | ||
| 31 | 32 | ||
| 32 | 33 | /** | |
| 33 | 34 | * Specialized {@link VariableNode} for representing fields. Overrides | |
| 34 | 35 | * {@link #setValue} to properly change the value of the encapsulated field. | |
| 35 | - * | ||
| 36 | - * @author Martin Leopold <m@martinleopold.com> | ||
| 37 | 36 | */ | |
| 38 | 37 | public class FieldNode extends VariableNode { | |
| 39 | - protected Field field; | ||
| 40 | - protected ObjectReference obj; | ||
| 38 | + protected Field field; | ||
| 39 | + protected ObjectReference obj; | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * Construct a {@link FieldNode}. | ||
| 44 | + * @param obj a reference to the object containing the field | ||
| 45 | + */ | ||
| 46 | + public FieldNode(String name, String type, Value value, Field field, | ||
| 47 | + ObjectReference obj) { | ||
| 48 | + super(name, type, value); | ||
| 49 | + this.field = field; | ||
| 50 | + this.obj = obj; | ||
| 51 | + } | ||
| 41 | 52 | ||
| 42 | - | ||
| 43 | - /** | ||
| 44 | - * Construct a {@link FieldNode}. | ||
| 45 | - * | ||
| 46 | - * @param name the name | ||
| 47 | - * @param type the type | ||
| 48 | - * @param value the value | ||
| 49 | - * @param field the field | ||
| 50 | - * @param obj a reference to the object containing the field | ||
| 51 | - */ | ||
| 52 | - public FieldNode(String name, String type, Value value, Field field, ObjectReference obj) { | ||
| 53 | - super(name, type, value); | ||
| 54 | - this.field = field; | ||
| 55 | - this.obj = obj; | ||
| 56 | - } | ||
| 57 | 53 | ||
| 58 | - | ||
| 59 | - @Override | ||
| 60 | - public void setValue(Value value) { | ||
| 61 | - try { | ||
| 62 | - obj.setValue(field, value); | ||
| 63 | - } catch (InvalidTypeException ex) { | ||
| 64 | - Logger.getLogger(FieldNode.class.getName()).log(Level.SEVERE, null, ex); | ||
| 65 | - } catch (ClassNotLoadedException ex) { | ||
| 66 | - Logger.getLogger(FieldNode.class.getName()).log(Level.SEVERE, null, ex); | ||
| 67 | - } | ||
| 68 | - this.value = value; | ||
| 54 | + @Override | ||
| 55 | + public void setValue(Value value) { | ||
| 56 | + try { | ||
| 57 | + obj.setValue(field, value); | ||
| 58 | + } catch (InvalidTypeException ite) { | ||
| 59 | + Messages.loge(null, ite); | ||
| 60 | + } catch (ClassNotLoadedException cnle) { | ||
| 61 | + Messages.loge(null, cnle); | ||
| 69 | 62 | } | |
| 63 | + this.value = value; | ||
| 64 | + } | ||
| 70 | 65 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments