code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public static CondensedCallStackElement of(CallStackElement callStackElement) { CondensedCallStackElement condensedCallStackElement = new CondensedCallStackElement(callStackElement); List<CallStackElement> children = Lists.newArrayList(); for (CallStackElement child : callStackElement.getChildren()) { CondensedCallStackElement condensedChild = of(child); children.add(condensedChild); condensedChild.setParent(condensedCallStackElement); } condensedCallStackElement.setChildren(children); return condensedCallStackElement; } }
public class class_name { public static CondensedCallStackElement of(CallStackElement callStackElement) { CondensedCallStackElement condensedCallStackElement = new CondensedCallStackElement(callStackElement); List<CallStackElement> children = Lists.newArrayList(); for (CallStackElement child : callStackElement.getChildren()) { CondensedCallStackElement condensedChild = of(child); children.add(condensedChild); // depends on control dependency: [for], data = [child] condensedChild.setParent(condensedCallStackElement); // depends on control dependency: [for], data = [none] } condensedCallStackElement.setChildren(children); return condensedCallStackElement; } }
public class class_name { private RelationType getRelationType(int value) { RelationType result = null; if (value >= 0 || value < RELATION_TYPES.length) { result = RELATION_TYPES[value]; } if (result == null) { result = RelationType.FINISH_START; } return result; } }
public class class_name { private RelationType getRelationType(int value) { RelationType result = null; if (value >= 0 || value < RELATION_TYPES.length) { result = RELATION_TYPES[value]; // depends on control dependency: [if], data = [none] } if (result == null) { result = RelationType.FINISH_START; // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { private static boolean isEnumIdentifier(Parameter parameter) { switch (parameter.kind()) { case IDENTIFIER: case MEMBER_SELECT: break; default: return false; } TypeSymbol typeSymbol = parameter.type().tsym; if (typeSymbol != null) { return typeSymbol.getKind() == ElementKind.ENUM; } return false; } }
public class class_name { private static boolean isEnumIdentifier(Parameter parameter) { switch (parameter.kind()) { case IDENTIFIER: case MEMBER_SELECT: break; default: return false; } TypeSymbol typeSymbol = parameter.type().tsym; if (typeSymbol != null) { return typeSymbol.getKind() == ElementKind.ENUM; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { public Transition getWorkTransitionVO(Long pWorkTransId) { if(this.transitions == null){ return null; } for(int i=0; i<transitions.size(); i++){ if(pWorkTransId.longValue() == transitions.get(i).getId().longValue()){ return transitions.get(i); } } return null; } }
public class class_name { public Transition getWorkTransitionVO(Long pWorkTransId) { if(this.transitions == null){ return null; // depends on control dependency: [if], data = [none] } for(int i=0; i<transitions.size(); i++){ if(pWorkTransId.longValue() == transitions.get(i).getId().longValue()){ return transitions.get(i); // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public DiGraph<Vertex> subDiGraph(final Collection<Vertex> verts) { final BiDiNavigator<Vertex> origNav = this.getBiDiNavigator(); return DiGraph.diGraph (verts, new BiDiNavigator<Vertex>() { public List<Vertex> next(Vertex v) { return (List<Vertex>) diff(origNav.next(v), verts, new LinkedList<Vertex>()); } public List<Vertex> prev(Vertex v) { return (List<Vertex>) diff(origNav.prev(v), verts, new LinkedList<Vertex>()); } private <T> Collection<T> diff(Iterable<T> a, Collection<T> b, Collection<T> res) { for(T t : a) { if(b.contains(t)) { res.add(t); } } return res; } }); } }
public class class_name { public DiGraph<Vertex> subDiGraph(final Collection<Vertex> verts) { final BiDiNavigator<Vertex> origNav = this.getBiDiNavigator(); return DiGraph.diGraph (verts, new BiDiNavigator<Vertex>() { public List<Vertex> next(Vertex v) { return (List<Vertex>) diff(origNav.next(v), verts, new LinkedList<Vertex>()); } public List<Vertex> prev(Vertex v) { return (List<Vertex>) diff(origNav.prev(v), verts, new LinkedList<Vertex>()); } private <T> Collection<T> diff(Iterable<T> a, Collection<T> b, Collection<T> res) { for(T t : a) { if(b.contains(t)) { res.add(t); // depends on control dependency: [if], data = [none] } } return res; } }); } }
public class class_name { public AutoScalingSettingsDescription withScalingPolicies(AutoScalingPolicyDescription... scalingPolicies) { if (this.scalingPolicies == null) { setScalingPolicies(new java.util.ArrayList<AutoScalingPolicyDescription>(scalingPolicies.length)); } for (AutoScalingPolicyDescription ele : scalingPolicies) { this.scalingPolicies.add(ele); } return this; } }
public class class_name { public AutoScalingSettingsDescription withScalingPolicies(AutoScalingPolicyDescription... scalingPolicies) { if (this.scalingPolicies == null) { setScalingPolicies(new java.util.ArrayList<AutoScalingPolicyDescription>(scalingPolicies.length)); // depends on control dependency: [if], data = [none] } for (AutoScalingPolicyDescription ele : scalingPolicies) { this.scalingPolicies.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public void closeConsumers() { final List<RowProcessingConsumer> configurableConsumers = getConfigurableConsumers(); final TaskRunner taskRunner = _publishers.getTaskRunner(); for (RowProcessingConsumer consumer : configurableConsumers) { TaskRunnable task = createCloseTask(consumer, null); taskRunner.run(task); } } }
public class class_name { public void closeConsumers() { final List<RowProcessingConsumer> configurableConsumers = getConfigurableConsumers(); final TaskRunner taskRunner = _publishers.getTaskRunner(); for (RowProcessingConsumer consumer : configurableConsumers) { TaskRunnable task = createCloseTask(consumer, null); taskRunner.run(task); // depends on control dependency: [for], data = [none] } } }
public class class_name { private void cleanConnectionClose(Connection connection, Statement stmt) { try { // clean close if (connection != null) { connection.rollback(); } if (stmt != null) { stmt.close(); } if (connection != null) { connection.close(); } } catch (SQLException e1) { e1.printStackTrace(); } } }
public class class_name { private void cleanConnectionClose(Connection connection, Statement stmt) { try { // clean close if (connection != null) { connection.rollback(); // depends on control dependency: [if], data = [none] } if (stmt != null) { stmt.close(); // depends on control dependency: [if], data = [none] } if (connection != null) { connection.close(); // depends on control dependency: [if], data = [none] } } catch (SQLException e1) { e1.printStackTrace(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private boolean checkFilesExists(String[] requiredFiles, File childResource) { File setupFile = null; boolean hasMissingSetupFiles = false; for (int j = 0; j < requiredFiles.length; j++) { setupFile = new File(childResource.getPath() + File.separatorChar + requiredFiles[j]); if (!setupFile.exists() || !setupFile.isFile() || !setupFile.canRead()) { hasMissingSetupFiles = true; System.err.println( "[" + getClass().getName() + "] missing or unreadable database setup file: " + setupFile.getPath()); break; } if (!hasMissingSetupFiles) { return true; } } return false; } }
public class class_name { private boolean checkFilesExists(String[] requiredFiles, File childResource) { File setupFile = null; boolean hasMissingSetupFiles = false; for (int j = 0; j < requiredFiles.length; j++) { setupFile = new File(childResource.getPath() + File.separatorChar + requiredFiles[j]); // depends on control dependency: [for], data = [j] if (!setupFile.exists() || !setupFile.isFile() || !setupFile.canRead()) { hasMissingSetupFiles = true; // depends on control dependency: [if], data = [none] System.err.println( "[" + getClass().getName() + "] missing or unreadable database setup file: " + setupFile.getPath()); // depends on control dependency: [if], data = [none] break; } if (!hasMissingSetupFiles) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { protected String resolveClassNameSuffix() { String classNameSuffix = proxetta.getClassNameSuffix(); if (classNameSuffix == null) { return null; } if (!proxetta.isVariableClassName()) { return classNameSuffix; } suffixCounter++; return classNameSuffix + suffixCounter; } }
public class class_name { protected String resolveClassNameSuffix() { String classNameSuffix = proxetta.getClassNameSuffix(); if (classNameSuffix == null) { return null; // depends on control dependency: [if], data = [none] } if (!proxetta.isVariableClassName()) { return classNameSuffix; // depends on control dependency: [if], data = [none] } suffixCounter++; return classNameSuffix + suffixCounter; } }
public class class_name { public void init(Record record, int iFieldSeq, String fieldName, int iSecondaryFieldSeq, String secondaryFieldName) { Converter converter = null; m_recMerge = record; m_iFieldSeq = iFieldSeq; m_iSecondaryFieldSeq = iSecondaryFieldSeq; this.fieldName = fieldName; this.secondaryFieldName = secondaryFieldName; if (record != null) converter = this.getTargetField(null); super.init(converter, null); if (record != null) record.addListener(new RemoveConverterOnCloseHandler(this)); // Because this is a converter (not a fieldConverter) if (m_recMerge != null) if (m_recMerge.getTable() instanceof MultiTable) { // Add all the fields in the sub-records MultiTable multiTable = (MultiTable)m_recMerge.getTable(); Iterator<BaseTable> iterator = multiTable.getTables(); while (iterator.hasNext()) { BaseTable table = (BaseTable)iterator.next(); Converter field = this.getTargetField(table.getRecord()); this.addConverterToPass(field); // Add it, and } } } }
public class class_name { public void init(Record record, int iFieldSeq, String fieldName, int iSecondaryFieldSeq, String secondaryFieldName) { Converter converter = null; m_recMerge = record; m_iFieldSeq = iFieldSeq; m_iSecondaryFieldSeq = iSecondaryFieldSeq; this.fieldName = fieldName; this.secondaryFieldName = secondaryFieldName; if (record != null) converter = this.getTargetField(null); super.init(converter, null); if (record != null) record.addListener(new RemoveConverterOnCloseHandler(this)); // Because this is a converter (not a fieldConverter) if (m_recMerge != null) if (m_recMerge.getTable() instanceof MultiTable) { // Add all the fields in the sub-records MultiTable multiTable = (MultiTable)m_recMerge.getTable(); Iterator<BaseTable> iterator = multiTable.getTables(); while (iterator.hasNext()) { BaseTable table = (BaseTable)iterator.next(); Converter field = this.getTargetField(table.getRecord()); this.addConverterToPass(field); // Add it, and // depends on control dependency: [while], data = [none] } } } }
public class class_name { @SuppressWarnings({"checkstyle:magicnumber", "checkstyle:cyclomaticcomplexity"}) public boolean remove(Point3D<?, ?> point) { if (this.types != null && !this.types.isEmpty() && this.coords != null && !this.coords.isEmpty()) { for (int i = 0, j = 0; i < this.coords.size() && j < this.types.size(); j++) { final Point3dfx currentPoint = this.coords.get(i); switch (this.types.get(j)) { case MOVE_TO: //$FALL-THROUGH$ case LINE_TO: if (point.equals(currentPoint)) { this.coords.remove(i); this.types.remove(j); return true; } i++; break; case CURVE_TO: final Point3dfx p2 = this.coords.get(i + 1); final Point3dfx p3 = this.coords.get(i + 2); if ((point.equals(currentPoint)) || (point.equals(p2)) || (point.equals(p3))) { this.coords.remove(i, i + 3); this.types.remove(j); return true; } i += 3; break; case QUAD_TO: final Point3dfx pt = this.coords.get(i + 1); if ((point.equals(currentPoint)) || (point.equals(pt))) { this.coords.remove(i, i + 2); this.types.remove(j); return true; } i += 2; break; case ARC_TO: throw new IllegalStateException(); //$CASES-OMITTED$ default: break; } } } return false; } }
public class class_name { @SuppressWarnings({"checkstyle:magicnumber", "checkstyle:cyclomaticcomplexity"}) public boolean remove(Point3D<?, ?> point) { if (this.types != null && !this.types.isEmpty() && this.coords != null && !this.coords.isEmpty()) { for (int i = 0, j = 0; i < this.coords.size() && j < this.types.size(); j++) { final Point3dfx currentPoint = this.coords.get(i); switch (this.types.get(j)) { case MOVE_TO: //$FALL-THROUGH$ case LINE_TO: if (point.equals(currentPoint)) { this.coords.remove(i); // depends on control dependency: [if], data = [none] this.types.remove(j); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } i++; // depends on control dependency: [for], data = [i] break; case CURVE_TO: final Point3dfx p2 = this.coords.get(i + 1); final Point3dfx p3 = this.coords.get(i + 2); if ((point.equals(currentPoint)) || (point.equals(p2)) || (point.equals(p3))) { this.coords.remove(i, i + 3); // depends on control dependency: [if], data = [none] this.types.remove(j); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } i += 3; // depends on control dependency: [for], data = [i] break; case QUAD_TO: final Point3dfx pt = this.coords.get(i + 1); if ((point.equals(currentPoint)) || (point.equals(pt))) { this.coords.remove(i, i + 2); // depends on control dependency: [if], data = [none] this.types.remove(j); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } i += 2; // depends on control dependency: [for], data = [i] break; case ARC_TO: throw new IllegalStateException(); //$CASES-OMITTED$ default: break; } } } return false; } }
public class class_name { public static Method getAccessibleMethod(Method method) { if (!MemberUtils.isAccessible(method)) { return null; } // If the declaring class is public, we are done final Class<?> cls = method.getDeclaringClass(); if (Modifier.isPublic(cls.getModifiers())) { return method; } final String methodName = method.getName(); final Class<?>[] parameterTypes = method.getParameterTypes(); // Check the implemented interfaces and subinterfaces method = getAccessibleMethodFromInterfaceNest(cls, methodName, parameterTypes); // Check the superclass chain if (method == null) { method = getAccessibleMethodFromSuperclass(cls, methodName, parameterTypes); } return method; } }
public class class_name { public static Method getAccessibleMethod(Method method) { if (!MemberUtils.isAccessible(method)) { return null; // depends on control dependency: [if], data = [none] } // If the declaring class is public, we are done final Class<?> cls = method.getDeclaringClass(); if (Modifier.isPublic(cls.getModifiers())) { return method; // depends on control dependency: [if], data = [none] } final String methodName = method.getName(); final Class<?>[] parameterTypes = method.getParameterTypes(); // Check the implemented interfaces and subinterfaces method = getAccessibleMethodFromInterfaceNest(cls, methodName, parameterTypes); // Check the superclass chain if (method == null) { method = getAccessibleMethodFromSuperclass(cls, methodName, parameterTypes); // depends on control dependency: [if], data = [none] } return method; } }
public class class_name { public void dataToField(ComponentCache componentCache, int iRowIndex, int iColumnIndex) { if (componentCache.m_rgcompoments[iColumnIndex] != null) { String string = null; if (componentCache.m_rgcompoments[iColumnIndex] instanceof JTextComponent) string = ((JTextComponent)componentCache.m_rgcompoments[iColumnIndex]).getText(); if (componentCache.m_rgcompoments[iColumnIndex] instanceof JCheckBox) if (((JCheckBox)componentCache.m_rgcompoments[iColumnIndex]).isSelected()) string = "1"; //xif (string != null) if (string.length() > 0) this.getModel().setValueAt(string, iRowIndex, iColumnIndex); } } }
public class class_name { public void dataToField(ComponentCache componentCache, int iRowIndex, int iColumnIndex) { if (componentCache.m_rgcompoments[iColumnIndex] != null) { String string = null; if (componentCache.m_rgcompoments[iColumnIndex] instanceof JTextComponent) string = ((JTextComponent)componentCache.m_rgcompoments[iColumnIndex]).getText(); if (componentCache.m_rgcompoments[iColumnIndex] instanceof JCheckBox) if (((JCheckBox)componentCache.m_rgcompoments[iColumnIndex]).isSelected()) string = "1"; //xif (string != null) if (string.length() > 0) this.getModel().setValueAt(string, iRowIndex, iColumnIndex); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void update(long throughput) { if (LOG.isDebugEnabled()) { LOG.debug("Received throughput of " + throughput + " on channel - " + this.channel.getComponentName()); } this.throughput = throughput; } }
public class class_name { public void update(long throughput) { if (LOG.isDebugEnabled()) { LOG.debug("Received throughput of " + throughput + " on channel - " + this.channel.getComponentName()); // depends on control dependency: [if], data = [none] } this.throughput = throughput; } }
public class class_name { public final BELScriptWalker.term_return term() throws RecognitionException { BELScriptWalker.term_return retval = new BELScriptWalker.term_return(); retval.start = input.LT(1); CommonTree root_0 = null; CommonTree _first_0 = null; CommonTree _last = null; CommonTree op=null; CommonTree c=null; CommonTree cp=null; BELScriptWalker.function_return f = null; BELScriptWalker.term_return t = null; BELScriptWalker.param_return p = null; CommonTree op_tree=null; CommonTree c_tree=null; CommonTree cp_tree=null; final StringBuilder termBuilder = new StringBuilder(); try { // BELScriptWalker.g:444:1: (f= function op= OPEN_PAREN ( (c= ',' )? (t= term | p= param ) )* cp= CLOSE_PAREN ) // BELScriptWalker.g:445:5: f= function op= OPEN_PAREN ( (c= ',' )? (t= term | p= param ) )* cp= CLOSE_PAREN { root_0 = (CommonTree)adaptor.nil(); _last = (CommonTree)input.LT(1); pushFollow(FOLLOW_function_in_term707); f=function(); state._fsp--; adaptor.addChild(root_0, f.getTree()); termBuilder.append(f.r); _last = (CommonTree)input.LT(1); op=(CommonTree)match(input,OPEN_PAREN,FOLLOW_OPEN_PAREN_in_term713); op_tree = (CommonTree)adaptor.dupNode(op); adaptor.addChild(root_0, op_tree); termBuilder.append(op.getText()); // BELScriptWalker.g:449:6: ( (c= ',' )? (t= term | p= param ) )* loop19: do { int alt19=2; int LA19_0 = input.LA(1); if ( (LA19_0==OBJECT_IDENT||LA19_0==QUOTED_VALUE||LA19_0==NS_PREFIX||(LA19_0>=43 && LA19_0<=102)) ) { alt19=1; } switch (alt19) { case 1 : // BELScriptWalker.g:449:7: (c= ',' )? (t= term | p= param ) { // BELScriptWalker.g:449:8: (c= ',' )? int alt17=2; int LA17_0 = input.LA(1); if ( (LA17_0==43) ) { alt17=1; } switch (alt17) { case 1 : // BELScriptWalker.g:449:8: c= ',' { _last = (CommonTree)input.LT(1); c=(CommonTree)match(input,43,FOLLOW_43_in_term719); c_tree = (CommonTree)adaptor.dupNode(c); adaptor.addChild(root_0, c_tree); } break; } if (c != null) { termBuilder.append(c.getText()); } // BELScriptWalker.g:453:7: (t= term | p= param ) int alt18=2; int LA18_0 = input.LA(1); if ( ((LA18_0>=44 && LA18_0<=102)) ) { alt18=1; } else if ( (LA18_0==OBJECT_IDENT||LA18_0==QUOTED_VALUE||LA18_0==NS_PREFIX) ) { alt18=2; } else { NoViableAltException nvae = new NoViableAltException("", 18, 0, input); throw nvae; } switch (alt18) { case 1 : // BELScriptWalker.g:453:8: t= term { _last = (CommonTree)input.LT(1); pushFollow(FOLLOW_term_in_term727); t=term(); state._fsp--; adaptor.addChild(root_0, t.getTree()); termBuilder.append(t.r); } break; case 2 : // BELScriptWalker.g:455:9: p= param { _last = (CommonTree)input.LT(1); pushFollow(FOLLOW_param_in_term735); p=param(); state._fsp--; adaptor.addChild(root_0, p.getTree()); termBuilder.append(p.r); } break; } } break; default : break loop19; } } while (true); _last = (CommonTree)input.LT(1); cp=(CommonTree)match(input,CLOSE_PAREN,FOLLOW_CLOSE_PAREN_in_term744); cp_tree = (CommonTree)adaptor.dupNode(cp); adaptor.addChild(root_0, cp_tree); termBuilder.append(cp.getText()); retval.r = termBuilder.toString(); } retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return retval; } }
public class class_name { public final BELScriptWalker.term_return term() throws RecognitionException { BELScriptWalker.term_return retval = new BELScriptWalker.term_return(); retval.start = input.LT(1); CommonTree root_0 = null; CommonTree _first_0 = null; CommonTree _last = null; CommonTree op=null; CommonTree c=null; CommonTree cp=null; BELScriptWalker.function_return f = null; BELScriptWalker.term_return t = null; BELScriptWalker.param_return p = null; CommonTree op_tree=null; CommonTree c_tree=null; CommonTree cp_tree=null; final StringBuilder termBuilder = new StringBuilder(); try { // BELScriptWalker.g:444:1: (f= function op= OPEN_PAREN ( (c= ',' )? (t= term | p= param ) )* cp= CLOSE_PAREN ) // BELScriptWalker.g:445:5: f= function op= OPEN_PAREN ( (c= ',' )? (t= term | p= param ) )* cp= CLOSE_PAREN { root_0 = (CommonTree)adaptor.nil(); _last = (CommonTree)input.LT(1); pushFollow(FOLLOW_function_in_term707); f=function(); state._fsp--; adaptor.addChild(root_0, f.getTree()); termBuilder.append(f.r); _last = (CommonTree)input.LT(1); op=(CommonTree)match(input,OPEN_PAREN,FOLLOW_OPEN_PAREN_in_term713); op_tree = (CommonTree)adaptor.dupNode(op); adaptor.addChild(root_0, op_tree); termBuilder.append(op.getText()); // BELScriptWalker.g:449:6: ( (c= ',' )? (t= term | p= param ) )* loop19: do { int alt19=2; int LA19_0 = input.LA(1); if ( (LA19_0==OBJECT_IDENT||LA19_0==QUOTED_VALUE||LA19_0==NS_PREFIX||(LA19_0>=43 && LA19_0<=102)) ) { alt19=1; // depends on control dependency: [if], data = [none] } switch (alt19) { case 1 : // BELScriptWalker.g:449:7: (c= ',' )? (t= term | p= param ) { // BELScriptWalker.g:449:8: (c= ',' )? int alt17=2; int LA17_0 = input.LA(1); if ( (LA17_0==43) ) { alt17=1; // depends on control dependency: [if], data = [none] } switch (alt17) { case 1 : // BELScriptWalker.g:449:8: c= ',' { _last = (CommonTree)input.LT(1); c=(CommonTree)match(input,43,FOLLOW_43_in_term719); c_tree = (CommonTree)adaptor.dupNode(c); adaptor.addChild(root_0, c_tree); } break; } if (c != null) { termBuilder.append(c.getText()); // depends on control dependency: [if], data = [(c] } // BELScriptWalker.g:453:7: (t= term | p= param ) int alt18=2; int LA18_0 = input.LA(1); if ( ((LA18_0>=44 && LA18_0<=102)) ) { alt18=1; // depends on control dependency: [if], data = [none] } else if ( (LA18_0==OBJECT_IDENT||LA18_0==QUOTED_VALUE||LA18_0==NS_PREFIX) ) { alt18=2; // depends on control dependency: [if], data = [none] } else { NoViableAltException nvae = new NoViableAltException("", 18, 0, input); throw nvae; } switch (alt18) { case 1 : // BELScriptWalker.g:453:8: t= term { _last = (CommonTree)input.LT(1); pushFollow(FOLLOW_term_in_term727); t=term(); state._fsp--; adaptor.addChild(root_0, t.getTree()); termBuilder.append(t.r); } break; case 2 : // BELScriptWalker.g:455:9: p= param { _last = (CommonTree)input.LT(1); pushFollow(FOLLOW_param_in_term735); p=param(); state._fsp--; adaptor.addChild(root_0, p.getTree()); termBuilder.append(p.r); } break; } } break; default : break loop19; } } while (true); _last = (CommonTree)input.LT(1); cp=(CommonTree)match(input,CLOSE_PAREN,FOLLOW_CLOSE_PAREN_in_term744); cp_tree = (CommonTree)adaptor.dupNode(cp); adaptor.addChild(root_0, cp_tree); termBuilder.append(cp.getText()); retval.r = termBuilder.toString(); } retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return retval; } }
public class class_name { public boolean renew(String value, String state, long time) { Nonce nonce = _map.get(state + ':' + value); if (nonce != null && !nonce.hasExpired()) { nonce.renew(time > 0 ? time : TTL); return true; } else { return false; } } }
public class class_name { public boolean renew(String value, String state, long time) { Nonce nonce = _map.get(state + ':' + value); if (nonce != null && !nonce.hasExpired()) { nonce.renew(time > 0 ? time : TTL); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { public boolean functionAvailable(String methName) { Object tblEntry = m_functionID.get(methName); if (null != tblEntry) return true; else{ tblEntry = m_functionID_customer.get(methName); return (null != tblEntry)? true : false; } } }
public class class_name { public boolean functionAvailable(String methName) { Object tblEntry = m_functionID.get(methName); if (null != tblEntry) return true; else{ tblEntry = m_functionID_customer.get(methName); // depends on control dependency: [if], data = [none] return (null != tblEntry)? true : false; // depends on control dependency: [if], data = [(null] } } }
public class class_name { public V getValue(T object) { try { if (this.getMethod != null) { return (V)this.getMethod.invoke(object); } else { return (V)this.field.get(object); } } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } } }
public class class_name { public V getValue(T object) { try { if (this.getMethod != null) { return (V)this.getMethod.invoke(object); // depends on control dependency: [if], data = [none] } else { return (V)this.field.get(object); // depends on control dependency: [if], data = [none] } } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { // depends on control dependency: [catch], data = [none] throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public Field updateFieldMultiChoicePlain( Field formFieldParam, List<String> multiChoiceValuesParam) { if(formFieldParam != null && this.serviceTicket != null) { formFieldParam.setServiceTicket(this.serviceTicket); } if(multiChoiceValuesParam == null || multiChoiceValuesParam.isEmpty()) { throw new FluidClientException( "No Multi-choice values provided.", FluidClientException.ErrorCode.FIELD_VALIDATE); } if(formFieldParam != null) { formFieldParam.setTypeAsEnum(Field.Type.MultipleChoice); formFieldParam.setTypeMetaData(FieldMetaData.MultiChoice.PLAIN); formFieldParam.setFieldValue(new MultiChoice(multiChoiceValuesParam)); } return new Field(this.postJson( formFieldParam, WS.Path.UserField.Version1.userFieldUpdate())); } }
public class class_name { public Field updateFieldMultiChoicePlain( Field formFieldParam, List<String> multiChoiceValuesParam) { if(formFieldParam != null && this.serviceTicket != null) { formFieldParam.setServiceTicket(this.serviceTicket); // depends on control dependency: [if], data = [none] } if(multiChoiceValuesParam == null || multiChoiceValuesParam.isEmpty()) { throw new FluidClientException( "No Multi-choice values provided.", FluidClientException.ErrorCode.FIELD_VALIDATE); } if(formFieldParam != null) { formFieldParam.setTypeAsEnum(Field.Type.MultipleChoice); // depends on control dependency: [if], data = [none] formFieldParam.setTypeMetaData(FieldMetaData.MultiChoice.PLAIN); // depends on control dependency: [if], data = [none] formFieldParam.setFieldValue(new MultiChoice(multiChoiceValuesParam)); // depends on control dependency: [if], data = [none] } return new Field(this.postJson( formFieldParam, WS.Path.UserField.Version1.userFieldUpdate())); } }
public class class_name { public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (m_fldTarget != null) if (m_fldTarget.getRecord() != this.getOwner().getRecord()) m_fldTarget.addListener(new FieldRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! if (this.getFieldTarget() != null) if (!(this.getFieldTarget().isVirtual()) && (!(this.getFieldTarget().getRecord() instanceof ScreenRecord))) if (this.respondsToMode(DBConstants.READ_MOVE) == true) if (this.respondsToMode(DBConstants.INIT_MOVE) == true) { // This is a performance issue if the field I'm updating is connected to a file this.setRespondsToMode(DBConstants.READ_MOVE, false); // Usually, you only want to recompute on screen change this.setRespondsToMode(DBConstants.INIT_MOVE, false); // Usually, you only want to recompute on screen change } } } }
public class class_name { public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (m_fldTarget != null) if (m_fldTarget.getRecord() != this.getOwner().getRecord()) m_fldTarget.addListener(new FieldRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! if (this.getFieldTarget() != null) if (!(this.getFieldTarget().isVirtual()) && (!(this.getFieldTarget().getRecord() instanceof ScreenRecord))) if (this.respondsToMode(DBConstants.READ_MOVE) == true) if (this.respondsToMode(DBConstants.INIT_MOVE) == true) { // This is a performance issue if the field I'm updating is connected to a file this.setRespondsToMode(DBConstants.READ_MOVE, false); // Usually, you only want to recompute on screen change // depends on control dependency: [if], data = [none] this.setRespondsToMode(DBConstants.INIT_MOVE, false); // Usually, you only want to recompute on screen change // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void subscriptionRequestReceived(SubscriptionRequest sr) throws SubscriptionException { LOG.info("Subscriber -> (Hub), new subscription request received.", sr.getCallback()); try { verifySubscriberRequestedSubscription(sr); if ("subscribe".equals(sr.getMode())) { LOG.info("Adding callback {} to the topic {}", sr.getCallback(), sr.getTopic()); addCallbackToTopic(sr.getCallback(), sr.getTopic()); } else if ("unsubscribe".equals(sr.getMode())) { LOG.info("Removing callback {} from the topic {}", sr.getCallback(), sr.getTopic()); removeCallbackToTopic(sr.getCallback(), sr.getTopic()); } } catch (Exception e) { throw new SubscriptionException(e); } } }
public class class_name { public void subscriptionRequestReceived(SubscriptionRequest sr) throws SubscriptionException { LOG.info("Subscriber -> (Hub), new subscription request received.", sr.getCallback()); try { verifySubscriberRequestedSubscription(sr); if ("subscribe".equals(sr.getMode())) { LOG.info("Adding callback {} to the topic {}", sr.getCallback(), sr.getTopic()); // depends on control dependency: [if], data = [none] addCallbackToTopic(sr.getCallback(), sr.getTopic()); // depends on control dependency: [if], data = [none] } else if ("unsubscribe".equals(sr.getMode())) { LOG.info("Removing callback {} from the topic {}", sr.getCallback(), sr.getTopic()); // depends on control dependency: [if], data = [none] removeCallbackToTopic(sr.getCallback(), sr.getTopic()); // depends on control dependency: [if], data = [none] } } catch (Exception e) { throw new SubscriptionException(e); } } }
public class class_name { public Content getSignature(FieldDoc enumConstant) { Content pre = new HtmlTree(HtmlTag.PRE); writer.addAnnotationInfo(enumConstant, pre); addModifiers(enumConstant, pre); Content enumConstantLink = writer.getLink(new LinkInfoImpl( configuration, LinkInfoImpl.Kind.MEMBER, enumConstant.type())); pre.addContent(enumConstantLink); pre.addContent(" "); if (configuration.linksource) { Content enumConstantName = new StringContent(enumConstant.name()); writer.addSrcLink(enumConstant, enumConstantName, pre); } else { addName(enumConstant.name(), pre); } return pre; } }
public class class_name { public Content getSignature(FieldDoc enumConstant) { Content pre = new HtmlTree(HtmlTag.PRE); writer.addAnnotationInfo(enumConstant, pre); addModifiers(enumConstant, pre); Content enumConstantLink = writer.getLink(new LinkInfoImpl( configuration, LinkInfoImpl.Kind.MEMBER, enumConstant.type())); pre.addContent(enumConstantLink); pre.addContent(" "); if (configuration.linksource) { Content enumConstantName = new StringContent(enumConstant.name()); writer.addSrcLink(enumConstant, enumConstantName, pre); // depends on control dependency: [if], data = [none] } else { addName(enumConstant.name(), pre); // depends on control dependency: [if], data = [none] } return pre; } }
public class class_name { public static void setValueFor(final ConverterFactory converterFactory, final InputComponent<?, ?> component, final Object value) { if (component instanceof SingleValued) { setSingleInputValue(converterFactory, component, value, false); } else if (component instanceof ManyValued) { setManyInputValue(converterFactory, component, value, false); } } }
public class class_name { public static void setValueFor(final ConverterFactory converterFactory, final InputComponent<?, ?> component, final Object value) { if (component instanceof SingleValued) { setSingleInputValue(converterFactory, component, value, false); // depends on control dependency: [if], data = [none] } else if (component instanceof ManyValued) { setManyInputValue(converterFactory, component, value, false); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void update(final GroupCommunicationMessage msg) { if (msg.hasSrcVersion()) { final String srcId = msg.getSrcid(); final int srcVersion = msg.getSrcVersion(); LOG.finest(getQualifiedName() + "Updating " + msg.getType() + " msg from " + srcId); LOG.finest(getQualifiedName() + "Before update: parent=" + ((parent != null) ? parent.getId() : "NULL")); LOG.finest(getQualifiedName() + "Before update: children=" + children); switch (msg.getType()) { case ParentAdd: updateParentAdd(srcId, srcVersion); break; case ParentDead: updateParentDead(srcId, srcVersion); break; case ChildAdd: updateChildAdd(srcId, srcVersion); break; case ChildDead: updateChildDead(srcId, srcVersion); break; default: throw new RuntimeException("Received a non control message in update"); } LOG.finest(getQualifiedName() + "After update: parent=" + ((parent != null) ? parent.getId() : "NULL")); LOG.finest(getQualifiedName() + "After update: children=" + children); } else { throw new RuntimeException(getQualifiedName() + "can only deal with msgs that have src version set"); } } }
public class class_name { @Override public void update(final GroupCommunicationMessage msg) { if (msg.hasSrcVersion()) { final String srcId = msg.getSrcid(); final int srcVersion = msg.getSrcVersion(); LOG.finest(getQualifiedName() + "Updating " + msg.getType() + " msg from " + srcId); // depends on control dependency: [if], data = [none] LOG.finest(getQualifiedName() + "Before update: parent=" + ((parent != null) ? parent.getId() : "NULL")); // depends on control dependency: [if], data = [none] LOG.finest(getQualifiedName() + "Before update: children=" + children); // depends on control dependency: [if], data = [none] switch (msg.getType()) { case ParentAdd: updateParentAdd(srcId, srcVersion); break; case ParentDead: updateParentDead(srcId, srcVersion); break; case ChildAdd: updateChildAdd(srcId, srcVersion); break; case ChildDead: updateChildDead(srcId, srcVersion); break; default: throw new RuntimeException("Received a non control message in update"); } LOG.finest(getQualifiedName() + "After update: parent=" + ((parent != null) ? parent.getId() : "NULL")); LOG.finest(getQualifiedName() + "After update: children=" + children); } else { throw new RuntimeException(getQualifiedName() + "can only deal with msgs that have src version set"); } } }
public class class_name { private void addHeadlines(final PrintWriter writer, final List headlines) { if (headlines == null || headlines.isEmpty()) { return; } writer.write("\n<!-- Start general headlines -->"); for (Object line : headlines) { writer.write("\n" + line); } writer.println("\n<!-- End general headlines -->"); } }
public class class_name { private void addHeadlines(final PrintWriter writer, final List headlines) { if (headlines == null || headlines.isEmpty()) { return; // depends on control dependency: [if], data = [none] } writer.write("\n<!-- Start general headlines -->"); for (Object line : headlines) { writer.write("\n" + line); // depends on control dependency: [for], data = [line] } writer.println("\n<!-- End general headlines -->"); } }
public class class_name { private static String classNameOf(TypeElement type, String delimiter) { String name = type.getSimpleName().toString(); while (type.getEnclosingElement() instanceof TypeElement) { type = (TypeElement) type.getEnclosingElement(); name = type.getSimpleName() + delimiter + name; } return name; } }
public class class_name { private static String classNameOf(TypeElement type, String delimiter) { String name = type.getSimpleName().toString(); while (type.getEnclosingElement() instanceof TypeElement) { type = (TypeElement) type.getEnclosingElement(); // depends on control dependency: [while], data = [none] name = type.getSimpleName() + delimiter + name; // depends on control dependency: [while], data = [none] } return name; } }
public class class_name { public int getTypeAnnotation() { int type = 0; if (nodeKind == ATTRIBUTE) { type = StandardNames.XS_UNTYPED_ATOMIC; } else { type = StandardNames.XS_UNTYPED; } return type; } }
public class class_name { public int getTypeAnnotation() { int type = 0; if (nodeKind == ATTRIBUTE) { type = StandardNames.XS_UNTYPED_ATOMIC; // depends on control dependency: [if], data = [none] } else { type = StandardNames.XS_UNTYPED; // depends on control dependency: [if], data = [none] } return type; } }
public class class_name { public void setAncestorToSave(QPath newAncestorToSave) { if (!ancestorToSave.equals(newAncestorToSave)) { isNeedReloadAncestorToSave = true; } this.ancestorToSave = newAncestorToSave; } }
public class class_name { public void setAncestorToSave(QPath newAncestorToSave) { if (!ancestorToSave.equals(newAncestorToSave)) { isNeedReloadAncestorToSave = true; // depends on control dependency: [if], data = [none] } this.ancestorToSave = newAncestorToSave; } }
public class class_name { public void setTapeRecoveryPointInfos(java.util.Collection<TapeRecoveryPointInfo> tapeRecoveryPointInfos) { if (tapeRecoveryPointInfos == null) { this.tapeRecoveryPointInfos = null; return; } this.tapeRecoveryPointInfos = new com.amazonaws.internal.SdkInternalList<TapeRecoveryPointInfo>(tapeRecoveryPointInfos); } }
public class class_name { public void setTapeRecoveryPointInfos(java.util.Collection<TapeRecoveryPointInfo> tapeRecoveryPointInfos) { if (tapeRecoveryPointInfos == null) { this.tapeRecoveryPointInfos = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.tapeRecoveryPointInfos = new com.amazonaws.internal.SdkInternalList<TapeRecoveryPointInfo>(tapeRecoveryPointInfos); } }
public class class_name { private void checkForUnexpectedCommandParameter(List<String> messages) { if (COMMANDS.UPDATE_COUNT.equalsIgnoreCase(command) || COMMANDS.UPDATE_COUNT_SQL.equalsIgnoreCase(command) || COMMANDS.UPDATE_TO_TAG.equalsIgnoreCase(command) || COMMANDS.UPDATE_TO_TAG_SQL.equalsIgnoreCase(command) || COMMANDS.CALCULATE_CHECKSUM.equalsIgnoreCase(command) || COMMANDS.DB_DOC.equalsIgnoreCase(command) || COMMANDS.TAG.equalsIgnoreCase(command) || COMMANDS.TAG_EXISTS.equalsIgnoreCase(command)) { if ((!commandParams.isEmpty()) && commandParams.iterator().next().startsWith("-")) { messages.add(coreBundle.getString(ERRORMSG_UNEXPECTED_PARAMETERS) + commandParams); } } else if (COMMANDS.STATUS.equalsIgnoreCase(command) || COMMANDS.UNEXPECTED_CHANGESETS.equalsIgnoreCase(command)) { if ((!commandParams.isEmpty()) && !commandParams.iterator().next().equalsIgnoreCase("--" + OPTIONS.VERBOSE)) { messages.add(coreBundle.getString(ERRORMSG_UNEXPECTED_PARAMETERS) + commandParams); } } else if (COMMANDS.DIFF.equalsIgnoreCase(command) || COMMANDS.DIFF_CHANGELOG.equalsIgnoreCase(command)) { if ((!commandParams.isEmpty())) { for (String cmdParm : commandParams) { if (!cmdParm.startsWith("--" + OPTIONS.REFERENCE_USERNAME) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_PASSWORD) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_DRIVER) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_DEFAULT_CATALOG_NAME) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_DEFAULT_SCHEMA_NAME) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_SCHEMA) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_CATALOG) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_TABLESPACE) && !cmdParm.startsWith("--" + OPTIONS.SCHEMAS) && !cmdParm.startsWith("--" + OPTIONS.OUTPUT_SCHEMAS_AS) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_SCHEMAS) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_URL) && !cmdParm.startsWith("--" + OPTIONS.EXCLUDE_OBJECTS) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_OBJECTS) && !cmdParm.startsWith("--" + OPTIONS.DIFF_TYPES)) { messages.add(String.format(coreBundle.getString("unexpected.command.parameter"), cmdParm)); } } } } else if ((COMMANDS.SNAPSHOT.equalsIgnoreCase(command) || COMMANDS.GENERATE_CHANGELOG.equalsIgnoreCase(command) ) && (!commandParams.isEmpty())) { for (String cmdParm : commandParams) { if (!cmdParm.startsWith("--" + OPTIONS.INCLUDE_SCHEMA) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_CATALOG) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_TABLESPACE) && !cmdParm.startsWith("--" + OPTIONS.SCHEMAS)) { messages.add(String.format(coreBundle.getString("unexpected.command.parameter"), cmdParm)); } } } } }
public class class_name { private void checkForUnexpectedCommandParameter(List<String> messages) { if (COMMANDS.UPDATE_COUNT.equalsIgnoreCase(command) || COMMANDS.UPDATE_COUNT_SQL.equalsIgnoreCase(command) || COMMANDS.UPDATE_TO_TAG.equalsIgnoreCase(command) || COMMANDS.UPDATE_TO_TAG_SQL.equalsIgnoreCase(command) || COMMANDS.CALCULATE_CHECKSUM.equalsIgnoreCase(command) || COMMANDS.DB_DOC.equalsIgnoreCase(command) || COMMANDS.TAG.equalsIgnoreCase(command) || COMMANDS.TAG_EXISTS.equalsIgnoreCase(command)) { if ((!commandParams.isEmpty()) && commandParams.iterator().next().startsWith("-")) { messages.add(coreBundle.getString(ERRORMSG_UNEXPECTED_PARAMETERS) + commandParams); // depends on control dependency: [if], data = [none] } } else if (COMMANDS.STATUS.equalsIgnoreCase(command) || COMMANDS.UNEXPECTED_CHANGESETS.equalsIgnoreCase(command)) { if ((!commandParams.isEmpty()) && !commandParams.iterator().next().equalsIgnoreCase("--" + OPTIONS.VERBOSE)) { messages.add(coreBundle.getString(ERRORMSG_UNEXPECTED_PARAMETERS) + commandParams); // depends on control dependency: [if], data = [none] } } else if (COMMANDS.DIFF.equalsIgnoreCase(command) || COMMANDS.DIFF_CHANGELOG.equalsIgnoreCase(command)) { if ((!commandParams.isEmpty())) { for (String cmdParm : commandParams) { if (!cmdParm.startsWith("--" + OPTIONS.REFERENCE_USERNAME) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_PASSWORD) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_DRIVER) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_DEFAULT_CATALOG_NAME) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_DEFAULT_SCHEMA_NAME) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_SCHEMA) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_CATALOG) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_TABLESPACE) && !cmdParm.startsWith("--" + OPTIONS.SCHEMAS) && !cmdParm.startsWith("--" + OPTIONS.OUTPUT_SCHEMAS_AS) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_SCHEMAS) && !cmdParm.startsWith("--" + OPTIONS.REFERENCE_URL) && !cmdParm.startsWith("--" + OPTIONS.EXCLUDE_OBJECTS) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_OBJECTS) && !cmdParm.startsWith("--" + OPTIONS.DIFF_TYPES)) { messages.add(String.format(coreBundle.getString("unexpected.command.parameter"), cmdParm)); // depends on control dependency: [if], data = [none] } } } } else if ((COMMANDS.SNAPSHOT.equalsIgnoreCase(command) || COMMANDS.GENERATE_CHANGELOG.equalsIgnoreCase(command) ) && (!commandParams.isEmpty())) { for (String cmdParm : commandParams) { if (!cmdParm.startsWith("--" + OPTIONS.INCLUDE_SCHEMA) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_CATALOG) && !cmdParm.startsWith("--" + OPTIONS.INCLUDE_TABLESPACE) && !cmdParm.startsWith("--" + OPTIONS.SCHEMAS)) { messages.add(String.format(coreBundle.getString("unexpected.command.parameter"), cmdParm)); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public void marshall(RemovePermissionRequest removePermissionRequest, ProtocolMarshaller protocolMarshaller) { if (removePermissionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(removePermissionRequest.getStatementId(), STATEMENTID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(RemovePermissionRequest removePermissionRequest, ProtocolMarshaller protocolMarshaller) { if (removePermissionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(removePermissionRequest.getStatementId(), STATEMENTID_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static void main(String[] args) { final int trials = 10000; final int maxLength = 10000; Random rnd = new Random(); final int seed = rnd.nextInt(); System.out.print("Test correctness... "); rnd = new Random(seed); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength)]; for (int j = 0; j < x.length; j++) x[j] = rnd.nextInt(Integer.MAX_VALUE); int size1 = 0; for (int j = 0; j < x.length; j++) size1 += Integer.bitCount(x[j]); int size2 = count(x); if (size1 != size2) { System.out.println("i = " + i); System.out.println("ERRORE!"); System.out.println(size1 + ", " + size2); for (int j = 0; j < x.length; j++) System.out.format("x[%d] = %d --> %d\n", j, x[j], Integer.bitCount(x[j])); return; } } System.out.println("done!"); System.out.print("Test correctness II... "); rnd = new Random(seed); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength << 1)]; for (int j = 1; j < x.length; j += 2) x[j] = rnd.nextInt(Integer.MAX_VALUE); int size1 = 0; for (int j = 1; j < x.length; j += 2) size1 += Integer.bitCount(x[j]); int size2 = count_2(x); if (size1 != size2) { System.out.println("i = " + i); System.out.println("ERRORE!"); System.out.println(size1 + ", " + size2); for (int j = 1; j < x.length; j += 2) System.out.format("x[%d] = %d --> %d\n", j, x[j], Integer.bitCount(x[j])); return; } } System.out.println("done!"); System.out.print("Test time count(): "); rnd = new Random(seed); long t = System.currentTimeMillis(); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength)]; for (int j = 0; j < x.length; j++) x[j] = rnd.nextInt(Integer.MAX_VALUE); @SuppressWarnings("unused") int size = 0; for (int j = 0; j < x.length; j++) size += Integer.bitCount(x[j]); } System.out.println(System.currentTimeMillis() - t); System.out.print("Test time BitCount.count(): "); rnd = new Random(seed); t = System.currentTimeMillis(); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength)]; for (int j = 0; j < x.length; j++) x[j] = rnd.nextInt(Integer.MAX_VALUE); count(x); } System.out.println(System.currentTimeMillis() - t); System.out.print("Test II time count(): "); rnd = new Random(seed); t = System.currentTimeMillis(); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength << 1)]; for (int j = 1; j < x.length; j += 2) x[j] = rnd.nextInt(Integer.MAX_VALUE); @SuppressWarnings("unused") int size = 0; for (int j = 1; j < x.length; j += 2) size += Integer.bitCount(x[j]); } System.out.println(System.currentTimeMillis() - t); System.out.print("Test II time BitCount.count(): "); rnd = new Random(seed); t = System.currentTimeMillis(); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength << 1)]; for (int j = 1; j < x.length; j += 2) x[j] = rnd.nextInt(Integer.MAX_VALUE); count_2(x); } System.out.println(System.currentTimeMillis() - t); } }
public class class_name { public static void main(String[] args) { final int trials = 10000; final int maxLength = 10000; Random rnd = new Random(); final int seed = rnd.nextInt(); System.out.print("Test correctness... "); rnd = new Random(seed); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength)]; for (int j = 0; j < x.length; j++) x[j] = rnd.nextInt(Integer.MAX_VALUE); int size1 = 0; for (int j = 0; j < x.length; j++) size1 += Integer.bitCount(x[j]); int size2 = count(x); if (size1 != size2) { System.out.println("i = " + i); // depends on control dependency: [if], data = [none] System.out.println("ERRORE!"); // depends on control dependency: [if], data = [none] System.out.println(size1 + ", " + size2); // depends on control dependency: [if], data = [(size1] for (int j = 0; j < x.length; j++) System.out.format("x[%d] = %d --> %d\n", j, x[j], Integer.bitCount(x[j])); return; // depends on control dependency: [if], data = [none] } } System.out.println("done!"); System.out.print("Test correctness II... "); rnd = new Random(seed); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength << 1)]; for (int j = 1; j < x.length; j += 2) x[j] = rnd.nextInt(Integer.MAX_VALUE); int size1 = 0; for (int j = 1; j < x.length; j += 2) size1 += Integer.bitCount(x[j]); int size2 = count_2(x); if (size1 != size2) { System.out.println("i = " + i); // depends on control dependency: [if], data = [none] System.out.println("ERRORE!"); // depends on control dependency: [if], data = [none] System.out.println(size1 + ", " + size2); // depends on control dependency: [if], data = [(size1] for (int j = 1; j < x.length; j += 2) System.out.format("x[%d] = %d --> %d\n", j, x[j], Integer.bitCount(x[j])); return; // depends on control dependency: [if], data = [none] } } System.out.println("done!"); System.out.print("Test time count(): "); rnd = new Random(seed); long t = System.currentTimeMillis(); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength)]; for (int j = 0; j < x.length; j++) x[j] = rnd.nextInt(Integer.MAX_VALUE); @SuppressWarnings("unused") int size = 0; for (int j = 0; j < x.length; j++) size += Integer.bitCount(x[j]); } System.out.println(System.currentTimeMillis() - t); System.out.print("Test time BitCount.count(): "); rnd = new Random(seed); t = System.currentTimeMillis(); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength)]; for (int j = 0; j < x.length; j++) x[j] = rnd.nextInt(Integer.MAX_VALUE); count(x); // depends on control dependency: [for], data = [none] } System.out.println(System.currentTimeMillis() - t); System.out.print("Test II time count(): "); rnd = new Random(seed); t = System.currentTimeMillis(); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength << 1)]; for (int j = 1; j < x.length; j += 2) x[j] = rnd.nextInt(Integer.MAX_VALUE); @SuppressWarnings("unused") int size = 0; for (int j = 1; j < x.length; j += 2) size += Integer.bitCount(x[j]); } System.out.println(System.currentTimeMillis() - t); System.out.print("Test II time BitCount.count(): "); rnd = new Random(seed); t = System.currentTimeMillis(); for (int i = 0; i < trials; i++) { int[] x = new int[rnd.nextInt(maxLength << 1)]; for (int j = 1; j < x.length; j += 2) x[j] = rnd.nextInt(Integer.MAX_VALUE); count_2(x); // depends on control dependency: [for], data = [none] } System.out.println(System.currentTimeMillis() - t); } }
public class class_name { public List<JAXBElement<Object>> get_GenericApplicationPropertyOfGroundSurface() { if (_GenericApplicationPropertyOfGroundSurface == null) { _GenericApplicationPropertyOfGroundSurface = new ArrayList<JAXBElement<Object>>(); } return this._GenericApplicationPropertyOfGroundSurface; } }
public class class_name { public List<JAXBElement<Object>> get_GenericApplicationPropertyOfGroundSurface() { if (_GenericApplicationPropertyOfGroundSurface == null) { _GenericApplicationPropertyOfGroundSurface = new ArrayList<JAXBElement<Object>>(); // depends on control dependency: [if], data = [none] } return this._GenericApplicationPropertyOfGroundSurface; } }
public class class_name { public int readUnsignedInt() { int variableByteDecode = 0; byte variableByteShift = 0; // check if the continuation bit is set while ((this.bufferData[this.bufferPosition] & 0x80) != 0) { variableByteDecode |= (this.bufferData[this.bufferPosition++] & 0x7f) << variableByteShift; variableByteShift += 7; } // read the seven data bits from the last byte return variableByteDecode | (this.bufferData[this.bufferPosition++] << variableByteShift); } }
public class class_name { public int readUnsignedInt() { int variableByteDecode = 0; byte variableByteShift = 0; // check if the continuation bit is set while ((this.bufferData[this.bufferPosition] & 0x80) != 0) { variableByteDecode |= (this.bufferData[this.bufferPosition++] & 0x7f) << variableByteShift; // depends on control dependency: [while], data = [none] variableByteShift += 7; // depends on control dependency: [while], data = [none] } // read the seven data bits from the last byte return variableByteDecode | (this.bufferData[this.bufferPosition++] << variableByteShift); } }
public class class_name { public void initialize() throws SQLException { if (initialized) { // just skip it if already initialized return; } if (connectionSource == null) { throw new IllegalStateException("connectionSource was never set on " + getClass().getSimpleName()); } databaseType = connectionSource.getDatabaseType(); if (databaseType == null) { throw new IllegalStateException( "connectionSource is getting a null DatabaseType in " + getClass().getSimpleName()); } if (tableConfig == null) { tableInfo = new TableInfo<T, ID>(databaseType, dataClass); } else { tableConfig.extractFieldTypes(databaseType); tableInfo = new TableInfo<T, ID>(databaseType, tableConfig); } statementExecutor = new StatementExecutor<T, ID>(databaseType, tableInfo, this); /* * This is a bit complex. Initially, when we were configuring the field types, external DAO information would be * configured for auto-refresh, foreign BaseDaoEnabled classes, and foreign-collections. This would cause the * system to go recursive and for class loops, a stack overflow. * * Then we fixed this by putting a level counter in the FieldType constructor that would stop the configurations * when we reach some recursion level. But this created some bad problems because we were using the DaoManager * to cache the created DAOs that had been constructed already limited by the level. * * What we do now is have a 2 phase initialization. The constructor initializes most of the fields but then we * go back and call FieldType.configDaoInformation() after we are done. So for every DAO that is initialized * here, we have to see if it is the top DAO. If not we save it for dao configuration later. */ List<BaseDaoImpl<?, ?>> daoConfigList = daoConfigLevelLocal.get(); daoConfigList.add(this); if (daoConfigList.size() > 1) { // if we have recursed then just save the dao for later configuration return; } try { /* * WARNING: We do _not_ use an iterator here because we may be adding to the list as we process it and we'll * get exceptions otherwise. This is an ArrayList so the get(i) should be efficient. * * Also, do _not_ get a copy of daoConfigLevel.doArray because that array may be replaced by another, larger * one during the recursion. */ for (int i = 0; i < daoConfigList.size(); i++) { BaseDaoImpl<?, ?> dao = daoConfigList.get(i); /* * Here's another complex bit. The first DAO that is being constructed as part of a DAO chain is not yet * in the DaoManager cache. If we continue onward we might come back around and try to configure this * DAO again. Forcing it into the cache here makes sure it won't be configured twice. This will cause it * to be stuck in twice when it returns out to the DaoManager but that's a small price to pay. This also * applies to self-referencing classes. */ DaoManager.registerDao(connectionSource, dao); try { // config our fields which may go recursive for (FieldType fieldType : dao.getTableInfo().getFieldTypes()) { fieldType.configDaoInformation(connectionSource, dao.getDataClass()); } } catch (SQLException e) { // unregister the DAO we just pre-registered DaoManager.unregisterDao(connectionSource, dao); throw e; } // it's now been fully initialized dao.initialized = true; } } finally { // if we throw we want to clear our class hierarchy here daoConfigList.clear(); daoConfigLevelLocal.remove(); } } }
public class class_name { public void initialize() throws SQLException { if (initialized) { // just skip it if already initialized return; } if (connectionSource == null) { throw new IllegalStateException("connectionSource was never set on " + getClass().getSimpleName()); } databaseType = connectionSource.getDatabaseType(); if (databaseType == null) { throw new IllegalStateException( "connectionSource is getting a null DatabaseType in " + getClass().getSimpleName()); } if (tableConfig == null) { tableInfo = new TableInfo<T, ID>(databaseType, dataClass); } else { tableConfig.extractFieldTypes(databaseType); tableInfo = new TableInfo<T, ID>(databaseType, tableConfig); } statementExecutor = new StatementExecutor<T, ID>(databaseType, tableInfo, this); /* * This is a bit complex. Initially, when we were configuring the field types, external DAO information would be * configured for auto-refresh, foreign BaseDaoEnabled classes, and foreign-collections. This would cause the * system to go recursive and for class loops, a stack overflow. * * Then we fixed this by putting a level counter in the FieldType constructor that would stop the configurations * when we reach some recursion level. But this created some bad problems because we were using the DaoManager * to cache the created DAOs that had been constructed already limited by the level. * * What we do now is have a 2 phase initialization. The constructor initializes most of the fields but then we * go back and call FieldType.configDaoInformation() after we are done. So for every DAO that is initialized * here, we have to see if it is the top DAO. If not we save it for dao configuration later. */ List<BaseDaoImpl<?, ?>> daoConfigList = daoConfigLevelLocal.get(); daoConfigList.add(this); if (daoConfigList.size() > 1) { // if we have recursed then just save the dao for later configuration return; } try { /* * WARNING: We do _not_ use an iterator here because we may be adding to the list as we process it and we'll * get exceptions otherwise. This is an ArrayList so the get(i) should be efficient. * * Also, do _not_ get a copy of daoConfigLevel.doArray because that array may be replaced by another, larger * one during the recursion. */ for (int i = 0; i < daoConfigList.size(); i++) { BaseDaoImpl<?, ?> dao = daoConfigList.get(i); // depends on control dependency: [for], data = [i] /* * Here's another complex bit. The first DAO that is being constructed as part of a DAO chain is not yet * in the DaoManager cache. If we continue onward we might come back around and try to configure this * DAO again. Forcing it into the cache here makes sure it won't be configured twice. This will cause it * to be stuck in twice when it returns out to the DaoManager but that's a small price to pay. This also * applies to self-referencing classes. */ DaoManager.registerDao(connectionSource, dao); // depends on control dependency: [for], data = [none] try { // config our fields which may go recursive for (FieldType fieldType : dao.getTableInfo().getFieldTypes()) { fieldType.configDaoInformation(connectionSource, dao.getDataClass()); // depends on control dependency: [for], data = [fieldType] } } catch (SQLException e) { // unregister the DAO we just pre-registered DaoManager.unregisterDao(connectionSource, dao); throw e; } // depends on control dependency: [catch], data = [none] // it's now been fully initialized dao.initialized = true; // depends on control dependency: [for], data = [none] } } finally { // if we throw we want to clear our class hierarchy here daoConfigList.clear(); daoConfigLevelLocal.remove(); } } }
public class class_name { @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public List<String> getVermarktungsart() { if (vermarktungsart == null) { vermarktungsart = new ArrayList<String>(); } return this.vermarktungsart; } }
public class class_name { @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public List<String> getVermarktungsart() { if (vermarktungsart == null) { vermarktungsart = new ArrayList<String>(); // depends on control dependency: [if], data = [none] } return this.vermarktungsart; } }
public class class_name { public Integer[] getParaValuesToInt(String name) { String[] values = request.getParameterValues(name); if (values == null || values.length == 0) { return null; } Integer[] result = new Integer[values.length]; for (int i=0; i<result.length; i++) { result[i] = StrKit.isBlank(values[i]) ? null : Integer.parseInt(values[i]); } return result; } }
public class class_name { public Integer[] getParaValuesToInt(String name) { String[] values = request.getParameterValues(name); if (values == null || values.length == 0) { return null; // depends on control dependency: [if], data = [none] } Integer[] result = new Integer[values.length]; for (int i=0; i<result.length; i++) { result[i] = StrKit.isBlank(values[i]) ? null : Integer.parseInt(values[i]); // depends on control dependency: [for], data = [i] } return result; } }
public class class_name { public java.util.List<CommandInvocation> getCommandInvocations() { if (commandInvocations == null) { commandInvocations = new com.amazonaws.internal.SdkInternalList<CommandInvocation>(); } return commandInvocations; } }
public class class_name { public java.util.List<CommandInvocation> getCommandInvocations() { if (commandInvocations == null) { commandInvocations = new com.amazonaws.internal.SdkInternalList<CommandInvocation>(); // depends on control dependency: [if], data = [none] } return commandInvocations; } }
public class class_name { public static String getGenderByIdCard(String idCard) { String sGender = "N"; if (idCard.length() == CHINA_ID_MIN_LENGTH) { idCard = conver15CardTo18(idCard); } String sCardNum = idCard.substring(16, 17); if (Integer.parseInt(sCardNum) % 2 != 0) { sGender = "M"; } else { sGender = "F"; } return sGender; } }
public class class_name { public static String getGenderByIdCard(String idCard) { String sGender = "N"; if (idCard.length() == CHINA_ID_MIN_LENGTH) { idCard = conver15CardTo18(idCard); // depends on control dependency: [if], data = [none] } String sCardNum = idCard.substring(16, 17); if (Integer.parseInt(sCardNum) % 2 != 0) { sGender = "M"; // depends on control dependency: [if], data = [none] } else { sGender = "F"; // depends on control dependency: [if], data = [none] } return sGender; } }
public class class_name { private static boolean overlaps_(String scl, int dim_a, int dim_b) { if (dim_a == dim_b) { if (dim_a != 1) { // Valid for area-area, Point-Point if (scl.charAt(0) == 'T' && scl.charAt(1) == '*' && scl.charAt(2) == 'T' && scl.charAt(3) == '*' && scl.charAt(4) == '*' && scl.charAt(5) == '*' && scl.charAt(6) == 'T' && scl.charAt(7) == '*' && scl.charAt(8) == '*') return true; return false; } // Valid for Line-Line if (scl.charAt(0) == '1' && scl.charAt(1) == '*' && scl.charAt(2) == 'T' && scl.charAt(3) == '*' && scl.charAt(4) == '*' && scl.charAt(5) == '*' && scl.charAt(6) == 'T' && scl.charAt(7) == '*' && scl.charAt(8) == '*') return true; } return false; } }
public class class_name { private static boolean overlaps_(String scl, int dim_a, int dim_b) { if (dim_a == dim_b) { if (dim_a != 1) { // Valid for area-area, Point-Point if (scl.charAt(0) == 'T' && scl.charAt(1) == '*' && scl.charAt(2) == 'T' && scl.charAt(3) == '*' && scl.charAt(4) == '*' && scl.charAt(5) == '*' && scl.charAt(6) == 'T' && scl.charAt(7) == '*' && scl.charAt(8) == '*') return true; return false; // depends on control dependency: [if], data = [none] } // Valid for Line-Line if (scl.charAt(0) == '1' && scl.charAt(1) == '*' && scl.charAt(2) == 'T' && scl.charAt(3) == '*' && scl.charAt(4) == '*' && scl.charAt(5) == '*' && scl.charAt(6) == 'T' && scl.charAt(7) == '*' && scl.charAt(8) == '*') return true; } return false; } }
public class class_name { public static RedisConnectionException create(Throwable cause) { if (cause instanceof RedisConnectionException) { return new RedisConnectionException(cause.getMessage(), cause.getCause()); } return new RedisConnectionException("Unable to connect", cause); } }
public class class_name { public static RedisConnectionException create(Throwable cause) { if (cause instanceof RedisConnectionException) { return new RedisConnectionException(cause.getMessage(), cause.getCause()); // depends on control dependency: [if], data = [none] } return new RedisConnectionException("Unable to connect", cause); } }
public class class_name { public File getLauncher() { if (System.getenv(LAUNCHER_ENV_VAR) != null && !System.getenv(LAUNCHER_ENV_VAR).isEmpty()) { options.get(LAUNCHER).setValue(new File(System.getenv(LAUNCHER_ENV_VAR))); } return (File) options.get(LAUNCHER).getValue(); } }
public class class_name { public File getLauncher() { if (System.getenv(LAUNCHER_ENV_VAR) != null && !System.getenv(LAUNCHER_ENV_VAR).isEmpty()) { options.get(LAUNCHER).setValue(new File(System.getenv(LAUNCHER_ENV_VAR))); // depends on control dependency: [if], data = [(System.getenv(LAUNCHER_ENV_VAR)] } return (File) options.get(LAUNCHER).getValue(); } }
public class class_name { public boolean setCurrentDestination(String destination) { RtfDestination dest = RtfDestinationMgr.getDestination(destination); if(dest != null) { this.currentState.destination = dest; return false; } else { this.setTokeniserStateSkipGroup(); return false; } } }
public class class_name { public boolean setCurrentDestination(String destination) { RtfDestination dest = RtfDestinationMgr.getDestination(destination); if(dest != null) { this.currentState.destination = dest; // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } else { this.setTokeniserStateSkipGroup(); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { protected List<PropertyData> getDirectChildPropertiesData(NodeData parent, List<QPathEntryFilter> itemDataFilters) throws RepositoryException, IllegalStateException { checkIfOpened(); List<PropertyData> children = new ArrayList<PropertyData>(); for (Iterator<QPathEntryFilter> it = itemDataFilters.iterator(); it.hasNext(); ) { QPathEntryFilter filter = it.next(); if (filter.isExactName()) { PropertyData data = (PropertyData)getItemData(parent, filter.getQPathEntry(), ItemType.PROPERTY); if (data != null) { children.add(data); } it.remove(); } } if (!itemDataFilters.isEmpty()) { children.addAll(getChildPropertiesDataInternal(parent, itemDataFilters)); } return children; } }
public class class_name { protected List<PropertyData> getDirectChildPropertiesData(NodeData parent, List<QPathEntryFilter> itemDataFilters) throws RepositoryException, IllegalStateException { checkIfOpened(); List<PropertyData> children = new ArrayList<PropertyData>(); for (Iterator<QPathEntryFilter> it = itemDataFilters.iterator(); it.hasNext(); ) { QPathEntryFilter filter = it.next(); if (filter.isExactName()) { PropertyData data = (PropertyData)getItemData(parent, filter.getQPathEntry(), ItemType.PROPERTY); if (data != null) { children.add(data); // depends on control dependency: [if], data = [(data] } it.remove(); // depends on control dependency: [if], data = [none] } } if (!itemDataFilters.isEmpty()) { children.addAll(getChildPropertiesDataInternal(parent, itemDataFilters)); } return children; } }
public class class_name { public Output withCaptionDescriptionNames(String... captionDescriptionNames) { if (this.captionDescriptionNames == null) { setCaptionDescriptionNames(new java.util.ArrayList<String>(captionDescriptionNames.length)); } for (String ele : captionDescriptionNames) { this.captionDescriptionNames.add(ele); } return this; } }
public class class_name { public Output withCaptionDescriptionNames(String... captionDescriptionNames) { if (this.captionDescriptionNames == null) { setCaptionDescriptionNames(new java.util.ArrayList<String>(captionDescriptionNames.length)); // depends on control dependency: [if], data = [none] } for (String ele : captionDescriptionNames) { this.captionDescriptionNames.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static String exception2StringShort(Exception e) { StringBuffer st = new StringBuffer(); Throwable e2 = e; while (e2 != null) { String exClass = e2.getClass().getName(); String msg = e2.getMessage(); if (msg != null) { st.setLength(0); st.append(exClass); st.append(": "); st.append(msg); } e2 = e2.getCause(); } return st.toString().trim(); } }
public class class_name { public static String exception2StringShort(Exception e) { StringBuffer st = new StringBuffer(); Throwable e2 = e; while (e2 != null) { String exClass = e2.getClass().getName(); String msg = e2.getMessage(); if (msg != null) { st.setLength(0); // depends on control dependency: [if], data = [none] st.append(exClass); // depends on control dependency: [if], data = [none] st.append(": "); // depends on control dependency: [if], data = [none] st.append(msg); // depends on control dependency: [if], data = [(msg] } e2 = e2.getCause(); // depends on control dependency: [while], data = [none] } return st.toString().trim(); } }
public class class_name { private File unpackFile(HttpPipeKey key) { Pipeline pipeline = configClientService.findPipeline(key.getIdentity().getPipelineId()); DataRetriever dataRetriever = dataRetrieverFactory.createRetriever(pipeline.getParameters().getRetriever(), key.getUrl(), downloadDir); File archiveFile = null; try { dataRetriever.connect(); dataRetriever.doRetrieve(); archiveFile = dataRetriever.getDataAsFile(); } catch (Exception e) { dataRetriever.abort(); throw new PipeException("download_error", e); } finally { dataRetriever.disconnect(); } // 处理下有加密的数据 if (StringUtils.isNotEmpty(key.getKey()) && StringUtils.isNotEmpty(key.getCrc())) { decodeFile(archiveFile, key.getKey(), key.getCrc()); } // 去除末尾的.gzip后缀,做为解压目录 String dir = StringUtils.removeEnd(archiveFile.getPath(), FilenameUtils.EXTENSION_SEPARATOR_STR + FilenameUtils.getExtension(archiveFile.getPath())); File unpackDir = new File(dir); // 开始解压 getArchiveBean().unpack(archiveFile, unpackDir); return unpackDir; } }
public class class_name { private File unpackFile(HttpPipeKey key) { Pipeline pipeline = configClientService.findPipeline(key.getIdentity().getPipelineId()); DataRetriever dataRetriever = dataRetrieverFactory.createRetriever(pipeline.getParameters().getRetriever(), key.getUrl(), downloadDir); File archiveFile = null; try { dataRetriever.connect(); // depends on control dependency: [try], data = [none] dataRetriever.doRetrieve(); // depends on control dependency: [try], data = [none] archiveFile = dataRetriever.getDataAsFile(); // depends on control dependency: [try], data = [none] } catch (Exception e) { dataRetriever.abort(); throw new PipeException("download_error", e); } finally { // depends on control dependency: [catch], data = [none] dataRetriever.disconnect(); } // 处理下有加密的数据 if (StringUtils.isNotEmpty(key.getKey()) && StringUtils.isNotEmpty(key.getCrc())) { decodeFile(archiveFile, key.getKey(), key.getCrc()); // depends on control dependency: [if], data = [none] } // 去除末尾的.gzip后缀,做为解压目录 String dir = StringUtils.removeEnd(archiveFile.getPath(), FilenameUtils.EXTENSION_SEPARATOR_STR + FilenameUtils.getExtension(archiveFile.getPath())); File unpackDir = new File(dir); // 开始解压 getArchiveBean().unpack(archiveFile, unpackDir); return unpackDir; } }
public class class_name { private CmsObject initCms(CmsObject cms) { try { cms = OpenCms.initCmsObject(cms); } catch (CmsException e) { LOG.error("Unable to init CmsObject"); } cms.getRequestContext().setSiteRoot(""); return cms; } }
public class class_name { private CmsObject initCms(CmsObject cms) { try { cms = OpenCms.initCmsObject(cms); // depends on control dependency: [try], data = [none] } catch (CmsException e) { LOG.error("Unable to init CmsObject"); } // depends on control dependency: [catch], data = [none] cms.getRequestContext().setSiteRoot(""); return cms; } }
public class class_name { @Trivial @Override public int getLocalPort() { int port = this.connection.getLocalPort(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "getLocalPort: " + port); } return port; } }
public class class_name { @Trivial @Override public int getLocalPort() { int port = this.connection.getLocalPort(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "getLocalPort: " + port); // depends on control dependency: [if], data = [none] } return port; } }
public class class_name { public DocumentationBuilder apiListingsByResourceGroupName(Map<String, List<ApiListing>> apiListings) { nullToEmptyMultimap(apiListings).entrySet().stream().forEachOrdered(entry -> { List<ApiListing> list; if (this.apiListings.containsKey(entry.getKey())) { list = this.apiListings.get(entry.getKey()); list.addAll(entry.getValue()); } else { list = new ArrayList<>(entry.getValue()); this.apiListings.put(entry.getKey(), list); } list.sort(byListingPosition()); }); return this; } }
public class class_name { public DocumentationBuilder apiListingsByResourceGroupName(Map<String, List<ApiListing>> apiListings) { nullToEmptyMultimap(apiListings).entrySet().stream().forEachOrdered(entry -> { List<ApiListing> list; if (this.apiListings.containsKey(entry.getKey())) { list = this.apiListings.get(entry.getKey()); // depends on control dependency: [if], data = [none] list.addAll(entry.getValue()); // depends on control dependency: [if], data = [none] } else { list = new ArrayList<>(entry.getValue()); // depends on control dependency: [if], data = [none] this.apiListings.put(entry.getKey(), list); // depends on control dependency: [if], data = [none] } list.sort(byListingPosition()); }); return this; } }
public class class_name { public List<E> getCondensedList() { return new AbstractList<E>() { @SuppressWarnings("unchecked") @Override public E get(int arg0) { stateLock.readLock().lock(); try { return (E) elements[effectiveIndex[arg0]]; } finally { stateLock.readLock().unlock(); } } @Override public int size() { return currentSize(); } }; } }
public class class_name { public List<E> getCondensedList() { return new AbstractList<E>() { @SuppressWarnings("unchecked") @Override public E get(int arg0) { stateLock.readLock().lock(); try { return (E) elements[effectiveIndex[arg0]]; // depends on control dependency: [try], data = [none] } finally { stateLock.readLock().unlock(); } } @Override public int size() { return currentSize(); } }; } }
public class class_name { public static HtmlPage toHtmlPage(InputStream inputStream) { try { return toHtmlPage(IOUtils.toString(inputStream)); } catch (IOException e) { throw new RuntimeException("Error creating HtmlPage from InputStream.", e); } } }
public class class_name { public static HtmlPage toHtmlPage(InputStream inputStream) { try { return toHtmlPage(IOUtils.toString(inputStream)); // depends on control dependency: [try], data = [none] } catch (IOException e) { throw new RuntimeException("Error creating HtmlPage from InputStream.", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public ScanProvisionedProductsResult withProvisionedProducts(ProvisionedProductDetail... provisionedProducts) { if (this.provisionedProducts == null) { setProvisionedProducts(new java.util.ArrayList<ProvisionedProductDetail>(provisionedProducts.length)); } for (ProvisionedProductDetail ele : provisionedProducts) { this.provisionedProducts.add(ele); } return this; } }
public class class_name { public ScanProvisionedProductsResult withProvisionedProducts(ProvisionedProductDetail... provisionedProducts) { if (this.provisionedProducts == null) { setProvisionedProducts(new java.util.ArrayList<ProvisionedProductDetail>(provisionedProducts.length)); // depends on control dependency: [if], data = [none] } for (ProvisionedProductDetail ele : provisionedProducts) { this.provisionedProducts.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public int put(Widget widget) { attach(widget); for (int i = 0; i < content.length; ++i) for (int j = 0; j < content[i].length; ++j) if (content[i][j] == null) { content[i][j] = widget; this.sendElement(); return i; } throw new IndexOutOfBoundsException(); //return -1; } }
public class class_name { public int put(Widget widget) { attach(widget); for (int i = 0; i < content.length; ++i) for (int j = 0; j < content[i].length; ++j) if (content[i][j] == null) { content[i][j] = widget; // depends on control dependency: [if], data = [none] this.sendElement(); // depends on control dependency: [if], data = [none] return i; // depends on control dependency: [if], data = [none] } throw new IndexOutOfBoundsException(); //return -1; } }
public class class_name { public QPath getRemainder() { if (matchPos + matchLength >= pathLength) { return null; } else { try { throw new RepositoryException("Not implemented"); //return path.subPath(matchPos + matchLength, pathLength); } catch (RepositoryException e) { throw (IllegalStateException)new IllegalStateException("Path not normalized").initCause(e); } } } }
public class class_name { public QPath getRemainder() { if (matchPos + matchLength >= pathLength) { return null; // depends on control dependency: [if], data = [none] } else { try { throw new RepositoryException("Not implemented"); //return path.subPath(matchPos + matchLength, pathLength); } catch (RepositoryException e) { throw (IllegalStateException)new IllegalStateException("Path not normalized").initCause(e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public KeyedStream<T, Tuple> keyBy(int... fields) { if (getType() instanceof BasicArrayTypeInfo || getType() instanceof PrimitiveArrayTypeInfo) { return keyBy(KeySelectorUtil.getSelectorForArray(fields, getType())); } else { return keyBy(new Keys.ExpressionKeys<>(fields, getType())); } } }
public class class_name { public KeyedStream<T, Tuple> keyBy(int... fields) { if (getType() instanceof BasicArrayTypeInfo || getType() instanceof PrimitiveArrayTypeInfo) { return keyBy(KeySelectorUtil.getSelectorForArray(fields, getType())); // depends on control dependency: [if], data = [none] } else { return keyBy(new Keys.ExpressionKeys<>(fields, getType())); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setButtonTooltipText(final String TEXT) { if (null == buttonTooltipText) { _buttonTooltipText = TEXT; fireUpdateEvent(REDRAW_EVENT); } else { buttonTooltipText.set(TEXT); } } }
public class class_name { public void setButtonTooltipText(final String TEXT) { if (null == buttonTooltipText) { _buttonTooltipText = TEXT; // depends on control dependency: [if], data = [none] fireUpdateEvent(REDRAW_EVENT); // depends on control dependency: [if], data = [none] } else { buttonTooltipText.set(TEXT); // depends on control dependency: [if], data = [none] } } }
public class class_name { private String normalizePath(String path) { // remove leading and tailing whitespaces path = path.trim(); // remove consecutive slashes & backslashes path = path.replace("\\", "/"); path = path.replaceAll("/+", "/"); // remove tailing separator if (path.endsWith(SEPARATOR) && !path.equals(SEPARATOR) && // UNIX root path !WINDOWS_ROOT_DIR_REGEX.matcher(path).matches()) { // Windows root path) // remove tailing slash path = path.substring(0, path.length() - SEPARATOR.length()); } return path; } }
public class class_name { private String normalizePath(String path) { // remove leading and tailing whitespaces path = path.trim(); // remove consecutive slashes & backslashes path = path.replace("\\", "/"); path = path.replaceAll("/+", "/"); // remove tailing separator if (path.endsWith(SEPARATOR) && !path.equals(SEPARATOR) && // UNIX root path !WINDOWS_ROOT_DIR_REGEX.matcher(path).matches()) { // Windows root path) // remove tailing slash path = path.substring(0, path.length() - SEPARATOR.length()); // depends on control dependency: [if], data = [none] } return path; } }
public class class_name { public boolean getInternalBoolean(ColumnInformation columnInfo) { if (lastValueWasNull()) { return false; } if (columnInfo.getColumnType() == ColumnType.BIT) { return parseBit() != 0; } final String rawVal = new String(buf, pos, length, StandardCharsets.UTF_8); return !("false".equals(rawVal) || "0".equals(rawVal)); } }
public class class_name { public boolean getInternalBoolean(ColumnInformation columnInfo) { if (lastValueWasNull()) { return false; // depends on control dependency: [if], data = [none] } if (columnInfo.getColumnType() == ColumnType.BIT) { return parseBit() != 0; // depends on control dependency: [if], data = [none] } final String rawVal = new String(buf, pos, length, StandardCharsets.UTF_8); return !("false".equals(rawVal) || "0".equals(rawVal)); } }
public class class_name { public Set<String> getCustomPlugins(boolean enabled){ Set<Entry<String, Boolean>> entrySet = customPlugins.entrySet(); Set<String> result = new TreeSet<>(); for (Entry<String, Boolean> entry : entrySet) { if(enabled) { if(entry.getValue() != null && entry.getValue().booleanValue()) { result.add(entry.getKey()); } } else { if(entry.getValue() == null || !entry.getValue().booleanValue()) { result.add(entry.getKey()); } } } return result; } }
public class class_name { public Set<String> getCustomPlugins(boolean enabled){ Set<Entry<String, Boolean>> entrySet = customPlugins.entrySet(); Set<String> result = new TreeSet<>(); for (Entry<String, Boolean> entry : entrySet) { if(enabled) { if(entry.getValue() != null && entry.getValue().booleanValue()) { result.add(entry.getKey()); // depends on control dependency: [if], data = [none] } } else { if(entry.getValue() == null || !entry.getValue().booleanValue()) { result.add(entry.getKey()); // depends on control dependency: [if], data = [none] } } } return result; } }
public class class_name { public static <T> List<T> addAll(List<T> to, List<? extends T> what) { List<T> data = safeList(to); if (!isEmpty(what)) { data.addAll(what); } return data; } }
public class class_name { public static <T> List<T> addAll(List<T> to, List<? extends T> what) { List<T> data = safeList(to); if (!isEmpty(what)) { data.addAll(what); // depends on control dependency: [if], data = [none] } return data; } }
public class class_name { protected void failOnInvalidContext(ExecutionContext executionContext) { for (Fact fact : executionContext.getFacts()) { failOnInvalidFact(fact); } for (Step step : executionContext.getSteps()) { failOnInvalidStep(step); } for (Result result : executionContext.getResults()) { failOnInvalidResult(result); } } }
public class class_name { protected void failOnInvalidContext(ExecutionContext executionContext) { for (Fact fact : executionContext.getFacts()) { failOnInvalidFact(fact); // depends on control dependency: [for], data = [fact] } for (Step step : executionContext.getSteps()) { failOnInvalidStep(step); // depends on control dependency: [for], data = [step] } for (Result result : executionContext.getResults()) { failOnInvalidResult(result); // depends on control dependency: [for], data = [result] } } }
public class class_name { public static boolean shouldShowRateDialog() { if (mOptOut) { return false; } else { if (mLaunchTimes >= sConfig.mCriteriaLaunchTimes) { return true; } long threshold = TimeUnit.DAYS.toMillis(sConfig.mCriteriaInstallDays); // msec if (new Date().getTime() - mInstallDate.getTime() >= threshold && new Date().getTime() - mAskLaterDate.getTime() >= threshold) { return true; } return false; } } }
public class class_name { public static boolean shouldShowRateDialog() { if (mOptOut) { return false; // depends on control dependency: [if], data = [none] } else { if (mLaunchTimes >= sConfig.mCriteriaLaunchTimes) { return true; // depends on control dependency: [if], data = [none] } long threshold = TimeUnit.DAYS.toMillis(sConfig.mCriteriaInstallDays); // msec if (new Date().getTime() - mInstallDate.getTime() >= threshold && new Date().getTime() - mAskLaterDate.getTime() >= threshold) { return true; // depends on control dependency: [if], data = [none] } return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override protected int readData(byte[] buffer, int offset) { if (FastTrackUtility.getByte(buffer, offset) == 0x01) { offset += 2; } else { offset += 20; StringsWithLengthBlock options = new StringsWithLengthBlock().read(buffer, offset, false); m_options = options.getData(); offset = options.getOffset(); // Skip bytes offset += 8; } StringsWithLengthBlock data = new StringsWithLengthBlock().read(buffer, offset, true); m_data = data.getData(); offset = data.getOffset(); return offset; } }
public class class_name { @Override protected int readData(byte[] buffer, int offset) { if (FastTrackUtility.getByte(buffer, offset) == 0x01) { offset += 2; // depends on control dependency: [if], data = [none] } else { offset += 20; // depends on control dependency: [if], data = [none] StringsWithLengthBlock options = new StringsWithLengthBlock().read(buffer, offset, false); m_options = options.getData(); // depends on control dependency: [if], data = [none] offset = options.getOffset(); // depends on control dependency: [if], data = [none] // Skip bytes offset += 8; // depends on control dependency: [if], data = [none] } StringsWithLengthBlock data = new StringsWithLengthBlock().read(buffer, offset, true); m_data = data.getData(); offset = data.getOffset(); return offset; } }
public class class_name { private static long getMaxTTL(Map<byte[], Long> ttlByFamily) { long maxTTL = 0; for (Long familyTTL : ttlByFamily.values()) { maxTTL = Math.max(familyTTL <= 0 ? Long.MAX_VALUE : familyTTL, maxTTL); } return maxTTL == 0 ? Long.MAX_VALUE : maxTTL; } }
public class class_name { private static long getMaxTTL(Map<byte[], Long> ttlByFamily) { long maxTTL = 0; for (Long familyTTL : ttlByFamily.values()) { maxTTL = Math.max(familyTTL <= 0 ? Long.MAX_VALUE : familyTTL, maxTTL); // depends on control dependency: [for], data = [familyTTL] } return maxTTL == 0 ? Long.MAX_VALUE : maxTTL; } }
public class class_name { public synchronized TreeEntry<K, V> pollFirstEntry() { final TreeEntry<K, V> entry = firstEntry(); if (entry != null) { remove(entry.getKey()); } return entry; } }
public class class_name { public synchronized TreeEntry<K, V> pollFirstEntry() { final TreeEntry<K, V> entry = firstEntry(); if (entry != null) { remove(entry.getKey()); // depends on control dependency: [if], data = [(entry] } return entry; } }
public class class_name { public static NutMap createParamsMap(HttpServletRequest req) { NutMap params = new NutMap(); // parse query strings Enumeration<?> en = req.getParameterNames(); while (en.hasMoreElements()) { String key = en.nextElement().toString(); params.put(key, req.getParameter(key)); } return params; } }
public class class_name { public static NutMap createParamsMap(HttpServletRequest req) { NutMap params = new NutMap(); // parse query strings Enumeration<?> en = req.getParameterNames(); while (en.hasMoreElements()) { String key = en.nextElement().toString(); params.put(key, req.getParameter(key)); // depends on control dependency: [while], data = [none] } return params; } }
public class class_name { private void validateDepDefinitionUniqueness(final List<FlowTriggerDependency> dependencies) { final Set<String> seen = new HashSet<>(); for (final FlowTriggerDependency dep : dependencies) { final Map<String, String> props = dep.getProps(); // set.add() returns false when there exists duplicate Preconditions.checkArgument(seen.add(dep.getType() + ":" + props.toString()), String.format ("duplicate dependency config %s found, dependency config should be unique", dep.getName())); } } }
public class class_name { private void validateDepDefinitionUniqueness(final List<FlowTriggerDependency> dependencies) { final Set<String> seen = new HashSet<>(); for (final FlowTriggerDependency dep : dependencies) { final Map<String, String> props = dep.getProps(); // set.add() returns false when there exists duplicate Preconditions.checkArgument(seen.add(dep.getType() + ":" + props.toString()), String.format ("duplicate dependency config %s found, dependency config should be unique", dep.getName())); // depends on control dependency: [for], data = [none] } } }
public class class_name { public static Object[] merge(Object[]... arrays) { int size = 0; for (Object[] arr : arrays) size += arr.length; Object[] concat = new Object[size]; int destPos = 0; for (Object[] src : arrays) { System.arraycopy(src, 0, concat, destPos, src.length); destPos += src.length; } return concat; } }
public class class_name { public static Object[] merge(Object[]... arrays) { int size = 0; for (Object[] arr : arrays) size += arr.length; Object[] concat = new Object[size]; int destPos = 0; for (Object[] src : arrays) { System.arraycopy(src, 0, concat, destPos, src.length); // depends on control dependency: [for], data = [src] destPos += src.length; // depends on control dependency: [for], data = [src] } return concat; } }
public class class_name { public T withStatement(Statement statement) { PropertyIdValue pid = statement.getMainSnak() .getPropertyId(); ArrayList<Statement> pidStatements = this.statements.get(pid); if (pidStatements == null) { pidStatements = new ArrayList<Statement>(); this.statements.put(pid, pidStatements); } pidStatements.add(statement); return getThis(); } }
public class class_name { public T withStatement(Statement statement) { PropertyIdValue pid = statement.getMainSnak() .getPropertyId(); ArrayList<Statement> pidStatements = this.statements.get(pid); if (pidStatements == null) { pidStatements = new ArrayList<Statement>(); // depends on control dependency: [if], data = [none] this.statements.put(pid, pidStatements); // depends on control dependency: [if], data = [none] } pidStatements.add(statement); return getThis(); } }
public class class_name { @Override public RuntimeResourceDefinition validateCriteriaAndReturnResourceDefinition(String criteria) { String resourceName; if (criteria == null || criteria.trim().isEmpty()) { throw new IllegalArgumentException("Criteria cannot be empty"); } if (criteria.contains("?")) { resourceName = criteria.substring(0, criteria.indexOf("?")); } else { resourceName = criteria; } return getContext().getResourceDefinition(resourceName); } }
public class class_name { @Override public RuntimeResourceDefinition validateCriteriaAndReturnResourceDefinition(String criteria) { String resourceName; if (criteria == null || criteria.trim().isEmpty()) { throw new IllegalArgumentException("Criteria cannot be empty"); } if (criteria.contains("?")) { resourceName = criteria.substring(0, criteria.indexOf("?")); // depends on control dependency: [if], data = [none] } else { resourceName = criteria; // depends on control dependency: [if], data = [none] } return getContext().getResourceDefinition(resourceName); } }
public class class_name { public MarcField tail(MarcField marcField, String key, MarcField appendToThisField) { if (key == null) { return marcField; } MarcField newMarcField = appendToThisField; if (newMarcField == null) { newMarcField = get(key); } if (lastReceived != null) { String lastKey = getTransformKey(lastReceived); if (key.equals(lastKey)) { repeatCounter++; } else { repeatCounter = 0; } } lastReceived = marcField; MarcField.Builder builder = MarcField.builder(); if (appendToThisField != null) { builder.marcField(appendToThisField); } else { builder.tag(newMarcField.getTag()) .value(marcField.getValue()); if (ignoreIndicator) { builder.indicator(marcField.getIndicator()); } else { builder.indicator(interpolate(marcField, newMarcField.getIndicator())); } } if (ignoreSubfieldIds) { // just copy subfields as they are for (MarcField.Subfield subfield : marcField.getSubfields()) { builder.subfield(subfield.getId(), subfield.getValue()); } } else { // get the correct MARC field to map subfield IDs MarcField marcField1 = get(key); Iterator<MarcField.Subfield> subfields = marcField.getSubfields().iterator(); Iterator<MarcField.Subfield> newSubfields = marcField1.getSubfields().iterator(); while (subfields.hasNext() && newSubfields.hasNext()) { MarcField.Subfield subfield = subfields.next(); MarcField.Subfield newSubfield = newSubfields.next(); builder.subfield(newSubfield.getId(), subfield.getValue()); } } lastBuilt = builder.build(); return lastBuilt; } }
public class class_name { public MarcField tail(MarcField marcField, String key, MarcField appendToThisField) { if (key == null) { return marcField; // depends on control dependency: [if], data = [none] } MarcField newMarcField = appendToThisField; if (newMarcField == null) { newMarcField = get(key); // depends on control dependency: [if], data = [none] } if (lastReceived != null) { String lastKey = getTransformKey(lastReceived); if (key.equals(lastKey)) { repeatCounter++; // depends on control dependency: [if], data = [none] } else { repeatCounter = 0; // depends on control dependency: [if], data = [none] } } lastReceived = marcField; MarcField.Builder builder = MarcField.builder(); if (appendToThisField != null) { builder.marcField(appendToThisField); // depends on control dependency: [if], data = [(appendToThisField] } else { builder.tag(newMarcField.getTag()) .value(marcField.getValue()); // depends on control dependency: [if], data = [none] if (ignoreIndicator) { builder.indicator(marcField.getIndicator()); // depends on control dependency: [if], data = [none] } else { builder.indicator(interpolate(marcField, newMarcField.getIndicator())); // depends on control dependency: [if], data = [none] } } if (ignoreSubfieldIds) { // just copy subfields as they are for (MarcField.Subfield subfield : marcField.getSubfields()) { builder.subfield(subfield.getId(), subfield.getValue()); // depends on control dependency: [for], data = [subfield] } } else { // get the correct MARC field to map subfield IDs MarcField marcField1 = get(key); Iterator<MarcField.Subfield> subfields = marcField.getSubfields().iterator(); Iterator<MarcField.Subfield> newSubfields = marcField1.getSubfields().iterator(); while (subfields.hasNext() && newSubfields.hasNext()) { MarcField.Subfield subfield = subfields.next(); MarcField.Subfield newSubfield = newSubfields.next(); builder.subfield(newSubfield.getId(), subfield.getValue()); // depends on control dependency: [while], data = [none] } } lastBuilt = builder.build(); return lastBuilt; } }
public class class_name { public InjectorBuilder filter(ElementVisitor<Boolean> predicate) { List<Element> elements = new ArrayList<Element>(); for (Element element : Elements.getElements(Stage.TOOL, module)) { if (element.acceptVisitor(predicate)) { elements.add(element); } } this.module = Elements.getModule(elements); return this; } }
public class class_name { public InjectorBuilder filter(ElementVisitor<Boolean> predicate) { List<Element> elements = new ArrayList<Element>(); for (Element element : Elements.getElements(Stage.TOOL, module)) { if (element.acceptVisitor(predicate)) { elements.add(element); // depends on control dependency: [if], data = [none] } } this.module = Elements.getModule(elements); return this; } }
public class class_name { private void checkFileType() { if ((m_fileInput != null) && (m_replaceInfo != null) && (m_fileWidget != null)) { CmsFileInfo file = m_fileInput.getFiles()[0]; if (!m_replaceInfo.getSitepath().endsWith(file.getFileSuffix())) { Widget warningImage = FontOpenCms.WARNING.getWidget( 20, I_CmsConstantsBundle.INSTANCE.css().colorWarning()); warningImage.setTitle(Messages.get().key(Messages.GUI_REPLACE_WRONG_FILE_EXTENSION_0)); warningImage.addStyleName( org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().permaVisible()); m_fileWidget.addButton(warningImage); } } } }
public class class_name { private void checkFileType() { if ((m_fileInput != null) && (m_replaceInfo != null) && (m_fileWidget != null)) { CmsFileInfo file = m_fileInput.getFiles()[0]; if (!m_replaceInfo.getSitepath().endsWith(file.getFileSuffix())) { Widget warningImage = FontOpenCms.WARNING.getWidget( 20, I_CmsConstantsBundle.INSTANCE.css().colorWarning()); warningImage.setTitle(Messages.get().key(Messages.GUI_REPLACE_WRONG_FILE_EXTENSION_0)); // depends on control dependency: [if], data = [none] warningImage.addStyleName( org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().permaVisible()); // depends on control dependency: [if], data = [none] m_fileWidget.addButton(warningImage); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private static int findNext(boolean reverse, int pos) { boolean backwards = IS_BACKWARDS_CHECKBOX.isSelected(); backwards = backwards ? !reverse : reverse; String pattern = (String) FIND_FIELD.getSelectedItem(); if (pattern != null && pattern.length() > 0) { try { Document doc = textComponent.getDocument(); doc.getText(0, doc.getLength(), SEGMENT); } catch (Exception e) { // should NEVER reach here e.printStackTrace(); } pos += textComponent.getSelectedText() == null ? (backwards ? -1 : 1) : 0; char first = backwards ? pattern.charAt(pattern.length() - 1) : pattern.charAt(0); char oppFirst = Character.isUpperCase(first) ? Character.toLowerCase(first) : Character.toUpperCase(first); int start = pos; boolean wrapped = WRAP_SEARCH_CHECKBOX.isSelected(); int end = backwards ? 0 : SEGMENT.getEndIndex(); pos += backwards ? -1 : 1; int length = textComponent.getDocument().getLength(); if (pos > length) { pos = wrapped ? 0 : length; } boolean found = false; while (!found && (backwards ? pos > end : pos < end)) { found = !MATCH_CASE_CHECKBOX.isSelected() && SEGMENT.array[pos] == oppFirst; found = found ? found : SEGMENT.array[pos] == first; if (found) { pos += backwards ? -(pattern.length() - 1) : 0; for (int i = 0; found && i < pattern.length(); i++) { char c = pattern.charAt(i); found = SEGMENT.array[pos + i] == c; if (!MATCH_CASE_CHECKBOX.isSelected() && !found) { c = Character.isUpperCase(c) ? Character.toLowerCase(c) : Character.toUpperCase(c); found = SEGMENT.array[pos + i] == c; } } } if (!found) { pos += backwards ? -1 : 1; if (pos == end && wrapped) { pos = backwards ? SEGMENT.getEndIndex() : 0; end = start; wrapped = false; } } } pos = found ? pos : -1; } return pos; } }
public class class_name { private static int findNext(boolean reverse, int pos) { boolean backwards = IS_BACKWARDS_CHECKBOX.isSelected(); backwards = backwards ? !reverse : reverse; String pattern = (String) FIND_FIELD.getSelectedItem(); if (pattern != null && pattern.length() > 0) { try { Document doc = textComponent.getDocument(); doc.getText(0, doc.getLength(), SEGMENT); // depends on control dependency: [try], data = [none] } catch (Exception e) { // should NEVER reach here e.printStackTrace(); } // depends on control dependency: [catch], data = [none] pos += textComponent.getSelectedText() == null ? (backwards ? -1 : 1) : 0; // depends on control dependency: [if], data = [none] char first = backwards ? pattern.charAt(pattern.length() - 1) : pattern.charAt(0); char oppFirst = Character.isUpperCase(first) ? Character.toLowerCase(first) : Character.toUpperCase(first); int start = pos; boolean wrapped = WRAP_SEARCH_CHECKBOX.isSelected(); int end = backwards ? 0 : SEGMENT.getEndIndex(); pos += backwards ? -1 : 1; // depends on control dependency: [if], data = [none] int length = textComponent.getDocument().getLength(); if (pos > length) { pos = wrapped ? 0 : length; // depends on control dependency: [if], data = [none] } boolean found = false; while (!found && (backwards ? pos > end : pos < end)) { found = !MATCH_CASE_CHECKBOX.isSelected() && SEGMENT.array[pos] == oppFirst; // depends on control dependency: [while], data = [none] found = found ? found : SEGMENT.array[pos] == first; // depends on control dependency: [while], data = [none] if (found) { pos += backwards ? -(pattern.length() - 1) : 0; // depends on control dependency: [if], data = [none] for (int i = 0; found && i < pattern.length(); i++) { char c = pattern.charAt(i); found = SEGMENT.array[pos + i] == c; // depends on control dependency: [for], data = [i] if (!MATCH_CASE_CHECKBOX.isSelected() && !found) { c = Character.isUpperCase(c) ? Character.toLowerCase(c) : Character.toUpperCase(c); // depends on control dependency: [if], data = [none] found = SEGMENT.array[pos + i] == c; // depends on control dependency: [if], data = [none] } } } if (!found) { pos += backwards ? -1 : 1; // depends on control dependency: [if], data = [none] if (pos == end && wrapped) { pos = backwards ? SEGMENT.getEndIndex() : 0; // depends on control dependency: [if], data = [none] end = start; // depends on control dependency: [if], data = [none] wrapped = false; // depends on control dependency: [if], data = [none] } } } pos = found ? pos : -1; // depends on control dependency: [if], data = [none] } return pos; } }
public class class_name { @Override public void prepare(FeatureProvider provider) { super.prepare(provider); transformable = provider.getFeature(Transformable.class); transformable.addListener(this); if (provider instanceof CollidableListener) { addListener((CollidableListener) provider); } } }
public class class_name { @Override public void prepare(FeatureProvider provider) { super.prepare(provider); transformable = provider.getFeature(Transformable.class); transformable.addListener(this); if (provider instanceof CollidableListener) { addListener((CollidableListener) provider); // depends on control dependency: [if], data = [none] } } }
public class class_name { void displayInheritedPermissions() { // store all parent folder ids together with path in a map m_parents = new HashMap<CmsUUID, String>(); String sitePath = m_cms.getSitePath(m_resource); String path = CmsResource.getParentFolder(sitePath); List<CmsResource> parentResources = new ArrayList<CmsResource>(); try { // get all parent folders of the current file parentResources = m_cms.readPath(path, CmsResourceFilter.IGNORE_EXPIRATION); } catch (CmsException e) { // can usually be ignored if (LOG.isInfoEnabled()) { LOG.info(e.getLocalizedMessage()); } } Iterator<CmsResource> k = parentResources.iterator(); while (k.hasNext()) { // add the current folder to the map CmsResource curRes = k.next(); m_parents.put(curRes.getResourceId(), curRes.getRootPath()); } ArrayList<CmsAccessControlEntry> inheritedEntries = new ArrayList<CmsAccessControlEntry>(); try { Iterator<CmsAccessControlEntry> itAces = m_cms.getAccessControlEntries(path, true).iterator(); while (itAces.hasNext()) { CmsAccessControlEntry curEntry = itAces.next(); inheritedEntries.add(curEntry); } } catch (CmsException e) { // can usually be ignored if (LOG.isInfoEnabled()) { LOG.info(e.getLocalizedMessage()); } } addEntryTableToLayout(inheritedEntries, m_inheritedPermissions, false, true); // buildInheritedList(inheritedEntries, parents); } }
public class class_name { void displayInheritedPermissions() { // store all parent folder ids together with path in a map m_parents = new HashMap<CmsUUID, String>(); String sitePath = m_cms.getSitePath(m_resource); String path = CmsResource.getParentFolder(sitePath); List<CmsResource> parentResources = new ArrayList<CmsResource>(); try { // get all parent folders of the current file parentResources = m_cms.readPath(path, CmsResourceFilter.IGNORE_EXPIRATION); // depends on control dependency: [try], data = [none] } catch (CmsException e) { // can usually be ignored if (LOG.isInfoEnabled()) { LOG.info(e.getLocalizedMessage()); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] Iterator<CmsResource> k = parentResources.iterator(); while (k.hasNext()) { // add the current folder to the map CmsResource curRes = k.next(); m_parents.put(curRes.getResourceId(), curRes.getRootPath()); // depends on control dependency: [while], data = [none] } ArrayList<CmsAccessControlEntry> inheritedEntries = new ArrayList<CmsAccessControlEntry>(); try { Iterator<CmsAccessControlEntry> itAces = m_cms.getAccessControlEntries(path, true).iterator(); while (itAces.hasNext()) { CmsAccessControlEntry curEntry = itAces.next(); inheritedEntries.add(curEntry); // depends on control dependency: [while], data = [none] } } catch (CmsException e) { // can usually be ignored if (LOG.isInfoEnabled()) { LOG.info(e.getLocalizedMessage()); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] addEntryTableToLayout(inheritedEntries, m_inheritedPermissions, false, true); // buildInheritedList(inheritedEntries, parents); } }
public class class_name { public double getPriority(Object key) { for (int i = 0; i < elements.size(); i++) { if (elements.get(i).equals(key)) { return priorities[i]; } } throw new NoSuchElementException(); } }
public class class_name { public double getPriority(Object key) { for (int i = 0; i < elements.size(); i++) { if (elements.get(i).equals(key)) { return priorities[i]; // depends on control dependency: [if], data = [none] } } throw new NoSuchElementException(); } }
public class class_name { public static <T> T fromXml(String xml, Class<T> clazz) { try { StringReader reader = new StringReader(xml); return (T) createUnmarshaller(clazz).unmarshal(reader); } catch (JAXBException e) { throw ExceptionUtil.unchecked(e); } } }
public class class_name { public static <T> T fromXml(String xml, Class<T> clazz) { try { StringReader reader = new StringReader(xml); return (T) createUnmarshaller(clazz).unmarshal(reader); // depends on control dependency: [try], data = [none] } catch (JAXBException e) { throw ExceptionUtil.unchecked(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public Response saveAttachment(InputStream in, String name, String contentType, String docId, String docRev) { assertNotEmpty(in, "in"); assertNotEmpty(name, "name"); assertNotEmpty(contentType, "ContentType"); if (docId == null) { docId = generateUUID(); // A new doc is being created; there should be no revision specified. assertNull(docRev, "docRev"); } else { // The id has been specified, ensure it is not empty assertNotEmpty(docId, "docId"); if (docRev != null) { // Existing doc with the specified ID, ensure rev is not empty assertNotEmpty(docRev, "docRev"); } } final URI uri = new DatabaseURIHelper(dbUri).attachmentUri(docId, docRev, name); return couchDbClient.put(uri, in, contentType); } }
public class class_name { public Response saveAttachment(InputStream in, String name, String contentType, String docId, String docRev) { assertNotEmpty(in, "in"); assertNotEmpty(name, "name"); assertNotEmpty(contentType, "ContentType"); if (docId == null) { docId = generateUUID(); // depends on control dependency: [if], data = [none] // A new doc is being created; there should be no revision specified. assertNull(docRev, "docRev"); // depends on control dependency: [if], data = [none] } else { // The id has been specified, ensure it is not empty assertNotEmpty(docId, "docId"); // depends on control dependency: [if], data = [(docId] if (docRev != null) { // Existing doc with the specified ID, ensure rev is not empty assertNotEmpty(docRev, "docRev"); // depends on control dependency: [if], data = [(docRev] } } final URI uri = new DatabaseURIHelper(dbUri).attachmentUri(docId, docRev, name); return couchDbClient.put(uri, in, contentType); } }
public class class_name { void insertForwardEdge(final ManagementEdge managementEdge, final int index) { while (index >= this.forwardEdges.size()) { this.forwardEdges.add(null); } this.forwardEdges.set(index, managementEdge); } }
public class class_name { void insertForwardEdge(final ManagementEdge managementEdge, final int index) { while (index >= this.forwardEdges.size()) { this.forwardEdges.add(null); // depends on control dependency: [while], data = [none] } this.forwardEdges.set(index, managementEdge); } }
public class class_name { protected void setKeyringMonitorRegistration(ServiceRegistration<KeyringMonitor> keyringMonitorRegistration) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "setKeyringMonitorRegistration"); } this.keyringMonitorRegistration = keyringMonitorRegistration; } }
public class class_name { protected void setKeyringMonitorRegistration(ServiceRegistration<KeyringMonitor> keyringMonitorRegistration) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "setKeyringMonitorRegistration"); // depends on control dependency: [if], data = [none] } this.keyringMonitorRegistration = keyringMonitorRegistration; } }
public class class_name { private boolean registerListener(String newPath, ArtifactListenerSelector newListener) { boolean updatedCoveringPaths = addCoveringPath(newPath); Collection<ArtifactListenerSelector> listenersForPath = listeners.get(newPath); if ( listenersForPath == null ) { // Each listeners collection is expected to be small. listenersForPath = new LinkedList<ArtifactListenerSelector>(); listeners.put(newPath, listenersForPath); } listenersForPath.add(newListener); return ( updatedCoveringPaths ); } }
public class class_name { private boolean registerListener(String newPath, ArtifactListenerSelector newListener) { boolean updatedCoveringPaths = addCoveringPath(newPath); Collection<ArtifactListenerSelector> listenersForPath = listeners.get(newPath); if ( listenersForPath == null ) { // Each listeners collection is expected to be small. listenersForPath = new LinkedList<ArtifactListenerSelector>(); // depends on control dependency: [if], data = [none] listeners.put(newPath, listenersForPath); // depends on control dependency: [if], data = [none] } listenersForPath.add(newListener); return ( updatedCoveringPaths ); } }
public class class_name { public void set(T newValue) { Preconditions.checkNotNull(newValue, "Monitored value can not be null"); if (Objects.equal(this.value, newValue)) { return; } this.value = newValue; notifyMonitors(); } }
public class class_name { public void set(T newValue) { Preconditions.checkNotNull(newValue, "Monitored value can not be null"); if (Objects.equal(this.value, newValue)) { return; // depends on control dependency: [if], data = [none] } this.value = newValue; notifyMonitors(); } }
public class class_name { public void visitParameter(final String name, final int access) { if (api < Opcodes.ASM5) { throw new UnsupportedOperationException(REQUIRES_ASM5); } if (mv != null) { mv.visitParameter(name, access); } } }
public class class_name { public void visitParameter(final String name, final int access) { if (api < Opcodes.ASM5) { throw new UnsupportedOperationException(REQUIRES_ASM5); } if (mv != null) { mv.visitParameter(name, access); // depends on control dependency: [if], data = [none] } } }
public class class_name { public IpcLogEntry withException(Throwable exception) { this.exception = exception; if (statusDetail == null) { statusDetail = exception.getClass().getSimpleName(); } if (status == null) { status = IpcStatus.forException(exception); } return this; } }
public class class_name { public IpcLogEntry withException(Throwable exception) { this.exception = exception; if (statusDetail == null) { statusDetail = exception.getClass().getSimpleName(); // depends on control dependency: [if], data = [none] } if (status == null) { status = IpcStatus.forException(exception); // depends on control dependency: [if], data = [none] } return this; } }
public class class_name { public static void displayVersionInfo(String command) { String version = ProxyInitStrategy.class.getPackage() .getImplementationVersion(); if (version == null) { version = "N/A"; } System.out.format("%s v. %s (%s)\n", command, version, getAPIVersionString()); } }
public class class_name { public static void displayVersionInfo(String command) { String version = ProxyInitStrategy.class.getPackage() .getImplementationVersion(); if (version == null) { version = "N/A"; // depends on control dependency: [if], data = [none] } System.out.format("%s v. %s (%s)\n", command, version, getAPIVersionString()); } }
public class class_name { public void assertNullOrEmpty(Description description, Set<?> actual) { if (actual == null || actual.isEmpty()) { return; } throw failures.failure(description, shouldBeNullOrEmpty(actual)); } }
public class class_name { public void assertNullOrEmpty(Description description, Set<?> actual) { if (actual == null || actual.isEmpty()) { return; // depends on control dependency: [if], data = [none] } throw failures.failure(description, shouldBeNullOrEmpty(actual)); } }
public class class_name { @SuppressWarnings({"WeakerAccess", "unused"}) // For library users public Searcher removeNumericRefinement(@NonNull NumericRefinement refinement) { if (refinement.operator == NumericRefinement.OPERATOR_UNKNOWN) { numericRefinements.remove(refinement.attribute); } else { NumericRefinement.checkOperatorIsValid(refinement.operator); final SparseArray<NumericRefinement> attributeRefinements = numericRefinements.get(refinement.attribute); if (attributeRefinements != null) { attributeRefinements.remove(refinement.operator); } } rebuildQueryNumericFilters(); EventBus.getDefault().post(new NumericRefinementEvent(this, Operation.REMOVE, refinement)); return this; } }
public class class_name { @SuppressWarnings({"WeakerAccess", "unused"}) // For library users public Searcher removeNumericRefinement(@NonNull NumericRefinement refinement) { if (refinement.operator == NumericRefinement.OPERATOR_UNKNOWN) { numericRefinements.remove(refinement.attribute); // depends on control dependency: [if], data = [none] } else { NumericRefinement.checkOperatorIsValid(refinement.operator); // depends on control dependency: [if], data = [(refinement.operator] final SparseArray<NumericRefinement> attributeRefinements = numericRefinements.get(refinement.attribute); if (attributeRefinements != null) { attributeRefinements.remove(refinement.operator); // depends on control dependency: [if], data = [none] } } rebuildQueryNumericFilters(); EventBus.getDefault().post(new NumericRefinementEvent(this, Operation.REMOVE, refinement)); return this; } }
public class class_name { public final void append(char value) { char[] chunk; // We may have preallocated chunks. If so, all but last should // be at full size. if (m_firstFree < m_chunkSize) // Simplified test single-character-fits chunk = m_array[m_lastChunk]; else { // Extend array? int i = m_array.length; if (m_lastChunk + 1 == i) { char[][] newarray = new char[i + 16][]; System.arraycopy(m_array, 0, newarray, 0, i); m_array = newarray; } // Advance one chunk chunk = m_array[++m_lastChunk]; if (chunk == null) { // Hierarchical encapsulation if (m_lastChunk == 1 << m_rebundleBits && m_chunkBits < m_maxChunkBits) { // Should do all the work of both encapsulating // existing data and establishing new sizes/offsets m_innerFSB = new FastStringBuffer(this); } // Add a chunk. chunk = m_array[m_lastChunk] = new char[m_chunkSize]; } m_firstFree = 0; } // Space exists in the chunk. Append the character. chunk[m_firstFree++] = value; } }
public class class_name { public final void append(char value) { char[] chunk; // We may have preallocated chunks. If so, all but last should // be at full size. if (m_firstFree < m_chunkSize) // Simplified test single-character-fits chunk = m_array[m_lastChunk]; else { // Extend array? int i = m_array.length; if (m_lastChunk + 1 == i) { char[][] newarray = new char[i + 16][]; System.arraycopy(m_array, 0, newarray, 0, i); // depends on control dependency: [if], data = [i)] m_array = newarray; // depends on control dependency: [if], data = [none] } // Advance one chunk chunk = m_array[++m_lastChunk]; // depends on control dependency: [if], data = [none] if (chunk == null) { // Hierarchical encapsulation if (m_lastChunk == 1 << m_rebundleBits && m_chunkBits < m_maxChunkBits) { // Should do all the work of both encapsulating // existing data and establishing new sizes/offsets m_innerFSB = new FastStringBuffer(this); // depends on control dependency: [if], data = [none] } // Add a chunk. chunk = m_array[m_lastChunk] = new char[m_chunkSize]; // depends on control dependency: [if], data = [none] } m_firstFree = 0; // depends on control dependency: [if], data = [none] } // Space exists in the chunk. Append the character. chunk[m_firstFree++] = value; } }
public class class_name { protected static void fireWarnEvent( String warning, JsonConfig jsonConfig ) { if( jsonConfig.isEventTriggeringEnabled() ){ for( Iterator listeners = jsonConfig.getJsonEventListeners() .iterator(); listeners.hasNext(); ){ JsonEventListener listener = (JsonEventListener) listeners.next(); try{ listener.onWarning( warning ); }catch( RuntimeException e ){ log.warn( e ); } } } } }
public class class_name { protected static void fireWarnEvent( String warning, JsonConfig jsonConfig ) { if( jsonConfig.isEventTriggeringEnabled() ){ for( Iterator listeners = jsonConfig.getJsonEventListeners() .iterator(); listeners.hasNext(); ){ JsonEventListener listener = (JsonEventListener) listeners.next(); try{ listener.onWarning( warning ); // depends on control dependency: [try], data = [none] }catch( RuntimeException e ){ log.warn( e ); } // depends on control dependency: [catch], data = [none] } } } }
public class class_name { public static void main(final String[] args) { Switch about = new Switch("a", "about", "display about message"); Switch help = new Switch("h", "help", "display help message"); FileArgument inputHmlFile = new FileArgument("i", "input-hml-file", "input HML file, default stdin", false); FileArgument outputFile = new FileArgument("o", "output-file", "output allele assignment file, default stdout", false); ArgumentList arguments = new ArgumentList(about, help, inputHmlFile, outputFile); CommandLine commandLine = new CommandLine(args); ExtractExpectedHaploids extractExpectedHaploids = null; try { CommandLineParser.parse(commandLine, arguments); if (about.wasFound()) { About.about(System.out); System.exit(0); } if (help.wasFound()) { Usage.usage(USAGE, null, commandLine, arguments, System.out); System.exit(0); } extractExpectedHaploids = new ExtractExpectedHaploids(inputHmlFile.getValue(), outputFile.getValue()); } catch (CommandLineParseException | IllegalArgumentException e) { Usage.usage(USAGE, e, commandLine, arguments, System.err); System.exit(-1); } try { System.exit(extractExpectedHaploids.call()); } catch (Exception e) { e.printStackTrace(); System.exit(1); } } }
public class class_name { public static void main(final String[] args) { Switch about = new Switch("a", "about", "display about message"); Switch help = new Switch("h", "help", "display help message"); FileArgument inputHmlFile = new FileArgument("i", "input-hml-file", "input HML file, default stdin", false); FileArgument outputFile = new FileArgument("o", "output-file", "output allele assignment file, default stdout", false); ArgumentList arguments = new ArgumentList(about, help, inputHmlFile, outputFile); CommandLine commandLine = new CommandLine(args); ExtractExpectedHaploids extractExpectedHaploids = null; try { CommandLineParser.parse(commandLine, arguments); // depends on control dependency: [try], data = [none] if (about.wasFound()) { About.about(System.out); // depends on control dependency: [if], data = [none] System.exit(0); // depends on control dependency: [if], data = [none] } if (help.wasFound()) { Usage.usage(USAGE, null, commandLine, arguments, System.out); // depends on control dependency: [if], data = [none] System.exit(0); // depends on control dependency: [if], data = [none] } extractExpectedHaploids = new ExtractExpectedHaploids(inputHmlFile.getValue(), outputFile.getValue()); // depends on control dependency: [try], data = [none] } catch (CommandLineParseException | IllegalArgumentException e) { Usage.usage(USAGE, e, commandLine, arguments, System.err); System.exit(-1); } // depends on control dependency: [catch], data = [none] try { System.exit(extractExpectedHaploids.call()); // depends on control dependency: [try], data = [none] } catch (Exception e) { e.printStackTrace(); System.exit(1); } // depends on control dependency: [catch], data = [none] } }
public class class_name { protected void set(V v) { if (U.compareAndSwapInt(this, STATE, NEW, COMPLETING)) { outcome = v; U.putOrderedInt(this, STATE, NORMAL); // final state finishCompletion(); } } }
public class class_name { protected void set(V v) { if (U.compareAndSwapInt(this, STATE, NEW, COMPLETING)) { outcome = v; // depends on control dependency: [if], data = [none] U.putOrderedInt(this, STATE, NORMAL); // final state // depends on control dependency: [if], data = [none] finishCompletion(); // depends on control dependency: [if], data = [none] } } }
public class class_name { private static ApplicationEngine findDelegate() { try { ApplicationEngine result=createApplicationEngineFromSPI(); if(result==null) { result=createApplicationEngineFromConfigurationFile(); } if(result==null) { final String delegateClassName = System.getProperty(LDP4J_APPLICATION_ENGINE_PROPERTY); if(delegateClassName!=null) { result=createApplicationEngineForClassName(delegateClassName); } } return result; } catch (final Exception ex) { throw new IllegalStateException("Could not find application engine",ex); } } }
public class class_name { private static ApplicationEngine findDelegate() { try { ApplicationEngine result=createApplicationEngineFromSPI(); if(result==null) { result=createApplicationEngineFromConfigurationFile(); // depends on control dependency: [if], data = [none] } if(result==null) { final String delegateClassName = System.getProperty(LDP4J_APPLICATION_ENGINE_PROPERTY); if(delegateClassName!=null) { result=createApplicationEngineForClassName(delegateClassName); // depends on control dependency: [if], data = [(delegateClassName] } } return result; // depends on control dependency: [try], data = [none] } catch (final Exception ex) { throw new IllegalStateException("Could not find application engine",ex); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static String getURLPath(String url) { url = stripURLScheme(url); int pathIdx = url.indexOf(UrlOperations.PATH_START); if(pathIdx == -1) { return "/"; } return url.substring(pathIdx); } }
public class class_name { public static String getURLPath(String url) { url = stripURLScheme(url); int pathIdx = url.indexOf(UrlOperations.PATH_START); if(pathIdx == -1) { return "/"; // depends on control dependency: [if], data = [none] } return url.substring(pathIdx); } }
public class class_name { public void addRewardProducer(IRewardProducer producer) { if (this.producers == null) { this.producers = new ArrayList<IRewardProducer>(); } this.producers.add(producer); } }
public class class_name { public void addRewardProducer(IRewardProducer producer) { if (this.producers == null) { this.producers = new ArrayList<IRewardProducer>(); // depends on control dependency: [if], data = [none] } this.producers.add(producer); } }
public class class_name { @Override public void connect(String server, int port, Map<String, Object> connectionParams, IPendingServiceCallback connectCallback, Object[] connectCallArguments) { log.debug("connect server: {} port {} connect - params: {} callback: {} args: {}", new Object[] { server, port, connectionParams, connectCallback, Arrays.toString(connectCallArguments) }); log.info("{}://{}:{}/{}", new Object[] { protocol, server, port, connectionParams.get("app") }); this.connectionParams = connectionParams; this.connectArguments = connectCallArguments; if (!connectionParams.containsKey("objectEncoding")) { connectionParams.put("objectEncoding", 0); } this.connectCallback = connectCallback; startConnector(server, port); } }
public class class_name { @Override public void connect(String server, int port, Map<String, Object> connectionParams, IPendingServiceCallback connectCallback, Object[] connectCallArguments) { log.debug("connect server: {} port {} connect - params: {} callback: {} args: {}", new Object[] { server, port, connectionParams, connectCallback, Arrays.toString(connectCallArguments) }); log.info("{}://{}:{}/{}", new Object[] { protocol, server, port, connectionParams.get("app") }); this.connectionParams = connectionParams; this.connectArguments = connectCallArguments; if (!connectionParams.containsKey("objectEncoding")) { connectionParams.put("objectEncoding", 0); // depends on control dependency: [if], data = [none] } this.connectCallback = connectCallback; startConnector(server, port); } }
public class class_name { public CompletableFuture<Map<InetSocketAddress, List<String>>> getRpcNodeWebSocketAddresses(final Serializable userid) { CompletableFuture<Collection<InetSocketAddress>> sncpFuture = getRpcNodeAddresses(userid); return sncpFuture.thenCompose((Collection<InetSocketAddress> addrs) -> { if (logger.isLoggable(Level.FINEST)) logger.finest("websocket found userid:" + userid + " on " + addrs); if (addrs == null || addrs.isEmpty()) return CompletableFuture.completedFuture(new HashMap<>()); CompletableFuture<Map<InetSocketAddress, List<String>>> future = null; for (final InetSocketAddress nodeAddress : addrs) { CompletableFuture<Map<InetSocketAddress, List<String>>> mapFuture = getWebSocketAddresses(nodeAddress, userid) .thenCompose((List<String> list) -> CompletableFuture.completedFuture(Utility.ofMap(nodeAddress, list))); future = future == null ? mapFuture : future.thenCombine(mapFuture, (a, b) -> Utility.merge(a, b)); } return future == null ? CompletableFuture.completedFuture(new HashMap<>()) : future; }); } }
public class class_name { public CompletableFuture<Map<InetSocketAddress, List<String>>> getRpcNodeWebSocketAddresses(final Serializable userid) { CompletableFuture<Collection<InetSocketAddress>> sncpFuture = getRpcNodeAddresses(userid); return sncpFuture.thenCompose((Collection<InetSocketAddress> addrs) -> { if (logger.isLoggable(Level.FINEST)) logger.finest("websocket found userid:" + userid + " on " + addrs); if (addrs == null || addrs.isEmpty()) return CompletableFuture.completedFuture(new HashMap<>()); CompletableFuture<Map<InetSocketAddress, List<String>>> future = null; for (final InetSocketAddress nodeAddress : addrs) { CompletableFuture<Map<InetSocketAddress, List<String>>> mapFuture = getWebSocketAddresses(nodeAddress, userid) .thenCompose((List<String> list) -> CompletableFuture.completedFuture(Utility.ofMap(nodeAddress, list))); future = future == null ? mapFuture : future.thenCombine(mapFuture, (a, b) -> Utility.merge(a, b)); // depends on control dependency: [for], data = [none] } return future == null ? CompletableFuture.completedFuture(new HashMap<>()) : future; }); } }
public class class_name { private void validateIfdFP(IFD ifd, int p) { IfdTags metadata = ifd.getMetadata(); checkRequiredTag(metadata, "ImageDescription", 1); checkRequiredTag(metadata, "StripOffsets", 1); if (p == 1 || p == 2) { checkRequiredTag(metadata, "StripOffsets", 1, new long[]{0}); } checkRequiredTag(metadata, "NewSubfileType", 1); checkRequiredTag(metadata, "ImageLength", 1); checkRequiredTag(metadata, "ImageWidth", 1); checkRequiredTag(metadata, "StripOffsets", 1); if (p == 0) { checkRequiredTag(metadata, "Orientation", 1, new long[]{1,4,5,8}); } else { checkRequiredTag(metadata, "Orientation", 1, new long[]{1}); } checkRequiredTag(metadata, "StripBYTECount", 1); checkRequiredTag(metadata, "XResolution", 1); checkRequiredTag(metadata, "YResolution", 1); checkRequiredTag(metadata, "PlanarConfiguration", 1, new long[]{2}); if (p == 1 || p == 2) { checkRequiredTag(metadata, "ResolutionUnit", 1, new long[]{2, 3}); checkRequiredTag(metadata, "NumberOfInks", 1, new long[]{4}); } } }
public class class_name { private void validateIfdFP(IFD ifd, int p) { IfdTags metadata = ifd.getMetadata(); checkRequiredTag(metadata, "ImageDescription", 1); checkRequiredTag(metadata, "StripOffsets", 1); if (p == 1 || p == 2) { checkRequiredTag(metadata, "StripOffsets", 1, new long[]{0}); // depends on control dependency: [if], data = [none] } checkRequiredTag(metadata, "NewSubfileType", 1); checkRequiredTag(metadata, "ImageLength", 1); checkRequiredTag(metadata, "ImageWidth", 1); checkRequiredTag(metadata, "StripOffsets", 1); if (p == 0) { checkRequiredTag(metadata, "Orientation", 1, new long[]{1,4,5,8}); // depends on control dependency: [if], data = [none] } else { checkRequiredTag(metadata, "Orientation", 1, new long[]{1}); // depends on control dependency: [if], data = [none] } checkRequiredTag(metadata, "StripBYTECount", 1); checkRequiredTag(metadata, "XResolution", 1); checkRequiredTag(metadata, "YResolution", 1); checkRequiredTag(metadata, "PlanarConfiguration", 1, new long[]{2}); if (p == 1 || p == 2) { checkRequiredTag(metadata, "ResolutionUnit", 1, new long[]{2, 3}); // depends on control dependency: [if], data = [none] checkRequiredTag(metadata, "NumberOfInks", 1, new long[]{4}); // depends on control dependency: [if], data = [none] } } }