Skip to content

Commit 9c2effa

Browse files
committed
Refactoring Regression Fix
Debugger improvment
1 parent 9637af5 commit 9c2effa

File tree

6 files changed

+17
-21
lines changed

6 files changed

+17
-21
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@
749749
<properties>
750750
<dev.name>albilu</dev.name>
751751
<netbeans.release.version>RELEASE170</netbeans.release.version>
752-
<next.version>0.6</next.version>
752+
<next.version>0.7</next.version>
753753
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
754754
</properties>
755755
</project>

src/main/java/org/netbeans/modules/python/debugger/PythonDebugger.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ void kill() {
153153
pdbClient.getProcess().destroyForcibly();
154154
pdbClient.getReader().close();
155155
pdbClient.getWriter().close();
156-
engineProvider.getDestructor().killEngine();
157-
io.closeInputOutput();
158-
createHandle.finish();
159156
} catch (IOException ex) {
160157
Exceptions.printStackTrace(ex);
161158
}
159+
engineProvider.getDestructor().killEngine();
160+
io.closeInputOutput();
161+
createHandle.finish();
162162
}
163163

164164
public PdbClient getPdbClient() {

src/main/java/org/netbeans/modules/python/debugger/pdb/PdbClient.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,18 @@ public BufferedWriter getWriter() {
6767

6868
public void sendCommand(String cmd) throws IOException {
6969
isStopped = false;
70+
writeToStream(cmd);
71+
}
72+
73+
private void writeToStream(String cmd) throws IOException {
7074
writer.write(cmd);
7175
writer.newLine();
7276
writer.flush();
7377
}
7478

7579
public boolean sendCommandAndProcessResponse(String cmd) throws IOException {
7680
isStopped = false;
77-
writer.write(cmd);
78-
writer.newLine();
79-
writer.flush();
81+
writeToStream(cmd);
8082
try {
8183
return processResponse(getStreamResponse(false));
8284
} catch (IOException ex) {
@@ -88,9 +90,7 @@ public boolean sendCommandAndProcessResponse(String cmd) throws IOException {
8890

8991
public Object[] sendBreakpointsCommand(String cmd) throws IOException {
9092
isStopped = false;
91-
writer.write(cmd);
92-
writer.newLine();
93-
writer.flush();
93+
writeToStream(cmd);
9494
try {
9595
return breakPointCommandResponse(getStreamResponse(false));
9696
} catch (IOException ex) {
@@ -103,18 +103,14 @@ public Object[] sendBreakpointsCommand(String cmd) throws IOException {
103103

104104
public List<PythonDebuggerCallStack> sendWhere(String cmd) throws IOException {
105105
isStopped = false;
106-
writer.write(cmd);
107-
writer.newLine();
108-
writer.flush();
106+
writeToStream(cmd);
109107
return whereResponse(getStreamResponse(false));
110108

111109
}
112110

113111
public String sendCommandAndGetResponse(String cmd) throws IOException {
114112
isStopped = false;
115-
writer.write(cmd);
116-
writer.newLine();
117-
writer.flush();
113+
writeToStream(cmd);
118114
return StringUtils.removeEnd(getStreamResponse(false), "(Pdb)").trim();
119115
}
120116

src/main/java/org/netbeans/modules/python/indexing/PythonCustomIndexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected void index(Iterable<? extends Indexable> files, Context context) {
5252
FileObject root = context.getRoot();
5353
Project owner = root != null ? FileOwnerQuery.getOwner(root) : null;
5454
boolean pyProject = owner != null && owner.getClass()
55-
.getName().equals("org.netbeans.modules.python.PythonProject");
55+
.getName().equals("org.netbeans.modules.python.project.PythonProject");
5656
boolean pyLibPath = root != null && root.getParent() != null
5757
&& root.getParent().getName().equals("lib");
5858
if (pyProject || pyLibPath) {

src/main/java/org/netbeans/modules/python/indexing/PythonCustomIndexerFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void filesDeleted(Iterable<? extends Indexable> deleted, Context context)
3838
FileObject fo = context.getRoot();
3939
Project owner = fo != null ? FileOwnerQuery.getOwner(fo) : null;
4040
if (owner != null && owner.getClass()
41-
.getName().equals("org.netbeans.modules.python.PythonProject")) {
41+
.getName().equals("org.netbeans.modules.python.project.PythonProject")) {
4242
try {
4343
IndexingSupport is = IndexingSupport.getInstance(context);
4444
for (Indexable indexable : deleted) {
@@ -58,7 +58,7 @@ public void filesDirty(Iterable<? extends Indexable> dirty, Context context) {
5858
FileObject fo = context.getRoot();
5959
Project owner = fo != null ? FileOwnerQuery.getOwner(fo) : null;
6060
if (owner != null && owner.getClass()
61-
.getName().equals("org.netbeans.modules.python.PythonProject")) {
61+
.getName().equals("org.netbeans.modules.python.project.PythonProject")) {
6262
try {
6363
IndexingSupport is = IndexingSupport.getInstance(context);
6464
for (Indexable indexable : dirty) {

src/main/java/org/netbeans/modules/python/indexing/PythonErrorAnnotator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Image annotateIcon(Image icon, int iconType, Set<? extends FileObject> fi
5757
Project owner = FileOwnerQuery.getOwner(fo);
5858

5959
if (!Utilities.isBadgesEnabled() || owner == null || !owner.getClass().getName()
60-
.equals("org.netbeans.modules.python.PythonProject")) {
60+
.equals("org.netbeans.modules.python.project.PythonProject")) {
6161
return null;
6262
}
6363
boolean inError = false;
@@ -97,7 +97,7 @@ public Image annotateIcon(Image icon, int iconType, Set<? extends FileObject> fi
9797
}
9898

9999
if (owner.getClass().getName()
100-
.equals("org.netbeans.modules.python.PythonProject")
100+
.equals("org.netbeans.modules.python.project.PythonProject")
101101
&& files.size() == 1 && fo.isFolder() && fo.getFileObject("__init__.py") != null) {
102102
icon = ImageUtilities.mergeImages(icon, ImageUtilities
103103
.addToolTipToImage(ImageUtilities.loadImage(IMAGE), "<img src='"

0 commit comments

Comments
 (0)