Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RepositoryServiceImpl improvements #54

Open
wants to merge 8 commits into
base: trunk
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ private String saveGetIdString(ItemId id, SessionInfo sessionInfo) {
}

private String saveGetIdString(ItemId id, NamePathResolver resolver) {
StringBuffer bf = new StringBuffer();
StringBuilder bf = new StringBuilder();
String uid = id.getUniqueID();
if (uid != null) {
bf.append(uid);
Expand Down Expand Up @@ -1388,7 +1388,7 @@ public PropertyInfo getPropertyInfo(SessionInfo sessionInfo, PropertyId property
v = getQValueFactory().create(entity.getContent());
} else {
Reader reader = new InputStreamReader(entity.getContent(), ct.getCharset());
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
int c;
while ((c = reader.read()) > -1) {
sb.append((char) c);
Expand Down Expand Up @@ -2054,7 +2054,9 @@ public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, No
} catch (DavException ex) {
throw ExceptionConverter.generate(ex);
} finally {
request.releaseConnection();
if (request != null) {
request.releaseConnection();
}
}
}

Expand All @@ -2073,7 +2075,9 @@ public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId,
} catch (DavException ex) {
throw ExceptionConverter.generate(ex);
} finally {
request.releaseConnection();
if (request != null) {
request.releaseConnection();
}
}
}

Expand Down Expand Up @@ -2183,7 +2187,7 @@ public EventFilter createEventFilter(SessionInfo sessionInfo,
if (nodeTypeNames != null) {
resolvedTypeNames = new HashSet<Name>();
// make sure node type definitions are available
if (nodeTypeDefinitions.size() == 0) {
if (nodeTypeDefinitions.isEmpty()) {
getQNodeTypeDefinitions(sessionInfo);
}
synchronized (nodeTypeDefinitions) {
Expand Down
Loading