Permalink
Browse files

Fix p:episode issue; see #286

  • Loading branch information...
ndw committed Jan 18, 2019
1 parent 1098686 commit f58db234872914262a714830346bafecb31c6104
Showing with 1 addition and 15 deletions.
  1. +1 −15 src/main/java/com/xmlcalabash/core/XProcRuntime.java
@@ -96,8 +96,6 @@
import java.lang.reflect.Method;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@@ -526,19 +524,7 @@ public Parser getParser() {

public String getEpisode() {
if (episode == null) {
MessageDigest digest = null;
GregorianCalendar calendar = new GregorianCalendar();
try {
digest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException nsae) {
throw XProcException.dynamicError(36);
}

byte[] hash = digest.digest(calendar.toString().getBytes());
episode = "CB";
for (byte b : hash) {
episode = episode + Integer.toHexString(b & 0xff);
}
episode = "CB-" + java.util.UUID.randomUUID().toString();
}

return episode;

0 comments on commit f58db23

Please sign in to comment.