code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public final FieldTextInfo createFieldInfo(@NotNull final Field field, @NotNull final Locale locale, @NotNull final Class<? extends Annotation> annotationClasz) { Contract.requireArgNotNull("field", field); Contract.requireArgNotNull("locale", locale); Contract.requireArgNotNull("annotationClasz", annotationClasz); final Annotation annotation = field.getAnnotation(annotationClasz); if (annotation == null) { return null; } try { final ResourceBundle bundle = getResourceBundle(annotation, locale, field.getDeclaringClass()); final String text = getText(bundle, annotation, field.getName() + "." + annotationClasz.getSimpleName()); return new FieldTextInfo(field, text); } catch (final MissingResourceException ex) { return new FieldTextInfo(field, toNullableString(getValue(annotation))); } } }
public class class_name { public final FieldTextInfo createFieldInfo(@NotNull final Field field, @NotNull final Locale locale, @NotNull final Class<? extends Annotation> annotationClasz) { Contract.requireArgNotNull("field", field); Contract.requireArgNotNull("locale", locale); Contract.requireArgNotNull("annotationClasz", annotationClasz); final Annotation annotation = field.getAnnotation(annotationClasz); if (annotation == null) { return null; // depends on control dependency: [if], data = [none] } try { final ResourceBundle bundle = getResourceBundle(annotation, locale, field.getDeclaringClass()); final String text = getText(bundle, annotation, field.getName() + "." + annotationClasz.getSimpleName()); return new FieldTextInfo(field, text); // depends on control dependency: [try], data = [none] } catch (final MissingResourceException ex) { return new FieldTextInfo(field, toNullableString(getValue(annotation))); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setOpenIDConnectProviderList(java.util.Collection<OpenIDConnectProviderListEntry> openIDConnectProviderList) { if (openIDConnectProviderList == null) { this.openIDConnectProviderList = null; return; } this.openIDConnectProviderList = new com.amazonaws.internal.SdkInternalList<OpenIDConnectProviderListEntry>(openIDConnectProviderList); } }
public class class_name { public void setOpenIDConnectProviderList(java.util.Collection<OpenIDConnectProviderListEntry> openIDConnectProviderList) { if (openIDConnectProviderList == null) { this.openIDConnectProviderList = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.openIDConnectProviderList = new com.amazonaws.internal.SdkInternalList<OpenIDConnectProviderListEntry>(openIDConnectProviderList); } }
public class class_name { public static void Forward(double[] data) { double[] result = new double[data.length]; for (int k = 0; k < result.length; k++) { double sum = 0; for (int n = 0; n < data.length; n++) { double theta = ((2.0 * Math.PI) / data.length) * k * n; sum += data[n] * cas(theta); } result[k] = (1.0 / Math.sqrt(data.length)) * sum; } for (int i = 0; i < result.length; i++) { data[i] = result[i]; } } }
public class class_name { public static void Forward(double[] data) { double[] result = new double[data.length]; for (int k = 0; k < result.length; k++) { double sum = 0; for (int n = 0; n < data.length; n++) { double theta = ((2.0 * Math.PI) / data.length) * k * n; sum += data[n] * cas(theta); // depends on control dependency: [for], data = [n] } result[k] = (1.0 / Math.sqrt(data.length)) * sum; // depends on control dependency: [for], data = [k] } for (int i = 0; i < result.length; i++) { data[i] = result[i]; // depends on control dependency: [for], data = [i] } } }
public class class_name { private Deployment findMatchingDeployment(DeploymentTargetDescription target) { List<Deployment> matching = findMatchingDeployments(target); if (matching.size() == 0) { return null; } if (matching.size() == 1) { return matching.get(0); } // if multiple Deployment of different Type, we get the Archive Deployment return archiveDeployments(matching).get(0); } }
public class class_name { private Deployment findMatchingDeployment(DeploymentTargetDescription target) { List<Deployment> matching = findMatchingDeployments(target); if (matching.size() == 0) { return null; // depends on control dependency: [if], data = [none] } if (matching.size() == 1) { return matching.get(0); // depends on control dependency: [if], data = [none] } // if multiple Deployment of different Type, we get the Archive Deployment return archiveDeployments(matching).get(0); } }
public class class_name { void hashUpdate(final long hash0, final long hash1) { int col = Long.numberOfLeadingZeros(hash1); if (col < fiCol) { return; } // important speed optimization if (col > 63) { col = 63; } // clip so that 0 <= col <= 63 final long c = numCoupons; if (c == 0) { promoteEmptyToSparse(this); } final long k = 1L << lgK; final int row = (int) (hash0 & (k - 1L)); int rowCol = (row << 6) | col; // Avoid the hash table's "empty" value which is (2^26 -1, 63) (all ones) by changing it // to the pair (2^26 - 2, 63), which effectively merges the two cells. // This case is *extremely* unlikely, but we might as well handle it. // It can't happen at all if lgK (or maxLgK) < 26. if (rowCol == -1) { rowCol ^= (1 << 6); } //set the LSB of row to 0 if ((c << 5) < (3L * k)) { updateSparse(this, rowCol); } else { updateWindowed(this, rowCol); } } }
public class class_name { void hashUpdate(final long hash0, final long hash1) { int col = Long.numberOfLeadingZeros(hash1); if (col < fiCol) { return; } // important speed optimization // depends on control dependency: [if], data = [none] if (col > 63) { col = 63; } // clip so that 0 <= col <= 63 // depends on control dependency: [if], data = [none] final long c = numCoupons; if (c == 0) { promoteEmptyToSparse(this); } // depends on control dependency: [if], data = [none] final long k = 1L << lgK; final int row = (int) (hash0 & (k - 1L)); int rowCol = (row << 6) | col; // Avoid the hash table's "empty" value which is (2^26 -1, 63) (all ones) by changing it // to the pair (2^26 - 2, 63), which effectively merges the two cells. // This case is *extremely* unlikely, but we might as well handle it. // It can't happen at all if lgK (or maxLgK) < 26. if (rowCol == -1) { rowCol ^= (1 << 6); } //set the LSB of row to 0 // depends on control dependency: [if], data = [none] if ((c << 5) < (3L * k)) { updateSparse(this, rowCol); } // depends on control dependency: [if], data = [none] else { updateWindowed(this, rowCol); } // depends on control dependency: [if], data = [none] } }
public class class_name { protected void handleControlSignal() { if (toActivate) { if (!isInstanceStarted) { startInstance(); } instance.activate(); LOG.info("Activated instance: " + physicalPlanHelper.getMyInstanceId()); // Reset the flag value toActivate = false; } if (toDeactivate) { instance.deactivate(); LOG.info("Deactivated instance: " + physicalPlanHelper.getMyInstanceId()); // Reset the flag value toDeactivate = false; } if (toStop) { instance.shutdown(); LOG.info("Stopped instance: " + physicalPlanHelper.getMyInstanceId()); // Reset the flag value toStop = false; } } }
public class class_name { protected void handleControlSignal() { if (toActivate) { if (!isInstanceStarted) { startInstance(); // depends on control dependency: [if], data = [none] } instance.activate(); // depends on control dependency: [if], data = [none] LOG.info("Activated instance: " + physicalPlanHelper.getMyInstanceId()); // depends on control dependency: [if], data = [none] // Reset the flag value toActivate = false; // depends on control dependency: [if], data = [none] } if (toDeactivate) { instance.deactivate(); // depends on control dependency: [if], data = [none] LOG.info("Deactivated instance: " + physicalPlanHelper.getMyInstanceId()); // depends on control dependency: [if], data = [none] // Reset the flag value toDeactivate = false; // depends on control dependency: [if], data = [none] } if (toStop) { instance.shutdown(); // depends on control dependency: [if], data = [none] LOG.info("Stopped instance: " + physicalPlanHelper.getMyInstanceId()); // depends on control dependency: [if], data = [none] // Reset the flag value toStop = false; // depends on control dependency: [if], data = [none] } } }
public class class_name { private static TaskEntity getTask(final int taskId, final Collection<TaskEntity> tasks) { for (final TaskEntity task : tasks) { if (taskId == task.getId()) { return task; } } return null; } }
public class class_name { private static TaskEntity getTask(final int taskId, final Collection<TaskEntity> tasks) { for (final TaskEntity task : tasks) { if (taskId == task.getId()) { return task; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public static Collection<ModelElementType> calculateAllExtendingTypes(Model model, Collection<ModelElementType> baseTypes) { Set<ModelElementType> allExtendingTypes = new HashSet<ModelElementType>(); for (ModelElementType baseType : baseTypes) { ModelElementTypeImpl modelElementTypeImpl = (ModelElementTypeImpl) model.getType(baseType.getInstanceType()); modelElementTypeImpl.resolveExtendingTypes(allExtendingTypes); } return allExtendingTypes; } }
public class class_name { public static Collection<ModelElementType> calculateAllExtendingTypes(Model model, Collection<ModelElementType> baseTypes) { Set<ModelElementType> allExtendingTypes = new HashSet<ModelElementType>(); for (ModelElementType baseType : baseTypes) { ModelElementTypeImpl modelElementTypeImpl = (ModelElementTypeImpl) model.getType(baseType.getInstanceType()); modelElementTypeImpl.resolveExtendingTypes(allExtendingTypes); // depends on control dependency: [for], data = [none] } return allExtendingTypes; } }
public class class_name { @Override public int compareTo(YearMonth other) { int cmp = (year - other.year); if (cmp == 0) { cmp = (month - other.month); } return cmp; } }
public class class_name { @Override public int compareTo(YearMonth other) { int cmp = (year - other.year); if (cmp == 0) { cmp = (month - other.month); // depends on control dependency: [if], data = [none] } return cmp; } }
public class class_name { public static String determineLeastSpecificType(final String... types) { switch (types.length) { case 0: throw new IllegalArgumentException("At least one type has to be provided"); case 1: return types[0]; case 2: return determineLeastSpecific(types[0], types[1]); default: String currentLeastSpecific = determineLeastSpecific(types[0], types[1]); for (int i = 2; i < types.length; i++) { currentLeastSpecific = determineLeastSpecific(currentLeastSpecific, types[i]); } return currentLeastSpecific; } } }
public class class_name { public static String determineLeastSpecificType(final String... types) { switch (types.length) { case 0: throw new IllegalArgumentException("At least one type has to be provided"); case 1: return types[0]; case 2: return determineLeastSpecific(types[0], types[1]); default: String currentLeastSpecific = determineLeastSpecific(types[0], types[1]); for (int i = 2; i < types.length; i++) { currentLeastSpecific = determineLeastSpecific(currentLeastSpecific, types[i]); // depends on control dependency: [for], data = [i] } return currentLeastSpecific; } } }
public class class_name { protected final JsEngineComponent loadClass(String className, int stopSeq, boolean reportError) { String thisMethodName = "loadClass"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, new Object[] { className, Integer.toString(stopSeq), Boolean.toString(reportError) }); } Class myClass = null; JsEngineComponent retValue = null; int _seq = stopSeq; if (_seq < 0 || _seq > NUM_STOP_PHASES) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "loadClass: stopSeq is out of bounds " + stopSeq); } else { try { myClass = Class.forName(className); retValue = (JsEngineComponent) myClass.newInstance(); ComponentList compList = new ComponentList(className, retValue); // No need to synchronize on jmeComponents to prevent concurrent // modification from dynamic config and runtime callbacks, because // jmeComponents is now a CopyOnWriteArrayList. jmeComponents.add(compList); stopSequence[_seq].addElement(compList); } catch (ClassNotFoundException e) { // No FFDC code needed if (reportError == true) { com.ibm.ws.ffdc.FFDCFilter.processException(e, CLASS_NAME + ".loadClass", "3", this); SibTr.error(tc, "CLASS_LOAD_FAILURE_SIAS0013", className); SibTr.exception(tc, e); } } catch (InstantiationException e) { com.ibm.ws.ffdc.FFDCFilter.processException(e, CLASS_NAME + ".loadClass", "1", this); if (reportError == true) { SibTr.error(tc, "CLASS_LOAD_FAILURE_SIAS0013", className); SibTr.exception(tc, e); } } catch (Throwable e) { com.ibm.ws.ffdc.FFDCFilter.processException(e, CLASS_NAME + ".loadClass", "2", this); if (reportError == true) { SibTr.error(tc, "CLASS_LOAD_FAILURE_SIAS0013", className); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { if (retValue == null) SibTr.debug(tc, "loadClass: failed"); else SibTr.debug(tc, "loadClass: OK"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(tc, thisMethodName, retValue); } return retValue; } }
public class class_name { protected final JsEngineComponent loadClass(String className, int stopSeq, boolean reportError) { String thisMethodName = "loadClass"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, new Object[] { className, Integer.toString(stopSeq), Boolean.toString(reportError) }); // depends on control dependency: [if], data = [none] } Class myClass = null; JsEngineComponent retValue = null; int _seq = stopSeq; if (_seq < 0 || _seq > NUM_STOP_PHASES) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "loadClass: stopSeq is out of bounds " + stopSeq); } else { try { myClass = Class.forName(className); // depends on control dependency: [try], data = [none] retValue = (JsEngineComponent) myClass.newInstance(); // depends on control dependency: [try], data = [none] ComponentList compList = new ComponentList(className, retValue); // No need to synchronize on jmeComponents to prevent concurrent // modification from dynamic config and runtime callbacks, because // jmeComponents is now a CopyOnWriteArrayList. jmeComponents.add(compList); // depends on control dependency: [try], data = [none] stopSequence[_seq].addElement(compList); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { // No FFDC code needed if (reportError == true) { com.ibm.ws.ffdc.FFDCFilter.processException(e, CLASS_NAME + ".loadClass", "3", this); // depends on control dependency: [if], data = [none] SibTr.error(tc, "CLASS_LOAD_FAILURE_SIAS0013", className); // depends on control dependency: [if], data = [none] SibTr.exception(tc, e); // depends on control dependency: [if], data = [none] } } catch (InstantiationException e) { // depends on control dependency: [catch], data = [none] com.ibm.ws.ffdc.FFDCFilter.processException(e, CLASS_NAME + ".loadClass", "1", this); if (reportError == true) { SibTr.error(tc, "CLASS_LOAD_FAILURE_SIAS0013", className); // depends on control dependency: [if], data = [none] SibTr.exception(tc, e); // depends on control dependency: [if], data = [none] } } catch (Throwable e) { // depends on control dependency: [catch], data = [none] com.ibm.ws.ffdc.FFDCFilter.processException(e, CLASS_NAME + ".loadClass", "2", this); if (reportError == true) { SibTr.error(tc, "CLASS_LOAD_FAILURE_SIAS0013", className); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { if (retValue == null) SibTr.debug(tc, "loadClass: failed"); else SibTr.debug(tc, "loadClass: OK"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(tc, thisMethodName, retValue); // depends on control dependency: [if], data = [none] } return retValue; } }
public class class_name { private static void swap(byte[] array, int i, int j) { if (i != j) { byte valAtI = array[i]; array[i] = array[j]; array[j] = valAtI; numSwaps++; } } }
public class class_name { private static void swap(byte[] array, int i, int j) { if (i != j) { byte valAtI = array[i]; array[i] = array[j]; // depends on control dependency: [if], data = [none] array[j] = valAtI; // depends on control dependency: [if], data = [none] numSwaps++; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static Object getAttribute(String key) { Object value = localAttributeHolder.get().get(key); if(value == null) { value = inheritableAttributeHolder.get().get(key); } return value; } }
public class class_name { public static Object getAttribute(String key) { Object value = localAttributeHolder.get().get(key); if(value == null) { value = inheritableAttributeHolder.get().get(key); // depends on control dependency: [if], data = [none] } return value; } }
public class class_name { public static Set<EmailAddress> parseMultiple(String email) { if(AssertUtils.isEmpty(email)) { throw new IllegalArgumentException("Email cannot be empty/null"); } Set<EmailAddress> emails = new HashSet<EmailAddress>(); String[] tokens = email.split("[;,]"); for(String token : tokens) { token = token.trim(); // check for angular brackets if(token.contains("<") || token.contains(">")) { int start = token.indexOf('<'); int end = token.indexOf('>'); if(start >= 0 && end > start) { String name = token.substring(start + 1, end).trim(); String em = token.substring(end + 1).trim(); emails.add(new EmailAddress(name, em)); } else { emails.add(new EmailAddress(token)); } } else { emails.add(new EmailAddress(token)); } } return emails; } }
public class class_name { public static Set<EmailAddress> parseMultiple(String email) { if(AssertUtils.isEmpty(email)) { throw new IllegalArgumentException("Email cannot be empty/null"); } Set<EmailAddress> emails = new HashSet<EmailAddress>(); String[] tokens = email.split("[;,]"); for(String token : tokens) { token = token.trim(); // depends on control dependency: [for], data = [token] // check for angular brackets if(token.contains("<") || token.contains(">")) { int start = token.indexOf('<'); int end = token.indexOf('>'); if(start >= 0 && end > start) { String name = token.substring(start + 1, end).trim(); String em = token.substring(end + 1).trim(); emails.add(new EmailAddress(name, em)); // depends on control dependency: [if], data = [none] } else { emails.add(new EmailAddress(token)); // depends on control dependency: [if], data = [none] } } else { emails.add(new EmailAddress(token)); // depends on control dependency: [if], data = [none] } } return emails; } }
public class class_name { public final ProtoParser.extensions_range_return extensions_range(Proto proto, Message message) throws RecognitionException { ProtoParser.extensions_range_return retval = new ProtoParser.extensions_range_return(); retval.start = input.LT(1); Object root_0 = null; Token f=null; Token l=null; Token EXTENSIONS67=null; Token TO68=null; Token MAX69=null; Token SEMICOLON70=null; Object f_tree=null; Object l_tree=null; Object EXTENSIONS67_tree=null; Object TO68_tree=null; Object MAX69_tree=null; Object SEMICOLON70_tree=null; int first = -1; int last = -1; try { // com/dyuproject/protostuff/parser/ProtoParser.g:199:5: ( EXTENSIONS f= NUMINT ( TO (l= NUMINT | MAX ) )? SEMICOLON ) // com/dyuproject/protostuff/parser/ProtoParser.g:199:9: EXTENSIONS f= NUMINT ( TO (l= NUMINT | MAX ) )? SEMICOLON { root_0 = (Object)adaptor.nil(); EXTENSIONS67=(Token)match(input,EXTENSIONS,FOLLOW_EXTENSIONS_in_extensions_range1358); if (state.failed) return retval; if ( state.backtracking==0 ) { EXTENSIONS67_tree = (Object)adaptor.create(EXTENSIONS67); adaptor.addChild(root_0, EXTENSIONS67_tree); } f=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_extensions_range1362); if (state.failed) return retval; if ( state.backtracking==0 ) { f_tree = (Object)adaptor.create(f); adaptor.addChild(root_0, f_tree); } if ( state.backtracking==0 ) { first = Integer.parseInt((f!=null?f.getText():null)); last = first; } // com/dyuproject/protostuff/parser/ProtoParser.g:200:9: ( TO (l= NUMINT | MAX ) )? int alt15=2; switch ( input.LA(1) ) { case TO: { alt15=1; } break; } switch (alt15) { case 1 : // com/dyuproject/protostuff/parser/ProtoParser.g:200:11: TO (l= NUMINT | MAX ) { TO68=(Token)match(input,TO,FOLLOW_TO_in_extensions_range1376); if (state.failed) return retval; if ( state.backtracking==0 ) { TO68_tree = (Object)adaptor.create(TO68); adaptor.addChild(root_0, TO68_tree); } // com/dyuproject/protostuff/parser/ProtoParser.g:200:14: (l= NUMINT | MAX ) int alt14=2; switch ( input.LA(1) ) { case NUMINT: { alt14=1; } break; case MAX: { alt14=2; } break; default: if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 14, 0, input); throw nvae; } switch (alt14) { case 1 : // com/dyuproject/protostuff/parser/ProtoParser.g:200:16: l= NUMINT { l=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_extensions_range1382); if (state.failed) return retval; if ( state.backtracking==0 ) { l_tree = (Object)adaptor.create(l); adaptor.addChild(root_0, l_tree); } if ( state.backtracking==0 ) { last = Integer.parseInt((l!=null?l.getText():null)); } } break; case 2 : // com/dyuproject/protostuff/parser/ProtoParser.g:200:65: MAX { MAX69=(Token)match(input,MAX,FOLLOW_MAX_in_extensions_range1388); if (state.failed) return retval; if ( state.backtracking==0 ) { MAX69_tree = (Object)adaptor.create(MAX69); adaptor.addChild(root_0, MAX69_tree); } if ( state.backtracking==0 ) { last = 536870911; } } break; } } break; } SEMICOLON70=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_extensions_range1405); if (state.failed) return retval; if ( state.backtracking==0 ) { message.defineExtensionRange(first, last); } } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { } return retval; } }
public class class_name { public final ProtoParser.extensions_range_return extensions_range(Proto proto, Message message) throws RecognitionException { ProtoParser.extensions_range_return retval = new ProtoParser.extensions_range_return(); retval.start = input.LT(1); Object root_0 = null; Token f=null; Token l=null; Token EXTENSIONS67=null; Token TO68=null; Token MAX69=null; Token SEMICOLON70=null; Object f_tree=null; Object l_tree=null; Object EXTENSIONS67_tree=null; Object TO68_tree=null; Object MAX69_tree=null; Object SEMICOLON70_tree=null; int first = -1; int last = -1; try { // com/dyuproject/protostuff/parser/ProtoParser.g:199:5: ( EXTENSIONS f= NUMINT ( TO (l= NUMINT | MAX ) )? SEMICOLON ) // com/dyuproject/protostuff/parser/ProtoParser.g:199:9: EXTENSIONS f= NUMINT ( TO (l= NUMINT | MAX ) )? SEMICOLON { root_0 = (Object)adaptor.nil(); EXTENSIONS67=(Token)match(input,EXTENSIONS,FOLLOW_EXTENSIONS_in_extensions_range1358); if (state.failed) return retval; if ( state.backtracking==0 ) { EXTENSIONS67_tree = (Object)adaptor.create(EXTENSIONS67); // depends on control dependency: [if], data = [none] adaptor.addChild(root_0, EXTENSIONS67_tree); // depends on control dependency: [if], data = [none] } f=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_extensions_range1362); if (state.failed) return retval; if ( state.backtracking==0 ) { f_tree = (Object)adaptor.create(f); // depends on control dependency: [if], data = [none] adaptor.addChild(root_0, f_tree); // depends on control dependency: [if], data = [none] } if ( state.backtracking==0 ) { first = Integer.parseInt((f!=null?f.getText():null)); last = first; // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] } // com/dyuproject/protostuff/parser/ProtoParser.g:200:9: ( TO (l= NUMINT | MAX ) )? int alt15=2; switch ( input.LA(1) ) { case TO: { alt15=1; } break; } switch (alt15) { case 1 : // com/dyuproject/protostuff/parser/ProtoParser.g:200:11: TO (l= NUMINT | MAX ) { TO68=(Token)match(input,TO,FOLLOW_TO_in_extensions_range1376); if (state.failed) return retval; if ( state.backtracking==0 ) { TO68_tree = (Object)adaptor.create(TO68); // depends on control dependency: [if], data = [none] adaptor.addChild(root_0, TO68_tree); // depends on control dependency: [if], data = [none] } // com/dyuproject/protostuff/parser/ProtoParser.g:200:14: (l= NUMINT | MAX ) int alt14=2; switch ( input.LA(1) ) { case NUMINT: { alt14=1; } break; case MAX: { alt14=2; } break; default: if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 14, 0, input); throw nvae; } switch (alt14) { case 1 : // com/dyuproject/protostuff/parser/ProtoParser.g:200:16: l= NUMINT { l=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_extensions_range1382); if (state.failed) return retval; if ( state.backtracking==0 ) { l_tree = (Object)adaptor.create(l); adaptor.addChild(root_0, l_tree); } if ( state.backtracking==0 ) { last = Integer.parseInt((l!=null?l.getText():null)); } } break; case 2 : // com/dyuproject/protostuff/parser/ProtoParser.g:200:65: MAX { MAX69=(Token)match(input,MAX,FOLLOW_MAX_in_extensions_range1388); if (state.failed) return retval; if ( state.backtracking==0 ) { MAX69_tree = (Object)adaptor.create(MAX69); adaptor.addChild(root_0, MAX69_tree); } if ( state.backtracking==0 ) { last = 536870911; } } break; } } break; } SEMICOLON70=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_extensions_range1405); if (state.failed) return retval; if ( state.backtracking==0 ) { message.defineExtensionRange(first, last); } } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { } return retval; } }
public class class_name { public void setTrainingJobSummaries(java.util.Collection<HyperParameterTrainingJobSummary> trainingJobSummaries) { if (trainingJobSummaries == null) { this.trainingJobSummaries = null; return; } this.trainingJobSummaries = new java.util.ArrayList<HyperParameterTrainingJobSummary>(trainingJobSummaries); } }
public class class_name { public void setTrainingJobSummaries(java.util.Collection<HyperParameterTrainingJobSummary> trainingJobSummaries) { if (trainingJobSummaries == null) { this.trainingJobSummaries = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.trainingJobSummaries = new java.util.ArrayList<HyperParameterTrainingJobSummary>(trainingJobSummaries); } }
public class class_name { protected static String makeFilename(File directory, final String keyspace, final String columnFamily) { final Set<Descriptor> existing = new HashSet<Descriptor>(); directory.list(new FilenameFilter() { public boolean accept(File dir, String name) { Pair<Descriptor, Component> p = SSTable.tryComponentFromFilename(dir, name); Descriptor desc = p == null ? null : p.left; if (desc == null) return false; if (desc.cfname.equals(columnFamily)) existing.add(desc); return false; } }); int maxGen = generation.getAndIncrement(); for (Descriptor desc : existing) { while (desc.generation > maxGen) { maxGen = generation.getAndIncrement(); } } return new Descriptor(directory, keyspace, columnFamily, maxGen + 1, Descriptor.Type.TEMP).filenameFor(Component.DATA); } }
public class class_name { protected static String makeFilename(File directory, final String keyspace, final String columnFamily) { final Set<Descriptor> existing = new HashSet<Descriptor>(); directory.list(new FilenameFilter() { public boolean accept(File dir, String name) { Pair<Descriptor, Component> p = SSTable.tryComponentFromFilename(dir, name); Descriptor desc = p == null ? null : p.left; if (desc == null) return false; if (desc.cfname.equals(columnFamily)) existing.add(desc); return false; } }); int maxGen = generation.getAndIncrement(); for (Descriptor desc : existing) { while (desc.generation > maxGen) { maxGen = generation.getAndIncrement(); // depends on control dependency: [while], data = [none] } } return new Descriptor(directory, keyspace, columnFamily, maxGen + 1, Descriptor.Type.TEMP).filenameFor(Component.DATA); } }
public class class_name { private static void cleanStyles(Element e) { if (e == null) { return; } Element cur = e.children().first(); // Remove any root styles, if we're able. if (!"readability-styled".equals(e.className())) { e.removeAttr("style"); } // Go until there are no more child nodes while (cur != null) { // Remove style attributes if (!"readability-styled".equals(cur.className())) { cur.removeAttr("style"); } cleanStyles(cur); cur = cur.nextElementSibling(); } } }
public class class_name { private static void cleanStyles(Element e) { if (e == null) { return; // depends on control dependency: [if], data = [none] } Element cur = e.children().first(); // Remove any root styles, if we're able. if (!"readability-styled".equals(e.className())) { e.removeAttr("style"); // depends on control dependency: [if], data = [none] } // Go until there are no more child nodes while (cur != null) { // Remove style attributes if (!"readability-styled".equals(cur.className())) { cur.removeAttr("style"); // depends on control dependency: [if], data = [none] } cleanStyles(cur); // depends on control dependency: [while], data = [(cur] cur = cur.nextElementSibling(); // depends on control dependency: [while], data = [none] } } }
public class class_name { public void setLargeIcons(boolean largeIcons) { this.largeIcons = largeIcons; if (getCompositionRoot() != null) { if (largeIcons) { getCompositionRoot().addStyleName(ValoTheme.MENU_PART_LARGE_ICONS); } else { getCompositionRoot().removeStyleName(ValoTheme.MENU_PART_LARGE_ICONS); } } } }
public class class_name { public void setLargeIcons(boolean largeIcons) { this.largeIcons = largeIcons; if (getCompositionRoot() != null) { if (largeIcons) { getCompositionRoot().addStyleName(ValoTheme.MENU_PART_LARGE_ICONS); // depends on control dependency: [if], data = [none] } else { getCompositionRoot().removeStyleName(ValoTheme.MENU_PART_LARGE_ICONS); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public AbstractRule getRule() { if (rule != null && rule.eIsProxy()) { InternalEObject oldRule = (InternalEObject)rule; rule = (AbstractRule)eResolveProxy(oldRule); if (rule != oldRule) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, XtextPackage.RULE_CALL__RULE, oldRule, rule)); } } return rule; } }
public class class_name { public AbstractRule getRule() { if (rule != null && rule.eIsProxy()) { InternalEObject oldRule = (InternalEObject)rule; rule = (AbstractRule)eResolveProxy(oldRule); // depends on control dependency: [if], data = [none] if (rule != oldRule) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, XtextPackage.RULE_CALL__RULE, oldRule, rule)); } } return rule; } }
public class class_name { int compareTwoSegments_(Segment seg_1, Segment seg_2) { int res = seg_1._isIntersecting(seg_2, m_tolerance, true); if (res != 0) { if (res == 2) return errorCoincident(); else return errorCracking(); } Point2D start_1 = seg_1.getStartXY(); Point2D end1 = seg_1.getEndXY(); Point2D start2 = seg_2.getStartXY(); Point2D end2 = seg_2.getEndXY(); Point2D ptSweep = new Point2D(); ptSweep.setCoords(m_sweep_x, m_sweep_y); if (start_1.isEqual(start2) && m_sweep_y == start_1.y) { assert (start_1.compare(end1) < 0 && start2.compare(end2) < 0); if (end1.compare(end2) < 0) ptSweep.setCoords(end1); else ptSweep.setCoords(end2); } else if (start_1.isEqual(end2) && m_sweep_y == start_1.y) { assert (start_1.compare(end1) < 0 && start2.compare(end2) > 0); if (end1.compare(start2) < 0) ptSweep.setCoords(end1); else ptSweep.setCoords(start2); } else if (start2.isEqual(end1) && m_sweep_y == start2.y) { assert (end1.compare(start_1) < 0 && start2.compare(end2) < 0); if (start_1.compare(end2) < 0) ptSweep.setCoords(start_1); else ptSweep.setCoords(end2); } else if (end1.isEqual(end2) && m_sweep_y == end1.y) { assert (start_1.compare(end1) > 0 && start2.compare(end2) > 0); if (start_1.compare(start2) < 0) ptSweep.setCoords(start_1); else ptSweep.setCoords(start2); } double xleft = seg_1.intersectionOfYMonotonicWithAxisX(ptSweep.y, ptSweep.x); double xright = seg_2.intersectionOfYMonotonicWithAxisX(ptSweep.y, ptSweep.x); assert (xleft != xright); return xleft < xright ? -1 : 1; } }
public class class_name { int compareTwoSegments_(Segment seg_1, Segment seg_2) { int res = seg_1._isIntersecting(seg_2, m_tolerance, true); if (res != 0) { if (res == 2) return errorCoincident(); else return errorCracking(); } Point2D start_1 = seg_1.getStartXY(); Point2D end1 = seg_1.getEndXY(); Point2D start2 = seg_2.getStartXY(); Point2D end2 = seg_2.getEndXY(); Point2D ptSweep = new Point2D(); ptSweep.setCoords(m_sweep_x, m_sweep_y); if (start_1.isEqual(start2) && m_sweep_y == start_1.y) { assert (start_1.compare(end1) < 0 && start2.compare(end2) < 0); // depends on control dependency: [if], data = [none] if (end1.compare(end2) < 0) ptSweep.setCoords(end1); else ptSweep.setCoords(end2); } else if (start_1.isEqual(end2) && m_sweep_y == start_1.y) { assert (start_1.compare(end1) < 0 && start2.compare(end2) > 0); // depends on control dependency: [if], data = [none] if (end1.compare(start2) < 0) ptSweep.setCoords(end1); else ptSweep.setCoords(start2); } else if (start2.isEqual(end1) && m_sweep_y == start2.y) { assert (end1.compare(start_1) < 0 && start2.compare(end2) < 0); // depends on control dependency: [if], data = [none] if (start_1.compare(end2) < 0) ptSweep.setCoords(start_1); else ptSweep.setCoords(end2); } else if (end1.isEqual(end2) && m_sweep_y == end1.y) { assert (start_1.compare(end1) > 0 && start2.compare(end2) > 0); // depends on control dependency: [if], data = [none] if (start_1.compare(start2) < 0) ptSweep.setCoords(start_1); else ptSweep.setCoords(start2); } double xleft = seg_1.intersectionOfYMonotonicWithAxisX(ptSweep.y, ptSweep.x); double xright = seg_2.intersectionOfYMonotonicWithAxisX(ptSweep.y, ptSweep.x); assert (xleft != xright); return xleft < xright ? -1 : 1; } }
public class class_name { public void Resolve( String pFrom, String pTo ) { if( periods != null ) { // call on an already resolved CalendarPeriod // echo // "LJLJKZHL KJH ELF B.EB EKJGF EFJBH EKLFJHL JGH <{{ : ' } <br/>"; throw new RuntimeException( "Error call on an already resolved CalendarPeriod" ); } // echo "Resolving from $from to $to " . implode( ".", $this->days ) . // "<br/>"; // if all days are selected, make a whole period // build the micro periods int nb = 0; for( int i = 0; i < 7; i++ ) nb += days.getDay( i ).get(); if( nb == 7 ) { periods = new ArrayList<Period>(); periods.add( new Period( pFrom, pTo ) ); return; } else if( nb == 0 ) { periods = new ArrayList<Period>(); return; } // echo "Continuing<br/>"; int fromDay = CalendarFunctions.date_get_day( pFrom ); // we have at least one gap Groups groups = new Groups(); Group curGroup = null; for( int i = fromDay; i < fromDay + 7; i++ ) { if( days.getDay( i % 7 ).get() > 0 ) { if( curGroup == null ) // no group created yet curGroup = new Group( i - fromDay, i - fromDay ); else if( curGroup.getTo() == i - fromDay - 1 ) // day jointed to // current group curGroup.setTo( i - fromDay ); else // day disjointed from current group { groups.add( curGroup ); curGroup = new Group( i - fromDay, i - fromDay ); } } } if( curGroup != null ) groups.add( curGroup ); // Dump( $groups ); // now generate the periods // String msg = "Starts on " + pFrom + ", which day is a " + fromDay + // "<br/>"; // for( int i = 0; i < groups.size(); i++ ) // { // Group group = groups.get( i ); // msg += "Group : " + group.implode( " to " ) + "<br/>"; // } // echo "From day : $from : $fromDay <br/>"; String firstOccurence = pFrom; // echo "First occurence : $firstOccurence<br/>"; days = null; periods = new ArrayList<Period>(); while( firstOccurence.compareTo( pTo ) <= 0 ) { // msg += "Occurence " + firstOccurence + "<br/>"; // day of $firstOccurence is always $fromDay // foreach( $groups as $group ) for( int i = 0; i < groups.size(); i++ ) { Group group = groups.get( i ); String mpFrom = CalendarFunctions.date_add_day( firstOccurence, group.getFrom() ); if( mpFrom.compareTo( pTo ) <= 0 ) { String mpTo = CalendarFunctions.date_add_day( firstOccurence, group.getTo() ); if( mpTo.compareTo( pTo ) > 0 ) mpTo = pTo; // msg += "Adding " + mpFrom + ", " + mpTo + "<br/>"; periods.add( new Period( mpFrom, mpTo ) ); } } firstOccurence = CalendarFunctions.date_add_day( firstOccurence, 7 ); } // ServerState::inst()->AddMessage( $msg ); } }
public class class_name { public void Resolve( String pFrom, String pTo ) { if( periods != null ) { // call on an already resolved CalendarPeriod // echo // "LJLJKZHL KJH ELF B.EB EKJGF EFJBH EKLFJHL JGH <{{ : ' } <br/>"; throw new RuntimeException( "Error call on an already resolved CalendarPeriod" ); } // echo "Resolving from $from to $to " . implode( ".", $this->days ) . // "<br/>"; // if all days are selected, make a whole period // build the micro periods int nb = 0; for( int i = 0; i < 7; i++ ) nb += days.getDay( i ).get(); if( nb == 7 ) { periods = new ArrayList<Period>(); // depends on control dependency: [if], data = [none] periods.add( new Period( pFrom, pTo ) ); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } else if( nb == 0 ) { periods = new ArrayList<Period>(); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } // echo "Continuing<br/>"; int fromDay = CalendarFunctions.date_get_day( pFrom ); // we have at least one gap Groups groups = new Groups(); Group curGroup = null; for( int i = fromDay; i < fromDay + 7; i++ ) { if( days.getDay( i % 7 ).get() > 0 ) { if( curGroup == null ) // no group created yet curGroup = new Group( i - fromDay, i - fromDay ); else if( curGroup.getTo() == i - fromDay - 1 ) // day jointed to // current group curGroup.setTo( i - fromDay ); else // day disjointed from current group { groups.add( curGroup ); // depends on control dependency: [if], data = [none] curGroup = new Group( i - fromDay, i - fromDay ); // depends on control dependency: [if], data = [none] } } } if( curGroup != null ) groups.add( curGroup ); // Dump( $groups ); // now generate the periods // String msg = "Starts on " + pFrom + ", which day is a " + fromDay + // "<br/>"; // for( int i = 0; i < groups.size(); i++ ) // { // Group group = groups.get( i ); // msg += "Group : " + group.implode( " to " ) + "<br/>"; // } // echo "From day : $from : $fromDay <br/>"; String firstOccurence = pFrom; // echo "First occurence : $firstOccurence<br/>"; days = null; periods = new ArrayList<Period>(); while( firstOccurence.compareTo( pTo ) <= 0 ) { // msg += "Occurence " + firstOccurence + "<br/>"; // day of $firstOccurence is always $fromDay // foreach( $groups as $group ) for( int i = 0; i < groups.size(); i++ ) { Group group = groups.get( i ); String mpFrom = CalendarFunctions.date_add_day( firstOccurence, group.getFrom() ); if( mpFrom.compareTo( pTo ) <= 0 ) { String mpTo = CalendarFunctions.date_add_day( firstOccurence, group.getTo() ); if( mpTo.compareTo( pTo ) > 0 ) mpTo = pTo; // msg += "Adding " + mpFrom + ", " + mpTo + "<br/>"; periods.add( new Period( mpFrom, mpTo ) ); // depends on control dependency: [if], data = [none] } } firstOccurence = CalendarFunctions.date_add_day( firstOccurence, 7 ); // depends on control dependency: [while], data = [none] } // ServerState::inst()->AddMessage( $msg ); } }
public class class_name { public static Method getMethod(Class<?> cl, Method method) { if (method == null) { return null; } if (Modifier.isPublic(cl.getModifiers())) { return method; } Class<?> [] interfaces = cl.getInterfaces (); for (int i = 0; i < interfaces.length; i++) { Class<?> c = interfaces[i]; Method m = null; try { m = c.getMethod(method.getName(), method.getParameterTypes()); c = m.getDeclaringClass(); if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) { } } Class<?> c = cl.getSuperclass(); if (c != null) { Method m = null; try { m = c.getMethod(method.getName(), method.getParameterTypes()); c = m.getDeclaringClass(); if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) { } } return null; } }
public class class_name { public static Method getMethod(Class<?> cl, Method method) { if (method == null) { return null; // depends on control dependency: [if], data = [none] } if (Modifier.isPublic(cl.getModifiers())) { return method; // depends on control dependency: [if], data = [none] } Class<?> [] interfaces = cl.getInterfaces (); for (int i = 0; i < interfaces.length; i++) { Class<?> c = interfaces[i]; Method m = null; // depends on control dependency: [for], data = [none] try { m = c.getMethod(method.getName(), method.getParameterTypes()); // depends on control dependency: [try], data = [none] c = m.getDeclaringClass(); // depends on control dependency: [try], data = [none] if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) { } // depends on control dependency: [catch], data = [none] } Class<?> c = cl.getSuperclass(); if (c != null) { Method m = null; try { m = c.getMethod(method.getName(), method.getParameterTypes()); // depends on control dependency: [try], data = [none] c = m.getDeclaringClass(); // depends on control dependency: [try], data = [none] if ((m = getMethod(c, m)) != null) return m; } catch (NoSuchMethodException ex) { } // depends on control dependency: [catch], data = [none] } return null; } }
public class class_name { synchronized ContentHandler getContentHandler() throws IOException { String contentType = stripOffParameters(getContentType()); ContentHandler handler = null; if (contentType == null) { if ((contentType = guessContentTypeFromName(url.getFile())) == null) { contentType = guessContentTypeFromStream(getInputStream()); } } if (contentType == null) { return UnknownContentHandler.INSTANCE; } try { handler = (ContentHandler) handlers.get(contentType); if (handler != null) return handler; } catch(Exception e) { } if (factory != null) handler = factory.createContentHandler(contentType); if (handler == null) { try { handler = lookupContentHandlerClassFor(contentType); } catch(Exception e) { e.printStackTrace(); handler = UnknownContentHandler.INSTANCE; } handlers.put(contentType, handler); } return handler; } }
public class class_name { synchronized ContentHandler getContentHandler() throws IOException { String contentType = stripOffParameters(getContentType()); ContentHandler handler = null; if (contentType == null) { if ((contentType = guessContentTypeFromName(url.getFile())) == null) { contentType = guessContentTypeFromStream(getInputStream()); // depends on control dependency: [if], data = [none] } } if (contentType == null) { return UnknownContentHandler.INSTANCE; // depends on control dependency: [if], data = [none] } try { handler = (ContentHandler) handlers.get(contentType); // depends on control dependency: [try], data = [none] if (handler != null) return handler; } catch(Exception e) { } // depends on control dependency: [catch], data = [none] if (factory != null) handler = factory.createContentHandler(contentType); if (handler == null) { try { handler = lookupContentHandlerClassFor(contentType); // depends on control dependency: [try], data = [none] } catch(Exception e) { e.printStackTrace(); handler = UnknownContentHandler.INSTANCE; } // depends on control dependency: [catch], data = [none] handlers.put(contentType, handler); // depends on control dependency: [if], data = [none] } return handler; } }
public class class_name { public BDD bdd(final VariableOrdering variableOrdering) { final int varNum = this.variables().size(); final BDDFactory factory = new BDDFactory(varNum * 30, varNum * 20, this.factory()); if (variableOrdering == null) { factory.setNumberOfVars(varNum); } else { try { final VariableOrderingProvider provider = variableOrdering.provider().newInstance(); factory.setVariableOrder(provider.getOrder(this)); } catch (final InstantiationException | IllegalAccessException e) { throw new IllegalStateException("Could not generate the BDD variable ordering provider", e); } } return factory.build(this); } }
public class class_name { public BDD bdd(final VariableOrdering variableOrdering) { final int varNum = this.variables().size(); final BDDFactory factory = new BDDFactory(varNum * 30, varNum * 20, this.factory()); if (variableOrdering == null) { factory.setNumberOfVars(varNum); // depends on control dependency: [if], data = [none] } else { try { final VariableOrderingProvider provider = variableOrdering.provider().newInstance(); factory.setVariableOrder(provider.getOrder(this)); // depends on control dependency: [try], data = [none] } catch (final InstantiationException | IllegalAccessException e) { throw new IllegalStateException("Could not generate the BDD variable ordering provider", e); } // depends on control dependency: [catch], data = [none] } return factory.build(this); } }
public class class_name { @Override public String getUserFacingMessage() { final StringBuilder bldr = new StringBuilder(); bldr.append("RESOLUTION FAILURE "); final String name = getName(); if (name != null) { bldr.append(" in "); bldr.append(name); } bldr.append("\n\treason: "); final String msg = getMessage(); if (msg != null) { bldr.append(msg); } else { bldr.append("Unknown"); } bldr.append("\n"); return bldr.toString(); } }
public class class_name { @Override public String getUserFacingMessage() { final StringBuilder bldr = new StringBuilder(); bldr.append("RESOLUTION FAILURE "); final String name = getName(); if (name != null) { bldr.append(" in "); // depends on control dependency: [if], data = [none] bldr.append(name); // depends on control dependency: [if], data = [(name] } bldr.append("\n\treason: "); final String msg = getMessage(); if (msg != null) { bldr.append(msg); // depends on control dependency: [if], data = [(msg] } else { bldr.append("Unknown"); // depends on control dependency: [if], data = [none] } bldr.append("\n"); return bldr.toString(); } }
public class class_name { protected void logDebug(String id, String messageTemplate, Object... parameters) { if(delegateLogger.isDebugEnabled()) { String msg = formatMessageTemplate(id, messageTemplate); delegateLogger.debug(msg, parameters); } } }
public class class_name { protected void logDebug(String id, String messageTemplate, Object... parameters) { if(delegateLogger.isDebugEnabled()) { String msg = formatMessageTemplate(id, messageTemplate); delegateLogger.debug(msg, parameters); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected void removeSequence(String sequenceName) { // lookup the sequence map for calling DB Map mapForDB = (Map) sequencesDBMap.get(getBrokerForClass() .serviceConnectionManager().getConnectionDescriptor().getJcdAlias()); if(mapForDB != null) { synchronized(SequenceManagerHighLowImpl.class) { mapForDB.remove(sequenceName); } } } }
public class class_name { protected void removeSequence(String sequenceName) { // lookup the sequence map for calling DB Map mapForDB = (Map) sequencesDBMap.get(getBrokerForClass() .serviceConnectionManager().getConnectionDescriptor().getJcdAlias()); if(mapForDB != null) { synchronized(SequenceManagerHighLowImpl.class) // depends on control dependency: [if], data = [none] { mapForDB.remove(sequenceName); } } } }
public class class_name { public void moveResource(CmsDbContext dbc, CmsResource source, String destination, boolean internal) throws CmsException { CmsFolder destinationFolder = readFolder(dbc, CmsResource.getParentFolder(destination), CmsResourceFilter.ALL); m_securityManager.checkPermissions( dbc, destinationFolder, CmsPermissionSet.ACCESS_WRITE, false, CmsResourceFilter.ALL); if (source.isFolder()) { m_monitor.flushCache(CmsMemoryMonitor.CacheType.HAS_ROLE, CmsMemoryMonitor.CacheType.ROLE_LIST); } getVfsDriver(dbc).moveResource(dbc, dbc.getRequestContext().getCurrentProject().getUuid(), source, destination); if (!internal) { CmsResourceState newState = CmsResource.STATE_CHANGED; if (source.getState().isNew()) { newState = CmsResource.STATE_NEW; } else if (source.getState().isDeleted()) { newState = CmsResource.STATE_DELETED; } source.setState(newState); // safe since this operation always uses the ids instead of the resource path getVfsDriver(dbc).writeResourceState( dbc, dbc.currentProject(), source, CmsDriverManager.UPDATE_STRUCTURE_STATE, false); // log it log( dbc, new CmsLogEntry( dbc, source.getStructureId(), CmsLogEntryType.RESOURCE_MOVED, new String[] {source.getRootPath(), destination}), false); } CmsResource destRes = readResource(dbc, destination, CmsResourceFilter.ALL); // move lock m_lockManager.moveResource(source.getRootPath(), destRes.getRootPath()); // flush all relevant caches m_monitor.clearAccessControlListCache(); m_monitor.flushCache( CmsMemoryMonitor.CacheType.PROPERTY, CmsMemoryMonitor.CacheType.PROPERTY_LIST, CmsMemoryMonitor.CacheType.PROJECT_RESOURCES); List<CmsResource> resources = new ArrayList<CmsResource>(4); // source resources.add(source); try { resources.add(readFolder(dbc, CmsResource.getParentFolder(source.getRootPath()), CmsResourceFilter.ALL)); } catch (Exception e) { if (LOG.isDebugEnabled()) { LOG.debug(e); } } // destination resources.add(destRes); resources.add(destinationFolder); Map<String, Object> eventData = new HashMap<String, Object>(); eventData.put(I_CmsEventListener.KEY_RESOURCES, resources); eventData.put(I_CmsEventListener.KEY_DBCONTEXT, dbc); // fire the events OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_RESOURCE_MOVED, eventData)); } }
public class class_name { public void moveResource(CmsDbContext dbc, CmsResource source, String destination, boolean internal) throws CmsException { CmsFolder destinationFolder = readFolder(dbc, CmsResource.getParentFolder(destination), CmsResourceFilter.ALL); m_securityManager.checkPermissions( dbc, destinationFolder, CmsPermissionSet.ACCESS_WRITE, false, CmsResourceFilter.ALL); if (source.isFolder()) { m_monitor.flushCache(CmsMemoryMonitor.CacheType.HAS_ROLE, CmsMemoryMonitor.CacheType.ROLE_LIST); } getVfsDriver(dbc).moveResource(dbc, dbc.getRequestContext().getCurrentProject().getUuid(), source, destination); if (!internal) { CmsResourceState newState = CmsResource.STATE_CHANGED; if (source.getState().isNew()) { newState = CmsResource.STATE_NEW; // depends on control dependency: [if], data = [none] } else if (source.getState().isDeleted()) { newState = CmsResource.STATE_DELETED; // depends on control dependency: [if], data = [none] } source.setState(newState); // safe since this operation always uses the ids instead of the resource path getVfsDriver(dbc).writeResourceState( dbc, dbc.currentProject(), source, CmsDriverManager.UPDATE_STRUCTURE_STATE, false); // log it log( dbc, new CmsLogEntry( dbc, source.getStructureId(), CmsLogEntryType.RESOURCE_MOVED, new String[] {source.getRootPath(), destination}), false); } CmsResource destRes = readResource(dbc, destination, CmsResourceFilter.ALL); // move lock m_lockManager.moveResource(source.getRootPath(), destRes.getRootPath()); // flush all relevant caches m_monitor.clearAccessControlListCache(); m_monitor.flushCache( CmsMemoryMonitor.CacheType.PROPERTY, CmsMemoryMonitor.CacheType.PROPERTY_LIST, CmsMemoryMonitor.CacheType.PROJECT_RESOURCES); List<CmsResource> resources = new ArrayList<CmsResource>(4); // source resources.add(source); try { resources.add(readFolder(dbc, CmsResource.getParentFolder(source.getRootPath()), CmsResourceFilter.ALL)); } catch (Exception e) { if (LOG.isDebugEnabled()) { LOG.debug(e); // depends on control dependency: [if], data = [none] } } // destination resources.add(destRes); resources.add(destinationFolder); Map<String, Object> eventData = new HashMap<String, Object>(); eventData.put(I_CmsEventListener.KEY_RESOURCES, resources); eventData.put(I_CmsEventListener.KEY_DBCONTEXT, dbc); // fire the events OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_RESOURCE_MOVED, eventData)); } }
public class class_name { public void deleteUser(final Node user) { Node userReplica, following; for (Relationship replica : user.getRelationships( SocialGraphRelationshipType.REPLICA, Direction.INCOMING)) { userReplica = replica.getEndNode(); following = NeoUtils.getPrevSingleNode(userReplica, SocialGraphRelationshipType.FOLLOW); this.removeFriendship(following, user); } } }
public class class_name { public void deleteUser(final Node user) { Node userReplica, following; for (Relationship replica : user.getRelationships( SocialGraphRelationshipType.REPLICA, Direction.INCOMING)) { userReplica = replica.getEndNode(); // depends on control dependency: [for], data = [replica] following = NeoUtils.getPrevSingleNode(userReplica, SocialGraphRelationshipType.FOLLOW); // depends on control dependency: [for], data = [none] this.removeFriendship(following, user); // depends on control dependency: [for], data = [none] } } }
public class class_name { private static List<RedisCommand<?, ?, ?>> drainCommands(Queue<? extends RedisCommand<?, ?, ?>> source) { List<RedisCommand<?, ?, ?>> target = new ArrayList<>(source.size()); RedisCommand<?, ?, ?> cmd; while ((cmd = source.poll()) != null) { if (!cmd.isDone()) { target.add(cmd); } } return target; } }
public class class_name { private static List<RedisCommand<?, ?, ?>> drainCommands(Queue<? extends RedisCommand<?, ?, ?>> source) { List<RedisCommand<?, ?, ?>> target = new ArrayList<>(source.size()); RedisCommand<?, ?, ?> cmd; while ((cmd = source.poll()) != null) { if (!cmd.isDone()) { target.add(cmd); // depends on control dependency: [if], data = [none] } } return target; } }
public class class_name { public void configure(Object object, String objectName) { if (object == null) { logger.debug("object to be configured is null"); return; } Assert.notNull(objectName, "objectName"); if (object instanceof TitleConfigurable) { configureTitle((TitleConfigurable) object, objectName); } if (object instanceof LabelConfigurable) { configureLabel((LabelConfigurable) object, objectName); } if (object instanceof ColorConfigurable) { configureColor((ColorConfigurable)object, objectName); } if (object instanceof CommandLabelConfigurable) { configureCommandLabel((CommandLabelConfigurable) object, objectName); } if (object instanceof DescriptionConfigurable) { configureDescription((DescriptionConfigurable) object, objectName); } if (object instanceof ImageConfigurable) { configureImage((ImageConfigurable) object, objectName); } if (object instanceof IconConfigurable) { configureIcon((IconConfigurable) object, objectName); } if (object instanceof CommandIconConfigurable) { configureCommandIcons((CommandIconConfigurable) object, objectName); } if (object instanceof Secured) { configureSecurityController((Secured) object, objectName); } } }
public class class_name { public void configure(Object object, String objectName) { if (object == null) { logger.debug("object to be configured is null"); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } Assert.notNull(objectName, "objectName"); if (object instanceof TitleConfigurable) { configureTitle((TitleConfigurable) object, objectName); // depends on control dependency: [if], data = [none] } if (object instanceof LabelConfigurable) { configureLabel((LabelConfigurable) object, objectName); // depends on control dependency: [if], data = [none] } if (object instanceof ColorConfigurable) { configureColor((ColorConfigurable)object, objectName); // depends on control dependency: [if], data = [none] } if (object instanceof CommandLabelConfigurable) { configureCommandLabel((CommandLabelConfigurable) object, objectName); // depends on control dependency: [if], data = [none] } if (object instanceof DescriptionConfigurable) { configureDescription((DescriptionConfigurable) object, objectName); // depends on control dependency: [if], data = [none] } if (object instanceof ImageConfigurable) { configureImage((ImageConfigurable) object, objectName); // depends on control dependency: [if], data = [none] } if (object instanceof IconConfigurable) { configureIcon((IconConfigurable) object, objectName); // depends on control dependency: [if], data = [none] } if (object instanceof CommandIconConfigurable) { configureCommandIcons((CommandIconConfigurable) object, objectName); // depends on control dependency: [if], data = [none] } if (object instanceof Secured) { configureSecurityController((Secured) object, objectName); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static int checkPreconditionI( final int value, final IntPredicate predicate, final IntFunction<String> describer) { final boolean ok; try { ok = predicate.test(value); } catch (final Throwable e) { final Violations violations = singleViolation(failedPredicate(e)); throw new PreconditionViolationException( failedMessage(Integer.valueOf(value), violations), e, violations.count()); } return innerCheckI(value, ok, describer); } }
public class class_name { public static int checkPreconditionI( final int value, final IntPredicate predicate, final IntFunction<String> describer) { final boolean ok; try { ok = predicate.test(value); // depends on control dependency: [try], data = [none] } catch (final Throwable e) { final Violations violations = singleViolation(failedPredicate(e)); throw new PreconditionViolationException( failedMessage(Integer.valueOf(value), violations), e, violations.count()); } // depends on control dependency: [catch], data = [none] return innerCheckI(value, ok, describer); } }
public class class_name { static String convertToSnakeCase(final String string) { final StringBuilder builder = new StringBuilder(); boolean isPrevCharLowerCase = false; for (int index = 0; index < string.length(); index++) { final char character = string.charAt(index); if (character == ' ') { builder.append("_"); } else if (Character.isUpperCase(character) && isPrevCharLowerCase) { builder.append("_").append(Character.toLowerCase(character)); } else { builder.append(Character.toLowerCase(character)); } isPrevCharLowerCase = Character.isLowerCase(character); } return builder.toString(); } }
public class class_name { static String convertToSnakeCase(final String string) { final StringBuilder builder = new StringBuilder(); boolean isPrevCharLowerCase = false; for (int index = 0; index < string.length(); index++) { final char character = string.charAt(index); if (character == ' ') { builder.append("_"); // depends on control dependency: [if], data = [none] } else if (Character.isUpperCase(character) && isPrevCharLowerCase) { builder.append("_").append(Character.toLowerCase(character)); // depends on control dependency: [if], data = [none] } else { builder.append(Character.toLowerCase(character)); // depends on control dependency: [if], data = [none] } isPrevCharLowerCase = Character.isLowerCase(character); // depends on control dependency: [for], data = [none] } return builder.toString(); } }
public class class_name { public void addTopic(String topic) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addTopic", topic); SelectionCriteria criteria = _messageProcessor. getSelectionCriteriaFactory(). createSelectionCriteria(topic, null, SelectorDomain.SIMESSAGE); if (_subscriptionState == null) { _subscriptionState = new ConsumerDispatcherState(_destinationHandler.getUuid(), criteria, _destName, _busName); } else _subscriptionState.addSelectionCriteria(criteria); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addTopic"); } }
public class class_name { public void addTopic(String topic) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addTopic", topic); SelectionCriteria criteria = _messageProcessor. getSelectionCriteriaFactory(). createSelectionCriteria(topic, null, SelectorDomain.SIMESSAGE); if (_subscriptionState == null) { _subscriptionState = new ConsumerDispatcherState(_destinationHandler.getUuid(), criteria, _destName, _busName); // depends on control dependency: [if], data = [none] } else _subscriptionState.addSelectionCriteria(criteria); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addTopic"); } }
public class class_name { void onNextJVM(final AllocatedEvaluator allocatedEvaluator) { try { final Configuration contextConfiguration = ContextConfiguration.CONF .set(ContextConfiguration.IDENTIFIER, "HelloREEFContext") .build(); final Configuration taskConfiguration = TaskConfiguration.CONF .set(TaskConfiguration.IDENTIFIER, "HelloREEFTask") .set(TaskConfiguration.TASK, HelloTask.class) .build(); allocatedEvaluator.submitContextAndTask(contextConfiguration, taskConfiguration); } catch (final BindException ex) { final String message = "Unable to setup Task or Context configuration."; LOG.log(Level.SEVERE, message, ex); throw new RuntimeException(message, ex); } } }
public class class_name { void onNextJVM(final AllocatedEvaluator allocatedEvaluator) { try { final Configuration contextConfiguration = ContextConfiguration.CONF .set(ContextConfiguration.IDENTIFIER, "HelloREEFContext") .build(); final Configuration taskConfiguration = TaskConfiguration.CONF .set(TaskConfiguration.IDENTIFIER, "HelloREEFTask") .set(TaskConfiguration.TASK, HelloTask.class) .build(); allocatedEvaluator.submitContextAndTask(contextConfiguration, taskConfiguration); // depends on control dependency: [try], data = [none] } catch (final BindException ex) { final String message = "Unable to setup Task or Context configuration."; LOG.log(Level.SEVERE, message, ex); throw new RuntimeException(message, ex); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public ListCertificateAuthoritiesResult withCertificateAuthorities(CertificateAuthority... certificateAuthorities) { if (this.certificateAuthorities == null) { setCertificateAuthorities(new java.util.ArrayList<CertificateAuthority>(certificateAuthorities.length)); } for (CertificateAuthority ele : certificateAuthorities) { this.certificateAuthorities.add(ele); } return this; } }
public class class_name { public ListCertificateAuthoritiesResult withCertificateAuthorities(CertificateAuthority... certificateAuthorities) { if (this.certificateAuthorities == null) { setCertificateAuthorities(new java.util.ArrayList<CertificateAuthority>(certificateAuthorities.length)); // depends on control dependency: [if], data = [none] } for (CertificateAuthority ele : certificateAuthorities) { this.certificateAuthorities.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public List<String> extractWords(@NotNull String text, @NotNull Language language) { Timer timer = MetricsFactory.getMetrics().getTimer(MetricsType.TEXT_UTILS_TOKENIZE_TEXT.name()); if (StringUtils.isEmpty(text)) { timer.stop(); return Collections.emptyList(); } List<String> strings = splitText(text, language); timer.stop(); return strings; } }
public class class_name { public List<String> extractWords(@NotNull String text, @NotNull Language language) { Timer timer = MetricsFactory.getMetrics().getTimer(MetricsType.TEXT_UTILS_TOKENIZE_TEXT.name()); if (StringUtils.isEmpty(text)) { timer.stop(); // depends on control dependency: [if], data = [none] return Collections.emptyList(); // depends on control dependency: [if], data = [none] } List<String> strings = splitText(text, language); timer.stop(); return strings; } }
public class class_name { public List<String> descriptionsForResponseIDs(List<String> _ids, boolean payload, boolean pretty) { List<String> descriptions = new ArrayList<String>(); for (ServiceWrapper s : _cache) { if (_ids.isEmpty() || _responseIds.contains(s.getResponseId())) { StringBuffer buf = serviceDesciption(payload, pretty, s); descriptions.add(buf.toString()); } } return descriptions; } }
public class class_name { public List<String> descriptionsForResponseIDs(List<String> _ids, boolean payload, boolean pretty) { List<String> descriptions = new ArrayList<String>(); for (ServiceWrapper s : _cache) { if (_ids.isEmpty() || _responseIds.contains(s.getResponseId())) { StringBuffer buf = serviceDesciption(payload, pretty, s); descriptions.add(buf.toString()); // depends on control dependency: [if], data = [none] } } return descriptions; } }
public class class_name { public static Version copy(Version version) { if (version == null) { return null; } Version result = new Version(); result.labels = new LinkedList<String>(version.labels); result.numbers = new LinkedList<Integer>(version.numbers); result.snapshot = version.snapshot; return result; } }
public class class_name { public static Version copy(Version version) { if (version == null) { return null; // depends on control dependency: [if], data = [none] } Version result = new Version(); result.labels = new LinkedList<String>(version.labels); result.numbers = new LinkedList<Integer>(version.numbers); result.snapshot = version.snapshot; return result; } }
public class class_name { public boolean replaceMemberVariable( Variable newVar) { if (isImmutable()) throw new IllegalStateException("Cant modify"); //smembers = null; boolean found = false; for (int i = 0; i < members.size(); i++) { Variable v = members.get(i); if (v.getShortName() == null) System.out.println("BAD null short name"); // E:/work/ghansham/iasi_20110513_045057_metopa_23676_eps_o.l1_bufr if (v.getShortName().equals( newVar.getShortName())) { members.set( i, newVar); found = true; } } if (!found) members.add( newVar); return found; } }
public class class_name { public boolean replaceMemberVariable( Variable newVar) { if (isImmutable()) throw new IllegalStateException("Cant modify"); //smembers = null; boolean found = false; for (int i = 0; i < members.size(); i++) { Variable v = members.get(i); if (v.getShortName() == null) System.out.println("BAD null short name"); // E:/work/ghansham/iasi_20110513_045057_metopa_23676_eps_o.l1_bufr if (v.getShortName().equals( newVar.getShortName())) { members.set( i, newVar); // depends on control dependency: [if], data = [none] found = true; // depends on control dependency: [if], data = [none] } } if (!found) members.add( newVar); return found; } }
public class class_name { public java.util.List<SnapshotDetail> getSnapshotDetails() { if (snapshotDetails == null) { snapshotDetails = new com.amazonaws.internal.SdkInternalList<SnapshotDetail>(); } return snapshotDetails; } }
public class class_name { public java.util.List<SnapshotDetail> getSnapshotDetails() { if (snapshotDetails == null) { snapshotDetails = new com.amazonaws.internal.SdkInternalList<SnapshotDetail>(); // depends on control dependency: [if], data = [none] } return snapshotDetails; } }
public class class_name { public synchronized Object[] mapObjects(ResultSet pRSet) throws SQLException { Vector result = new Vector(); ResultSetMetaData meta = pRSet.getMetaData(); int cols = meta.getColumnCount(); // Get colum names String[] colNames = new String[cols]; for (int i = 0; i < cols; i++) { colNames[i] = meta.getColumnName(i + 1); // JDBC cols start at 1... /* System.out.println(meta.getColumnLabel(i + 1)); System.out.println(meta.getColumnName(i + 1)); System.out.println(meta.getColumnType(i + 1)); System.out.println(meta.getColumnTypeName(i + 1)); // System.out.println(meta.getTableName(i + 1)); // System.out.println(meta.getCatalogName(i + 1)); // System.out.println(meta.getSchemaName(i + 1)); // Last three NOT IMPLEMENTED!! */ } // Loop through rows in resultset while (pRSet.next()) { Object obj = null; try { obj = mInstanceClass.newInstance(); // Asserts empty constructor! } catch (IllegalAccessException iae) { mLog.logError(iae); // iae.printStackTrace(); } catch (InstantiationException ie) { mLog.logError(ie); // ie.printStackTrace(); } // Read each colum from this row into object for (int i = 0; i < cols; i++) { String property = (String) mColumnMap.get(colNames[i]); if (property != null) { // This column is mapped to a property mapColumnProperty(pRSet, i + 1, property, obj); } } // Add object to the result Vector result.addElement(obj); } return result.toArray((Object[]) Array.newInstance(mInstanceClass, result.size())); } }
public class class_name { public synchronized Object[] mapObjects(ResultSet pRSet) throws SQLException { Vector result = new Vector(); ResultSetMetaData meta = pRSet.getMetaData(); int cols = meta.getColumnCount(); // Get colum names String[] colNames = new String[cols]; for (int i = 0; i < cols; i++) { colNames[i] = meta.getColumnName(i + 1); // JDBC cols start at 1... // depends on control dependency: [for], data = [i] /* System.out.println(meta.getColumnLabel(i + 1)); System.out.println(meta.getColumnName(i + 1)); System.out.println(meta.getColumnType(i + 1)); System.out.println(meta.getColumnTypeName(i + 1)); // System.out.println(meta.getTableName(i + 1)); // System.out.println(meta.getCatalogName(i + 1)); // System.out.println(meta.getSchemaName(i + 1)); // Last three NOT IMPLEMENTED!! */ } // Loop through rows in resultset while (pRSet.next()) { Object obj = null; try { obj = mInstanceClass.newInstance(); // Asserts empty constructor! // depends on control dependency: [try], data = [none] } catch (IllegalAccessException iae) { mLog.logError(iae); // iae.printStackTrace(); } // depends on control dependency: [catch], data = [none] catch (InstantiationException ie) { mLog.logError(ie); // ie.printStackTrace(); } // depends on control dependency: [catch], data = [none] // Read each colum from this row into object for (int i = 0; i < cols; i++) { String property = (String) mColumnMap.get(colNames[i]); if (property != null) { // This column is mapped to a property mapColumnProperty(pRSet, i + 1, property, obj); // depends on control dependency: [if], data = [none] } } // Add object to the result Vector result.addElement(obj); // depends on control dependency: [while], data = [none] } return result.toArray((Object[]) Array.newInstance(mInstanceClass, result.size())); } }
public class class_name { public static Range create2D(Device _device, int _globalWidth, int _globalHeight) { final Range withoutLocal = create2D(_device, _globalWidth, _globalHeight, 1, 1); if (withoutLocal.isValid()) { withoutLocal.setLocalIsDerived(true); final int[] widthFactors = getFactors(_globalWidth, withoutLocal.getMaxWorkItemSize()[0]); final int[] heightFactors = getFactors(_globalHeight, withoutLocal.getMaxWorkItemSize()[1]); withoutLocal.setLocalSize_0(1); withoutLocal.setLocalSize_1(1); int max = 1; int perimeter = 0; for (final int w : widthFactors) { for (final int h : heightFactors) { final int size = w * h; if (size > withoutLocal.getMaxWorkGroupSize()) { break; } if (size > max) { max = size; perimeter = w + h; withoutLocal.setLocalSize_0(w); withoutLocal.setLocalSize_1(h); } else if (size == max) { final int localPerimeter = w + h; if (localPerimeter < perimeter) {// is this the shortest perimeter so far perimeter = localPerimeter; withoutLocal.setLocalSize_0(w); withoutLocal.setLocalSize_1(h); } } } } withoutLocal.setValid((withoutLocal.getLocalSize_0() > 0) && (withoutLocal.getLocalSize_1() > 0) && (withoutLocal.getLocalSize_0() <= withoutLocal.getMaxWorkItemSize()[0]) && (withoutLocal.getLocalSize_1() <= withoutLocal.getMaxWorkItemSize()[1]) && ((withoutLocal.getLocalSize_0() * withoutLocal.getLocalSize_1()) <= withoutLocal.getMaxWorkGroupSize()) && ((withoutLocal.getGlobalSize_0() % withoutLocal.getLocalSize_0()) == 0) && ((withoutLocal.getGlobalSize_1() % withoutLocal.getLocalSize_1()) == 0)); } return (withoutLocal); } }
public class class_name { public static Range create2D(Device _device, int _globalWidth, int _globalHeight) { final Range withoutLocal = create2D(_device, _globalWidth, _globalHeight, 1, 1); if (withoutLocal.isValid()) { withoutLocal.setLocalIsDerived(true); // depends on control dependency: [if], data = [none] final int[] widthFactors = getFactors(_globalWidth, withoutLocal.getMaxWorkItemSize()[0]); final int[] heightFactors = getFactors(_globalHeight, withoutLocal.getMaxWorkItemSize()[1]); withoutLocal.setLocalSize_0(1); // depends on control dependency: [if], data = [none] withoutLocal.setLocalSize_1(1); // depends on control dependency: [if], data = [none] int max = 1; int perimeter = 0; for (final int w : widthFactors) { for (final int h : heightFactors) { final int size = w * h; if (size > withoutLocal.getMaxWorkGroupSize()) { break; } if (size > max) { max = size; // depends on control dependency: [if], data = [none] perimeter = w + h; // depends on control dependency: [if], data = [none] withoutLocal.setLocalSize_0(w); // depends on control dependency: [if], data = [none] withoutLocal.setLocalSize_1(h); // depends on control dependency: [if], data = [none] } else if (size == max) { final int localPerimeter = w + h; if (localPerimeter < perimeter) {// is this the shortest perimeter so far perimeter = localPerimeter; // depends on control dependency: [if], data = [none] withoutLocal.setLocalSize_0(w); // depends on control dependency: [if], data = [none] withoutLocal.setLocalSize_1(h); // depends on control dependency: [if], data = [none] } } } } withoutLocal.setValid((withoutLocal.getLocalSize_0() > 0) && (withoutLocal.getLocalSize_1() > 0) && (withoutLocal.getLocalSize_0() <= withoutLocal.getMaxWorkItemSize()[0]) && (withoutLocal.getLocalSize_1() <= withoutLocal.getMaxWorkItemSize()[1]) && ((withoutLocal.getLocalSize_0() * withoutLocal.getLocalSize_1()) <= withoutLocal.getMaxWorkGroupSize()) && ((withoutLocal.getGlobalSize_0() % withoutLocal.getLocalSize_0()) == 0) && ((withoutLocal.getGlobalSize_1() % withoutLocal.getLocalSize_1()) == 0)); // depends on control dependency: [if], data = [none] } return (withoutLocal); } }
public class class_name { @SuppressWarnings("unchecked") public Translator<V> getTranslatedValue(Object src, Locale loc, Translator<?> curr) { if( curr != null ) { Map<Locale,Object> map = (Map<Locale, Object>)curr.toMap(); Object ob = getValue(src); map.put(loc, ob); return new Translator(map); } else { return new Translator<V>(loc, getValue(src)); } } }
public class class_name { @SuppressWarnings("unchecked") public Translator<V> getTranslatedValue(Object src, Locale loc, Translator<?> curr) { if( curr != null ) { Map<Locale,Object> map = (Map<Locale, Object>)curr.toMap(); Object ob = getValue(src); map.put(loc, ob); // depends on control dependency: [if], data = [none] return new Translator(map); // depends on control dependency: [if], data = [none] } else { return new Translator<V>(loc, getValue(src)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static MappedStatement newCountMappedStatement(MappedStatement ms, String newMsId) { MappedStatement.Builder builder = new MappedStatement.Builder(ms.getConfiguration(), newMsId, ms.getSqlSource(), ms.getSqlCommandType()); builder.resource(ms.getResource()); builder.fetchSize(ms.getFetchSize()); builder.statementType(ms.getStatementType()); builder.keyGenerator(ms.getKeyGenerator()); if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) { StringBuilder keyProperties = new StringBuilder(); for (String keyProperty : ms.getKeyProperties()) { keyProperties.append(keyProperty).append(","); } keyProperties.delete(keyProperties.length() - 1, keyProperties.length()); builder.keyProperty(keyProperties.toString()); } builder.timeout(ms.getTimeout()); builder.parameterMap(ms.getParameterMap()); //count查询返回值int List<ResultMap> resultMaps = new ArrayList<ResultMap>(); ResultMap resultMap = new ResultMap.Builder(ms.getConfiguration(), ms.getId(), Long.class, EMPTY_RESULTMAPPING).build(); resultMaps.add(resultMap); builder.resultMaps(resultMaps); builder.resultSetType(ms.getResultSetType()); builder.cache(ms.getCache()); builder.flushCacheRequired(ms.isFlushCacheRequired()); builder.useCache(ms.isUseCache()); return builder.build(); } }
public class class_name { public static MappedStatement newCountMappedStatement(MappedStatement ms, String newMsId) { MappedStatement.Builder builder = new MappedStatement.Builder(ms.getConfiguration(), newMsId, ms.getSqlSource(), ms.getSqlCommandType()); builder.resource(ms.getResource()); builder.fetchSize(ms.getFetchSize()); builder.statementType(ms.getStatementType()); builder.keyGenerator(ms.getKeyGenerator()); if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) { StringBuilder keyProperties = new StringBuilder(); for (String keyProperty : ms.getKeyProperties()) { keyProperties.append(keyProperty).append(","); // depends on control dependency: [for], data = [keyProperty] } keyProperties.delete(keyProperties.length() - 1, keyProperties.length()); // depends on control dependency: [if], data = [none] builder.keyProperty(keyProperties.toString()); // depends on control dependency: [if], data = [none] } builder.timeout(ms.getTimeout()); builder.parameterMap(ms.getParameterMap()); //count查询返回值int List<ResultMap> resultMaps = new ArrayList<ResultMap>(); ResultMap resultMap = new ResultMap.Builder(ms.getConfiguration(), ms.getId(), Long.class, EMPTY_RESULTMAPPING).build(); resultMaps.add(resultMap); builder.resultMaps(resultMaps); builder.resultSetType(ms.getResultSetType()); builder.cache(ms.getCache()); builder.flushCacheRequired(ms.isFlushCacheRequired()); builder.useCache(ms.isUseCache()); return builder.build(); } }
public class class_name { public GetCostAndUsageResult withGroupDefinitions(GroupDefinition... groupDefinitions) { if (this.groupDefinitions == null) { setGroupDefinitions(new java.util.ArrayList<GroupDefinition>(groupDefinitions.length)); } for (GroupDefinition ele : groupDefinitions) { this.groupDefinitions.add(ele); } return this; } }
public class class_name { public GetCostAndUsageResult withGroupDefinitions(GroupDefinition... groupDefinitions) { if (this.groupDefinitions == null) { setGroupDefinitions(new java.util.ArrayList<GroupDefinition>(groupDefinitions.length)); // depends on control dependency: [if], data = [none] } for (GroupDefinition ele : groupDefinitions) { this.groupDefinitions.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public void marshall(DescribeEndpointGroupRequest describeEndpointGroupRequest, ProtocolMarshaller protocolMarshaller) { if (describeEndpointGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeEndpointGroupRequest.getEndpointGroupArn(), ENDPOINTGROUPARN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DescribeEndpointGroupRequest describeEndpointGroupRequest, ProtocolMarshaller protocolMarshaller) { if (describeEndpointGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeEndpointGroupRequest.getEndpointGroupArn(), ENDPOINTGROUPARN_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 final AntlrDatatypeRuleToken ruleOpMultiAssign() throws RecognitionException { AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); Token kw=null; enterRule(); try { // InternalSARL.g:12210:2: ( (kw= '+=' | kw= '-=' | kw= '*=' | kw= '/=' | kw= '%=' | (kw= '<' kw= '<' kw= '=' ) | (kw= '>' (kw= '>' )? kw= '>=' ) ) ) // InternalSARL.g:12211:2: (kw= '+=' | kw= '-=' | kw= '*=' | kw= '/=' | kw= '%=' | (kw= '<' kw= '<' kw= '=' ) | (kw= '>' (kw= '>' )? kw= '>=' ) ) { // InternalSARL.g:12211:2: (kw= '+=' | kw= '-=' | kw= '*=' | kw= '/=' | kw= '%=' | (kw= '<' kw= '<' kw= '=' ) | (kw= '>' (kw= '>' )? kw= '>=' ) ) int alt301=7; switch ( input.LA(1) ) { case 107: { alt301=1; } break; case 108: { alt301=2; } break; case 109: { alt301=3; } break; case 110: { alt301=4; } break; case 111: { alt301=5; } break; case 40: { alt301=6; } break; case 41: { alt301=7; } break; default: if (state.backtracking>0) {state.failed=true; return current;} NoViableAltException nvae = new NoViableAltException("", 301, 0, input); throw nvae; } switch (alt301) { case 1 : // InternalSARL.g:12212:3: kw= '+=' { kw=(Token)match(input,107,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getPlusSignEqualsSignKeyword_0()); } } break; case 2 : // InternalSARL.g:12218:3: kw= '-=' { kw=(Token)match(input,108,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getHyphenMinusEqualsSignKeyword_1()); } } break; case 3 : // InternalSARL.g:12224:3: kw= '*=' { kw=(Token)match(input,109,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getAsteriskEqualsSignKeyword_2()); } } break; case 4 : // InternalSARL.g:12230:3: kw= '/=' { kw=(Token)match(input,110,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getSolidusEqualsSignKeyword_3()); } } break; case 5 : // InternalSARL.g:12236:3: kw= '%=' { kw=(Token)match(input,111,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getPercentSignEqualsSignKeyword_4()); } } break; case 6 : // InternalSARL.g:12242:3: (kw= '<' kw= '<' kw= '=' ) { // InternalSARL.g:12242:3: (kw= '<' kw= '<' kw= '=' ) // InternalSARL.g:12243:4: kw= '<' kw= '<' kw= '=' { kw=(Token)match(input,40,FOLLOW_91); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getLessThanSignKeyword_5_0()); } kw=(Token)match(input,40,FOLLOW_83); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getLessThanSignKeyword_5_1()); } kw=(Token)match(input,47,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getEqualsSignKeyword_5_2()); } } } break; case 7 : // InternalSARL.g:12260:3: (kw= '>' (kw= '>' )? kw= '>=' ) { // InternalSARL.g:12260:3: (kw= '>' (kw= '>' )? kw= '>=' ) // InternalSARL.g:12261:4: kw= '>' (kw= '>' )? kw= '>=' { kw=(Token)match(input,41,FOLLOW_113); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getGreaterThanSignKeyword_6_0()); } // InternalSARL.g:12266:4: (kw= '>' )? int alt300=2; int LA300_0 = input.LA(1); if ( (LA300_0==41) ) { alt300=1; } switch (alt300) { case 1 : // InternalSARL.g:12267:5: kw= '>' { kw=(Token)match(input,41,FOLLOW_114); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getGreaterThanSignKeyword_6_1()); } } break; } kw=(Token)match(input,112,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getGreaterThanSignEqualsSignKeyword_6_2()); } } } break; } } if ( state.backtracking==0 ) { leaveRule(); } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { public final AntlrDatatypeRuleToken ruleOpMultiAssign() throws RecognitionException { AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); Token kw=null; enterRule(); try { // InternalSARL.g:12210:2: ( (kw= '+=' | kw= '-=' | kw= '*=' | kw= '/=' | kw= '%=' | (kw= '<' kw= '<' kw= '=' ) | (kw= '>' (kw= '>' )? kw= '>=' ) ) ) // InternalSARL.g:12211:2: (kw= '+=' | kw= '-=' | kw= '*=' | kw= '/=' | kw= '%=' | (kw= '<' kw= '<' kw= '=' ) | (kw= '>' (kw= '>' )? kw= '>=' ) ) { // InternalSARL.g:12211:2: (kw= '+=' | kw= '-=' | kw= '*=' | kw= '/=' | kw= '%=' | (kw= '<' kw= '<' kw= '=' ) | (kw= '>' (kw= '>' )? kw= '>=' ) ) int alt301=7; switch ( input.LA(1) ) { case 107: { alt301=1; } break; case 108: { alt301=2; } break; case 109: { alt301=3; } break; case 110: { alt301=4; } break; case 111: { alt301=5; } break; case 40: { alt301=6; } break; case 41: { alt301=7; } break; default: if (state.backtracking>0) {state.failed=true; return current;} // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] NoViableAltException nvae = new NoViableAltException("", 301, 0, input); throw nvae; } switch (alt301) { case 1 : // InternalSARL.g:12212:3: kw= '+=' { kw=(Token)match(input,107,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getPlusSignEqualsSignKeyword_0()); // depends on control dependency: [if], data = [none] } } break; case 2 : // InternalSARL.g:12218:3: kw= '-=' { kw=(Token)match(input,108,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getHyphenMinusEqualsSignKeyword_1()); // depends on control dependency: [if], data = [none] } } break; case 3 : // InternalSARL.g:12224:3: kw= '*=' { kw=(Token)match(input,109,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getAsteriskEqualsSignKeyword_2()); // depends on control dependency: [if], data = [none] } } break; case 4 : // InternalSARL.g:12230:3: kw= '/=' { kw=(Token)match(input,110,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getSolidusEqualsSignKeyword_3()); // depends on control dependency: [if], data = [none] } } break; case 5 : // InternalSARL.g:12236:3: kw= '%=' { kw=(Token)match(input,111,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getPercentSignEqualsSignKeyword_4()); // depends on control dependency: [if], data = [none] } } break; case 6 : // InternalSARL.g:12242:3: (kw= '<' kw= '<' kw= '=' ) { // InternalSARL.g:12242:3: (kw= '<' kw= '<' kw= '=' ) // InternalSARL.g:12243:4: kw= '<' kw= '<' kw= '=' { kw=(Token)match(input,40,FOLLOW_91); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getLessThanSignKeyword_5_0()); // depends on control dependency: [if], data = [none] } kw=(Token)match(input,40,FOLLOW_83); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getLessThanSignKeyword_5_1()); // depends on control dependency: [if], data = [none] } kw=(Token)match(input,47,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getEqualsSignKeyword_5_2()); // depends on control dependency: [if], data = [none] } } } break; case 7 : // InternalSARL.g:12260:3: (kw= '>' (kw= '>' )? kw= '>=' ) { // InternalSARL.g:12260:3: (kw= '>' (kw= '>' )? kw= '>=' ) // InternalSARL.g:12261:4: kw= '>' (kw= '>' )? kw= '>=' { kw=(Token)match(input,41,FOLLOW_113); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getGreaterThanSignKeyword_6_0()); // depends on control dependency: [if], data = [none] } // InternalSARL.g:12266:4: (kw= '>' )? int alt300=2; int LA300_0 = input.LA(1); if ( (LA300_0==41) ) { alt300=1; // depends on control dependency: [if], data = [none] } switch (alt300) { case 1 : // InternalSARL.g:12267:5: kw= '>' { kw=(Token)match(input,41,FOLLOW_114); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getGreaterThanSignKeyword_6_1()); // depends on control dependency: [if], data = [none] } } break; } kw=(Token)match(input,112,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { current.merge(kw); // depends on control dependency: [if], data = [none] newLeafNode(kw, grammarAccess.getOpMultiAssignAccess().getGreaterThanSignEqualsSignKeyword_6_2()); // depends on control dependency: [if], data = [none] } } } break; } } if ( state.backtracking==0 ) { leaveRule(); } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; } }
public class class_name { private synchronized void evaluateConditions() { // Copy the current Conditions ... Set<IWatchedCondition> copiedConditions = this.copyConditions(); // check the conditions .... for (Iterator<IWatchedCondition> iterator = copiedConditions.iterator(); iterator.hasNext(); ) { IWatchedCondition cond = iterator.next(); synchronized (cond) { // the conditions are not accessed in a synchronized way. This has to be make sure by the Implementations if (cond.isActive() && !cond.checkCondition()) { cond.conditionViolated(); } } } return; } }
public class class_name { private synchronized void evaluateConditions() { // Copy the current Conditions ... Set<IWatchedCondition> copiedConditions = this.copyConditions(); // check the conditions .... for (Iterator<IWatchedCondition> iterator = copiedConditions.iterator(); iterator.hasNext(); ) { IWatchedCondition cond = iterator.next(); synchronized (cond) { // depends on control dependency: [for], data = [none] // the conditions are not accessed in a synchronized way. This has to be make sure by the Implementations if (cond.isActive() && !cond.checkCondition()) { cond.conditionViolated(); // depends on control dependency: [if], data = [none] } } } return; } }
public class class_name { public List<MonolingualTextValue> getRemovedAliases(String language) { AliasesWithUpdate update = newAliases.get(language); if (update == null) { return Collections.<MonolingualTextValue>emptyList(); } return update.deleted; } }
public class class_name { public List<MonolingualTextValue> getRemovedAliases(String language) { AliasesWithUpdate update = newAliases.get(language); if (update == null) { return Collections.<MonolingualTextValue>emptyList(); // depends on control dependency: [if], data = [none] } return update.deleted; } }
public class class_name { public void remove(T element) { lock.writeLock().lock(); try { if (outgoingEdges.remove(element) != null) { for (Set<T> values : outgoingEdges.values()) { values.remove(element); } } if (incomingEdges.remove(element) != null) { for (Set<T> values : incomingEdges.values()) { values.remove(element); } } } finally { lock.writeLock().unlock(); } } }
public class class_name { public void remove(T element) { lock.writeLock().lock(); try { if (outgoingEdges.remove(element) != null) { for (Set<T> values : outgoingEdges.values()) { values.remove(element); // depends on control dependency: [for], data = [values] } } if (incomingEdges.remove(element) != null) { for (Set<T> values : incomingEdges.values()) { values.remove(element); // depends on control dependency: [for], data = [values] } } } finally { lock.writeLock().unlock(); } } }
public class class_name { public MethodInfo addMethod(Method method) { Modifiers modifiers = Modifiers.getInstance(method.getModifiers()).toAbstract(false); MethodInfo mi = addMethod(modifiers, method.getName(), MethodDesc.forMethod(method)); // exception stuff... Class[] exceptions = method.getExceptionTypes(); for (int i=0; i<exceptions.length; i++) { mi.addException(TypeDesc.forClass(exceptions[i])); } return mi; } }
public class class_name { public MethodInfo addMethod(Method method) { Modifiers modifiers = Modifiers.getInstance(method.getModifiers()).toAbstract(false); MethodInfo mi = addMethod(modifiers, method.getName(), MethodDesc.forMethod(method)); // exception stuff... Class[] exceptions = method.getExceptionTypes(); for (int i=0; i<exceptions.length; i++) { mi.addException(TypeDesc.forClass(exceptions[i])); // depends on control dependency: [for], data = [i] } return mi; } }
public class class_name { public final void unlockRejectedTick(TransactionCommon t, AOValue storedTick) throws MessageStoreException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "unlockRejectedTick"); try { SIMPMessage msg = consumerDispatcher.getMessageByValue(storedTick); Transaction msTran = mp.resolveAndEnlistMsgStoreTransaction(t); if(msg != null) { // Set the rme unlock count into the Messageitem so it can be taken into // account on further rollback threshold checks. (Note we take one off // because the following operation will perform an unlock itself) // 488794. boolean incrementCount = false; // TODO: THIS DOESN'T WORK - MsgStore does not support the use of 'don't increment count' // when unlocking a persistently locked message (i.e. one of these). So the count will // get incremented anyway. So if the message has been rejected because it was never consumed // (and therefore, shouldn't have the count incremented) the unlock count WILL be incremented // which could cause us to exception it. // TODO: However, this is still an improvement on the pre-V7 logic and not a regression // so we'll leave it as is unless someone complains. // TODO: I also doubt all this logic as the rmeUnlockCount is only transient, if MsgStore // chooses to un-cache this message we'll lose the extra count info. Although I guess it does // solve the case when the RME has rolled it back enough to reach the max failure limit, so I // guess we leave it as is. if(storedTick.rmeUnlockCount > 0) { incrementCount = true; msg.setRMEUnlockCount(storedTick.rmeUnlockCount - 1); } if (msg.getLockID()==storedTick.getPLockId()) msg.unlockMsg(storedTick.getPLockId(), msTran, incrementCount); } storedTick.lockItemIfAvailable(controlItemLockID); // should always be successful storedTick.remove(msTran, controlItemLockID); } catch (MessageStoreException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "unlockRejectedTick", e); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "unlockRejectedTick"); } }
public class class_name { public final void unlockRejectedTick(TransactionCommon t, AOValue storedTick) throws MessageStoreException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "unlockRejectedTick"); try { SIMPMessage msg = consumerDispatcher.getMessageByValue(storedTick); Transaction msTran = mp.resolveAndEnlistMsgStoreTransaction(t); if(msg != null) { // Set the rme unlock count into the Messageitem so it can be taken into // account on further rollback threshold checks. (Note we take one off // because the following operation will perform an unlock itself) // 488794. boolean incrementCount = false; // TODO: THIS DOESN'T WORK - MsgStore does not support the use of 'don't increment count' // when unlocking a persistently locked message (i.e. one of these). So the count will // get incremented anyway. So if the message has been rejected because it was never consumed // (and therefore, shouldn't have the count incremented) the unlock count WILL be incremented // which could cause us to exception it. // TODO: However, this is still an improvement on the pre-V7 logic and not a regression // so we'll leave it as is unless someone complains. // TODO: I also doubt all this logic as the rmeUnlockCount is only transient, if MsgStore // chooses to un-cache this message we'll lose the extra count info. Although I guess it does // solve the case when the RME has rolled it back enough to reach the max failure limit, so I // guess we leave it as is. if(storedTick.rmeUnlockCount > 0) { incrementCount = true; // depends on control dependency: [if], data = [none] msg.setRMEUnlockCount(storedTick.rmeUnlockCount - 1); // depends on control dependency: [if], data = [(storedTick.rmeUnlockCount] } if (msg.getLockID()==storedTick.getPLockId()) msg.unlockMsg(storedTick.getPLockId(), msTran, incrementCount); } storedTick.lockItemIfAvailable(controlItemLockID); // should always be successful storedTick.remove(msTran, controlItemLockID); } catch (MessageStoreException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "unlockRejectedTick", e); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "unlockRejectedTick"); } }
public class class_name { public RetentionStrategy getRetentionStrategyCopy() { if (retentionStrategy instanceof DockerOnceRetentionStrategy) { DockerOnceRetentionStrategy onceRetention = (DockerOnceRetentionStrategy) retentionStrategy; return new DockerOnceRetentionStrategy(onceRetention.getIdleMinutes()); } return retentionStrategy; } }
public class class_name { public RetentionStrategy getRetentionStrategyCopy() { if (retentionStrategy instanceof DockerOnceRetentionStrategy) { DockerOnceRetentionStrategy onceRetention = (DockerOnceRetentionStrategy) retentionStrategy; return new DockerOnceRetentionStrategy(onceRetention.getIdleMinutes()); // depends on control dependency: [if], data = [none] } return retentionStrategy; } }
public class class_name { public Kafka properties(Properties properties) { Preconditions.checkNotNull(properties); if (this.kafkaProperties == null) { this.kafkaProperties = new HashMap<>(); } this.kafkaProperties.clear(); properties.forEach((k, v) -> this.kafkaProperties.put((String) k, (String) v)); return this; } }
public class class_name { public Kafka properties(Properties properties) { Preconditions.checkNotNull(properties); if (this.kafkaProperties == null) { this.kafkaProperties = new HashMap<>(); // depends on control dependency: [if], data = [none] } this.kafkaProperties.clear(); properties.forEach((k, v) -> this.kafkaProperties.put((String) k, (String) v)); return this; } }
public class class_name { public boolean contains(Jid jid) { if (jid == null) { return false; } synchronized (entries) { for (Iterator<EntityBareJid> i = entries.iterator(); i.hasNext();) { EntityBareJid entry = i.next(); if (entry.equals(jid)) { return true; } } } return false; } }
public class class_name { public boolean contains(Jid jid) { if (jid == null) { return false; // depends on control dependency: [if], data = [none] } synchronized (entries) { for (Iterator<EntityBareJid> i = entries.iterator(); i.hasNext();) { EntityBareJid entry = i.next(); if (entry.equals(jid)) { return true; // depends on control dependency: [if], data = [none] } } } return false; } }
public class class_name { public static String datasetStats(Map<String, List<double[]>> data, String name) { int globalMinLength = Integer.MAX_VALUE; int globalMaxLength = Integer.MIN_VALUE; double globalMinValue = Double.MAX_VALUE; double globalMaxValue = Double.MIN_VALUE; for (Entry<String, List<double[]>> e : data.entrySet()) { for (double[] dataEntry : e.getValue()) { globalMaxLength = (dataEntry.length > globalMaxLength) ? dataEntry.length : globalMaxLength; globalMinLength = (dataEntry.length < globalMinLength) ? dataEntry.length : globalMinLength; for (double value : dataEntry) { globalMaxValue = (value > globalMaxValue) ? value : globalMaxValue; globalMinValue = (value < globalMinValue) ? value : globalMinValue; } } } StringBuffer sb = new StringBuffer(); sb.append(name).append("classes: ").append(data.size()); sb.append(", series length min: ").append(globalMinLength); sb.append(", max: ").append(globalMaxLength); sb.append(", min value: ").append(globalMinValue); sb.append(", max value: ").append(globalMaxValue).append(";"); for (Entry<String, List<double[]>> e : data.entrySet()) { sb.append(name).append(" class: ").append(e.getKey()); sb.append(" series: ").append(e.getValue().size()).append(";"); } return sb.delete(sb.length() - 1, sb.length()).toString(); } }
public class class_name { public static String datasetStats(Map<String, List<double[]>> data, String name) { int globalMinLength = Integer.MAX_VALUE; int globalMaxLength = Integer.MIN_VALUE; double globalMinValue = Double.MAX_VALUE; double globalMaxValue = Double.MIN_VALUE; for (Entry<String, List<double[]>> e : data.entrySet()) { for (double[] dataEntry : e.getValue()) { globalMaxLength = (dataEntry.length > globalMaxLength) ? dataEntry.length : globalMaxLength; // depends on control dependency: [for], data = [dataEntry] globalMinLength = (dataEntry.length < globalMinLength) ? dataEntry.length : globalMinLength; // depends on control dependency: [for], data = [dataEntry] for (double value : dataEntry) { globalMaxValue = (value > globalMaxValue) ? value : globalMaxValue; // depends on control dependency: [for], data = [value] globalMinValue = (value < globalMinValue) ? value : globalMinValue; // depends on control dependency: [for], data = [value] } } } StringBuffer sb = new StringBuffer(); sb.append(name).append("classes: ").append(data.size()); sb.append(", series length min: ").append(globalMinLength); sb.append(", max: ").append(globalMaxLength); sb.append(", min value: ").append(globalMinValue); sb.append(", max value: ").append(globalMaxValue).append(";"); for (Entry<String, List<double[]>> e : data.entrySet()) { sb.append(name).append(" class: ").append(e.getKey()); sb.append(" series: ").append(e.getValue().size()).append(";"); } return sb.delete(sb.length() - 1, sb.length()).toString(); } }
public class class_name { @Override public T create(CreationalContext<T> creationalContext) { T instance = getProducer().produce(creationalContext); getProducer().inject(instance, creationalContext); if (!hasPostConstructCallback || beanManager.isContextActive(RequestScoped.class)) { getProducer().postConstruct(instance); } else { /* * CDI-219 * The request scope is active during @PostConstruct callback of any bean. */ RequestContext context = getUnboundRequestContext(); try { context.activate(); beanManager.fireRequestContextInitialized(getId()); getProducer().postConstruct(instance); } finally { beanManager.fireRequestContextBeforeDestroyed(getId()); context.invalidate(); context.deactivate(); beanManager.fireRequestContextDestroyed(getId()); } } return instance; } }
public class class_name { @Override public T create(CreationalContext<T> creationalContext) { T instance = getProducer().produce(creationalContext); getProducer().inject(instance, creationalContext); if (!hasPostConstructCallback || beanManager.isContextActive(RequestScoped.class)) { getProducer().postConstruct(instance); // depends on control dependency: [if], data = [none] } else { /* * CDI-219 * The request scope is active during @PostConstruct callback of any bean. */ RequestContext context = getUnboundRequestContext(); try { context.activate(); // depends on control dependency: [try], data = [none] beanManager.fireRequestContextInitialized(getId()); // depends on control dependency: [try], data = [none] getProducer().postConstruct(instance); // depends on control dependency: [try], data = [none] } finally { beanManager.fireRequestContextBeforeDestroyed(getId()); context.invalidate(); context.deactivate(); beanManager.fireRequestContextDestroyed(getId()); } } return instance; } }
public class class_name { public void marshall(Workteam workteam, ProtocolMarshaller protocolMarshaller) { if (workteam == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(workteam.getWorkteamName(), WORKTEAMNAME_BINDING); protocolMarshaller.marshall(workteam.getMemberDefinitions(), MEMBERDEFINITIONS_BINDING); protocolMarshaller.marshall(workteam.getWorkteamArn(), WORKTEAMARN_BINDING); protocolMarshaller.marshall(workteam.getProductListingIds(), PRODUCTLISTINGIDS_BINDING); protocolMarshaller.marshall(workteam.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(workteam.getSubDomain(), SUBDOMAIN_BINDING); protocolMarshaller.marshall(workteam.getCreateDate(), CREATEDATE_BINDING); protocolMarshaller.marshall(workteam.getLastUpdatedDate(), LASTUPDATEDDATE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(Workteam workteam, ProtocolMarshaller protocolMarshaller) { if (workteam == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(workteam.getWorkteamName(), WORKTEAMNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(workteam.getMemberDefinitions(), MEMBERDEFINITIONS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(workteam.getWorkteamArn(), WORKTEAMARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(workteam.getProductListingIds(), PRODUCTLISTINGIDS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(workteam.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(workteam.getSubDomain(), SUBDOMAIN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(workteam.getCreateDate(), CREATEDATE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(workteam.getLastUpdatedDate(), LASTUPDATEDDATE_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 Observable<ServiceResponse<WorkerPoolResourceInner>> getWorkerPoolWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } if (workerPoolName == null) { throw new IllegalArgumentException("Parameter workerPoolName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.getWorkerPool(resourceGroupName, name, workerPoolName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<WorkerPoolResourceInner>>>() { @Override public Observable<ServiceResponse<WorkerPoolResourceInner>> call(Response<ResponseBody> response) { try { ServiceResponse<WorkerPoolResourceInner> clientResponse = getWorkerPoolDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<WorkerPoolResourceInner>> getWorkerPoolWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } if (workerPoolName == null) { throw new IllegalArgumentException("Parameter workerPoolName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.getWorkerPool(resourceGroupName, name, workerPoolName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<WorkerPoolResourceInner>>>() { @Override public Observable<ServiceResponse<WorkerPoolResourceInner>> call(Response<ResponseBody> response) { try { ServiceResponse<WorkerPoolResourceInner> clientResponse = getWorkerPoolDelegate(response); return Observable.just(clientResponse); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { public static Centroid make(Relation<? extends NumberVector> relation, DBIDs ids) { final int dim = RelationUtil.dimensionality(relation); Centroid c = new Centroid(dim); double[] elems = c.elements; int count = 0; for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { NumberVector v = relation.get(iter); for(int i = 0; i < dim; i++) { elems[i] += v.doubleValue(i); } count += 1; } if(count == 0) { return c; } for(int i = 0; i < dim; i++) { elems[i] /= count; } c.wsum = count; return c; } }
public class class_name { public static Centroid make(Relation<? extends NumberVector> relation, DBIDs ids) { final int dim = RelationUtil.dimensionality(relation); Centroid c = new Centroid(dim); double[] elems = c.elements; int count = 0; for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { NumberVector v = relation.get(iter); for(int i = 0; i < dim; i++) { elems[i] += v.doubleValue(i); // depends on control dependency: [for], data = [i] } count += 1; // depends on control dependency: [for], data = [none] } if(count == 0) { return c; // depends on control dependency: [if], data = [none] } for(int i = 0; i < dim; i++) { elems[i] /= count; // depends on control dependency: [for], data = [i] } c.wsum = count; return c; } }
public class class_name { private void convert(int set[], UnicodeSet uset) { uset.clear(); if (!initNameSetsLengths()) { return; } // build a char string with all chars that are used in character names for (char c = 255; c > 0; c --) { if (contains(set, c)) { uset.add(c); } } } }
public class class_name { private void convert(int set[], UnicodeSet uset) { uset.clear(); if (!initNameSetsLengths()) { return; // depends on control dependency: [if], data = [none] } // build a char string with all chars that are used in character names for (char c = 255; c > 0; c --) { if (contains(set, c)) { uset.add(c); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void marshall(RemoveTagsFromOnPremisesInstancesRequest removeTagsFromOnPremisesInstancesRequest, ProtocolMarshaller protocolMarshaller) { if (removeTagsFromOnPremisesInstancesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(removeTagsFromOnPremisesInstancesRequest.getTags(), TAGS_BINDING); protocolMarshaller.marshall(removeTagsFromOnPremisesInstancesRequest.getInstanceNames(), INSTANCENAMES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(RemoveTagsFromOnPremisesInstancesRequest removeTagsFromOnPremisesInstancesRequest, ProtocolMarshaller protocolMarshaller) { if (removeTagsFromOnPremisesInstancesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(removeTagsFromOnPremisesInstancesRequest.getTags(), TAGS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(removeTagsFromOnPremisesInstancesRequest.getInstanceNames(), INSTANCENAMES_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 void register(final Class<?> model) { final ODatabaseObject db = dbProvider.get(); // auto create schema for new classes ((OObjectDatabaseTx) db).setAutomaticSchemaGeneration(true); // processing lower hierarchy types first try { for (Class<?> type : Lists.reverse(SchemeUtils.resolveHierarchy(model))) { processType(db, type); } } catch (Throwable th) { throw new SchemeInitializationException("Failed to register model class " + model.getName(), th); } } }
public class class_name { public void register(final Class<?> model) { final ODatabaseObject db = dbProvider.get(); // auto create schema for new classes ((OObjectDatabaseTx) db).setAutomaticSchemaGeneration(true); // processing lower hierarchy types first try { for (Class<?> type : Lists.reverse(SchemeUtils.resolveHierarchy(model))) { processType(db, type); // depends on control dependency: [for], data = [type] } } catch (Throwable th) { throw new SchemeInitializationException("Failed to register model class " + model.getName(), th); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void browserButtonActionPerformed(java.awt.event.ActionEvent evt) { try { Desktop.getDesktop().browse(new URL(localhostURL).toURI()); } catch (IOException e) { System.err.println("IO Exception: " + e.getMessage()); } catch (URISyntaxException e) { System.err.println("URISyntaxException: " + e.getMessage()); } } }
public class class_name { private void browserButtonActionPerformed(java.awt.event.ActionEvent evt) { try { Desktop.getDesktop().browse(new URL(localhostURL).toURI()); // depends on control dependency: [try], data = [none] } catch (IOException e) { System.err.println("IO Exception: " + e.getMessage()); } catch (URISyntaxException e) { // depends on control dependency: [catch], data = [none] System.err.println("URISyntaxException: " + e.getMessage()); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public Set<D> getMatchedDeclaration() { Set<D> bindedSet = new HashSet<D>(); for (Map.Entry<ServiceReference<D>, Boolean> e : declarations.entrySet()) { if (e.getValue()) { bindedSet.add(getDeclaration(e.getKey())); } } return bindedSet; } }
public class class_name { public Set<D> getMatchedDeclaration() { Set<D> bindedSet = new HashSet<D>(); for (Map.Entry<ServiceReference<D>, Boolean> e : declarations.entrySet()) { if (e.getValue()) { bindedSet.add(getDeclaration(e.getKey())); // depends on control dependency: [if], data = [none] } } return bindedSet; } }
public class class_name { public void addNodesInDocOrder(NodeList nodelist, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); int nChildren = nodelist.getLength(); for (int i = 0; i < nChildren; i++) { Node node = nodelist.item(i); if (null != node) { addNodeInDocOrder(node, support); } } } }
public class class_name { public void addNodesInDocOrder(NodeList nodelist, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); int nChildren = nodelist.getLength(); for (int i = 0; i < nChildren; i++) { Node node = nodelist.item(i); if (null != node) { addNodeInDocOrder(node, support); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private static void init(List<File> list, File dir, Filter filter) { File[] files = dir.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { init(list, files[i], filter); } else { if (filter == null || filter.accepts(files[i].getAbsolutePath())) { list.add(files[i]); } } } } }
public class class_name { private static void init(List<File> list, File dir, Filter filter) { File[] files = dir.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { init(list, files[i], filter); // depends on control dependency: [if], data = [none] } else { if (filter == null || filter.accepts(files[i].getAbsolutePath())) { list.add(files[i]); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public static String replaceAll(String str, final String searchToken, final String replacement) { if (str == null) { return str; } str = str.replace(searchToken, replacement); return str; } }
public class class_name { public static String replaceAll(String str, final String searchToken, final String replacement) { if (str == null) { return str; // depends on control dependency: [if], data = [none] } str = str.replace(searchToken, replacement); return str; } }
public class class_name { protected final void firePropertyChange(PropertyChangeEvent event) { PropertyChangeSupport aChangeSupport = this.changeSupport; if (aChangeSupport == null) { return; } aChangeSupport.firePropertyChange(event); } }
public class class_name { protected final void firePropertyChange(PropertyChangeEvent event) { PropertyChangeSupport aChangeSupport = this.changeSupport; if (aChangeSupport == null) { return; // depends on control dependency: [if], data = [none] } aChangeSupport.firePropertyChange(event); } }
public class class_name { public static File getCurrentVersion(File storeDirectory) { File latestDir = getLatestDir(storeDirectory); if(latestDir != null) return latestDir; File[] versionDirs = getVersionDirs(storeDirectory); if(versionDirs == null || versionDirs.length == 0) { return null; } else { return findKthVersionedDir(versionDirs, versionDirs.length - 1, versionDirs.length - 1)[0]; } } }
public class class_name { public static File getCurrentVersion(File storeDirectory) { File latestDir = getLatestDir(storeDirectory); if(latestDir != null) return latestDir; File[] versionDirs = getVersionDirs(storeDirectory); if(versionDirs == null || versionDirs.length == 0) { return null; // depends on control dependency: [if], data = [none] } else { return findKthVersionedDir(versionDirs, versionDirs.length - 1, versionDirs.length - 1)[0]; // depends on control dependency: [if], data = [(versionDirs] } } }
public class class_name { private void collectGarbage() { // dispose unused objects if any NativePointerPhantomReference toCollect; while((toCollect = (NativePointerPhantomReference)collectableObjects.poll()) != null) { liveComObjects.remove(toCollect); toCollect.clear(); toCollect.releaseNative(); } } }
public class class_name { private void collectGarbage() { // dispose unused objects if any NativePointerPhantomReference toCollect; while((toCollect = (NativePointerPhantomReference)collectableObjects.poll()) != null) { liveComObjects.remove(toCollect); // depends on control dependency: [while], data = [none] toCollect.clear(); // depends on control dependency: [while], data = [none] toCollect.releaseNative(); // depends on control dependency: [while], data = [none] } } }
public class class_name { private static List<MavenCoordinates> findCompileDependenciesFromManifest(ZipFile zipFile, ZipEntry zipEntry) throws MavenRepoGeneratorException { List<MavenCoordinates> result = new ArrayList<MavenCoordinates>(); InputStream inputStream = null; try { inputStream = zipFile.getInputStream(zipEntry); Manifest manifest = new Manifest(inputStream); Attributes mainAttributes = manifest.getMainAttributes(); String subsystemContent = mainAttributes.getValue(Constants.SUBSYSTEM_CONTENT); List<String> lines = ManifestProcessor.split(subsystemContent, ","); for (String line : lines) { if (line.contains(Constants.SUBSYSTEM_MAVEN_COORDINATES)){ List<String> components = ManifestProcessor.split(line, ";"); String requiredFeature = components.get(0); String mavenCoordinates = null; for (String component : components) { if (component.startsWith(Constants.SUBSYSTEM_MAVEN_COORDINATES)) { mavenCoordinates = component.substring(Constants.SUBSYSTEM_MAVEN_COORDINATES.length() + 1, component.length()); if (mavenCoordinates.startsWith("\"") && mavenCoordinates.endsWith("\"")) { mavenCoordinates = mavenCoordinates.substring(1, mavenCoordinates.length() - 1); } break; } } if (mavenCoordinates != null) { try { result.add(new MavenCoordinates(mavenCoordinates)); System.out.println("Found compile dependency for subsystem content " + requiredFeature + ": " + mavenCoordinates); } catch (IllegalArgumentException e) { throw new MavenRepoGeneratorException( "Invalid Maven coordinates defined in subsystem content " + requiredFeature + " in the manifest for ESA file " + zipFile.getName(), e); } } else { throw new MavenRepoGeneratorException( "For ESA " + zipFile.getName() + ", found " + Constants.SUBSYSTEM_MAVEN_COORDINATES + " key in manifest but failed to parse it from the string: " + line); } } } } catch (IOException e) { throw new MavenRepoGeneratorException("Could not read manifest file " + zipEntry.getName() + " from ESA file " + zipFile.getName(), e); } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } return result; } }
public class class_name { private static List<MavenCoordinates> findCompileDependenciesFromManifest(ZipFile zipFile, ZipEntry zipEntry) throws MavenRepoGeneratorException { List<MavenCoordinates> result = new ArrayList<MavenCoordinates>(); InputStream inputStream = null; try { inputStream = zipFile.getInputStream(zipEntry); Manifest manifest = new Manifest(inputStream); Attributes mainAttributes = manifest.getMainAttributes(); String subsystemContent = mainAttributes.getValue(Constants.SUBSYSTEM_CONTENT); List<String> lines = ManifestProcessor.split(subsystemContent, ","); for (String line : lines) { if (line.contains(Constants.SUBSYSTEM_MAVEN_COORDINATES)){ List<String> components = ManifestProcessor.split(line, ";"); String requiredFeature = components.get(0); String mavenCoordinates = null; for (String component : components) { if (component.startsWith(Constants.SUBSYSTEM_MAVEN_COORDINATES)) { mavenCoordinates = component.substring(Constants.SUBSYSTEM_MAVEN_COORDINATES.length() + 1, component.length()); // depends on control dependency: [if], data = [none] if (mavenCoordinates.startsWith("\"") && mavenCoordinates.endsWith("\"")) { mavenCoordinates = mavenCoordinates.substring(1, mavenCoordinates.length() - 1); // depends on control dependency: [if], data = [none] } break; } } if (mavenCoordinates != null) { try { result.add(new MavenCoordinates(mavenCoordinates)); // depends on control dependency: [try], data = [none] System.out.println("Found compile dependency for subsystem content " + requiredFeature + ": " + mavenCoordinates); // depends on control dependency: [try], data = [none] } catch (IllegalArgumentException e) { throw new MavenRepoGeneratorException( "Invalid Maven coordinates defined in subsystem content " + requiredFeature + " in the manifest for ESA file " + zipFile.getName(), e); } // depends on control dependency: [catch], data = [none] } else { throw new MavenRepoGeneratorException( "For ESA " + zipFile.getName() + ", found " + Constants.SUBSYSTEM_MAVEN_COORDINATES + " key in manifest but failed to parse it from the string: " + line); } } } } catch (IOException e) { throw new MavenRepoGeneratorException("Could not read manifest file " + zipEntry.getName() + " from ESA file " + zipFile.getName(), e); } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } return result; } }
public class class_name { private static int compareTo(Deque<String> first, Deque<String> second) { if (0 == first.size() && 0 == second.size()) { return 0; } if (0 == first.size()) { return 1; } if (0 == second.size()) { return -1; } int headsComparation = (Integer.valueOf(first.remove())).compareTo(Integer.parseInt(second.remove())); if (0 == headsComparation) { return compareTo(first, second); } else { return headsComparation; } } }
public class class_name { private static int compareTo(Deque<String> first, Deque<String> second) { if (0 == first.size() && 0 == second.size()) { return 0; // depends on control dependency: [if], data = [none] } if (0 == first.size()) { return 1; // depends on control dependency: [if], data = [none] } if (0 == second.size()) { return -1; // depends on control dependency: [if], data = [none] } int headsComparation = (Integer.valueOf(first.remove())).compareTo(Integer.parseInt(second.remove())); if (0 == headsComparation) { return compareTo(first, second); // depends on control dependency: [if], data = [none] } else { return headsComparation; // depends on control dependency: [if], data = [none] } } }
public class class_name { private static Optional<Class<?>> loadEnum(final String className) { try { Class<?> type = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); if (type.isEnum()) { return Optional.of(type); } } catch (ClassNotFoundException e) { LOG.error(e.getMessage(), e); } return Optional.empty(); } }
public class class_name { private static Optional<Class<?>> loadEnum(final String className) { try { Class<?> type = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); if (type.isEnum()) { return Optional.of(type); // depends on control dependency: [if], data = [none] } } catch (ClassNotFoundException e) { LOG.error(e.getMessage(), e); } // depends on control dependency: [catch], data = [none] return Optional.empty(); } }
public class class_name { protected Date getExpirationDate(HttpServletRequest request, XHttpServletResponse response) { String contentType = response.getContentType(); // lookup exact content-type match (e.g. // "text/html; charset=iso-8859-1") ExpiresConfiguration configuration = expiresConfigurationByContentType.get(contentType); String matchingContentType = contentType; if (configuration == null && contains(contentType, ";")) { // lookup content-type without charset match (e.g. "text/html") String contentTypeWithoutCharset = substringBefore(contentType, ";").trim(); configuration = expiresConfigurationByContentType.get(contentTypeWithoutCharset); matchingContentType = contentTypeWithoutCharset; } if (configuration == null && contains(contentType, "/")) { // lookup content-type without charset match (e.g. "text/html") String majorType = substringBefore(contentType, "/"); configuration = expiresConfigurationByContentType.get(majorType); matchingContentType = majorType; } if (configuration == null) { configuration = defaultExpiresConfiguration; matchingContentType = "#DEFAULT#"; } if (configuration == null) { logger.trace("No Expires configuration found for content-type {}", contentType); return null; } if (logger.isTraceEnabled()) { logger.trace("Use {} matching '{}' for content-type '{}'", new Object[] { configuration, matchingContentType, contentType }); } Calendar calendar; switch (configuration.getStartingPoint()) { case ACCESS_TIME: calendar = GregorianCalendar.getInstance(); break; case LAST_MODIFICATION_TIME: if (response.isLastModifiedHeaderSet()) { long lastModified = response.getLastModifiedHeader(); calendar = GregorianCalendar.getInstance(); calendar.setTimeInMillis(lastModified); } else { // Last-Modified header not found, use now calendar = GregorianCalendar.getInstance(); } break; default: throw new IllegalStateException("Unsupported startingPoint '" + configuration.getStartingPoint() + "'"); } for (Duration duration : configuration.getDurations()) { calendar.add(duration.getUnit().getCalendarField(), duration.getAmount()); } return calendar.getTime(); } }
public class class_name { protected Date getExpirationDate(HttpServletRequest request, XHttpServletResponse response) { String contentType = response.getContentType(); // lookup exact content-type match (e.g. // "text/html; charset=iso-8859-1") ExpiresConfiguration configuration = expiresConfigurationByContentType.get(contentType); String matchingContentType = contentType; if (configuration == null && contains(contentType, ";")) { // lookup content-type without charset match (e.g. "text/html") String contentTypeWithoutCharset = substringBefore(contentType, ";").trim(); configuration = expiresConfigurationByContentType.get(contentTypeWithoutCharset); // depends on control dependency: [if], data = [none] matchingContentType = contentTypeWithoutCharset; // depends on control dependency: [if], data = [none] } if (configuration == null && contains(contentType, "/")) { // lookup content-type without charset match (e.g. "text/html") String majorType = substringBefore(contentType, "/"); configuration = expiresConfigurationByContentType.get(majorType); // depends on control dependency: [if], data = [none] matchingContentType = majorType; // depends on control dependency: [if], data = [none] } if (configuration == null) { configuration = defaultExpiresConfiguration; // depends on control dependency: [if], data = [none] matchingContentType = "#DEFAULT#"; // depends on control dependency: [if], data = [none] } if (configuration == null) { logger.trace("No Expires configuration found for content-type {}", contentType); // depends on control dependency: [if], data = [none] return null; // depends on control dependency: [if], data = [none] } if (logger.isTraceEnabled()) { logger.trace("Use {} matching '{}' for content-type '{}'", new Object[] { configuration, matchingContentType, contentType }); // depends on control dependency: [if], data = [none] } Calendar calendar; switch (configuration.getStartingPoint()) { case ACCESS_TIME: calendar = GregorianCalendar.getInstance(); break; case LAST_MODIFICATION_TIME: if (response.isLastModifiedHeaderSet()) { long lastModified = response.getLastModifiedHeader(); calendar = GregorianCalendar.getInstance(); // depends on control dependency: [if], data = [none] calendar.setTimeInMillis(lastModified); // depends on control dependency: [if], data = [none] } else { // Last-Modified header not found, use now calendar = GregorianCalendar.getInstance(); // depends on control dependency: [if], data = [none] } break; default: throw new IllegalStateException("Unsupported startingPoint '" + configuration.getStartingPoint() + "'"); } for (Duration duration : configuration.getDurations()) { calendar.add(duration.getUnit().getCalendarField(), duration.getAmount()); } return calendar.getTime(); } }
public class class_name { @Override public double getCopyProcessingRate(long currentTime) { @SuppressWarnings("deprecation") long bytesCopied = super.getCounters().findCounter (Task.Counter.REDUCE_SHUFFLE_BYTES).getCounter(); long timeSpentCopying = 0; long startTime = getStartTime(); if(getPhase() == Phase.SHUFFLE) { if (currentTime <= startTime) { LOG.error("current time is " + currentTime + ", which is <= start " + "time " + startTime + " in " + this.getTaskID()); } timeSpentCopying = currentTime - startTime; } else { //shuffle phase is done long shuffleFinishTime = getShuffleFinishTime(); if (shuffleFinishTime <= startTime) { LOG.error("Shuffle finish time is " + shuffleFinishTime + ", which is <= start time " + startTime + " in " + this.getTaskID()); return 0; } timeSpentCopying = shuffleFinishTime - startTime; } copyProcessingRate = bytesCopied/timeSpentCopying; return copyProcessingRate; } }
public class class_name { @Override public double getCopyProcessingRate(long currentTime) { @SuppressWarnings("deprecation") long bytesCopied = super.getCounters().findCounter (Task.Counter.REDUCE_SHUFFLE_BYTES).getCounter(); long timeSpentCopying = 0; long startTime = getStartTime(); if(getPhase() == Phase.SHUFFLE) { if (currentTime <= startTime) { LOG.error("current time is " + currentTime + ", which is <= start " + "time " + startTime + " in " + this.getTaskID()); // depends on control dependency: [if], data = [none] } timeSpentCopying = currentTime - startTime; // depends on control dependency: [if], data = [none] } else { //shuffle phase is done long shuffleFinishTime = getShuffleFinishTime(); if (shuffleFinishTime <= startTime) { LOG.error("Shuffle finish time is " + shuffleFinishTime + ", which is <= start time " + startTime + " in " + this.getTaskID()); // depends on control dependency: [if], data = [none] return 0; // depends on control dependency: [if], data = [none] } timeSpentCopying = shuffleFinishTime - startTime; // depends on control dependency: [if], data = [none] } copyProcessingRate = bytesCopied/timeSpentCopying; return copyProcessingRate; } }
public class class_name { public Object nextElemNoEx() { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // If the current bucket has been exhausted, try to find // another non-empty bucket. if (ivElementIndex >= ivBucketSize) { if (!findNextBucket()) { // No more non-empty buckets, no more elements return null; } } // Return the next element from the current bucket. // Note that we do not have to worry about concurrent // access to the bucket, as this is actually a copy // of the bucket, and not the actual bucket in // the Cache being enumerated. if (isTraceOn && tc.isDebugEnabled()) ivElementsReturned++; return ivBucket[ivElementIndex++]; } }
public class class_name { public Object nextElemNoEx() { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // If the current bucket has been exhausted, try to find // another non-empty bucket. if (ivElementIndex >= ivBucketSize) { if (!findNextBucket()) { // No more non-empty buckets, no more elements return null; // depends on control dependency: [if], data = [none] } } // Return the next element from the current bucket. // Note that we do not have to worry about concurrent // access to the bucket, as this is actually a copy // of the bucket, and not the actual bucket in // the Cache being enumerated. if (isTraceOn && tc.isDebugEnabled()) ivElementsReturned++; return ivBucket[ivElementIndex++]; } }
public class class_name { public List<Role> findAllRoles() { List<Role> list = new ArrayList<>(); List<String> roleStrings; try { roleStrings = readLines(rolesFile); } catch (IOException e) { throw new FileBasedRuntimeException(e); } for (String roleString : roleStrings) { if (StringUtils.isNotBlank(roleString)) { String[] substrings = StringUtils.splitByWholeSeparator(roleString, Configuration.get().getAssociationSeparator()); if (substrings.length < 1 || StringUtils.isBlank(substrings[0])) { continue; } Role role = new Role(substrings[0]); if (substrings.length > 1) { role.setRoles(Arrays.asList(StringUtils.splitByWholeSeparator(substrings[1], Configuration.get() .getValueSeparator()))); } list.add(role); } } return list; } }
public class class_name { public List<Role> findAllRoles() { List<Role> list = new ArrayList<>(); List<String> roleStrings; try { roleStrings = readLines(rolesFile); // depends on control dependency: [try], data = [none] } catch (IOException e) { throw new FileBasedRuntimeException(e); } // depends on control dependency: [catch], data = [none] for (String roleString : roleStrings) { if (StringUtils.isNotBlank(roleString)) { String[] substrings = StringUtils.splitByWholeSeparator(roleString, Configuration.get().getAssociationSeparator()); if (substrings.length < 1 || StringUtils.isBlank(substrings[0])) { continue; } Role role = new Role(substrings[0]); if (substrings.length > 1) { role.setRoles(Arrays.asList(StringUtils.splitByWholeSeparator(substrings[1], Configuration.get() .getValueSeparator()))); // depends on control dependency: [if], data = [none] } list.add(role); // depends on control dependency: [if], data = [none] } } return list; } }
public class class_name { @SuppressWarnings("deprecation") public void onDestroy() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { mRemoteControlClientCompat.setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED); mAudioManager.unregisterMediaButtonEventReceiver(mMediaButtonReceiverComponent); mLocalBroadcastManager.unregisterReceiver(mLockScreenReceiver); } mMediaSession.release(); } }
public class class_name { @SuppressWarnings("deprecation") public void onDestroy() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { mRemoteControlClientCompat.setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED); // depends on control dependency: [if], data = [none] mAudioManager.unregisterMediaButtonEventReceiver(mMediaButtonReceiverComponent); // depends on control dependency: [if], data = [none] mLocalBroadcastManager.unregisterReceiver(mLockScreenReceiver); // depends on control dependency: [if], data = [none] } mMediaSession.release(); } }
public class class_name { @SuppressWarnings("unchecked") public double getRank(final T value) { if (isEmpty()) { return Double.NaN; } long total = 0; int weight = 1; for (int i = 0; i < baseBufferCount_; i++) { if (comparator_.compare((T) combinedBuffer_[i], value) < 0) { total += weight; } } long bitPattern = bitPattern_; for (int lvl = 0; bitPattern != 0L; lvl++, bitPattern >>>= 1) { weight *= 2; if ((bitPattern & 1L) > 0) { // level is not empty final int offset = (2 + lvl) * k_; for (int i = 0; i < k_; i++) { if (comparator_.compare((T) combinedBuffer_[i + offset], value) < 0) { total += weight; } else { break; // levels are sorted, no point comparing further } } } } return (double) total / n_; } }
public class class_name { @SuppressWarnings("unchecked") public double getRank(final T value) { if (isEmpty()) { return Double.NaN; } // depends on control dependency: [if], data = [none] long total = 0; int weight = 1; for (int i = 0; i < baseBufferCount_; i++) { if (comparator_.compare((T) combinedBuffer_[i], value) < 0) { total += weight; // depends on control dependency: [if], data = [none] } } long bitPattern = bitPattern_; for (int lvl = 0; bitPattern != 0L; lvl++, bitPattern >>>= 1) { weight *= 2; // depends on control dependency: [for], data = [none] if ((bitPattern & 1L) > 0) { // level is not empty final int offset = (2 + lvl) * k_; for (int i = 0; i < k_; i++) { if (comparator_.compare((T) combinedBuffer_[i + offset], value) < 0) { total += weight; // depends on control dependency: [if], data = [none] } else { break; // levels are sorted, no point comparing further } } } } return (double) total / n_; } }
public class class_name { protected void enterClause(Clause clause) { if (clause instanceof WAMCompiledQuery) { WAMOptimizeableListing query = (WAMCompiledQuery) clause; for (WAMInstruction instruction : query.getUnoptimizedInstructions()) { addLineToRow(instruction.toString()); nextRow(); } } } }
public class class_name { protected void enterClause(Clause clause) { if (clause instanceof WAMCompiledQuery) { WAMOptimizeableListing query = (WAMCompiledQuery) clause; for (WAMInstruction instruction : query.getUnoptimizedInstructions()) { addLineToRow(instruction.toString()); // depends on control dependency: [for], data = [instruction] nextRow(); // depends on control dependency: [for], data = [none] } } } }
public class class_name { public static byte[] readEntityBytes(InputStream in) { byte[] jsonEntity = null; try { if (in != null && in.available() > 0) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[1024]; int length; while ((length = in.read(buf)) > 0) { baos.write(buf, 0, length); } jsonEntity = baos.toByteArray(); } else { jsonEntity = new byte[0]; } } catch (IOException ex) { logger.error(null, ex); } finally { try { if (in != null) { in.close(); } } catch (IOException ex) { logger.error(null, ex); } } return jsonEntity; } }
public class class_name { public static byte[] readEntityBytes(InputStream in) { byte[] jsonEntity = null; try { if (in != null && in.available() > 0) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[1024]; int length; while ((length = in.read(buf)) > 0) { baos.write(buf, 0, length); // depends on control dependency: [while], data = [none] } jsonEntity = baos.toByteArray(); // depends on control dependency: [if], data = [none] } else { jsonEntity = new byte[0]; // depends on control dependency: [if], data = [none] } } catch (IOException ex) { logger.error(null, ex); } finally { // depends on control dependency: [catch], data = [none] try { if (in != null) { in.close(); // depends on control dependency: [if], data = [none] } } catch (IOException ex) { logger.error(null, ex); } // depends on control dependency: [catch], data = [none] } return jsonEntity; } }
public class class_name { public static boolean getSetPortUsedBySupervisor(String instanceName, String supervisorHost, int port, RegistryOperations registryOperations) { String appPath = RegistryUtils.serviceclassPath( JOYConstants.APP_NAME, JOYConstants.APP_TYPE); String path = RegistryUtils.servicePath( JOYConstants.APP_NAME, JOYConstants.APP_TYPE, instanceName); String hostPath = RegistryUtils.componentPath( JOYConstants.APP_NAME, JOYConstants.APP_TYPE, instanceName, supervisorHost); try { List<String> instanceNames = registryOperations.list(appPath); for (String instance : instanceNames) { String servicePath = RegistryUtils.servicePath( JOYConstants.APP_NAME, JOYConstants.APP_TYPE, instance); Map<String, ServiceRecord> hosts = RegistryUtils.listServiceRecords(registryOperations, servicePath); for (String host : hosts.keySet()) { ServiceRecord sr = hosts.get(JOYConstants.HOST); String[] portList = sr.get(JOYConstants.PORT_LIST).split(JOYConstants.COMMA); for (String usedport : portList) { if (Integer.parseInt(usedport) == port) return true; } } } if (registryOperations.exists(path)) { ServiceRecord sr = registryOperations.resolve(path); String[] portList = sr.get(JOYConstants.PORT_LIST).split(JOYConstants.COMMA); String portListUpdate = join(portList, JOYConstants.COMMA, true) + String.valueOf(port); sr.set(JOYConstants.PORT_LIST, portListUpdate); registryOperations.bind(path, sr, BindFlags.OVERWRITE); return false; } else { registryOperations.mknode(path, true); ServiceRecord sr = new ServiceRecord(); String portListUpdate = String.valueOf(port); sr.set(JOYConstants.PORT_LIST, portListUpdate); registryOperations.bind(path, sr, BindFlags.OVERWRITE); return false; } } catch (Exception ex) { return true; } } }
public class class_name { public static boolean getSetPortUsedBySupervisor(String instanceName, String supervisorHost, int port, RegistryOperations registryOperations) { String appPath = RegistryUtils.serviceclassPath( JOYConstants.APP_NAME, JOYConstants.APP_TYPE); String path = RegistryUtils.servicePath( JOYConstants.APP_NAME, JOYConstants.APP_TYPE, instanceName); String hostPath = RegistryUtils.componentPath( JOYConstants.APP_NAME, JOYConstants.APP_TYPE, instanceName, supervisorHost); try { List<String> instanceNames = registryOperations.list(appPath); for (String instance : instanceNames) { String servicePath = RegistryUtils.servicePath( JOYConstants.APP_NAME, JOYConstants.APP_TYPE, instance); Map<String, ServiceRecord> hosts = RegistryUtils.listServiceRecords(registryOperations, servicePath); for (String host : hosts.keySet()) { ServiceRecord sr = hosts.get(JOYConstants.HOST); String[] portList = sr.get(JOYConstants.PORT_LIST).split(JOYConstants.COMMA); for (String usedport : portList) { if (Integer.parseInt(usedport) == port) return true; } } } if (registryOperations.exists(path)) { ServiceRecord sr = registryOperations.resolve(path); String[] portList = sr.get(JOYConstants.PORT_LIST).split(JOYConstants.COMMA); String portListUpdate = join(portList, JOYConstants.COMMA, true) + String.valueOf(port); sr.set(JOYConstants.PORT_LIST, portListUpdate); // depends on control dependency: [if], data = [none] registryOperations.bind(path, sr, BindFlags.OVERWRITE); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } else { registryOperations.mknode(path, true); // depends on control dependency: [if], data = [none] ServiceRecord sr = new ServiceRecord(); String portListUpdate = String.valueOf(port); sr.set(JOYConstants.PORT_LIST, portListUpdate); // depends on control dependency: [if], data = [none] registryOperations.bind(path, sr, BindFlags.OVERWRITE); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } } catch (Exception ex) { return true; } // depends on control dependency: [catch], data = [none] } }
public class class_name { private String getUrlPrefix( HttpServletRequest req ) { StringBuilder url = new StringBuilder(); String scheme = req.getScheme(); int port = req.getServerPort(); url.append( scheme ); // http, https url.append( "://" ); url.append( req.getServerName() ); if ( ( scheme.equals( "http" ) && port != 80 ) || ( scheme.equals( "https" ) && port != 443 ) ) { url.append( ':' ); url.append( req.getServerPort() ); } return url.toString(); } }
public class class_name { private String getUrlPrefix( HttpServletRequest req ) { StringBuilder url = new StringBuilder(); String scheme = req.getScheme(); int port = req.getServerPort(); url.append( scheme ); // http, https url.append( "://" ); url.append( req.getServerName() ); if ( ( scheme.equals( "http" ) && port != 80 ) || ( scheme.equals( "https" ) && port != 443 ) ) { url.append( ':' ); // depends on control dependency: [if], data = [none] url.append( req.getServerPort() ); // depends on control dependency: [if], data = [none] } return url.toString(); } }
public class class_name { private List<TypePattern> getPatternsFrom(String value) { if (value == null) { return Collections.emptyList(); } List<TypePattern> typePatterns = new ArrayList<TypePattern>(); StringTokenizer st = new StringTokenizer(value, ","); while (st.hasMoreElements()) { String typepattern = st.nextToken(); TypePattern typePattern = null; if (typepattern.endsWith("..*")) { typePattern = new PrefixTypePattern(typepattern); if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.INFO)) { log.info("registered package prefix '" + typepattern + "'"); } } else if (typepattern.equals("*")) { typePattern = new AnyTypePattern(); } else { typePattern = new ExactTypePattern(typepattern); } typePatterns.add(typePattern); } return typePatterns; } }
public class class_name { private List<TypePattern> getPatternsFrom(String value) { if (value == null) { return Collections.emptyList(); // depends on control dependency: [if], data = [none] } List<TypePattern> typePatterns = new ArrayList<TypePattern>(); StringTokenizer st = new StringTokenizer(value, ","); while (st.hasMoreElements()) { String typepattern = st.nextToken(); TypePattern typePattern = null; if (typepattern.endsWith("..*")) { typePattern = new PrefixTypePattern(typepattern); // depends on control dependency: [if], data = [none] if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.INFO)) { log.info("registered package prefix '" + typepattern + "'"); // depends on control dependency: [if], data = [none] } } else if (typepattern.equals("*")) { typePattern = new AnyTypePattern(); // depends on control dependency: [if], data = [none] } else { typePattern = new ExactTypePattern(typepattern); // depends on control dependency: [if], data = [none] } typePatterns.add(typePattern); // depends on control dependency: [while], data = [none] } return typePatterns; } }
public class class_name { private void updateActionStatus(final Message message) { final DmfActionUpdateStatus actionUpdateStatus = convertMessage(message, DmfActionUpdateStatus.class); final Action action = checkActionExist(message, actionUpdateStatus); final List<String> messages = actionUpdateStatus.getMessage(); if (isCorrelationIdNotEmpty(message)) { messages.add(RepositoryConstants.SERVER_MESSAGE_PREFIX + "DMF message correlation-id " + message.getMessageProperties().getCorrelationId()); } final Status status = mapStatus(message, actionUpdateStatus, action); final ActionStatusCreate actionStatus = entityFactory.actionStatus().create(action.getId()).status(status) .messages(messages); final Action addUpdateActionStatus = getUpdateActionStatus(status, actionStatus); if (!addUpdateActionStatus.isActive() || (addUpdateActionStatus.hasMaintenanceSchedule() && addUpdateActionStatus.isMaintenanceWindowAvailable())) { lookIfUpdateAvailable(action.getTarget()); } } }
public class class_name { private void updateActionStatus(final Message message) { final DmfActionUpdateStatus actionUpdateStatus = convertMessage(message, DmfActionUpdateStatus.class); final Action action = checkActionExist(message, actionUpdateStatus); final List<String> messages = actionUpdateStatus.getMessage(); if (isCorrelationIdNotEmpty(message)) { messages.add(RepositoryConstants.SERVER_MESSAGE_PREFIX + "DMF message correlation-id " + message.getMessageProperties().getCorrelationId()); // depends on control dependency: [if], data = [none] } final Status status = mapStatus(message, actionUpdateStatus, action); final ActionStatusCreate actionStatus = entityFactory.actionStatus().create(action.getId()).status(status) .messages(messages); final Action addUpdateActionStatus = getUpdateActionStatus(status, actionStatus); if (!addUpdateActionStatus.isActive() || (addUpdateActionStatus.hasMaintenanceSchedule() && addUpdateActionStatus.isMaintenanceWindowAvailable())) { lookIfUpdateAvailable(action.getTarget()); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public double[] getVotesForInstance(Instance inst) { // Prepare the results array double[] votes = new double[getNumberOfClasses()]; // Over all classes for (int classIndex = 0; classIndex < votes.length; classIndex++) { // Get the prior for this class votes[classIndex] = Math.log(getPrior(classIndex)); // Iterate over the instance attributes for (int index = 0; index < inst.numAttributes(); index++) { int attributeID = inst.index(index); // Skip class attribute if (attributeID == inst.classIndex()) continue; Double value = inst.value(attributeID); // Get the observer for the given attribute GaussianNumericAttributeClassObserver obs = attributeObservers.get(attributeID); // Init the estimator to null by default GaussianEstimator estimator = null; if (obs != null && obs.getEstimator(classIndex) != null) { // Get the estimator estimator = obs.getEstimator(classIndex); } double valueNonZero; // The null case should be handled by smoothing! if (estimator != null) { // Get the score for a NON-ZERO attribute value valueNonZero = estimator.probabilityDensity(value); } // We don't have an estimator else { // Assign a very small probability that we do see this value valueNonZero = ADDITIVE_SMOOTHING_FACTOR; } votes[classIndex] += Math.log(valueNonZero); // - Math.log(valueZero); } // Check for null in the case of prequential evaluation if (this.classPrototypes.get(classIndex) != null) { // Add the prototype for the class, already in log space votes[classIndex] += Math.log(this.classPrototypes.get(classIndex)); } } return votes; } }
public class class_name { @Override public double[] getVotesForInstance(Instance inst) { // Prepare the results array double[] votes = new double[getNumberOfClasses()]; // Over all classes for (int classIndex = 0; classIndex < votes.length; classIndex++) { // Get the prior for this class votes[classIndex] = Math.log(getPrior(classIndex)); // depends on control dependency: [for], data = [classIndex] // Iterate over the instance attributes for (int index = 0; index < inst.numAttributes(); index++) { int attributeID = inst.index(index); // Skip class attribute if (attributeID == inst.classIndex()) continue; Double value = inst.value(attributeID); // Get the observer for the given attribute GaussianNumericAttributeClassObserver obs = attributeObservers.get(attributeID); // Init the estimator to null by default GaussianEstimator estimator = null; if (obs != null && obs.getEstimator(classIndex) != null) { // Get the estimator estimator = obs.getEstimator(classIndex); // depends on control dependency: [if], data = [none] } double valueNonZero; // The null case should be handled by smoothing! if (estimator != null) { // Get the score for a NON-ZERO attribute value valueNonZero = estimator.probabilityDensity(value); // depends on control dependency: [if], data = [none] } // We don't have an estimator else { // Assign a very small probability that we do see this value valueNonZero = ADDITIVE_SMOOTHING_FACTOR; // depends on control dependency: [if], data = [none] } votes[classIndex] += Math.log(valueNonZero); // - Math.log(valueZero); // depends on control dependency: [for], data = [none] } // Check for null in the case of prequential evaluation if (this.classPrototypes.get(classIndex) != null) { // Add the prototype for the class, already in log space votes[classIndex] += Math.log(this.classPrototypes.get(classIndex)); // depends on control dependency: [if], data = [(this.classPrototypes.get(classIndex)] } } return votes; } }
public class class_name { public static AmazonS3Client getS3Client(Map conf) { AWSCredentialsProvider provider = new DefaultAWSCredentialsProviderChain(); AWSCredentials credentials = provider.getCredentials(); ClientConfiguration config = new ClientConfiguration(); AmazonS3Client client = new AmazonS3Client(credentials, config); String regionName = ConfUtils.getString(conf, REGION); if (StringUtils.isNotBlank(regionName)) { client.setRegion(RegionUtils.getRegion(regionName)); } String endpoint = ConfUtils.getString(conf, ENDPOINT); if (StringUtils.isNotBlank(endpoint)) { client.setEndpoint(endpoint); } return client; } }
public class class_name { public static AmazonS3Client getS3Client(Map conf) { AWSCredentialsProvider provider = new DefaultAWSCredentialsProviderChain(); AWSCredentials credentials = provider.getCredentials(); ClientConfiguration config = new ClientConfiguration(); AmazonS3Client client = new AmazonS3Client(credentials, config); String regionName = ConfUtils.getString(conf, REGION); if (StringUtils.isNotBlank(regionName)) { client.setRegion(RegionUtils.getRegion(regionName)); // depends on control dependency: [if], data = [none] } String endpoint = ConfUtils.getString(conf, ENDPOINT); if (StringUtils.isNotBlank(endpoint)) { client.setEndpoint(endpoint); // depends on control dependency: [if], data = [none] } return client; } }
public class class_name { private boolean buildHeader(HeaderFields headerFields, WsByteBuffer xmitBuffer) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "buildHeader", new Object[] {headerFields, xmitBuffer}); if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, xmitBuffer, "xmitBuffer"); boolean headerFinished = false; WsByteBuffer headerBuffer = null; if (headerScratchSpace.position() == 0) { if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, headerScratchSpace, "headerScratchSpace"); // No data in the scratch space buffer - so we must decide if we can // build this header in place. if (xmitBuffer.remaining() >= headerFields.sizeof()) { // Enough space in the transmission buffer to build the header in // place. headerBuffer = xmitBuffer; headerFields.writeToBuffer(xmitBuffer); headerFinished = true; } else { // Insufficient room in the transmission buffer to build the header // in place. headerBuffer = headerScratchSpace; headerFields.writeToBuffer(headerScratchSpace); headerScratchSpace.flip(); } // build header into buffer. } else { // We have already built a header into the scratch space and are // in the process of copying it into the transmission buffer. headerBuffer = headerScratchSpace; } if (!headerFinished) { // We have not finished on this header yet. Try copying it into // the transmission buffer. int headerLeftToCopy = headerBuffer.remaining(); int amountCopied = JFapUtils.copyWsByteBuffer(headerBuffer, xmitBuffer, headerLeftToCopy); headerFinished = amountCopied == headerLeftToCopy; } // If we finished the header - clean out anything we might have put // into the scratch space. if (headerFinished) { headerScratchSpace.clear(); transmissionRemaining -= headerFields.sizeof(); } else exhausedXmitBuffer = true; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "buildHeader", ""+headerFinished); return headerFinished; } }
public class class_name { private boolean buildHeader(HeaderFields headerFields, WsByteBuffer xmitBuffer) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "buildHeader", new Object[] {headerFields, xmitBuffer}); if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, xmitBuffer, "xmitBuffer"); boolean headerFinished = false; WsByteBuffer headerBuffer = null; if (headerScratchSpace.position() == 0) { if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, headerScratchSpace, "headerScratchSpace"); // No data in the scratch space buffer - so we must decide if we can // build this header in place. if (xmitBuffer.remaining() >= headerFields.sizeof()) { // Enough space in the transmission buffer to build the header in // place. headerBuffer = xmitBuffer; // depends on control dependency: [if], data = [none] headerFields.writeToBuffer(xmitBuffer); // depends on control dependency: [if], data = [none] headerFinished = true; // depends on control dependency: [if], data = [none] } else { // Insufficient room in the transmission buffer to build the header // in place. headerBuffer = headerScratchSpace; // depends on control dependency: [if], data = [none] headerFields.writeToBuffer(headerScratchSpace); // depends on control dependency: [if], data = [none] headerScratchSpace.flip(); // depends on control dependency: [if], data = [none] } // build header into buffer. } else { // We have already built a header into the scratch space and are // in the process of copying it into the transmission buffer. headerBuffer = headerScratchSpace; // depends on control dependency: [if], data = [none] } if (!headerFinished) { // We have not finished on this header yet. Try copying it into // the transmission buffer. int headerLeftToCopy = headerBuffer.remaining(); int amountCopied = JFapUtils.copyWsByteBuffer(headerBuffer, xmitBuffer, headerLeftToCopy); headerFinished = amountCopied == headerLeftToCopy; // depends on control dependency: [if], data = [none] } // If we finished the header - clean out anything we might have put // into the scratch space. if (headerFinished) { headerScratchSpace.clear(); // depends on control dependency: [if], data = [none] transmissionRemaining -= headerFields.sizeof(); // depends on control dependency: [if], data = [none] } else exhausedXmitBuffer = true; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "buildHeader", ""+headerFinished); return headerFinished; } }
public class class_name { public boolean containsFunction(String ns, String name) { for (int i = 0; i < this.libraries.length; i++) { if (this.libraries[i].containsFunction(ns, name)) { return true; } } return false; } }
public class class_name { public boolean containsFunction(String ns, String name) { for (int i = 0; i < this.libraries.length; i++) { if (this.libraries[i].containsFunction(ns, name)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { void sendAccessibilityEvent(View view) { // Since the view is still not attached we create, populate, // and send the event directly since we do not know when it // will be attached and posting commands is not as clean. AccessibilityManager accessibilityManager = (AccessibilityManager)getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); if (accessibilityManager == null) return; if (mSendClickAccessibilityEvent && accessibilityManager.isEnabled()) { AccessibilityEvent event = AccessibilityEvent.obtain(); event.setEventType(AccessibilityEvent.TYPE_VIEW_CLICKED); view.onInitializeAccessibilityEvent(event); view.dispatchPopulateAccessibilityEvent(event); accessibilityManager.sendAccessibilityEvent(event); } mSendClickAccessibilityEvent = false; } }
public class class_name { void sendAccessibilityEvent(View view) { // Since the view is still not attached we create, populate, // and send the event directly since we do not know when it // will be attached and posting commands is not as clean. AccessibilityManager accessibilityManager = (AccessibilityManager)getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); if (accessibilityManager == null) return; if (mSendClickAccessibilityEvent && accessibilityManager.isEnabled()) { AccessibilityEvent event = AccessibilityEvent.obtain(); event.setEventType(AccessibilityEvent.TYPE_VIEW_CLICKED); // depends on control dependency: [if], data = [none] view.onInitializeAccessibilityEvent(event); // depends on control dependency: [if], data = [none] view.dispatchPopulateAccessibilityEvent(event); // depends on control dependency: [if], data = [none] accessibilityManager.sendAccessibilityEvent(event); // depends on control dependency: [if], data = [none] } mSendClickAccessibilityEvent = false; } }
public class class_name { private static String findJavaVersionString(MavenProject project) { while (project != null) { String target = project.getProperties().getProperty("maven.compiler.target"); if (target != null) { return target; } for (org.apache.maven.model.Plugin plugin : CompoundList.of(project.getBuildPlugins(), project.getPluginManagement().getPlugins())) { if ("maven-compiler-plugin".equals(plugin.getArtifactId())) { if (plugin.getConfiguration() instanceof Xpp3Dom) { Xpp3Dom node = ((Xpp3Dom) plugin.getConfiguration()).getChild("target"); if (node != null) { return node.getValue(); } } } } project = project.getParent(); } return null; } }
public class class_name { private static String findJavaVersionString(MavenProject project) { while (project != null) { String target = project.getProperties().getProperty("maven.compiler.target"); if (target != null) { return target; // depends on control dependency: [if], data = [none] } for (org.apache.maven.model.Plugin plugin : CompoundList.of(project.getBuildPlugins(), project.getPluginManagement().getPlugins())) { if ("maven-compiler-plugin".equals(plugin.getArtifactId())) { if (plugin.getConfiguration() instanceof Xpp3Dom) { Xpp3Dom node = ((Xpp3Dom) plugin.getConfiguration()).getChild("target"); if (node != null) { return node.getValue(); // depends on control dependency: [if], data = [none] } } } } project = project.getParent(); // depends on control dependency: [while], data = [none] } return null; } }
public class class_name { private Link verify(Link link) { Assert.notNull(link, "Link must not be null!"); try { String uri = link.expand().getHref(); this.log.debug("Verifying link pointing to {}…", uri); this.restOperations.headForHeaders(uri); this.log.debug("Successfully verified link!"); return link; } catch (RestClientException o_O) { this.log.debug("Verification failed, marking as outdated!"); return null; } } }
public class class_name { private Link verify(Link link) { Assert.notNull(link, "Link must not be null!"); try { String uri = link.expand().getHref(); this.log.debug("Verifying link pointing to {}…", uri); // depends on control dependency: [try], data = [none] this.restOperations.headForHeaders(uri); // depends on control dependency: [try], data = [none] this.log.debug("Successfully verified link!"); // depends on control dependency: [try], data = [none] return link; // depends on control dependency: [try], data = [none] } catch (RestClientException o_O) { this.log.debug("Verification failed, marking as outdated!"); return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public JmxMetricReporter init(ConfigurationProperties configurationProperties, MetricRegistry metricRegistry) { if (configurationProperties.isJmxEnabled()) { jmxReporter = JmxReporter .forRegistry(metricRegistry) .inDomain(MetricRegistry.name(getClass(), configurationProperties.getUniqueName())) .build(); } if(configurationProperties.isJmxAutoStart()) { start(); } return this; } }
public class class_name { @Override public JmxMetricReporter init(ConfigurationProperties configurationProperties, MetricRegistry metricRegistry) { if (configurationProperties.isJmxEnabled()) { jmxReporter = JmxReporter .forRegistry(metricRegistry) .inDomain(MetricRegistry.name(getClass(), configurationProperties.getUniqueName())) .build(); // depends on control dependency: [if], data = [none] } if(configurationProperties.isJmxAutoStart()) { start(); // depends on control dependency: [if], data = [none] } return this; } }
public class class_name { public static <T> List<T> toposort(final Set<T> inputSet, T root, final Deps<T> deps, boolean isFullCut) { // Check that inputs set is a valid set of leaves for the given output module. checkAreDescendentsOf(inputSet, root, deps); if (isFullCut) { checkIsFullCut(inputSet, root, deps); } Deps<T> cutoffDeps = getCutoffDeps(inputSet, deps); return Toposort.toposort(root, cutoffDeps); } }
public class class_name { public static <T> List<T> toposort(final Set<T> inputSet, T root, final Deps<T> deps, boolean isFullCut) { // Check that inputs set is a valid set of leaves for the given output module. checkAreDescendentsOf(inputSet, root, deps); if (isFullCut) { checkIsFullCut(inputSet, root, deps); // depends on control dependency: [if], data = [none] } Deps<T> cutoffDeps = getCutoffDeps(inputSet, deps); return Toposort.toposort(root, cutoffDeps); } }
public class class_name { boolean compareAndSetLeaf(Page oldPage, Page page) { if (oldPage == page) { return true; } int pid = (int) page.getId(); updateTailPid(pid); if (oldPage instanceof PageLeafImpl && page instanceof PageLeafImpl) { PageLeafImpl oldLeaf = (PageLeafImpl) oldPage; PageLeafImpl newLeaf = (PageLeafImpl) page; if (BlockTree.compareKey(oldLeaf.getMaxKey(), newLeaf.getMaxKey(), 0) < 0) { System.err.println(" DERP: " + oldPage + " " + page); Thread.dumpStack(); /* throw new IllegalStateException("DERP: old=" + oldPage + " " + page + " old-dirt:" + oldPage.isDirty()); */ } } boolean result = _pages.compareAndSet(pid, oldPage, page); return result; } }
public class class_name { boolean compareAndSetLeaf(Page oldPage, Page page) { if (oldPage == page) { return true; // depends on control dependency: [if], data = [none] } int pid = (int) page.getId(); updateTailPid(pid); if (oldPage instanceof PageLeafImpl && page instanceof PageLeafImpl) { PageLeafImpl oldLeaf = (PageLeafImpl) oldPage; PageLeafImpl newLeaf = (PageLeafImpl) page; if (BlockTree.compareKey(oldLeaf.getMaxKey(), newLeaf.getMaxKey(), 0) < 0) { System.err.println(" DERP: " + oldPage + " " + page); // depends on control dependency: [if], data = [none] Thread.dumpStack(); // depends on control dependency: [if], data = [none] /* throw new IllegalStateException("DERP: old=" + oldPage + " " + page + " old-dirt:" + oldPage.isDirty()); */ } } boolean result = _pages.compareAndSet(pid, oldPage, page); return result; } }
public class class_name { private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) { if (builder.hasDocumentation(type)) { htmlTree.addContent(getMarkerAnchor(ANCHORS[type])); } } }
public class class_name { private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) { if (builder.hasDocumentation(type)) { htmlTree.addContent(getMarkerAnchor(ANCHORS[type])); // depends on control dependency: [if], data = [none] } } }
public class class_name { public SIMPTopicSpaceControllable getTopicSpace() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getTopicSpace"); //need to check that we don't hav it already if (_topicspace == null) { _topicspace = new Topicspace(_messageProcessor, _destinationHandler); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getTopicSpace", _topicspace); return _topicspace; } }
public class class_name { public SIMPTopicSpaceControllable getTopicSpace() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getTopicSpace"); //need to check that we don't hav it already if (_topicspace == null) { _topicspace = new Topicspace(_messageProcessor, _destinationHandler); // depends on control dependency: [if], data = [none] } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getTopicSpace", _topicspace); return _topicspace; } }