Skip to content

Commit

Permalink
Merge branch 'hotfix-1.6.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed Dec 10, 2013
2 parents f3eff9b + 57903bf commit bbb45db
Show file tree
Hide file tree
Showing 171 changed files with 3,211 additions and 1,164 deletions.
3 changes: 3 additions & 0 deletions _base/base-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<property name="project.debug-level" value="lines,vars,source"/>
<property name="project.target-comp" value="1.6"/>
<property name="project.source-comp" value="1.6"/>
<property name="ant.build.javac.source" value="1.6"/>
<property name="ant.build.javac.target" value="1.6"/>

<property name="build.sysclasspath" value="ignore"/>

<path id="project.classpath">
Expand Down
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<property environment="env"/>
<property name="vendor" value="NuvolaBase Ltd"/>
<property name="product" value="OrientDB"/>
<property name="version" value="1.6.1"/>
<property name="version" value="1.6.2"/>
<condition property="community.release" value="${releaseHome}/orientdb-community-${version}"
else="../releases/orientdb-community-${version}">
<isset property="releaseHome"/>
Expand Down
4 changes: 1 addition & 3 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>1.6.1</version>
<version>1.6.2</version>
<relativePath>../</relativePath>
</parent>

Expand All @@ -35,7 +35,6 @@
<properties>
<osgi.import>*</osgi.import>
<osgi.export>com.orientechnologies.orient.client.*</osgi.export>
<osgi.fragment.host>com.orientechnologies.orientdb-core</osgi.fragment.host>
</properties>

<dependencies>
Expand All @@ -46,5 +45,4 @@
</dependency>
</dependencies>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -1809,13 +1809,15 @@ private void removeDeadConnections() {
// FREE DEAD CONNECTIONS
int removedDeadConnections = 0;
for (OChannelBinaryAsynchClient n : new ArrayList<OChannelBinaryAsynchClient>(networkPool)) {
if (n != null && !n.isConnected())
if (n != null && !n.isConnected()) //Fixed issue with removing of network connections though connection is active.
{
try {
n.close();
} catch (Exception e) {
}
networkPool.remove(n);
removedDeadConnections++;
}
}

OLogManager.instance().debug(this, "Found and removed %d dead connections from the network pool", removedDeadConnections);
Expand Down
3 changes: 1 addition & 2 deletions commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>1.6.1</version>
<version>1.6.2</version>
<relativePath>../</relativePath>
</parent>

Expand All @@ -35,7 +35,6 @@
<properties>
<osgi.export>com.orientechnologies.common.*</osgi.export>
<osgi.import>javax.imageio.spi.*,sun.misc.*;resolution:=optional</osgi.import>
<osgi.fragment.host>com.orientechnologies.orientdb-core</osgi.fragment.host>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
*/
public class OCaseInsentiveComparator implements Comparator<String> {
public int compare(final String stringOne, final String stringTwo) {
return stringOne.toLowerCase().compareTo(stringTwo.toLowerCase());
return stringOne.compareToIgnoreCase(stringTwo);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.orientechnologies.common.console;

import com.orientechnologies.common.concur.resource.OCloseable;

/**
* @author <a href='mailto:enisher@gmail.com'> Artem Orobets </a>
*/
public interface OCommandStream extends OCloseable {
boolean hasNext();
String nextCommand();
}
32 changes: 16 additions & 16 deletions commons/src/main/java/com/orientechnologies/common/console/OConsoleApplication.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;

Expand Down Expand Up @@ -85,7 +91,7 @@ public int run() {
if (consoleInput == null || consoleInput.length() == 0)
continue;

if (!executeCommands(new Scanner(consoleInput), false))
if (!executeCommands(new ODFACommandStream(consoleInput), false))
break;
}
} else {
Expand All @@ -105,28 +111,22 @@ protected boolean isInteractiveMode(String[] args) {
protected boolean executeBatch(final String commandLine) {
final File commandFile = new File(commandLine);

Scanner scanner = null;

OCommandStream scanner;
try {
scanner = new Scanner(commandFile);
scanner = new ODFACommandStream(commandFile);
} catch (FileNotFoundException e) {
scanner = new Scanner(commandLine);
scanner = new ODFACommandStream(commandLine);
}

return executeCommands(scanner, true);
}

protected boolean executeCommands(final Scanner iScanner, final boolean iExitOnException) {
protected boolean executeCommands(final OCommandStream commandStream, final boolean iExitOnException) {
final StringBuilder commandBuffer = new StringBuilder();

try {
String commandLine = null;

iScanner.useDelimiter(";(?=([^\"]*\"[^\"]*\")*[^\"]*$)(?=([^']*'[^']*')*[^']*$)|\n");

while (iScanner.hasNext()) {

commandLine = iScanner.next().trim();
while (commandStream.hasNext()) {
String commandLine = commandStream.nextCommand();

if (commandLine.isEmpty())
// EMPTY LINE
Expand Down Expand Up @@ -167,7 +167,7 @@ protected boolean executeCommands(final Scanner iScanner, final boolean iExitOnE
return false;
}
} finally {
iScanner.close();
commandStream.close();
}
return true;
}
Expand Down Expand Up @@ -349,7 +349,7 @@ protected void syntaxError(String iCommand, Method m) {
/**
* Returns a map of all console method and the object they can be called on.
*
* @return Map<Method,Object>
* @return Map&lt;Method,Object&gt;
*/
protected Map<Method, Object> getConsoleMethods() {

Expand Down
Loading

0 comments on commit bbb45db

Please sign in to comment.