code
stringlengths
73
34.1k
label
stringclasses
1 value
public void cleanDatabase() { lockingMechanism.writeLock().lock(); try { for (ODocument edge : graph.browseEdges()) { edge.delete(); } for (ODocument node : graph.browseVertices()) { node.delete(); } } finally { ...
java
private void checkTransformationDescriptionId(TransformationDescription description) { if (description.getId() == null) { description.setId("EKBInternal-" + counter.incrementAndGet()); } }
java
private List<ODocument> getEdgesBetweenModels(String source, String target) { ODocument from = getModel(source); ODocument to = getModel(target); String query = "select from E where out = ? AND in = ?"; return graph.query(new OSQLSynchQuery<ODocument>(query), from, to); }
java
private List<ODocument> getNeighborsOfModel(String model) { String query = String.format("select from Models where in.out.%s in [?]", OGraphDatabase.LABEL); List<ODocument> neighbors = graph.query(new OSQLSynchQuery<ODocument>(query), model); return neighbors; }
java
private ODocument getOrCreateModel(String model) { ODocument node = getModel(model); if (node == null) { node = graph.createVertex("Models"); OrientModelGraphUtils.setIdFieldValue(node, model.toString()); OrientModelGraphUtils.setActiveFieldValue(node, false); ...
java
private ODocument getModel(String model) { String query = String.format("select from Models where %s = ?", OGraphDatabase.LABEL); List<ODocument> from = graph.query(new OSQLSynchQuery<ODocument>(query), model); if (from.size() > 0) { return from.get(0); } else { r...
java
private List<ODocument> recursivePathSearch(String start, String end, List<String> ids, ODocument... steps) { List<ODocument> neighbors = getNeighborsOfModel(start); for (ODocument neighbor : neighbors) { if (alreadyVisited(neighbor, steps) || !OrientModelGraphUtils.getActiveFieldValue(neigh...
java
private ODocument getEdgeWithPossibleId(String start, String end, List<String> ids) { List<ODocument> edges = getEdgesBetweenModels(start, end); for (ODocument edge : edges) { if (ids.contains(OrientModelGraphUtils.getIdFieldValue(edge))) { return edge; } ...
java
private boolean alreadyVisited(ODocument neighbor, ODocument[] steps) { for (ODocument step : steps) { ODocument out = graph.getOutVertex(step); if (out.equals(neighbor)) { return true; } } return false; }
java
public boolean isModelActive(ModelDescription model) { lockingMechanism.readLock().lock(); try { ODocument node = getModel(model.toString()); return OrientModelGraphUtils.getActiveFieldValue(node); } finally { lockingMechanism.readLock().unlock(); } ...
java
protected com.sun.jersey.api.client.Client getJerseyClient() { final ClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE); com.sun.jersey.api.client.Client client = com.sun.jersey.api.client.Client.create(clientConfig); ...
java
public static boolean isEmpty(final Collection<String> c) { if (c == null || c.isEmpty()) { return false; } for (final String text : c) { if (isNotEmpty(text)) { return false; } } return true; }
java
public static boolean isBlank(final Collection<String> c) { if (c == null || c.isEmpty()) { return false; } for (final String text : c) { if (isNotBlank(text)) { return false; } } return true; }
java
private boolean hello(InetAddress broadcast) { if (socket == null) return false; Command hello = new Command(); byte[] helloMsg = hello.create(); DatagramPacket packet; if (ip == null){ if (this.acceptableModels == null) return false; packet = new Datagram...
java
public boolean discover(){ boolean helloResponse = false; for (int helloRetries = this.retries; helloRetries >= 0; helloRetries--) { List<InetAddress> broadcast = listAllBroadcastAddresses(); if (broadcast == null) return false; for (InetAddress i : broadcast) { ...
java
public String send(String payload) throws CommandExecutionException { if (payload == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); if (deviceID == -1 || timeStamp == -1 || token == null || ip == null) { if (!discover()) throw new CommandExecut...
java
public boolean update(String url, String md5) throws CommandExecutionException { if (url == null || md5 == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); if (md5.length() != 32) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PA...
java
public int updateProgress() throws CommandExecutionException { int resp = sendToArray("miIO.get_ota_progress").optInt(0, -1); if ((resp < 0) || (resp > 100)) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); return resp; }
java
public String updateStatus() throws CommandExecutionException { String resp = sendToArray("miIO.get_ota_state").optString(0, null); if (resp == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); return resp; }
java
public String model() throws CommandExecutionException { JSONObject in = info(); if (in == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); return in.optString("model"); }
java
public static byte[] hexToBytes(String s) { try { if (s == null) return new byte[0]; s = s.toUpperCase(); int len = s.length(); byte[] data = new byte[len / 2]; for (int i = 0; i < len; i += 2) { data[i / 2] = (byte) ((Character.digit(s...
java
public static byte[] append(byte[] first, byte[] second) { if ((first == null) || (second == null)) return null; byte[] output = new byte[first.length + second.length]; System.arraycopy(first, 0, output, 0, first.length); System.arraycopy(second, 0, output, first.length, second.length); ...
java
public static byte[] toBytes(long value, int length) { if (length <= 0) return new byte[0]; if (length > 8) length = 8; byte[] out = new byte[length]; for (int i = length - 1; i >= 0; i--){ out[i] = (byte)(value & 0xFFL); value = value >> 8; } retu...
java
public static long fromBytes(byte[] value){ if (value == null) return 0; long out = 0; int length = value.length; if (length > 8) length = 8; for (int i = 0; i < length; i++){ out = (out << 8) + (value[i] & 0xff); } return out; }
java
protected final void acceptAnnotations(final MethodVisitor mv) { int n = visibleTypeAnnotations == null ? 0 : visibleTypeAnnotations .size(); for (int i = 0; i < n; ++i) { TypeAnnotationNode an = visibleTypeAnnotations.get(i); an.accept(mv.visitInsnAnnotation(an.t...
java
protected final AbstractInsnNode cloneAnnotations( final AbstractInsnNode insn) { if (insn.visibleTypeAnnotations != null) { this.visibleTypeAnnotations = new ArrayList<TypeAnnotationNode>(); for (int i = 0; i < insn.visibleTypeAnnotations.size(); ++i) { TypeA...
java
public String getDebugInfo() { StringBuilder sb = new StringBuilder("\r\n========BeanBox Debug for " + this + "===========\r\n"); sb.append("target=" + this.target).append("\r\n"); sb.append("pureValue=" + this.pureValue).append("\r\n"); sb.append("type=" + this.type).append("\r\n"); sb.append("required=" + t...
java
public synchronized BeanBox addBeanAop(Object aop, String methodNameRegex) { checkOrCreateMethodAopRules(); aopRules.add(new Object[] { BeanBoxUtils.checkAOP(aop), methodNameRegex }); return this; }
java
public BeanBox injectField(String fieldName, Object inject) { BeanBox box = BeanBoxUtils.wrapParamToBox(inject); checkOrCreateFieldInjects(); Field f = ReflectionUtils.findField(beanClass, fieldName); box.setType(f.getType()); ReflectionUtils.makeAccessible(f); this.getFieldInjects().put(f, box); return t...
java
public BeanBox injectValue(String fieldName, Object constValue) { checkOrCreateFieldInjects(); Field f = ReflectionUtils.findField(beanClass, fieldName); BeanBox inject = new BeanBox(); inject.setTarget(constValue); inject.setType(f.getType()); inject.setPureValue(true); ReflectionUtils.makeAccessible(f);...
java
public void updateIndex(final int index) { int newTypeRef = 0x42000000 | (index << 8); if (visibleTypeAnnotations != null) { for (TypeAnnotationNode tan : visibleTypeAnnotations) { tan.typeRef = newTypeRef; } } if (invisibleTypeAnnotations != null)...
java
public void accept(final MethodVisitor mv) { mv.visitTryCatchBlock(start.getLabel(), end.getLabel(), handler == null ? null : handler.getLabel(), type); int n = visibleTypeAnnotations == null ? 0 : visibleTypeAnnotations .size(); for (int i = 0; i < n; ++i) { ...
java
@Override public void visitFormalTypeParameter(final String name) { if (type == TYPE_SIGNATURE || (state != EMPTY && state != FORMAL && state != BOUND)) { throw new IllegalStateException(); } CheckMethodAdapter.checkIdentifier(name, "formal type parameter"); ...
java
static void appendConstant(final StringBuffer buf, final Object cst) { if (cst == null) { buf.append("null"); } else if (cst instanceof String) { appendString(buf, (String) cst); } else if (cst instanceof Type) { buf.append("Type.getType(\""); buf....
java
public static void verify(final ClassReader cr, final ClassLoader loader, final boolean dump, final PrintWriter pw) { ClassNode cn = new ClassNode(); cr.accept(new CheckClassAdapter(cn, false), ClassReader.SKIP_DEBUG); Type syperType = cn.superName == null ? null : Type ...
java
public static void verify(final ClassReader cr, final boolean dump, final PrintWriter pw) { verify(cr, null, dump, pw); }
java
static void checkAccess(final int access, final int possibleAccess) { if ((access & ~possibleAccess) != 0) { throw new IllegalArgumentException("Invalid access flags: " + access); } int pub = (access & Opcodes.ACC_PUBLIC) == 0 ? 0 : 1; int pri = (access & ...
java
public static void checkClassSignature(final String signature) { // ClassSignature: // FormalTypeParameters? ClassTypeSignature ClassTypeSignature* int pos = 0; if (getChar(signature, 0) == '<') { pos = checkFormalTypeParameters(signature, pos); } pos = check...
java
public static void checkMethodSignature(final String signature) { // MethodTypeSignature: // FormalTypeParameters? ( TypeSignature* ) ( TypeSignature | V ) ( // ^ClassTypeSignature | ^TypeVariableSignature )* int pos = 0; if (getChar(signature, 0) == '<') { pos = che...
java
public static void checkFieldSignature(final String signature) { int pos = checkFieldTypeSignature(signature, 0); if (pos != signature.length()) { throw new IllegalArgumentException(signature + ": error at index " + pos); } }
java
static void checkTypeRefAndPath(int typeRef, TypePath typePath) { int mask = 0; switch (typeRef >>> 24) { case TypeReference.CLASS_TYPE_PARAMETER: case TypeReference.METHOD_TYPE_PARAMETER: case TypeReference.METHOD_FORMAL_PARAMETER: mask = 0xFFFF0000; brea...
java
private static int checkFormalTypeParameters(final String signature, int pos) { // FormalTypeParameters: // < FormalTypeParameter+ > pos = checkChar('<', signature, pos); pos = checkFormalTypeParameter(signature, pos); while (getChar(signature, pos) != '>') { pos = c...
java
private static int checkFormalTypeParameter(final String signature, int pos) { // FormalTypeParameter: // Identifier : FieldTypeSignature? (: FieldTypeSignature)* pos = checkIdentifier(signature, pos); pos = checkChar(':', signature, pos); if ("L[T".indexOf(getChar(signature, po...
java
private static int checkFieldTypeSignature(final String signature, int pos) { // FieldTypeSignature: // ClassTypeSignature | ArrayTypeSignature | TypeVariableSignature // // ArrayTypeSignature: // [ TypeSignature switch (getChar(signature, pos)) { case 'L': ...
java
private static int checkClassTypeSignature(final String signature, int pos) { // ClassTypeSignature: // L Identifier ( / Identifier )* TypeArguments? ( . Identifier // TypeArguments? )* ; pos = checkChar('L', signature, pos); pos = checkIdentifier(signature, pos); while ...
java
private static int checkTypeArguments(final String signature, int pos) { // TypeArguments: // < TypeArgument+ > pos = checkChar('<', signature, pos); pos = checkTypeArgument(signature, pos); while (getChar(signature, pos) != '>') { pos = checkTypeArgument(signature, ...
java
private static int checkTypeArgument(final String signature, int pos) { // TypeArgument: // * | ( ( + | - )? FieldTypeSignature ) char c = getChar(signature, pos); if (c == '*') { return pos + 1; } else if (c == '+' || c == '-') { pos++; } ...
java
private static int checkTypeVariableSignature(final String signature, int pos) { // TypeVariableSignature: // T Identifier ; pos = checkChar('T', signature, pos); pos = checkIdentifier(signature, pos); return checkChar(';', signature, pos); }
java
private static int checkTypeSignature(final String signature, int pos) { // TypeSignature: // Z | C | B | S | I | F | J | D | FieldTypeSignature switch (getChar(signature, pos)) { case 'Z': case 'C': case 'B': case 'S': case 'I': case 'F': ...
java
private static int checkIdentifier(final String signature, int pos) { if (!Character.isJavaIdentifierStart(getChar(signature, pos))) { throw new IllegalArgumentException(signature + ": identifier expected at index " + pos); } ++pos; while (Character.isJava...
java
private static int checkChar(final char c, final String signature, int pos) { if (getChar(signature, pos) == c) { return pos + 1; } throw new IllegalArgumentException(signature + ": '" + c + "' expected at index " + pos); }
java
private static char getChar(final String signature, int pos) { return pos < signature.length() ? signature.charAt(pos) : (char) 0; }
java
public void accept(final MethodVisitor mv, boolean visible) { Label[] start = new Label[this.start.size()]; Label[] end = new Label[this.end.size()]; int[] index = new int[this.index.size()]; for (int i = 0; i < start.length; ++i) { start[i] = this.start.get(i).getLabel(); ...
java
public static void appendString(final StringBuffer buf, final String s) { buf.append('\"'); for (int i = 0; i < s.length(); ++i) { char c = s.charAt(i); if (c == '\n') { buf.append("\\n"); } else if (c == '\r') { buf.append("\\r"); ...
java
static void printList(final PrintWriter pw, final List<?> l) { for (int i = 0; i < l.size(); ++i) { Object o = l.get(i); if (o instanceof List) { printList(pw, (List<?>) o); } else { pw.print(o.toString()); } } }
java
public JettyBootstrap startServer(Boolean join) throws JettyBootstrapException { LOG.info("Starting Server..."); IJettyConfiguration iJettyConfiguration = getInitializedConfiguration(); initServer(iJettyConfiguration); try { server.start(); } catch (Exception e) { ...
java
public JettyBootstrap joinServer() throws JettyBootstrapException { try { if (isServerStarted()) { LOG.debug("Joining Server..."); server.join(); } else { LOG.warn("Can't join Server. Not started"); } } catch (Interrupt...
java
public JettyBootstrap stopServer() throws JettyBootstrapException { LOG.info("Stopping Server..."); try { if (isServerStarted()) { handlers.stop(); server.stop(); LOG.info("Server stopped."); } else { LOG.warn("Can...
java
public WebAppContext addWarApp(String war, String contextPath) throws JettyBootstrapException { WarAppJettyHandler warAppJettyHandler = new WarAppJettyHandler(getInitializedConfiguration()); warAppJettyHandler.setWar(war); warAppJettyHandler.setContextPath(contextPath); WebAppContext we...
java
public WebAppContext addWarAppFromClasspath(String warFromClasspath, String contextPath) throws JettyBootstrapException { WarAppFromClasspathJettyHandler warAppFromClasspathJettyHandler = new WarAppFromClasspathJettyHandler(getInitializedConfiguration()); warAppFromClasspathJettyHandler.setWarFromClassp...
java
private void createShutdownHook() { LOG.trace("Creating Jetty ShutdownHook..."); Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { LOG.debug("Shutting Down..."); stopServer(); } catch (Exception e) { LOG.error("Shutdown...
java
public static Method[] getAllDeclaredMethods(Class<?> leafClass) { final List<Method> methods = new ArrayList<Method>(32); doWithMethods(leafClass, new MethodCallback() { public void doWith(Method method) { methods.add(method); } }); return methods.toArray(new Method[methods.size()]); }
java
public static List<Field> getSelfAndSuperClassFields(Class<?> clazz) {//YongZ added this method List<Field> fields = new ArrayList<Field>(); for (Field field : clazz.getDeclaredFields()) fields.add(field); Class<?> superclass = clazz.getSuperclass(); while (superclass != null) { if (Object.class.equals(s...
java
public void check(final int api) { if (api == Opcodes.ASM4) { if (visibleTypeAnnotations != null && visibleTypeAnnotations.size() > 0) { throw new RuntimeException(); } if (invisibleTypeAnnotations != null && invisibleTy...
java
public void accept(final ClassVisitor cv) { String[] exceptions = new String[this.exceptions.size()]; this.exceptions.toArray(exceptions); MethodVisitor mv = cv.visitMethod(access, name, desc, signature, exceptions); if (mv != null) { accept(mv); } ...
java
public void accept(final AnnotationVisitor av) { if (av != null) { if (values != null) { for (int i = 0; i < values.size(); i += 2) { String name = (String) values.get(i); Object value = values.get(i + 1); accept(av, name, v...
java
static void accept(final AnnotationVisitor av, final String name, final Object value) { if (av != null) { if (value instanceof String[]) { String[] typeconst = (String[]) value; av.visitEnum(name, typeconst[0], typeconst[1]); } else if (value i...
java
public static String getJarDir(Class<?> clazz) { return decodeUrl(new File(clazz.getProtectionDomain().getCodeSource().getLocation().getPath()).getParent()); }
java
public void accept(final MethodVisitor mv) { mv.visitLocalVariable(name, desc, signature, start.getLabel(), end.getLabel(), index); }
java
public List<SherdogBaseObject> parse(String url) throws IOException { Document document = ParserUtils.parseDocument(url); Elements select = document.select(".fightfinder_result tr"); //removing the first one as it's the header if (select.size() > 0) { select.remove(0); ...
java
@Override public Promise<Void> undeploy(String deploymentID) { return adapter.toPromise(handler -> vertx.undeploy(deploymentID, handler)); }
java
protected File transformInputFile(File from) throws MojoExecutionException { // create a temp file File tempFile; try { tempFile = File.createTempFile("dotml-tmp", ".xml"); } catch (IOException e) { throw new MojoExecutionException( "error crea...
java
public static ConstraintSecurityHandler getConstraintSecurityHandlerConfidential() { Constraint constraint = new Constraint(); constraint.setDataConstraint(Constraint.DC_CONFIDENTIAL); ConstraintMapping constraintMapping = new ConstraintMapping(); constraintMapping.setConstraint(constra...
java
@Override public <T> Promise<Message<T>> send(String address, Object message) { return adapter.toPromise(handler -> eventBus.send(address, message, handler)); }
java
void set(final String name, final String desc, final Handle bsm, final Object[] bsmArgs) { this.type = 'y'; this.strVal1 = name; this.strVal2 = desc; this.objVal3 = bsm; this.objVals = bsmArgs; int hashCode = 'y' + name.hashCode() * desc.hashCode() * bsm.hash...
java
void checkFrameValue(final Object value) { if (value == Opcodes.TOP || value == Opcodes.INTEGER || value == Opcodes.FLOAT || value == Opcodes.LONG || value == Opcodes.DOUBLE || value == Opcodes.NULL || value == Opcodes.UNINITIALIZED_THIS) { return; ...
java
static void checkOpcode(final int opcode, final int type) { if (opcode < 0 || opcode > 199 || TYPE[opcode] != type) { throw new IllegalArgumentException("Invalid opcode: " + opcode); } }
java
static void checkSignedByte(final int value, final String msg) { if (value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) { throw new IllegalArgumentException(msg + " (must be a signed byte): " + value); } }
java
static void checkSignedShort(final int value, final String msg) { if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) { throw new IllegalArgumentException(msg + " (must be a signed short): " + value); } }
java
static void checkUnqualifiedName(int version, final String name, final String msg) { if ((version & 0xFFFF) < Opcodes.V1_5) { checkIdentifier(name, msg); } else { for (int i = 0; i < name.length(); ++i) { if (".;[/".indexOf(name.charAt(i)) != -1) { ...
java
static void checkIdentifier(final String name, final int start, final int end, final String msg) { if (name == null || (end == -1 ? name.length() <= start : end <= start)) { throw new IllegalArgumentException("Invalid " + msg + " (must not be null or empty)"); ...
java
static void checkMethodIdentifier(int version, final String name, final String msg) { if (name == null || name.length() == 0) { throw new IllegalArgumentException("Invalid " + msg + " (must not be null or empty)"); } if ((version & 0xFFFF) >= Opcodes.V...
java
static void checkInternalName(final String name, final String msg) { if (name == null || name.length() == 0) { throw new IllegalArgumentException("Invalid " + msg + " (must not be null or empty)"); } if (name.charAt(0) == '[') { checkDesc(name, false);...
java
static void checkInternalName(final String name, final int start, final int end, final String msg) { int max = end == -1 ? name.length() : end; try { int begin = start; int slash; do { slash = name.indexOf('/', begin + 1); i...
java
static void checkDesc(final String desc, final boolean canBeVoid) { int end = checkDesc(desc, 0, canBeVoid); if (end != desc.length()) { throw new IllegalArgumentException("Invalid descriptor: " + desc); } }
java
static int checkDesc(final String desc, final int start, final boolean canBeVoid) { if (desc == null || start >= desc.length()) { throw new IllegalArgumentException( "Invalid type descriptor (must not be null or empty)"); } int index; switch (d...
java
static void checkMethodDesc(final String desc) { if (desc == null || desc.length() == 0) { throw new IllegalArgumentException( "Invalid method descriptor (must not be null or empty)"); } if (desc.charAt(0) != '(' || desc.length() < 3) { throw new Illeg...
java
void checkLabel(final Label label, final boolean checkVisited, final String msg) { if (label == null) { throw new IllegalArgumentException("Invalid " + msg + " (must not be null)"); } if (checkVisited && labels.get(label) == null) { throw n...
java
private static void checkNonDebugLabel(final Label label) { Field f = getLabelStatusField(); int status = 0; try { status = f == null ? 0 : ((Integer) f.get(label)).intValue(); } catch (IllegalAccessException e) { throw new Error("Internal error"); } ...
java
private static Field getLabelStatusField() { if (labelStatusField == null) { labelStatusField = getLabelField("a"); if (labelStatusField == null) { labelStatusField = getLabelField("status"); } } return labelStatusField; }
java
private static Field getLabelField(final String name) { try { Field f = Label.class.getDeclaredField(name); f.setAccessible(true); return f; } catch (NoSuchFieldException e) { return null; } }
java
public void loadStoreFile() { try { BufferedInputStream bis = new BufferedInputStream( new FileInputStream(this.storeFile) ); JSONTokener jsonTokener = new JSONTokener(new InputStreamReader(bis)); JSONArray array = new JSONArray(jsonTokener); bis.close(); // Init our ...
java
private void search() throws IOException { String url = String.format(SEARCH_URL, term, (weightClass != null) ? weightClass.getValue() : "", page ); dryEvents = new ArrayList<>(); dryFighters = new ArrayList<>(); List<SherdogBase...
java
public List<Fighter> getFightersWithCompleteData() { return dryFighters.stream() .map(f -> { try { return sherdog.getFighter(f.getSherdogUrl()); } catch (IOException | ParseException | SherdogParserException e) { ...
java
public List<Event> getEventsWithCompleteData() { return dryEvents.stream() .map(f -> { try { return sherdog.getEvent(f.getSherdogUrl()); } catch (IOException | ParseException | SherdogParserException e) { re...
java
public Frame<V> init(final Frame<? extends V> src) { returnValue = src.returnValue; System.arraycopy(src.values, 0, values, 0, values.length); top = src.top; return this; }
java
public void setLocal(final int i, final V value) throws IndexOutOfBoundsException { if (i >= locals) { throw new IndexOutOfBoundsException( "Trying to access an inexistant local variable " + i); } values[i] = value; }
java
public void push(final V value) throws IndexOutOfBoundsException { if (top + locals >= values.length) { throw new IndexOutOfBoundsException( "Insufficient maximum stack size."); } values[top++ + locals] = value; }
java
public boolean merge(final Frame<? extends V> frame, final Interpreter<V> interpreter) throws AnalyzerException { if (top != frame.top) { throw new AnalyzerException(null, "Incompatible stack heights"); } boolean changes = false; for (int i = 0; i < locals + top; ...
java
public byte[] decrypt(byte[] msg) { if (msg == null) return null; try { Cipher cipher = Cipher.getInstance(ENCRYPTION_ALGORITHM_IMPLEMENTATION); SecretKeySpec key = new SecretKeySpec(getMd5(), ENCRYPTION_ALGORITHM); IvParameterSpec iv = new IvParameterSpec(getIv()); ...
java