code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { static Matcher removeMatchAnyFollowedByStart(Matcher matcher) { if (matcher instanceof ZeroOrMoreMatcher) { ZeroOrMoreMatcher zm = matcher.as(); if (zm.repeated() instanceof AnyMatcher && zm.next() instanceof SeqMatcher && zm.next().<SeqMatcher>as().matchers().get(0).isStartAnchored()) { return zm.next(); } } return matcher; } }
public class class_name { static Matcher removeMatchAnyFollowedByStart(Matcher matcher) { if (matcher instanceof ZeroOrMoreMatcher) { ZeroOrMoreMatcher zm = matcher.as(); if (zm.repeated() instanceof AnyMatcher && zm.next() instanceof SeqMatcher && zm.next().<SeqMatcher>as().matchers().get(0).isStartAnchored()) { return zm.next(); // depends on control dependency: [if], data = [none] } } return matcher; } }
public class class_name { public void notifyBeforeEvaluation(String expr) { if (getEvaluationListeners() == null) return; for (EvaluationListener listener: getEvaluationListeners()) { listener.beforeEvaluation(this, expr); } } }
public class class_name { public void notifyBeforeEvaluation(String expr) { if (getEvaluationListeners() == null) return; for (EvaluationListener listener: getEvaluationListeners()) { listener.beforeEvaluation(this, expr); // depends on control dependency: [for], data = [listener] } } }
public class class_name { protected String getSigningKey() { if (extendedMetadata != null && extendedMetadata.getSigningKey() != null) { return extendedMetadata.getSigningKey(); } else { return keyManager.getDefaultCredentialName(); } } }
public class class_name { protected String getSigningKey() { if (extendedMetadata != null && extendedMetadata.getSigningKey() != null) { return extendedMetadata.getSigningKey(); // depends on control dependency: [if], data = [none] } else { return keyManager.getDefaultCredentialName(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void CalcPath() { treepath = new int[size][]; for(int i=0;i<size;i++){ TIntArrayList list= new TIntArrayList (); list.add(i); Integer j=i; while((j=edgesInv.get(j))!=null){ list.add(j); } int s = list.size(); treepath[i] = new int[s]; for(int k=0;k<s;k++){ treepath[i][s-k-1] = list.get(k); } } } }
public class class_name { public void CalcPath() { treepath = new int[size][]; for(int i=0;i<size;i++){ TIntArrayList list= new TIntArrayList (); list.add(i); // depends on control dependency: [for], data = [i] Integer j=i; while((j=edgesInv.get(j))!=null){ list.add(j); // depends on control dependency: [while], data = [none] } int s = list.size(); treepath[i] = new int[s]; // depends on control dependency: [for], data = [i] for(int k=0;k<s;k++){ treepath[i][s-k-1] = list.get(k); // depends on control dependency: [for], data = [k] } } } }
public class class_name { public I run(GeneratorConsumerWithException<I> consumer) { try { consumer.accept(getThis()); } catch (Exception e) { sneakyThrow(e); } return getThis(); } }
public class class_name { public I run(GeneratorConsumerWithException<I> consumer) { try { consumer.accept(getThis()); // depends on control dependency: [try], data = [none] } catch (Exception e) { sneakyThrow(e); } // depends on control dependency: [catch], data = [none] return getThis(); } }
public class class_name { public static String getTrustyUriString(IRI baseUri, String artifactCode, String suffix) { String s = expandBaseUri(baseUri) + artifactCode; if (suffix != null) { suffix = suffix.replace("#", "%23"); if (suffix.startsWith(bnodeChar + "")) { // Duplicate bnode character for escaping: s += "" + getPostAcChar(baseUri) + bnodeChar + suffix; } else { s += "" + getPostAcChar(baseUri) + suffix; } } return s; } }
public class class_name { public static String getTrustyUriString(IRI baseUri, String artifactCode, String suffix) { String s = expandBaseUri(baseUri) + artifactCode; if (suffix != null) { suffix = suffix.replace("#", "%23"); // depends on control dependency: [if], data = [none] if (suffix.startsWith(bnodeChar + "")) { // Duplicate bnode character for escaping: s += "" + getPostAcChar(baseUri) + bnodeChar + suffix; // depends on control dependency: [if], data = [none] } else { s += "" + getPostAcChar(baseUri) + suffix; // depends on control dependency: [if], data = [none] } } return s; } }
public class class_name { public static Document getDocument(InputStream inputStream) { Document result = null; try { // memory optimization over minor performance sacrifice synchronized (XmlRepositoryFactory.class) { if (documentBuilder == null) { documentBuilder = builderFactory.newDocumentBuilder(); } result = documentBuilder.parse(inputStream); } } catch (ParserConfigurationException ex) { throw new MjdbcRuntimeException(ex); } catch (SAXException ex) { throw new MjdbcRuntimeException(ex); } catch (IOException ex) { throw new MjdbcRuntimeException(ex); } return result; } }
public class class_name { public static Document getDocument(InputStream inputStream) { Document result = null; try { // memory optimization over minor performance sacrifice synchronized (XmlRepositoryFactory.class) { // depends on control dependency: [try], data = [none] if (documentBuilder == null) { documentBuilder = builderFactory.newDocumentBuilder(); // depends on control dependency: [if], data = [none] } result = documentBuilder.parse(inputStream); } } catch (ParserConfigurationException ex) { throw new MjdbcRuntimeException(ex); } catch (SAXException ex) { // depends on control dependency: [catch], data = [none] throw new MjdbcRuntimeException(ex); } catch (IOException ex) { // depends on control dependency: [catch], data = [none] throw new MjdbcRuntimeException(ex); } // depends on control dependency: [catch], data = [none] return result; } }
public class class_name { @Override public void ack() { waitClientRunning(); if (!running) { return; } if (kafkaConsumer != null) { kafkaConsumer.commitSync(); } if (kafkaConsumer2 != null) { kafkaConsumer2.commitSync(); } } }
public class class_name { @Override public void ack() { waitClientRunning(); if (!running) { return; // depends on control dependency: [if], data = [none] } if (kafkaConsumer != null) { kafkaConsumer.commitSync(); // depends on control dependency: [if], data = [none] } if (kafkaConsumer2 != null) { kafkaConsumer2.commitSync(); // depends on control dependency: [if], data = [none] } } }
public class class_name { private void freezeEntities(final boolean frozen) { for (final AutoBean<?> bean : this.state.editedProxies.values()) { bean.setFrozen(frozen); } } }
public class class_name { private void freezeEntities(final boolean frozen) { for (final AutoBean<?> bean : this.state.editedProxies.values()) { bean.setFrozen(frozen); // depends on control dependency: [for], data = [bean] } } }
public class class_name { public static float[] dashFromString( String dashPattern ) { if (dashPattern.trim().length() > 0) { String[] split = dashPattern.split(","); if (split.length > 1) { float[] dash = new float[split.length]; for( int i = 0; i < split.length; i++ ) { try { float tmpDash = Float.parseFloat(split[i].trim()); dash[i] = tmpDash; } catch (NumberFormatException e) { // GPLog.error("Style", "Can't convert to dash pattern: " + dashPattern, e); return null; } } return dash; } } return null; } }
public class class_name { public static float[] dashFromString( String dashPattern ) { if (dashPattern.trim().length() > 0) { String[] split = dashPattern.split(","); if (split.length > 1) { float[] dash = new float[split.length]; for( int i = 0; i < split.length; i++ ) { try { float tmpDash = Float.parseFloat(split[i].trim()); dash[i] = tmpDash; // depends on control dependency: [try], data = [none] } catch (NumberFormatException e) { // GPLog.error("Style", "Can't convert to dash pattern: " + dashPattern, e); return null; } // depends on control dependency: [catch], data = [none] } return dash; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public static JSONObject merge(JSONObject src, JSONObject dest, String name, final boolean overwrite) { Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: src: %s, dest: %s", name, src, dest); final Iterator<String> keys = src.keys(); while (keys.hasNext()) { final String key = keys.next(); final Object value = src.opt(key); if (!dest.has(key)) { Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: no field '%s' in dest; putting %s", name, key, value); safePut(dest, key, value); } else if (value instanceof JSONObject) { Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: object value for '%s', submerging %s", name, key, value); mergeSubObject(dest, key, (JSONObject) value, name, overwrite); } else if (value instanceof JSONArray) { Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: array value for '%s', submerging %s", name, key, value); mergeSubArray(dest, key, (JSONArray) value, name, overwrite); } else if (overwrite) { safePut(dest, key, value); } } Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: result: %s", name, dest); return dest; } }
public class class_name { public static JSONObject merge(JSONObject src, JSONObject dest, String name, final boolean overwrite) { Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: src: %s, dest: %s", name, src, dest); final Iterator<String> keys = src.keys(); while (keys.hasNext()) { final String key = keys.next(); final Object value = src.opt(key); if (!dest.has(key)) { Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: no field '%s' in dest; putting %s", name, key, value); safePut(dest, key, value); } else if (value instanceof JSONObject) { Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: object value for '%s', submerging %s", name, key, value); mergeSubObject(dest, key, (JSONObject) value, name, overwrite); } else if (value instanceof JSONArray) { Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: array value for '%s', submerging %s", name, key, value); // depends on control dependency: [if], data = [none] mergeSubArray(dest, key, (JSONArray) value, name, overwrite); // depends on control dependency: [if], data = [none] } else if (overwrite) { safePut(dest, key, value); // depends on control dependency: [if], data = [none] } } Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: result: %s", name, dest); return dest; } }
public class class_name { @Override protected void onSessionClose() { // Rollback updates try { if (hasPendingUpdates()) rollbackUpdates(true,true, null); } catch (JMSException e) { ErrorTools.log(e, log); } super.onSessionClose(); } }
public class class_name { @Override protected void onSessionClose() { // Rollback updates try { if (hasPendingUpdates()) rollbackUpdates(true,true, null); } catch (JMSException e) { ErrorTools.log(e, log); } // depends on control dependency: [catch], data = [none] super.onSessionClose(); } }
public class class_name { public void setProperty(String propertyId, Object value) throws XMLConfigurationException { // Xerces properties if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length(); if (suffixLength == Constants.SYMBOL_TABLE_PROPERTY.length() && propertyId.endsWith(Constants.SYMBOL_TABLE_PROPERTY)) { fSymbolTable = (SymbolTable) value; } else if (suffixLength == Constants.ENTITY_RESOLVER_PROPERTY.length() && propertyId.endsWith(Constants.ENTITY_RESOLVER_PROPERTY)) { fResolver = (XMLEntityResolver) value; } } } }
public class class_name { public void setProperty(String propertyId, Object value) throws XMLConfigurationException { // Xerces properties if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length(); if (suffixLength == Constants.SYMBOL_TABLE_PROPERTY.length() && propertyId.endsWith(Constants.SYMBOL_TABLE_PROPERTY)) { fSymbolTable = (SymbolTable) value; // depends on control dependency: [if], data = [none] } else if (suffixLength == Constants.ENTITY_RESOLVER_PROPERTY.length() && propertyId.endsWith(Constants.ENTITY_RESOLVER_PROPERTY)) { fResolver = (XMLEntityResolver) value; // depends on control dependency: [if], data = [none] } } } }
public class class_name { public boolean recordConstructor() { if (!hasAnySingletonTypeTags() && !currentInfo.isConstructorOrInterface()) { currentInfo.setConstructor(true); populated = true; return true; } else { return false; } } }
public class class_name { public boolean recordConstructor() { if (!hasAnySingletonTypeTags() && !currentInfo.isConstructorOrInterface()) { currentInfo.setConstructor(true); // depends on control dependency: [if], data = [none] populated = true; // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static String leafName(final String path) { final int bangIdx = path.indexOf('!'); final int endIdx = bangIdx >= 0 ? bangIdx : path.length(); int leafStartIdx = 1 + (File.separatorChar == '/' ? path.lastIndexOf('/', endIdx) : Math.max(path.lastIndexOf('/', endIdx), path.lastIndexOf(File.separatorChar, endIdx))); // In case of temp files (for jars extracted from within jars), remove the temp filename prefix -- see // NestedJarHandler.unzipToTempFile() int sepIdx = path.indexOf(NestedJarHandler.TEMP_FILENAME_LEAF_SEPARATOR); if (sepIdx >= 0) { sepIdx += NestedJarHandler.TEMP_FILENAME_LEAF_SEPARATOR.length(); } leafStartIdx = Math.max(leafStartIdx, sepIdx); leafStartIdx = Math.min(leafStartIdx, endIdx); return path.substring(leafStartIdx, endIdx); } }
public class class_name { public static String leafName(final String path) { final int bangIdx = path.indexOf('!'); final int endIdx = bangIdx >= 0 ? bangIdx : path.length(); int leafStartIdx = 1 + (File.separatorChar == '/' ? path.lastIndexOf('/', endIdx) : Math.max(path.lastIndexOf('/', endIdx), path.lastIndexOf(File.separatorChar, endIdx))); // In case of temp files (for jars extracted from within jars), remove the temp filename prefix -- see // NestedJarHandler.unzipToTempFile() int sepIdx = path.indexOf(NestedJarHandler.TEMP_FILENAME_LEAF_SEPARATOR); if (sepIdx >= 0) { sepIdx += NestedJarHandler.TEMP_FILENAME_LEAF_SEPARATOR.length(); // depends on control dependency: [if], data = [none] } leafStartIdx = Math.max(leafStartIdx, sepIdx); leafStartIdx = Math.min(leafStartIdx, endIdx); return path.substring(leafStartIdx, endIdx); } }
public class class_name { public void marshall(ListSubscribedWorkteamsRequest listSubscribedWorkteamsRequest, ProtocolMarshaller protocolMarshaller) { if (listSubscribedWorkteamsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listSubscribedWorkteamsRequest.getNameContains(), NAMECONTAINS_BINDING); protocolMarshaller.marshall(listSubscribedWorkteamsRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(listSubscribedWorkteamsRequest.getMaxResults(), MAXRESULTS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ListSubscribedWorkteamsRequest listSubscribedWorkteamsRequest, ProtocolMarshaller protocolMarshaller) { if (listSubscribedWorkteamsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listSubscribedWorkteamsRequest.getNameContains(), NAMECONTAINS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listSubscribedWorkteamsRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listSubscribedWorkteamsRequest.getMaxResults(), MAXRESULTS_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 { @Override public MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, SecurityDocument.Parameters params) { Map<String, SecuritySchemeDefinition> definitions = params.securitySchemeDefinitions; if (MapUtils.isNotEmpty(definitions)) { applySecurityDocumentExtension(new Context(Position.DOCUMENT_BEFORE, markupDocBuilder)); buildSecurityTitle(markupDocBuilder, labels.getLabel(SECURITY)); applySecurityDocumentExtension(new Context(Position.DOCUMENT_BEGIN, markupDocBuilder)); buildSecuritySchemeDefinitionsSection(markupDocBuilder, definitions); applySecurityDocumentExtension(new Context(Position.DOCUMENT_END, markupDocBuilder)); applySecurityDocumentExtension(new Context(Position.DOCUMENT_AFTER, markupDocBuilder)); } return markupDocBuilder; } }
public class class_name { @Override public MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, SecurityDocument.Parameters params) { Map<String, SecuritySchemeDefinition> definitions = params.securitySchemeDefinitions; if (MapUtils.isNotEmpty(definitions)) { applySecurityDocumentExtension(new Context(Position.DOCUMENT_BEFORE, markupDocBuilder)); // depends on control dependency: [if], data = [none] buildSecurityTitle(markupDocBuilder, labels.getLabel(SECURITY)); // depends on control dependency: [if], data = [none] applySecurityDocumentExtension(new Context(Position.DOCUMENT_BEGIN, markupDocBuilder)); // depends on control dependency: [if], data = [none] buildSecuritySchemeDefinitionsSection(markupDocBuilder, definitions); // depends on control dependency: [if], data = [none] applySecurityDocumentExtension(new Context(Position.DOCUMENT_END, markupDocBuilder)); // depends on control dependency: [if], data = [none] applySecurityDocumentExtension(new Context(Position.DOCUMENT_AFTER, markupDocBuilder)); // depends on control dependency: [if], data = [none] } return markupDocBuilder; } }
public class class_name { Double truncate(Number numberValue) { // http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html double doubleValue = numberValue.doubleValue(); if (truncateEnabled) { final int exponent = Math.getExponent(doubleValue); if (Double.isNaN(doubleValue)) { doubleValue = 0.0; } else if (exponent >= MAX_EXPONENT) { doubleValue = (doubleValue < 0.0) ? -MAX_VALUE : MAX_VALUE; } else if (exponent <= MIN_EXPONENT) { doubleValue = 0.0; } } return doubleValue; } }
public class class_name { Double truncate(Number numberValue) { // http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html double doubleValue = numberValue.doubleValue(); if (truncateEnabled) { final int exponent = Math.getExponent(doubleValue); if (Double.isNaN(doubleValue)) { doubleValue = 0.0; // depends on control dependency: [if], data = [none] } else if (exponent >= MAX_EXPONENT) { doubleValue = (doubleValue < 0.0) ? -MAX_VALUE : MAX_VALUE; // depends on control dependency: [if], data = [none] } else if (exponent <= MIN_EXPONENT) { doubleValue = 0.0; // depends on control dependency: [if], data = [none] } } return doubleValue; } }
public class class_name { protected final int getCodePointOffset(int ch) { // if ((ch >> 16) == 0) slower if (ch < 0) { return -1; } else if (ch < UTF16.LEAD_SURROGATE_MIN_VALUE) { // fastpath for the part of the BMP below surrogates (D800) where getRawOffset() works return getRawOffset(0, (char)ch); } else if (ch < UTF16.SUPPLEMENTARY_MIN_VALUE) { // BMP codepoint return getBMPOffset((char)ch); } else if (ch <= UCharacter.MAX_VALUE) { // look at the construction of supplementary characters // trail forms the ends of it. return getSurrogateOffset(UTF16.getLeadSurrogate(ch), (char)(ch & SURROGATE_MASK_)); } else { // return -1 if there is an error, in this case we return return -1; } } }
public class class_name { protected final int getCodePointOffset(int ch) { // if ((ch >> 16) == 0) slower if (ch < 0) { return -1; // depends on control dependency: [if], data = [none] } else if (ch < UTF16.LEAD_SURROGATE_MIN_VALUE) { // fastpath for the part of the BMP below surrogates (D800) where getRawOffset() works return getRawOffset(0, (char)ch); // depends on control dependency: [if], data = [(ch] } else if (ch < UTF16.SUPPLEMENTARY_MIN_VALUE) { // BMP codepoint return getBMPOffset((char)ch); // depends on control dependency: [if], data = [(ch] } else if (ch <= UCharacter.MAX_VALUE) { // look at the construction of supplementary characters // trail forms the ends of it. return getSurrogateOffset(UTF16.getLeadSurrogate(ch), (char)(ch & SURROGATE_MASK_)); // depends on control dependency: [if], data = [(ch] } else { // return -1 if there is an error, in this case we return return -1; // depends on control dependency: [if], data = [none] } } }
public class class_name { public boolean matchChomp(String seq) { if (matches(seq)) { pos += seq.length(); return true; } else { return false; } } }
public class class_name { public boolean matchChomp(String seq) { if (matches(seq)) { pos += seq.length(); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { public static GrayU8 average( InterleavedU8 input , GrayU8 output ) { if (output == null) { output = new GrayU8(input.width, input.height); } else { output.reshape(input.width,input.height); } if( BoofConcurrency.USE_CONCURRENT ) { ConvertInterleavedToSingle_MT.average(input,output); } else { ConvertInterleavedToSingle.average(input,output); } return output; } }
public class class_name { public static GrayU8 average( InterleavedU8 input , GrayU8 output ) { if (output == null) { output = new GrayU8(input.width, input.height); // depends on control dependency: [if], data = [none] } else { output.reshape(input.width,input.height); // depends on control dependency: [if], data = [none] } if( BoofConcurrency.USE_CONCURRENT ) { ConvertInterleavedToSingle_MT.average(input,output); // depends on control dependency: [if], data = [none] } else { ConvertInterleavedToSingle.average(input,output); // depends on control dependency: [if], data = [none] } return output; } }
public class class_name { public void marshall(DescribeClusterRequest describeClusterRequest, ProtocolMarshaller protocolMarshaller) { if (describeClusterRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeClusterRequest.getClusterId(), CLUSTERID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DescribeClusterRequest describeClusterRequest, ProtocolMarshaller protocolMarshaller) { if (describeClusterRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeClusterRequest.getClusterId(), CLUSTERID_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 { @Override public void setMessageInterpolator(Configuration<?> apiConfig) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "setMessageInterpolator", apiConfig); } Class<? extends MessageInterpolator> clazz = null; MessageInterpolator mi = null; if (messageInterpolator != null) { try { clazz = loadClass(messageInterpolator).asSubclass(MessageInterpolator.class); mi = instantiateClass(clazz); } catch (Throwable t) { FFDCFilter.processException(t, CLASS_NAME + ".setMessageInterpolator", "249"); // message and exception printed out in previous method called. // however since we can not create a validation factory throw validationException ValidationException e = new ValidationException(t); throw e; } } if (mi != null) { apiConfig.messageInterpolator(mi); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "setMessageInterpolator", mi); } } }
public class class_name { @Override public void setMessageInterpolator(Configuration<?> apiConfig) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "setMessageInterpolator", apiConfig); // depends on control dependency: [if], data = [none] } Class<? extends MessageInterpolator> clazz = null; MessageInterpolator mi = null; if (messageInterpolator != null) { try { clazz = loadClass(messageInterpolator).asSubclass(MessageInterpolator.class); // depends on control dependency: [try], data = [none] mi = instantiateClass(clazz); // depends on control dependency: [try], data = [none] } catch (Throwable t) { FFDCFilter.processException(t, CLASS_NAME + ".setMessageInterpolator", "249"); // message and exception printed out in previous method called. // however since we can not create a validation factory throw validationException ValidationException e = new ValidationException(t); throw e; } // depends on control dependency: [catch], data = [none] } if (mi != null) { apiConfig.messageInterpolator(mi); // depends on control dependency: [if], data = [(mi] } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "setMessageInterpolator", mi); // depends on control dependency: [if], data = [none] } } }
public class class_name { public String fixSQLName(String strName) { int index = 0; while (index != -1) { index = strName.indexOf(' '); if (index != -1) strName = strName.substring(0, index) + strName.substring(index + 1, strName.length()); } return strName; } }
public class class_name { public String fixSQLName(String strName) { int index = 0; while (index != -1) { index = strName.indexOf(' '); // depends on control dependency: [while], data = [none] if (index != -1) strName = strName.substring(0, index) + strName.substring(index + 1, strName.length()); } return strName; } }
public class class_name { private void moveDirectory (final File sourceDir, final File targetDir) throws IOException { getLog ().debug ("Moving JTB output files: " + sourceDir + " -> " + targetDir); /* * NOTE: The source directory might be the current working directory if JTB * was told to output into the default package. The current working * directory might be quite anything and will likely contain sub directories * not created by JTB. Therefore, we do a defensive move and only delete the * expected Java source files. */ final File [] sourceFiles = sourceDir.listFiles (); if (sourceFiles == null) { return; } for (final File sourceFile2 : sourceFiles) { final File sourceFile = sourceFile2; if (sourceFile.isFile () && sourceFile.getName ().endsWith (".java")) { try { getLog ().debug (" Moving JTB output file: " + sourceFile + " -> " + targetDir); FileUtils.copyFileToDirectory (sourceFile, targetDir); if (!sourceFile.delete ()) { getLog ().error ("Failed to delete original JTB output file: " + sourceFile); } } catch (final Exception e) { throw new IOException ("Failed to move JTB output file: " + sourceFile + " -> " + targetDir); } } } if (sourceDir.list ().length <= 0) { if (!sourceDir.delete ()) { getLog ().error ("Failed to delete original JTB output directory: " + sourceDir); } } else { getLog ().debug ("Keeping non empty JTB output directory: " + sourceDir); } } }
public class class_name { private void moveDirectory (final File sourceDir, final File targetDir) throws IOException { getLog ().debug ("Moving JTB output files: " + sourceDir + " -> " + targetDir); /* * NOTE: The source directory might be the current working directory if JTB * was told to output into the default package. The current working * directory might be quite anything and will likely contain sub directories * not created by JTB. Therefore, we do a defensive move and only delete the * expected Java source files. */ final File [] sourceFiles = sourceDir.listFiles (); if (sourceFiles == null) { return; } for (final File sourceFile2 : sourceFiles) { final File sourceFile = sourceFile2; if (sourceFile.isFile () && sourceFile.getName ().endsWith (".java")) { try { getLog ().debug (" Moving JTB output file: " + sourceFile + " -> " + targetDir); // depends on control dependency: [try], data = [none] FileUtils.copyFileToDirectory (sourceFile, targetDir); // depends on control dependency: [try], data = [none] if (!sourceFile.delete ()) { getLog ().error ("Failed to delete original JTB output file: " + sourceFile); // depends on control dependency: [if], data = [none] } } catch (final Exception e) { throw new IOException ("Failed to move JTB output file: " + sourceFile + " -> " + targetDir); } // depends on control dependency: [catch], data = [none] } } if (sourceDir.list ().length <= 0) { if (!sourceDir.delete ()) { getLog ().error ("Failed to delete original JTB output directory: " + sourceDir); } } else { getLog ().debug ("Keeping non empty JTB output directory: " + sourceDir); } } }
public class class_name { public static Object newInstance(String name) { try { return forName(name).newInstance(); } catch (InstantiationException e) { throw new IllegalStateException(e.getMessage(), e); } catch (IllegalAccessException e) { throw new IllegalStateException(e.getMessage(), e); } } }
public class class_name { public static Object newInstance(String name) { try { return forName(name).newInstance(); // depends on control dependency: [try], data = [none] } catch (InstantiationException e) { throw new IllegalStateException(e.getMessage(), e); } catch (IllegalAccessException e) { // depends on control dependency: [catch], data = [none] throw new IllegalStateException(e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static boolean substringMatch(CharSequence str, int index, CharSequence substring) { for (int j = 0; j < substring.length(); j++) { int i = index + j; if (i >= str.length() || str.charAt(i) != substring.charAt(j)) { return false; } } return true; } }
public class class_name { public static boolean substringMatch(CharSequence str, int index, CharSequence substring) { for (int j = 0; j < substring.length(); j++) { int i = index + j; if (i >= str.length() || str.charAt(i) != substring.charAt(j)) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { void save(final ChangesLogWrapper logWrapper, TransactionableResourceManager txResourceManager) throws RepositoryException { final ItemStateChangesLog changesLog = logWrapper.optimizeAndGetChangesLog(); final ChangesLogPersister persister = new ChangesLogPersister(); // whole log will be reconstructed with persisted data ItemStateChangesLog persistedLog; boolean failed = true; ConnectionMode mode = getMode(txResourceManager); try { persister.init(mode, txResourceManager); if (changesLog instanceof TransactionChangesLog) { TransactionChangesLog orig = (TransactionChangesLog)changesLog; TransactionChangesLog persisted = new TransactionChangesLog(); persisted.setSystemId(orig.getSystemId()); for (ChangesLogIterator iter = orig.getLogIterator(); iter.hasNextLog();) { persisted.addLog(persister.save(iter.nextLog())); } persistedLog = persisted; } else { // we don't support other types now... i.e. add else-if for that type here throw new RepositoryException("Unsupported changes log class " + changesLog.getClass()); } // replace log with persisted data only logWrapper.setLog(persistedLog); persister.prepare(); notifySaveItems(persistedLog, true); onCommit(persister, mode, txResourceManager); failed = false; } catch (IOException e) { throw new RepositoryException("Save error", e); } finally { try { persister.clear(); if (failed) { persister.rollback(); } } catch (Exception e) { LOG.warn("Error while rollbacking changelog. Save operation exception log will be added below rollback exception log", e); } } } }
public class class_name { void save(final ChangesLogWrapper logWrapper, TransactionableResourceManager txResourceManager) throws RepositoryException { final ItemStateChangesLog changesLog = logWrapper.optimizeAndGetChangesLog(); final ChangesLogPersister persister = new ChangesLogPersister(); // whole log will be reconstructed with persisted data ItemStateChangesLog persistedLog; boolean failed = true; ConnectionMode mode = getMode(txResourceManager); try { persister.init(mode, txResourceManager); if (changesLog instanceof TransactionChangesLog) { TransactionChangesLog orig = (TransactionChangesLog)changesLog; TransactionChangesLog persisted = new TransactionChangesLog(); persisted.setSystemId(orig.getSystemId()); // depends on control dependency: [if], data = [none] for (ChangesLogIterator iter = orig.getLogIterator(); iter.hasNextLog();) { persisted.addLog(persister.save(iter.nextLog())); // depends on control dependency: [for], data = [iter] } persistedLog = persisted; // depends on control dependency: [if], data = [none] } else { // we don't support other types now... i.e. add else-if for that type here throw new RepositoryException("Unsupported changes log class " + changesLog.getClass()); } // replace log with persisted data only logWrapper.setLog(persistedLog); persister.prepare(); notifySaveItems(persistedLog, true); onCommit(persister, mode, txResourceManager); failed = false; } catch (IOException e) { throw new RepositoryException("Save error", e); } finally { try { persister.clear(); // depends on control dependency: [try], data = [none] if (failed) { persister.rollback(); // depends on control dependency: [if], data = [none] } } catch (Exception e) { LOG.warn("Error while rollbacking changelog. Save operation exception log will be added below rollback exception log", e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { @SuppressWarnings("unchecked") public static <T, R> boolean tryScalarXMapSubscribe(ObservableSource<T> source, Observer<? super R> observer, Function<? super T, ? extends ObservableSource<? extends R>> mapper) { if (source instanceof Callable) { T t; try { t = ((Callable<T>)source).call(); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); EmptyDisposable.error(ex, observer); return true; } if (t == null) { EmptyDisposable.complete(observer); return true; } ObservableSource<? extends R> r; try { r = ObjectHelper.requireNonNull(mapper.apply(t), "The mapper returned a null ObservableSource"); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); EmptyDisposable.error(ex, observer); return true; } if (r instanceof Callable) { R u; try { u = ((Callable<R>)r).call(); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); EmptyDisposable.error(ex, observer); return true; } if (u == null) { EmptyDisposable.complete(observer); return true; } ScalarDisposable<R> sd = new ScalarDisposable<R>(observer, u); observer.onSubscribe(sd); sd.run(); } else { r.subscribe(observer); } return true; } return false; } }
public class class_name { @SuppressWarnings("unchecked") public static <T, R> boolean tryScalarXMapSubscribe(ObservableSource<T> source, Observer<? super R> observer, Function<? super T, ? extends ObservableSource<? extends R>> mapper) { if (source instanceof Callable) { T t; try { t = ((Callable<T>)source).call(); // depends on control dependency: [try], data = [none] } catch (Throwable ex) { Exceptions.throwIfFatal(ex); EmptyDisposable.error(ex, observer); return true; } // depends on control dependency: [catch], data = [none] if (t == null) { EmptyDisposable.complete(observer); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } ObservableSource<? extends R> r; // depends on control dependency: [if], data = [none] try { r = ObjectHelper.requireNonNull(mapper.apply(t), "The mapper returned a null ObservableSource"); // depends on control dependency: [try], data = [none] } catch (Throwable ex) { Exceptions.throwIfFatal(ex); EmptyDisposable.error(ex, observer); return true; } // depends on control dependency: [catch], data = [none] if (r instanceof Callable) { R u; try { u = ((Callable<R>)r).call(); // depends on control dependency: [try], data = [none] } catch (Throwable ex) { Exceptions.throwIfFatal(ex); EmptyDisposable.error(ex, observer); return true; } // depends on control dependency: [catch], data = [none] if (u == null) { EmptyDisposable.complete(observer); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } ScalarDisposable<R> sd = new ScalarDisposable<R>(observer, u); observer.onSubscribe(sd); // depends on control dependency: [if], data = [none] sd.run(); // depends on control dependency: [if], data = [none] } else { r.subscribe(observer); // depends on control dependency: [if], data = [none] } return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { protected boolean checkTileIndex (int tileIndex) { int tcount = getTileCount(); if (tileIndex >= 0 && tileIndex < tcount) { return true; } else { log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].", new Exception()); return false; } } }
public class class_name { protected boolean checkTileIndex (int tileIndex) { int tcount = getTileCount(); if (tileIndex >= 0 && tileIndex < tcount) { return true; // depends on control dependency: [if], data = [none] } else { log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].", new Exception()); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { boolean documentBlock(String description) { if (!lazyInitDocumentation()) { return true; } if (documentation.blockDescription != null) { return false; } documentation.blockDescription = description; return true; } }
public class class_name { boolean documentBlock(String description) { if (!lazyInitDocumentation()) { return true; // depends on control dependency: [if], data = [none] } if (documentation.blockDescription != null) { return false; // depends on control dependency: [if], data = [none] } documentation.blockDescription = description; return true; } }
public class class_name { private Resolution createContextAndRedirect(ExecutionContext executionContext, WaitPage annotation) throws IOException { // Create context used to call the event in background. Context context = this.createContext(executionContext); context.actionBean = executionContext.getActionBean(); context.eventHandler = executionContext.getHandler(); context.annotation = annotation; context.resolution = new ForwardResolution(annotation.path()); context.bindingFlashScope = FlashScope.getCurrent(context.actionBean.getContext().getRequest(), false); int id = context.hashCode(); // Id of context. String ids = Integer.toHexString(id); // Create background request to execute event. HttpServletRequest request = executionContext.getActionBeanContext().getRequest(); UrlBuilder urlBuilder = new UrlBuilder(executionContext.getActionBeanContext().getLocale(), THREAD_URL, false); // Add parameters from the original request in case there were some parameters that weren't bound but are used @SuppressWarnings({ "cast", "unchecked" }) Set<Map.Entry<String,String[]>> paramSet = (Set<Map.Entry<String,String[]>>) request.getParameterMap().entrySet(); for (Map.Entry<String,String[]> param : paramSet) for (String value : param.getValue()) urlBuilder.addParameter(param.getKey(), value); urlBuilder.addParameter(ID_PARAMETER, ids); if (context.bindingFlashScope != null) { urlBuilder.addParameter(StripesConstants.URL_KEY_FLASH_SCOPE_ID, String.valueOf(context.bindingFlashScope.key())); } urlBuilder.addParameter(StripesConstants.URL_KEY_SOURCE_PAGE, CryptoUtil.encrypt(executionContext.getActionBeanContext().getSourcePage())); context.url = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), request.getContextPath() + urlBuilder.toString()); context.cookies = request.getHeader("Cookie"); // Save context. contexts.put(id, context); // Execute background request. context.thread = new Thread(context); context.thread.start(); // Redirect user to wait page. return new RedirectResolution(StripesFilter.getConfiguration().getActionResolver().getUrlBinding(context.actionBean.getClass())) { @Override public RedirectResolution addParameter(String key, Object... value) { // Leave flash scope to background request. if (!StripesConstants.URL_KEY_FLASH_SCOPE_ID.equals(key)) { return super.addParameter(key, value); } return this; } }.addParameter(ID_PARAMETER, ids); } }
public class class_name { private Resolution createContextAndRedirect(ExecutionContext executionContext, WaitPage annotation) throws IOException { // Create context used to call the event in background. Context context = this.createContext(executionContext); context.actionBean = executionContext.getActionBean(); context.eventHandler = executionContext.getHandler(); context.annotation = annotation; context.resolution = new ForwardResolution(annotation.path()); context.bindingFlashScope = FlashScope.getCurrent(context.actionBean.getContext().getRequest(), false); int id = context.hashCode(); // Id of context. String ids = Integer.toHexString(id); // Create background request to execute event. HttpServletRequest request = executionContext.getActionBeanContext().getRequest(); UrlBuilder urlBuilder = new UrlBuilder(executionContext.getActionBeanContext().getLocale(), THREAD_URL, false); // Add parameters from the original request in case there were some parameters that weren't bound but are used @SuppressWarnings({ "cast", "unchecked" }) Set<Map.Entry<String,String[]>> paramSet = (Set<Map.Entry<String,String[]>>) request.getParameterMap().entrySet(); for (Map.Entry<String,String[]> param : paramSet) for (String value : param.getValue()) urlBuilder.addParameter(param.getKey(), value); urlBuilder.addParameter(ID_PARAMETER, ids); if (context.bindingFlashScope != null) { urlBuilder.addParameter(StripesConstants.URL_KEY_FLASH_SCOPE_ID, String.valueOf(context.bindingFlashScope.key())); } urlBuilder.addParameter(StripesConstants.URL_KEY_SOURCE_PAGE, CryptoUtil.encrypt(executionContext.getActionBeanContext().getSourcePage())); context.url = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), request.getContextPath() + urlBuilder.toString()); context.cookies = request.getHeader("Cookie"); // Save context. contexts.put(id, context); // Execute background request. context.thread = new Thread(context); context.thread.start(); // Redirect user to wait page. return new RedirectResolution(StripesFilter.getConfiguration().getActionResolver().getUrlBinding(context.actionBean.getClass())) { @Override public RedirectResolution addParameter(String key, Object... value) { // Leave flash scope to background request. if (!StripesConstants.URL_KEY_FLASH_SCOPE_ID.equals(key)) { return super.addParameter(key, value); // depends on control dependency: [if], data = [none] } return this; } }.addParameter(ID_PARAMETER, ids); } }
public class class_name { public static <M extends PMessage<M,F>, F extends PField, B extends PMessageBuilder<M,F>> M buildIfNotNull(B builder) { if (builder == null) { return null; } return builder.build(); } }
public class class_name { public static <M extends PMessage<M,F>, F extends PField, B extends PMessageBuilder<M,F>> M buildIfNotNull(B builder) { if (builder == null) { return null; // depends on control dependency: [if], data = [none] } return builder.build(); } }
public class class_name { static Set<String> extractPortKeys(Configuration config) { final LinkedHashSet<String> tmPortKeys = new LinkedHashSet<>(TM_PORT_KEYS); final String portKeys = config.getString(PORT_ASSIGNMENTS); if (portKeys != null) { Arrays.stream(portKeys.split(",")) .map(String::trim) .peek(key -> LOG.debug("Adding port key {} to mesos request")) .forEach(tmPortKeys::add); } return Collections.unmodifiableSet(tmPortKeys); } }
public class class_name { static Set<String> extractPortKeys(Configuration config) { final LinkedHashSet<String> tmPortKeys = new LinkedHashSet<>(TM_PORT_KEYS); final String portKeys = config.getString(PORT_ASSIGNMENTS); if (portKeys != null) { Arrays.stream(portKeys.split(",")) .map(String::trim) .peek(key -> LOG.debug("Adding port key {} to mesos request")) .forEach(tmPortKeys::add); // depends on control dependency: [if], data = [(portKeys] } return Collections.unmodifiableSet(tmPortKeys); } }
public class class_name { private Map<String, ActivationSpecImpl> createInboundMapping(InboundResourceAdapter ira, ClassLoader cl) throws Exception { if (ira != null) { Map<String, ActivationSpecImpl> result = new HashMap<>(); for (org.ironjacamar.common.api.metadata.spec.MessageListener ml : ira.getMessageadapter().getMessagelisteners()) { String type = ml.getMessagelistenerType().getValue(); org.ironjacamar.common.api.metadata.spec.Activationspec as = ml.getActivationspec(); String clzName = as.getActivationspecClass().getValue(); Class<?> clz = Class.forName(clzName, true, cl); Map<String, Class<?>> configProperties = createPropertyMap(clz); Set<String> requiredConfigProperties = new HashSet<>(); if (as.getRequiredConfigProperties() != null) { for (org.ironjacamar.common.api.metadata.spec.RequiredConfigProperty rcp : as.getRequiredConfigProperties()) { requiredConfigProperties.add(rcp.getConfigPropertyName().getValue()); } } validationObj.add(new ValidateClass(Key.ACTIVATION_SPEC, clz, as.getConfigProperties())); ActivationSpecImpl asi = new ActivationSpecImpl(clzName, configProperties, requiredConfigProperties); if (!result.containsKey(type)) result.put(type, asi); } return result; } return null; } }
public class class_name { private Map<String, ActivationSpecImpl> createInboundMapping(InboundResourceAdapter ira, ClassLoader cl) throws Exception { if (ira != null) { Map<String, ActivationSpecImpl> result = new HashMap<>(); for (org.ironjacamar.common.api.metadata.spec.MessageListener ml : ira.getMessageadapter().getMessagelisteners()) { String type = ml.getMessagelistenerType().getValue(); org.ironjacamar.common.api.metadata.spec.Activationspec as = ml.getActivationspec(); String clzName = as.getActivationspecClass().getValue(); Class<?> clz = Class.forName(clzName, true, cl); Map<String, Class<?>> configProperties = createPropertyMap(clz); Set<String> requiredConfigProperties = new HashSet<>(); if (as.getRequiredConfigProperties() != null) { for (org.ironjacamar.common.api.metadata.spec.RequiredConfigProperty rcp : as.getRequiredConfigProperties()) { requiredConfigProperties.add(rcp.getConfigPropertyName().getValue()); // depends on control dependency: [for], data = [rcp] } } validationObj.add(new ValidateClass(Key.ACTIVATION_SPEC, clz, as.getConfigProperties())); ActivationSpecImpl asi = new ActivationSpecImpl(clzName, configProperties, requiredConfigProperties); if (!result.containsKey(type)) result.put(type, asi); } return result; } return null; } }
public class class_name { public void marshall(UpdateDocumentationPartRequest updateDocumentationPartRequest, ProtocolMarshaller protocolMarshaller) { if (updateDocumentationPartRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateDocumentationPartRequest.getRestApiId(), RESTAPIID_BINDING); protocolMarshaller.marshall(updateDocumentationPartRequest.getDocumentationPartId(), DOCUMENTATIONPARTID_BINDING); protocolMarshaller.marshall(updateDocumentationPartRequest.getPatchOperations(), PATCHOPERATIONS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(UpdateDocumentationPartRequest updateDocumentationPartRequest, ProtocolMarshaller protocolMarshaller) { if (updateDocumentationPartRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateDocumentationPartRequest.getRestApiId(), RESTAPIID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateDocumentationPartRequest.getDocumentationPartId(), DOCUMENTATIONPARTID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateDocumentationPartRequest.getPatchOperations(), PATCHOPERATIONS_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 marshall(UpdateVirtualInterfaceAttributesRequest updateVirtualInterfaceAttributesRequest, ProtocolMarshaller protocolMarshaller) { if (updateVirtualInterfaceAttributesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateVirtualInterfaceAttributesRequest.getVirtualInterfaceId(), VIRTUALINTERFACEID_BINDING); protocolMarshaller.marshall(updateVirtualInterfaceAttributesRequest.getMtu(), MTU_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(UpdateVirtualInterfaceAttributesRequest updateVirtualInterfaceAttributesRequest, ProtocolMarshaller protocolMarshaller) { if (updateVirtualInterfaceAttributesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateVirtualInterfaceAttributesRequest.getVirtualInterfaceId(), VIRTUALINTERFACEID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateVirtualInterfaceAttributesRequest.getMtu(), MTU_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static String normalizeRequestURI(final String servletPath, final String requestPathInfo, final String viewId) { // We must not process empty viewIds if (viewId == null) { return null; } /* * code from com.sun.faces.util.Util#getMappingForRequest(String servletPath, String pathInfo) * and com.sun.faces.application.view.MultiViewHandler#normalizeRequestURI(String uri, String mapping) */ if (servletPath != null) { if ((requestPathInfo != null || servletPath.indexOf('.') < 0) && viewId.startsWith(servletPath + '/')) { return viewId.substring(servletPath.length()); } } return viewId; } }
public class class_name { public static String normalizeRequestURI(final String servletPath, final String requestPathInfo, final String viewId) { // We must not process empty viewIds if (viewId == null) { return null; // depends on control dependency: [if], data = [none] } /* * code from com.sun.faces.util.Util#getMappingForRequest(String servletPath, String pathInfo) * and com.sun.faces.application.view.MultiViewHandler#normalizeRequestURI(String uri, String mapping) */ if (servletPath != null) { if ((requestPathInfo != null || servletPath.indexOf('.') < 0) && viewId.startsWith(servletPath + '/')) { return viewId.substring(servletPath.length()); // depends on control dependency: [if], data = [none] } } return viewId; } }
public class class_name { private void closeStorageRegistry() { for(DB storage : storageRegistry.values()) { if(isOpenStorage(storage)) { storage.close(); } } storageRegistry.clear(); } }
public class class_name { private void closeStorageRegistry() { for(DB storage : storageRegistry.values()) { if(isOpenStorage(storage)) { storage.close(); // depends on control dependency: [if], data = [none] } } storageRegistry.clear(); } }
public class class_name { public Clustering<MeanModel> run(Database database, Relation<V> relation) { final DistanceQuery<V> distq = database.getDistanceQuery(relation, getDistanceFunction()); final RangeQuery<V> rangeq = database.getRangeQuery(distq); final NumberVector.Factory<V> factory = RelationUtil.getNumberVectorFactory(relation); final int dim = RelationUtil.dimensionality(relation); // Stopping threshold final double threshold = bandwidth * 1E-10; // Result store: ArrayList<Pair<V, ModifiableDBIDs>> clusters = new ArrayList<>(); ModifiableDBIDs noise = DBIDUtil.newArray(); FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Mean-shift clustering", relation.size(), LOG) : null; for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) { // Initial position: V position = relation.get(iter); iterations: for(int j = 1; ; j++) { // Compute new position: V newvec = null; { DoubleDBIDList neigh = rangeq.getRangeForObject(position, bandwidth); boolean okay = (neigh.size() > 1) || (neigh.size() >= 1 && j > 1); if(okay) { Centroid newpos = new Centroid(dim); for(DoubleDBIDListIter niter = neigh.iter(); niter.valid(); niter.advance()) { final double weight = kernel.density(niter.doubleValue() / bandwidth); newpos.put(relation.get(niter), weight); } newvec = factory.newNumberVector(newpos.getArrayRef()); // TODO: detect 0 weight! } if(!okay) { noise.add(iter); break iterations; } } // Test if we are close to one of the known clusters: double bestd = Double.POSITIVE_INFINITY; Pair<V, ModifiableDBIDs> bestp = null; for(Pair<V, ModifiableDBIDs> pair : clusters) { final double merged = distq.distance(newvec, pair.first); if(merged < bestd) { bestd = merged; bestp = pair; } } // Check for convergence: double delta = distq.distance(position, newvec); if(bestd < 10 * threshold || bestd * 2 < delta) { assert(bestp != null); bestp.second.add(iter); break iterations; } if(Double.isNaN(delta)) { LOG.warning("Encountered NaN distance. Invalid center vector? " + newvec.toString()); break iterations; } if(j == MAXITER || delta < threshold) { if(j == MAXITER) { LOG.warning("No convergence after " + MAXITER + " iterations. Distance: " + delta); } if(LOG.isDebuggingFine()) { LOG.debugFine("New cluster:" + newvec + " delta: " + delta + " threshold: " + threshold + " bestd: " + bestd); } ArrayModifiableDBIDs cids = DBIDUtil.newArray(1); cids.add(iter); clusters.add(new Pair<V, ModifiableDBIDs>(newvec, cids)); break iterations; } position = newvec; } LOG.incrementProcessed(prog); } LOG.ensureCompleted(prog); ArrayList<Cluster<MeanModel>> cs = new ArrayList<>(clusters.size()); for(Pair<V, ModifiableDBIDs> pair : clusters) { cs.add(new Cluster<>(pair.second, new MeanModel(pair.first.toArray()))); } if(noise.size() > 0) { cs.add(new Cluster<MeanModel>(noise, true)); } return new Clustering<>("Mean-shift Clustering", "mean-shift-clustering", cs); } }
public class class_name { public Clustering<MeanModel> run(Database database, Relation<V> relation) { final DistanceQuery<V> distq = database.getDistanceQuery(relation, getDistanceFunction()); final RangeQuery<V> rangeq = database.getRangeQuery(distq); final NumberVector.Factory<V> factory = RelationUtil.getNumberVectorFactory(relation); final int dim = RelationUtil.dimensionality(relation); // Stopping threshold final double threshold = bandwidth * 1E-10; // Result store: ArrayList<Pair<V, ModifiableDBIDs>> clusters = new ArrayList<>(); ModifiableDBIDs noise = DBIDUtil.newArray(); FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Mean-shift clustering", relation.size(), LOG) : null; for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) { // Initial position: V position = relation.get(iter); iterations: for(int j = 1; ; j++) { // Compute new position: V newvec = null; { DoubleDBIDList neigh = rangeq.getRangeForObject(position, bandwidth); boolean okay = (neigh.size() > 1) || (neigh.size() >= 1 && j > 1); if(okay) { Centroid newpos = new Centroid(dim); for(DoubleDBIDListIter niter = neigh.iter(); niter.valid(); niter.advance()) { final double weight = kernel.density(niter.doubleValue() / bandwidth); newpos.put(relation.get(niter), weight); // depends on control dependency: [for], data = [niter] } newvec = factory.newNumberVector(newpos.getArrayRef()); // depends on control dependency: [if], data = [none] // TODO: detect 0 weight! } if(!okay) { noise.add(iter); // depends on control dependency: [if], data = [none] break iterations; } } // Test if we are close to one of the known clusters: double bestd = Double.POSITIVE_INFINITY; Pair<V, ModifiableDBIDs> bestp = null; for(Pair<V, ModifiableDBIDs> pair : clusters) { final double merged = distq.distance(newvec, pair.first); if(merged < bestd) { bestd = merged; // depends on control dependency: [if], data = [none] bestp = pair; // depends on control dependency: [if], data = [none] } } // Check for convergence: double delta = distq.distance(position, newvec); if(bestd < 10 * threshold || bestd * 2 < delta) { assert(bestp != null); // depends on control dependency: [if], data = [none] bestp.second.add(iter); // depends on control dependency: [if], data = [none] break iterations; } if(Double.isNaN(delta)) { LOG.warning("Encountered NaN distance. Invalid center vector? " + newvec.toString()); // depends on control dependency: [if], data = [none] break iterations; } if(j == MAXITER || delta < threshold) { if(j == MAXITER) { LOG.warning("No convergence after " + MAXITER + " iterations. Distance: " + delta); // depends on control dependency: [if], data = [none] } if(LOG.isDebuggingFine()) { LOG.debugFine("New cluster:" + newvec + " delta: " + delta + " threshold: " + threshold + " bestd: " + bestd); // depends on control dependency: [if], data = [none] } ArrayModifiableDBIDs cids = DBIDUtil.newArray(1); cids.add(iter); // depends on control dependency: [if], data = [none] clusters.add(new Pair<V, ModifiableDBIDs>(newvec, cids)); // depends on control dependency: [if], data = [none] break iterations; } position = newvec; // depends on control dependency: [for], data = [none] } LOG.incrementProcessed(prog); // depends on control dependency: [for], data = [none] } LOG.ensureCompleted(prog); ArrayList<Cluster<MeanModel>> cs = new ArrayList<>(clusters.size()); for(Pair<V, ModifiableDBIDs> pair : clusters) { cs.add(new Cluster<>(pair.second, new MeanModel(pair.first.toArray()))); // depends on control dependency: [for], data = [pair] } if(noise.size() > 0) { cs.add(new Cluster<MeanModel>(noise, true)); // depends on control dependency: [if], data = [none] } return new Clustering<>("Mean-shift Clustering", "mean-shift-clustering", cs); } }
public class class_name { public ComputeNodeListHeaders withLastModified(DateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { this.lastModified = new DateTimeRfc1123(lastModified); } return this; } }
public class class_name { public ComputeNodeListHeaders withLastModified(DateTime lastModified) { if (lastModified == null) { this.lastModified = null; // depends on control dependency: [if], data = [none] } else { this.lastModified = new DateTimeRfc1123(lastModified); // depends on control dependency: [if], data = [(lastModified] } return this; } }
public class class_name { public static Throwable peel(Throwable throwable) { requireNonNull(throwable, "throwable"); Throwable cause = throwable.getCause(); while (cause != null && cause != throwable && (throwable instanceof CompletionException || throwable instanceof ExecutionException || throwable instanceof InvocationTargetException || throwable instanceof ExceptionInInitializerError)) { throwable = cause; cause = throwable.getCause(); } return throwable; } }
public class class_name { public static Throwable peel(Throwable throwable) { requireNonNull(throwable, "throwable"); Throwable cause = throwable.getCause(); while (cause != null && cause != throwable && (throwable instanceof CompletionException || throwable instanceof ExecutionException || throwable instanceof InvocationTargetException || throwable instanceof ExceptionInInitializerError)) { throwable = cause; // depends on control dependency: [while], data = [none] cause = throwable.getCause(); // depends on control dependency: [while], data = [none] } return throwable; } }
public class class_name { public com.google.protobuf.ByteString getExtendsBytes() { java.lang.Object ref = extends_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); extends_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } }
public class class_name { public com.google.protobuf.ByteString getExtendsBytes() { java.lang.Object ref = extends_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); extends_ = b; // depends on control dependency: [if], data = [none] return b; // depends on control dependency: [if], data = [none] } else { return (com.google.protobuf.ByteString) ref; // depends on control dependency: [if], data = [none] } } }
public class class_name { private double[][] assignPiFactors(IAtomContainerSet setAc) { //a,b,c,denom,chi,q double[][] gasteigerFactors = new double[setAc.getAtomContainerCount()][(setAc.getAtomContainer(0) .getAtomCount() * (STEP_SIZE + 1))]; String AtomSymbol = ""; double[] factors = new double[]{0.0, 0.0, 0.0}; for (int k = 1; k < setAc.getAtomContainerCount(); k++) { IAtomContainer ac = setAc.getAtomContainer(k); for (int i = 0; i < ac.getAtomCount(); i++) { factors[0] = 0.0; factors[1] = 0.0; factors[2] = 0.0; AtomSymbol = ac.getAtom(i).getSymbol(); if (AtomSymbol.equals("H")) { factors[0] = 0.0; factors[1] = 0.0; factors[2] = 0.0; } else if (AtomSymbol.equals("C")) {/* * if(ac.getAtom(i).getFlag( * ISCHANGEDFC)) */ { factors[0] = 5.60; factors[1] = 8.93; factors[2] = 2.94; } } else if (AtomSymbol.equals("O")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) == IBond.Order.SINGLE) { factors[0] = 10.0; factors[1] = 13.86; factors[2] = 9.68; } else { factors[0] = 7.91; factors[1] = 14.76; factors[2] = 6.85; } } else if (AtomSymbol.equals("N")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) != IBond.Order.SINGLE) { factors[0] = 7.95;/* 7.95 */ factors[1] = 9.73;/* 9.73 */ factors[2] = 2.67;/* 2.67 */ } else { factors[0] = 4.54;/* 4.54 *//* 5.5 */ factors[1] = 11.86;/* 11.86 *//* 10.86 */ factors[2] = 7.32;/* 7.32 *//* 7.99 */ } } else if (AtomSymbol.equals("S")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) == IBond.Order.SINGLE) { factors[0] = 7.73; factors[1] = 8.16; factors[2] = 1.81; } else { factors[0] = 6.60; factors[1] = 10.32; factors[2] = 3.72; } } else if (AtomSymbol.equals("F")) { factors[0] = 7.34; factors[1] = 13.86; factors[2] = 9.68; } else if (AtomSymbol.equals("Cl")) { factors[0] = 6.50; factors[1] = 11.02; factors[2] = 4.52; } else if (AtomSymbol.equals("Br")) { factors[0] = 5.20; factors[1] = 9.68; factors[2] = 4.48; } else if (AtomSymbol.equals("I")) { factors[0] = 4.95; factors[1] = 8.81; factors[2] = 3.86; } gasteigerFactors[k][STEP_SIZE * i + i] = factors[0]; gasteigerFactors[k][STEP_SIZE * i + i + 1] = factors[1]; gasteigerFactors[k][STEP_SIZE * i + i + 2] = factors[2]; gasteigerFactors[k][STEP_SIZE * i + i + 5] = ac.getAtom(i).getCharge(); if (factors[0] == 0 && factors[1] == 0 && factors[2] == 0) { gasteigerFactors[k][STEP_SIZE * i + i + 3] = 1; } else { gasteigerFactors[k][STEP_SIZE * i + i + 3] = factors[0] + factors[1] + factors[2]; } } } return gasteigerFactors; } }
public class class_name { private double[][] assignPiFactors(IAtomContainerSet setAc) { //a,b,c,denom,chi,q double[][] gasteigerFactors = new double[setAc.getAtomContainerCount()][(setAc.getAtomContainer(0) .getAtomCount() * (STEP_SIZE + 1))]; String AtomSymbol = ""; double[] factors = new double[]{0.0, 0.0, 0.0}; for (int k = 1; k < setAc.getAtomContainerCount(); k++) { IAtomContainer ac = setAc.getAtomContainer(k); for (int i = 0; i < ac.getAtomCount(); i++) { factors[0] = 0.0; // depends on control dependency: [for], data = [none] factors[1] = 0.0; // depends on control dependency: [for], data = [none] factors[2] = 0.0; // depends on control dependency: [for], data = [none] AtomSymbol = ac.getAtom(i).getSymbol(); // depends on control dependency: [for], data = [i] if (AtomSymbol.equals("H")) { factors[0] = 0.0; // depends on control dependency: [if], data = [none] factors[1] = 0.0; // depends on control dependency: [if], data = [none] factors[2] = 0.0; // depends on control dependency: [if], data = [none] } else if (AtomSymbol.equals("C")) {/* * if(ac.getAtom(i).getFlag( * ISCHANGEDFC)) */ { factors[0] = 5.60; factors[1] = 8.93; factors[2] = 2.94; } } else if (AtomSymbol.equals("O")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) == IBond.Order.SINGLE) { factors[0] = 10.0; // depends on control dependency: [if], data = [none] factors[1] = 13.86; // depends on control dependency: [if], data = [none] factors[2] = 9.68; // depends on control dependency: [if], data = [none] } else { factors[0] = 7.91; // depends on control dependency: [if], data = [none] factors[1] = 14.76; // depends on control dependency: [if], data = [none] factors[2] = 6.85; // depends on control dependency: [if], data = [none] } } else if (AtomSymbol.equals("N")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) != IBond.Order.SINGLE) { factors[0] = 7.95;/* 7.95 */ // depends on control dependency: [if], data = [none] factors[1] = 9.73;/* 9.73 */ // depends on control dependency: [if], data = [none] factors[2] = 2.67;/* 2.67 */ // depends on control dependency: [if], data = [none] } else { factors[0] = 4.54;/* 4.54 *//* 5.5 */ // depends on control dependency: [if], data = [none] factors[1] = 11.86;/* 11.86 *//* 10.86 */ // depends on control dependency: [if], data = [none] factors[2] = 7.32;/* 7.32 *//* 7.99 */ // depends on control dependency: [if], data = [none] } } else if (AtomSymbol.equals("S")) { if (ac.getMaximumBondOrder(ac.getAtom(i)) == IBond.Order.SINGLE) { factors[0] = 7.73; // depends on control dependency: [if], data = [none] factors[1] = 8.16; // depends on control dependency: [if], data = [none] factors[2] = 1.81; // depends on control dependency: [if], data = [none] } else { factors[0] = 6.60; // depends on control dependency: [if], data = [none] factors[1] = 10.32; // depends on control dependency: [if], data = [none] factors[2] = 3.72; // depends on control dependency: [if], data = [none] } } else if (AtomSymbol.equals("F")) { factors[0] = 7.34; // depends on control dependency: [if], data = [none] factors[1] = 13.86; // depends on control dependency: [if], data = [none] factors[2] = 9.68; // depends on control dependency: [if], data = [none] } else if (AtomSymbol.equals("Cl")) { factors[0] = 6.50; // depends on control dependency: [if], data = [none] factors[1] = 11.02; // depends on control dependency: [if], data = [none] factors[2] = 4.52; // depends on control dependency: [if], data = [none] } else if (AtomSymbol.equals("Br")) { factors[0] = 5.20; // depends on control dependency: [if], data = [none] factors[1] = 9.68; // depends on control dependency: [if], data = [none] factors[2] = 4.48; // depends on control dependency: [if], data = [none] } else if (AtomSymbol.equals("I")) { factors[0] = 4.95; // depends on control dependency: [if], data = [none] factors[1] = 8.81; // depends on control dependency: [if], data = [none] factors[2] = 3.86; // depends on control dependency: [if], data = [none] } gasteigerFactors[k][STEP_SIZE * i + i] = factors[0]; // depends on control dependency: [for], data = [i] gasteigerFactors[k][STEP_SIZE * i + i + 1] = factors[1]; // depends on control dependency: [for], data = [i] gasteigerFactors[k][STEP_SIZE * i + i + 2] = factors[2]; // depends on control dependency: [for], data = [i] gasteigerFactors[k][STEP_SIZE * i + i + 5] = ac.getAtom(i).getCharge(); // depends on control dependency: [for], data = [i] if (factors[0] == 0 && factors[1] == 0 && factors[2] == 0) { gasteigerFactors[k][STEP_SIZE * i + i + 3] = 1; // depends on control dependency: [if], data = [none] } else { gasteigerFactors[k][STEP_SIZE * i + i + 3] = factors[0] + factors[1] + factors[2]; // depends on control dependency: [if], data = [none] } } } return gasteigerFactors; } }
public class class_name { @Pure public static String[] split(File filename) { if (filename == null) { return new String[0]; } return filename.getPath().split(Pattern.quote(File.separator)); } }
public class class_name { @Pure public static String[] split(File filename) { if (filename == null) { return new String[0]; // depends on control dependency: [if], data = [none] } return filename.getPath().split(Pattern.quote(File.separator)); } }
public class class_name { @VisibleForTesting ReferenceEntry<K, V> newEntry(K key, int hash, @NullableDecl ReferenceEntry<K, V> next) { Segment<K, V> segment = segmentFor(hash); segment.lock(); try { return segment.newEntry(key, hash, next); } finally { segment.unlock(); } } }
public class class_name { @VisibleForTesting ReferenceEntry<K, V> newEntry(K key, int hash, @NullableDecl ReferenceEntry<K, V> next) { Segment<K, V> segment = segmentFor(hash); segment.lock(); try { return segment.newEntry(key, hash, next); // depends on control dependency: [try], data = [none] } finally { segment.unlock(); } } }
public class class_name { @Override public Submitter createSubmitter(final String idString) { if (idString == null) { return new Submitter(getRoot(), null); } final Submitter submitter = new Submitter(getRoot(), new ObjectId(idString)); getRoot().insert(submitter); return submitter; } }
public class class_name { @Override public Submitter createSubmitter(final String idString) { if (idString == null) { return new Submitter(getRoot(), null); // depends on control dependency: [if], data = [null)] } final Submitter submitter = new Submitter(getRoot(), new ObjectId(idString)); getRoot().insert(submitter); return submitter; } }
public class class_name { public void serializeTimingData(Path outputPath) { //merge subThreads instances into the main instance merge(); try (FileWriter fw = new FileWriter(outputPath.toFile())) { fw.write("Number Of Executions, Total Milliseconds, Milliseconds per execution, Type\n"); for (Map.Entry<String, TimingData> timing : executionInfo.entrySet()) { TimingData data = timing.getValue(); long totalMillis = (data.totalNanos / 1000000); double millisPerExecution = (double) totalMillis / (double) data.numberOfExecutions; fw.write(String.format("%6d, %6d, %8.2f, %s\n", data.numberOfExecutions, totalMillis, millisPerExecution, StringEscapeUtils.escapeCsv(timing.getKey()) )); } } catch (Exception e) { e.printStackTrace(); } } }
public class class_name { public void serializeTimingData(Path outputPath) { //merge subThreads instances into the main instance merge(); try (FileWriter fw = new FileWriter(outputPath.toFile())) { fw.write("Number Of Executions, Total Milliseconds, Milliseconds per execution, Type\n"); for (Map.Entry<String, TimingData> timing : executionInfo.entrySet()) { TimingData data = timing.getValue(); long totalMillis = (data.totalNanos / 1000000); double millisPerExecution = (double) totalMillis / (double) data.numberOfExecutions; fw.write(String.format("%6d, %6d, %8.2f, %s\n", data.numberOfExecutions, totalMillis, millisPerExecution, StringEscapeUtils.escapeCsv(timing.getKey()) )); // depends on control dependency: [for], data = [none] } } catch (Exception e) { e.printStackTrace(); } } }
public class class_name { @Override public Object getField(FieldDescriptor field) { checkFieldDescriptor(field); Object result = field.getNumber() == 1 ? getKey() : getValue(); // Convert enums to EnumValueDescriptor. if (field.getType() == FieldDescriptor.Type.ENUM) { result = field.getEnumType().findValueByNumberCreatingIfUnknown((java.lang.Integer) result); } return result; } }
public class class_name { @Override public Object getField(FieldDescriptor field) { checkFieldDescriptor(field); Object result = field.getNumber() == 1 ? getKey() : getValue(); // Convert enums to EnumValueDescriptor. if (field.getType() == FieldDescriptor.Type.ENUM) { result = field.getEnumType().findValueByNumberCreatingIfUnknown((java.lang.Integer) result); // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { public static MethodNode findSAM(ClassNode type) { if (!Modifier.isAbstract(type.getModifiers())) return null; if (type.isInterface()) { List<MethodNode> methods = type.getMethods(); MethodNode found=null; for (MethodNode mi : methods) { // ignore methods, that are not abstract and from Object if (!Modifier.isAbstract(mi.getModifiers())) continue; // ignore trait methods which have a default implementation if (Traits.hasDefaultImplementation(mi)) continue; if (mi.getDeclaringClass().equals(OBJECT_TYPE)) continue; if (OBJECT_TYPE.getDeclaredMethod(mi.getName(), mi.getParameters())!=null) continue; // we have two methods, so no SAM if (found!=null) return null; found = mi; } return found; } else { List<MethodNode> methods = type.getAbstractMethods(); MethodNode found = null; if (methods!=null) { for (MethodNode mi : methods) { if (!hasUsableImplementation(type, mi)) { if (found!=null) return null; found = mi; } } } return found; } } }
public class class_name { public static MethodNode findSAM(ClassNode type) { if (!Modifier.isAbstract(type.getModifiers())) return null; if (type.isInterface()) { List<MethodNode> methods = type.getMethods(); MethodNode found=null; for (MethodNode mi : methods) { // ignore methods, that are not abstract and from Object if (!Modifier.isAbstract(mi.getModifiers())) continue; // ignore trait methods which have a default implementation if (Traits.hasDefaultImplementation(mi)) continue; if (mi.getDeclaringClass().equals(OBJECT_TYPE)) continue; if (OBJECT_TYPE.getDeclaredMethod(mi.getName(), mi.getParameters())!=null) continue; // we have two methods, so no SAM if (found!=null) return null; found = mi; // depends on control dependency: [for], data = [mi] } return found; // depends on control dependency: [if], data = [none] } else { List<MethodNode> methods = type.getAbstractMethods(); MethodNode found = null; if (methods!=null) { for (MethodNode mi : methods) { if (!hasUsableImplementation(type, mi)) { if (found!=null) return null; found = mi; // depends on control dependency: [if], data = [none] } } } return found; // depends on control dependency: [if], data = [none] } } }
public class class_name { private void initialize(byte[] prologue ,int prologueOffset ,JMFSchema headerSchema ,byte rawHeader[] ,int hdrOffset ,int hdrLength ,JMFSchema payloadSchema ,byte rawPayload[] ,int payOffset ,int payLength ,CommsConnection conn) throws MessageDecodeFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "initialize", new Object[] {prologue ,prologueOffset ,headerSchema ,rawHeader ,hdrOffset ,hdrLength ,payloadSchema ,rawPayload ,payOffset ,payLength ,conn }); // Construct the initial JMF message. If raw buffer(s) were provided we decode the message // parts from the buffer(s)......... if (rawHeader != null) { boolean separatePrologue = ( prologue!=null ? true : false); // If debug trace, dump the buffers first if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Decoding message from byte buffer(s)"); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { String outP = null; if (separatePrologue) { outP = SibTr.formatBytes(prologue, prologueOffset, PROLOGUE_LENGTH); } String out0 = SibTr.formatBytes(rawHeader, hdrOffset, hdrLength); String out1 = null; if (rawPayload != null) { out1 = SibTr.formatBytes(rawPayload, payOffset, payLength, MfpDiagnostics.getDiagnosticDataLimitInt()); } SibTr.debug(this, tc, "buffers: ", new Object[] { outP, out0, out1 }); } // Sanity check the length of the header section if (rawHeader.length-hdrOffset < hdrLength || hdrLength < IDS_LENGTH + ArrayUtil.INT_SIZE) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Message buffer size too small: "+rawHeader.length); throw new MessageDecodeFailedException("Invalid message buffer (buffer size too small)"); } // If there is a separate prologue, the JMFVersions, schemaIds & real header length will be there byte[] pBuffer; int pOffset; if (separatePrologue) { pBuffer = prologue; pOffset = prologueOffset; } // otherwise, the stuff will be at the front of the the header pBuffer else { pBuffer = rawHeader; pOffset = hdrOffset; } // Read in the Prologue information from the appropriate pBuffer short jmfVer1 = ArrayUtil.readShort(pBuffer, pOffset); pOffset += ArrayUtil.SHORT_SIZE; long encId1 = ArrayUtil.readLong(pBuffer, pOffset); pOffset += ArrayUtil.LONG_SIZE; short jmfVer2 = ArrayUtil.readShort(pBuffer, pOffset); pOffset += ArrayUtil.SHORT_SIZE; long encId2 = ArrayUtil.readLong(pBuffer, pOffset); pOffset += ArrayUtil.LONG_SIZE; int realHdrLength = ArrayUtil.readInt(pBuffer, pOffset); pOffset += ArrayUtil.INT_SIZE; // If the prologue was in the header buffer, update the offset now we have read it. if (!separatePrologue) { hdrOffset = pOffset; } // Save the original encoded message length originalLength = PROLOGUE_LENGTH + realHdrLength + payLength; // Decode the header headerPart = new JsMsgPart(initializePart(headerSchema, jmfVer1, encId1, rawHeader, hdrOffset, realHdrLength, conn)); try { // Decode the payload if present if (payLength > 0) { payloadPart = new JsMsgPart(initializePart(payloadSchema, jmfVer2, encId2, rawPayload, payOffset, payLength, conn)); } } catch (MessageDecodeFailedException e) { // No FFDC code needed // Just write out the decoded header to any debug trace and rethrow the Exception. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Decoded JMF Message Header", debugHeaderPart()); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Decoded JMF Message", debugMsg()); } // .... If no buffers, we create new empty message parts. else if (headerSchema != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Creating new empty header message: Schema="+debugSchema(headerSchema)); headerPart = new JsMsgPart(JMFRegistry.instance.newMessage(headerSchema)); if (payloadSchema != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Creating new empty payload: Schema="+debugSchema(payloadSchema)); payloadPart = new JsMsgPart(JMFRegistry.instance.newMessage(payloadSchema)); } } /* It is legitimate for both the schema and the buffer to be null. The */ /* JMO is not initialized, which is correct for use by getCopy(). */ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "initialize"); } }
public class class_name { private void initialize(byte[] prologue ,int prologueOffset ,JMFSchema headerSchema ,byte rawHeader[] ,int hdrOffset ,int hdrLength ,JMFSchema payloadSchema ,byte rawPayload[] ,int payOffset ,int payLength ,CommsConnection conn) throws MessageDecodeFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "initialize", new Object[] {prologue ,prologueOffset ,headerSchema ,rawHeader ,hdrOffset ,hdrLength ,payloadSchema ,rawPayload ,payOffset ,payLength ,conn }); // Construct the initial JMF message. If raw buffer(s) were provided we decode the message // parts from the buffer(s)......... if (rawHeader != null) { boolean separatePrologue = ( prologue!=null ? true : false); // If debug trace, dump the buffers first if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Decoding message from byte buffer(s)"); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { String outP = null; if (separatePrologue) { outP = SibTr.formatBytes(prologue, prologueOffset, PROLOGUE_LENGTH); // depends on control dependency: [if], data = [none] } String out0 = SibTr.formatBytes(rawHeader, hdrOffset, hdrLength); String out1 = null; if (rawPayload != null) { out1 = SibTr.formatBytes(rawPayload, payOffset, payLength, MfpDiagnostics.getDiagnosticDataLimitInt()); // depends on control dependency: [if], data = [(rawPayload] } SibTr.debug(this, tc, "buffers: ", new Object[] { outP, out0, out1 }); } // Sanity check the length of the header section if (rawHeader.length-hdrOffset < hdrLength || hdrLength < IDS_LENGTH + ArrayUtil.INT_SIZE) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Message buffer size too small: "+rawHeader.length); throw new MessageDecodeFailedException("Invalid message buffer (buffer size too small)"); } // If there is a separate prologue, the JMFVersions, schemaIds & real header length will be there byte[] pBuffer; int pOffset; if (separatePrologue) { pBuffer = prologue; pOffset = prologueOffset; } // otherwise, the stuff will be at the front of the the header pBuffer else { pBuffer = rawHeader; pOffset = hdrOffset; } // Read in the Prologue information from the appropriate pBuffer short jmfVer1 = ArrayUtil.readShort(pBuffer, pOffset); pOffset += ArrayUtil.SHORT_SIZE; long encId1 = ArrayUtil.readLong(pBuffer, pOffset); pOffset += ArrayUtil.LONG_SIZE; short jmfVer2 = ArrayUtil.readShort(pBuffer, pOffset); pOffset += ArrayUtil.SHORT_SIZE; long encId2 = ArrayUtil.readLong(pBuffer, pOffset); pOffset += ArrayUtil.LONG_SIZE; int realHdrLength = ArrayUtil.readInt(pBuffer, pOffset); pOffset += ArrayUtil.INT_SIZE; // If the prologue was in the header buffer, update the offset now we have read it. if (!separatePrologue) { hdrOffset = pOffset; } // Save the original encoded message length originalLength = PROLOGUE_LENGTH + realHdrLength + payLength; // Decode the header headerPart = new JsMsgPart(initializePart(headerSchema, jmfVer1, encId1, rawHeader, hdrOffset, realHdrLength, conn)); try { // Decode the payload if present if (payLength > 0) { payloadPart = new JsMsgPart(initializePart(payloadSchema, jmfVer2, encId2, rawPayload, payOffset, payLength, conn)); // depends on control dependency: [if], data = [none] } } catch (MessageDecodeFailedException e) { // No FFDC code needed // Just write out the decoded header to any debug trace and rethrow the Exception. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Decoded JMF Message Header", debugHeaderPart()); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Decoded JMF Message", debugMsg()); } // .... If no buffers, we create new empty message parts. else if (headerSchema != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Creating new empty header message: Schema="+debugSchema(headerSchema)); headerPart = new JsMsgPart(JMFRegistry.instance.newMessage(headerSchema)); if (payloadSchema != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Creating new empty payload: Schema="+debugSchema(payloadSchema)); payloadPart = new JsMsgPart(JMFRegistry.instance.newMessage(payloadSchema)); } } /* It is legitimate for both the schema and the buffer to be null. The */ /* JMO is not initialized, which is correct for use by getCopy(). */ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "initialize"); } }
public class class_name { public static String resolveLax(String input) { try { return resolve(input, false); } catch (UnresolvedExpressionException e) { // XXX OK. It should not reach here as exceptionIfNotResolved is false. return input; } } }
public class class_name { public static String resolveLax(String input) { try { return resolve(input, false); // depends on control dependency: [try], data = [none] } catch (UnresolvedExpressionException e) { // XXX OK. It should not reach here as exceptionIfNotResolved is false. return input; } // depends on control dependency: [catch], data = [none] } }
public class class_name { Logger createChildByLastNamePart(final String lastPart) { int i_index = LoggerNameUtil.getFirstSeparatorIndexOf(lastPart); if (i_index != -1) { throw new IllegalArgumentException("Child name [" + lastPart + " passed as parameter, may not include [" + CoreConstants.DOT + "]"); } if (childrenList == null) { childrenList = new CopyOnWriteArrayList<Logger>(); } Logger childLogger; if (this.isRootLogger()) { childLogger = new Logger(lastPart, this, this.loggerContext); } else { childLogger = new Logger(name + CoreConstants.DOT + lastPart, this, this.loggerContext); } childrenList.add(childLogger); childLogger.effectiveLevelInt = this.effectiveLevelInt; return childLogger; } }
public class class_name { Logger createChildByLastNamePart(final String lastPart) { int i_index = LoggerNameUtil.getFirstSeparatorIndexOf(lastPart); if (i_index != -1) { throw new IllegalArgumentException("Child name [" + lastPart + " passed as parameter, may not include [" + CoreConstants.DOT + "]"); } if (childrenList == null) { childrenList = new CopyOnWriteArrayList<Logger>(); // depends on control dependency: [if], data = [none] } Logger childLogger; if (this.isRootLogger()) { childLogger = new Logger(lastPart, this, this.loggerContext); // depends on control dependency: [if], data = [none] } else { childLogger = new Logger(name + CoreConstants.DOT + lastPart, this, this.loggerContext); // depends on control dependency: [if], data = [none] } childrenList.add(childLogger); childLogger.effectiveLevelInt = this.effectiveLevelInt; return childLogger; } }
public class class_name { public static CipherRegistry registerCiphers(String[]... ciphers) { for (String[] cipher : ciphers) { instance.register(cipher); } return instance; } }
public class class_name { public static CipherRegistry registerCiphers(String[]... ciphers) { for (String[] cipher : ciphers) { instance.register(cipher); // depends on control dependency: [for], data = [cipher] } return instance; } }
public class class_name { public Integer getMaxIdleTime() { if (childNode.getTextValueForPatternName("max-idle-time") != null && !childNode.getTextValueForPatternName("max-idle-time").equals("null")) { return Integer.valueOf(childNode.getTextValueForPatternName("max-idle-time")); } return null; } }
public class class_name { public Integer getMaxIdleTime() { if (childNode.getTextValueForPatternName("max-idle-time") != null && !childNode.getTextValueForPatternName("max-idle-time").equals("null")) { return Integer.valueOf(childNode.getTextValueForPatternName("max-idle-time")); // depends on control dependency: [if], data = [(childNode.getTextValueForPatternName("max-idle-time")] } return null; } }
public class class_name { private Node tryReplaceIf(Node n) { Node next = null; for (Node child = n.getFirstChild(); child != null; child = next){ next = child.getNext(); if (child.isIf()){ Node cond = child.getFirstChild(); Node thenBranch = cond.getNext(); Node elseBranch = thenBranch.getNext(); Node nextNode = child.getNext(); if (nextNode != null && elseBranch == null && isReturnBlock(thenBranch) && nextNode.isIf()) { Node nextCond = nextNode.getFirstChild(); Node nextThen = nextCond.getNext(); Node nextElse = nextThen.getNext(); if (thenBranch.isEquivalentToTyped(nextThen)) { // Transform // if (x) return 1; if (y) return 1; // to // if (x||y) return 1; child.detach(); child.detachChildren(); Node newCond = new Node(Token.OR, cond); nextNode.replaceChild(nextCond, newCond); newCond.addChildToBack(nextCond); reportChangeToEnclosingScope(newCond); } else if (nextElse != null && thenBranch.isEquivalentToTyped(nextElse)) { // Transform // if (x) return 1; if (y) foo() else return 1; // to // if (!x&&y) foo() else return 1; child.detach(); child.detachChildren(); Node newCond = new Node(Token.AND, IR.not(cond).srcref(cond)); nextNode.replaceChild(nextCond, newCond); newCond.addChildToBack(nextCond); reportChangeToEnclosingScope(newCond); } } else if (nextNode != null && elseBranch == null && isReturnBlock(thenBranch) && isReturnExpression(nextNode)) { Node thenExpr = null; // if(x)return; return 1 -> return x?void 0:1 if (isReturnExpressBlock(thenBranch)) { thenExpr = getBlockReturnExpression(thenBranch); thenExpr.detach(); } else { thenExpr = NodeUtil.newUndefinedNode(child); } Node elseExpr = nextNode.getFirstChild(); cond.detach(); elseExpr.detach(); Node returnNode = IR.returnNode( IR.hook(cond, thenExpr, elseExpr) .srcref(child)); n.replaceChild(child, returnNode); n.removeChild(nextNode); reportChangeToEnclosingScope(n); // everything else in the block is dead code. break; } else if (elseBranch != null && statementMustExitParent(thenBranch)) { child.removeChild(elseBranch); n.addChildAfter(elseBranch, child); reportChangeToEnclosingScope(n); } } } return n; } }
public class class_name { private Node tryReplaceIf(Node n) { Node next = null; for (Node child = n.getFirstChild(); child != null; child = next){ next = child.getNext(); // depends on control dependency: [for], data = [child] if (child.isIf()){ Node cond = child.getFirstChild(); Node thenBranch = cond.getNext(); Node elseBranch = thenBranch.getNext(); Node nextNode = child.getNext(); if (nextNode != null && elseBranch == null && isReturnBlock(thenBranch) && nextNode.isIf()) { Node nextCond = nextNode.getFirstChild(); Node nextThen = nextCond.getNext(); Node nextElse = nextThen.getNext(); if (thenBranch.isEquivalentToTyped(nextThen)) { // Transform // if (x) return 1; if (y) return 1; // to // if (x||y) return 1; child.detach(); // depends on control dependency: [if], data = [none] child.detachChildren(); // depends on control dependency: [if], data = [none] Node newCond = new Node(Token.OR, cond); nextNode.replaceChild(nextCond, newCond); // depends on control dependency: [if], data = [none] newCond.addChildToBack(nextCond); // depends on control dependency: [if], data = [none] reportChangeToEnclosingScope(newCond); // depends on control dependency: [if], data = [none] } else if (nextElse != null && thenBranch.isEquivalentToTyped(nextElse)) { // Transform // if (x) return 1; if (y) foo() else return 1; // to // if (!x&&y) foo() else return 1; child.detach(); // depends on control dependency: [if], data = [none] child.detachChildren(); // depends on control dependency: [if], data = [none] Node newCond = new Node(Token.AND, IR.not(cond).srcref(cond)); nextNode.replaceChild(nextCond, newCond); // depends on control dependency: [if], data = [none] newCond.addChildToBack(nextCond); // depends on control dependency: [if], data = [none] reportChangeToEnclosingScope(newCond); // depends on control dependency: [if], data = [none] } } else if (nextNode != null && elseBranch == null && isReturnBlock(thenBranch) && isReturnExpression(nextNode)) { Node thenExpr = null; // if(x)return; return 1 -> return x?void 0:1 if (isReturnExpressBlock(thenBranch)) { thenExpr = getBlockReturnExpression(thenBranch); // depends on control dependency: [if], data = [none] thenExpr.detach(); // depends on control dependency: [if], data = [none] } else { thenExpr = NodeUtil.newUndefinedNode(child); // depends on control dependency: [if], data = [none] } Node elseExpr = nextNode.getFirstChild(); cond.detach(); // depends on control dependency: [if], data = [none] elseExpr.detach(); // depends on control dependency: [if], data = [none] Node returnNode = IR.returnNode( IR.hook(cond, thenExpr, elseExpr) .srcref(child)); n.replaceChild(child, returnNode); // depends on control dependency: [if], data = [none] n.removeChild(nextNode); // depends on control dependency: [if], data = [none] reportChangeToEnclosingScope(n); // depends on control dependency: [if], data = [none] // everything else in the block is dead code. break; } else if (elseBranch != null && statementMustExitParent(thenBranch)) { child.removeChild(elseBranch); // depends on control dependency: [if], data = [(elseBranch] n.addChildAfter(elseBranch, child); // depends on control dependency: [if], data = [(elseBranch] reportChangeToEnclosingScope(n); // depends on control dependency: [if], data = [none] } } } return n; } }
public class class_name { public Observable<ServiceResponseWithHeaders<TaskAddCollectionResult, TaskAddCollectionHeaders>> addCollectionWithServiceResponseAsync(String jobId, List<TaskAddParameter> value) { if (this.client.batchUrl() == null) { throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null."); } if (jobId == null) { throw new IllegalArgumentException("Parameter jobId is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } if (value == null) { throw new IllegalArgumentException("Parameter value is required and cannot be null."); } Validator.validate(value); final TaskAddCollectionOptions taskAddCollectionOptions = null; Integer timeout = null; UUID clientRequestId = null; Boolean returnClientRequestId = null; DateTime ocpDate = null; TaskAddCollectionParameter taskCollection = new TaskAddCollectionParameter(); taskCollection.withValue(value); String parameterizedHost = Joiner.on(", ").join("{batchUrl}", this.client.batchUrl()); DateTimeRfc1123 ocpDateConverted = null; if (ocpDate != null) { ocpDateConverted = new DateTimeRfc1123(ocpDate); } return service.addCollection(jobId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, taskCollection, parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<TaskAddCollectionResult, TaskAddCollectionHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<TaskAddCollectionResult, TaskAddCollectionHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<TaskAddCollectionResult, TaskAddCollectionHeaders> clientResponse = addCollectionDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponseWithHeaders<TaskAddCollectionResult, TaskAddCollectionHeaders>> addCollectionWithServiceResponseAsync(String jobId, List<TaskAddParameter> value) { if (this.client.batchUrl() == null) { throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null."); } if (jobId == null) { throw new IllegalArgumentException("Parameter jobId is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } if (value == null) { throw new IllegalArgumentException("Parameter value is required and cannot be null."); } Validator.validate(value); final TaskAddCollectionOptions taskAddCollectionOptions = null; Integer timeout = null; UUID clientRequestId = null; Boolean returnClientRequestId = null; DateTime ocpDate = null; TaskAddCollectionParameter taskCollection = new TaskAddCollectionParameter(); taskCollection.withValue(value); String parameterizedHost = Joiner.on(", ").join("{batchUrl}", this.client.batchUrl()); DateTimeRfc1123 ocpDateConverted = null; if (ocpDate != null) { ocpDateConverted = new DateTimeRfc1123(ocpDate); // depends on control dependency: [if], data = [(ocpDate] } return service.addCollection(jobId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, taskCollection, parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<TaskAddCollectionResult, TaskAddCollectionHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<TaskAddCollectionResult, TaskAddCollectionHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<TaskAddCollectionResult, TaskAddCollectionHeaders> clientResponse = addCollectionDelegate(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 { private String normalizeActionPath(Resource parent, String uri) { String relativeUri = extractRelativeUrl(uri, parent.getUri()); if (!relativeUri.startsWith("/")) { relativeUri = "/" + relativeUri; } return relativeUri; } }
public class class_name { private String normalizeActionPath(Resource parent, String uri) { String relativeUri = extractRelativeUrl(uri, parent.getUri()); if (!relativeUri.startsWith("/")) { relativeUri = "/" + relativeUri; // depends on control dependency: [if], data = [none] } return relativeUri; } }
public class class_name { private void setCurrentTab(final int index) { if (this.currentTab == index) { // already current return; } this.currentTab = index; final Component component; if ((currentTab == -1) || tabs.isEmpty() || !getVisiblityCache().isVisible(currentTab)) { // no tabs or the current tab is not visible component = newPanel(); } else { // show panel from selected tab final T tab = tabs.get(currentTab); component = tab.getPanel(TAB_PANEL_ID); if (component == null) { throw new WicketRuntimeException("ITab.getPanel() returned null. TabbedPanel [" + getPath() + "] ITab index [" + currentTab + "]"); } } if (!component.getId().equals(TAB_PANEL_ID)) { throw new WicketRuntimeException( "ITab.getPanel() returned a panel with invalid id [" + component.getId() + "]. You always have to return a panel with id equal to the provided panelId parameter. TabbedPanel [" + getPath() + "] ITab index [" + currentTab + "]"); } addOrReplace(component); } }
public class class_name { private void setCurrentTab(final int index) { if (this.currentTab == index) { // already current return; // depends on control dependency: [if], data = [none] } this.currentTab = index; final Component component; if ((currentTab == -1) || tabs.isEmpty() || !getVisiblityCache().isVisible(currentTab)) { // no tabs or the current tab is not visible component = newPanel(); // depends on control dependency: [if], data = [none] } else { // show panel from selected tab final T tab = tabs.get(currentTab); component = tab.getPanel(TAB_PANEL_ID); // depends on control dependency: [if], data = [none] if (component == null) { throw new WicketRuntimeException("ITab.getPanel() returned null. TabbedPanel [" + getPath() + "] ITab index [" + currentTab + "]"); } } if (!component.getId().equals(TAB_PANEL_ID)) { throw new WicketRuntimeException( "ITab.getPanel() returned a panel with invalid id [" + component.getId() + "]. You always have to return a panel with id equal to the provided panelId parameter. TabbedPanel [" + getPath() + "] ITab index [" + currentTab + "]"); } addOrReplace(component); } }
public class class_name { private String[] parseIncludes(String sincludes) { sincludes = sincludes.trim(); if ("".equals(sincludes)) { return null; } String[] arr = sincludes.split(","); if (arr != null) { for (int i = 0; i < arr.length; i++) { arr[i] = arr[i].trim(); } } return arr; } }
public class class_name { private String[] parseIncludes(String sincludes) { sincludes = sincludes.trim(); if ("".equals(sincludes)) { return null; // depends on control dependency: [if], data = [none] } String[] arr = sincludes.split(","); if (arr != null) { for (int i = 0; i < arr.length; i++) { arr[i] = arr[i].trim(); // depends on control dependency: [for], data = [i] } } return arr; } }
public class class_name { public java.util.List<String> getVpcSecurityGroupIds() { if (vpcSecurityGroupIds == null) { vpcSecurityGroupIds = new com.amazonaws.internal.SdkInternalList<String>(); } return vpcSecurityGroupIds; } }
public class class_name { public java.util.List<String> getVpcSecurityGroupIds() { if (vpcSecurityGroupIds == null) { vpcSecurityGroupIds = new com.amazonaws.internal.SdkInternalList<String>(); // depends on control dependency: [if], data = [none] } return vpcSecurityGroupIds; } }
public class class_name { private Set<RemotingDestinationMetadata> findRemotingDestinations(ConfigurableListableBeanFactory beanFactory) { Set<RemotingDestinationMetadata> remotingDestinations = new HashSet<RemotingDestinationMetadata>(); Set<String> beanNames = new HashSet<String>(); beanNames.addAll(Arrays.asList(beanFactory.getBeanDefinitionNames())); if (beanFactory.getParentBeanFactory() instanceof ListableBeanFactory) { beanNames.addAll(Arrays.asList(((ListableBeanFactory)beanFactory.getParentBeanFactory()).getBeanDefinitionNames())); } for (String beanName : beanNames) { if (beanName.startsWith("scopedTarget.")) { continue; } RemotingDestination remotingDestination = null; BeanDefinition bd = beanFactory.getMergedBeanDefinition(beanName); if (bd.isAbstract() || bd.isLazyInit()) { continue; } if (bd instanceof AbstractBeanDefinition) { AbstractBeanDefinition abd = (AbstractBeanDefinition) bd; if (abd.hasBeanClass()) { Class<?> beanClass = abd.getBeanClass(); remotingDestination = AnnotationUtils.findAnnotation(beanClass, RemotingDestination.class); if (remotingDestination != null) { remotingDestinations.add(new RemotingDestinationMetadata(remotingDestination, beanName, beanClass)); continue; } } } Class<?> handlerType = beanFactory.getType(beanName); if (handlerType != null) { remotingDestination = AnnotationUtils.findAnnotation(handlerType, RemotingDestination.class); } else { if (log.isDebugEnabled()) { log.debug("Could not get type of bean '" + beanName + "' from bean factory."); } } if (remotingDestination != null) { remotingDestinations.add(new RemotingDestinationMetadata(remotingDestination, beanName, handlerType)); } } return remotingDestinations; } }
public class class_name { private Set<RemotingDestinationMetadata> findRemotingDestinations(ConfigurableListableBeanFactory beanFactory) { Set<RemotingDestinationMetadata> remotingDestinations = new HashSet<RemotingDestinationMetadata>(); Set<String> beanNames = new HashSet<String>(); beanNames.addAll(Arrays.asList(beanFactory.getBeanDefinitionNames())); if (beanFactory.getParentBeanFactory() instanceof ListableBeanFactory) { beanNames.addAll(Arrays.asList(((ListableBeanFactory)beanFactory.getParentBeanFactory()).getBeanDefinitionNames())); // depends on control dependency: [if], data = [none] } for (String beanName : beanNames) { if (beanName.startsWith("scopedTarget.")) { continue; } RemotingDestination remotingDestination = null; BeanDefinition bd = beanFactory.getMergedBeanDefinition(beanName); if (bd.isAbstract() || bd.isLazyInit()) { continue; } if (bd instanceof AbstractBeanDefinition) { AbstractBeanDefinition abd = (AbstractBeanDefinition) bd; if (abd.hasBeanClass()) { Class<?> beanClass = abd.getBeanClass(); remotingDestination = AnnotationUtils.findAnnotation(beanClass, RemotingDestination.class); if (remotingDestination != null) { remotingDestinations.add(new RemotingDestinationMetadata(remotingDestination, beanName, beanClass)); // depends on control dependency: [if], data = [(remotingDestination] continue; } } } Class<?> handlerType = beanFactory.getType(beanName); if (handlerType != null) { remotingDestination = AnnotationUtils.findAnnotation(handlerType, RemotingDestination.class); // depends on control dependency: [if], data = [(handlerType] } else { if (log.isDebugEnabled()) { log.debug("Could not get type of bean '" + beanName + "' from bean factory."); // depends on control dependency: [if], data = [none] } } if (remotingDestination != null) { remotingDestinations.add(new RemotingDestinationMetadata(remotingDestination, beanName, handlerType)); // depends on control dependency: [if], data = [(remotingDestination] } } return remotingDestinations; } }
public class class_name { @Deprecated protected boolean isRetriableException(Throwable e) { if (getRetryHandler() != null) { return getRetryHandler().isRetriableException(e, true); } return false; } }
public class class_name { @Deprecated protected boolean isRetriableException(Throwable e) { if (getRetryHandler() != null) { return getRetryHandler().isRetriableException(e, true); // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { int resolveNameAndTypeIndex(String name, String descriptor) { int size = 0; int index = 0; constantReadLock.lock(); try { size = getConstantPoolSize(); index = getNameAndTypeIndex(name, descriptor); } finally { constantReadLock.unlock(); } if (index != -1) { return index; } else { int nameIndex = resolveNameIndex(name); int typeIndex = resolveNameIndex(descriptor); return addConstantInfo(new NameAndType(nameIndex, typeIndex), size); } } }
public class class_name { int resolveNameAndTypeIndex(String name, String descriptor) { int size = 0; int index = 0; constantReadLock.lock(); try { size = getConstantPoolSize(); // depends on control dependency: [try], data = [none] index = getNameAndTypeIndex(name, descriptor); // depends on control dependency: [try], data = [none] } finally { constantReadLock.unlock(); } if (index != -1) { return index; // depends on control dependency: [if], data = [none] } else { int nameIndex = resolveNameIndex(name); int typeIndex = resolveNameIndex(descriptor); return addConstantInfo(new NameAndType(nameIndex, typeIndex), size); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void close() { cancel = true; try { thread.interrupt(); waitFor(); } catch (Throwable ignore) {} try { is.close(); } catch (Exception ignore) {} try { os.close(); } catch (Exception ignore) {} } }
public class class_name { public void close() { cancel = true; try { thread.interrupt(); // depends on control dependency: [try], data = [none] waitFor(); // depends on control dependency: [try], data = [none] } catch (Throwable ignore) {} // depends on control dependency: [catch], data = [none] try { is.close(); // depends on control dependency: [try], data = [none] } catch (Exception ignore) {} // depends on control dependency: [catch], data = [none] try { os.close(); // depends on control dependency: [try], data = [none] } catch (Exception ignore) {} // depends on control dependency: [catch], data = [none] } }
public class class_name { public static Collection map(Mapper mapper, Enumeration en, boolean allowNull) { ArrayList l = new ArrayList(); while (en.hasMoreElements()) { Object o = mapper.map(en.nextElement()); if (allowNull || o != null) { l.add(o); } } return l; } }
public class class_name { public static Collection map(Mapper mapper, Enumeration en, boolean allowNull) { ArrayList l = new ArrayList(); while (en.hasMoreElements()) { Object o = mapper.map(en.nextElement()); if (allowNull || o != null) { l.add(o); // depends on control dependency: [if], data = [none] } } return l; } }
public class class_name { public static void writeObject(Object object, OutputStream outputStream) { try { if (object instanceof Compactable) { ((Compactable) object).compact(); } defaultObjectMapper.writeValue(outputStream, object); } catch (IOException exp) { throw new RuntimeException("Failed to write object to outputstream", exp); } } }
public class class_name { public static void writeObject(Object object, OutputStream outputStream) { try { if (object instanceof Compactable) { ((Compactable) object).compact(); // depends on control dependency: [if], data = [none] } defaultObjectMapper.writeValue(outputStream, object); // depends on control dependency: [try], data = [none] } catch (IOException exp) { throw new RuntimeException("Failed to write object to outputstream", exp); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public Set<Category> getSiblings() { Set<Category> siblings = new HashSet<Category>(); // add siblings for (Category parent : this.getParents()) { siblings.addAll(parent.getChildren()); } // remove this category from list siblings.remove(this); return siblings; } }
public class class_name { public Set<Category> getSiblings() { Set<Category> siblings = new HashSet<Category>(); // add siblings for (Category parent : this.getParents()) { siblings.addAll(parent.getChildren()); // depends on control dependency: [for], data = [parent] } // remove this category from list siblings.remove(this); return siblings; } }
public class class_name { private void setupLoggerFromProperties(final Properties props) { final String driverLogLevel = PGProperty.LOGGER_LEVEL.get(props); if (driverLogLevel == null) { return; // Don't mess with Logger if not set } if ("OFF".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.OFF); return; // Don't mess with Logger if set to OFF } else if ("DEBUG".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.FINE); } else if ("TRACE".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.FINEST); } ExpressionProperties exprProps = new ExpressionProperties(props, System.getProperties()); final String driverLogFile = PGProperty.LOGGER_FILE.get(exprProps); if (driverLogFile != null && driverLogFile.equals(loggerHandlerFile)) { return; // Same file output, do nothing. } for (java.util.logging.Handler handlers : PARENT_LOGGER.getHandlers()) { // Remove previously set Handlers handlers.close(); PARENT_LOGGER.removeHandler(handlers); loggerHandlerFile = null; } java.util.logging.Handler handler = null; if (driverLogFile != null) { try { handler = new java.util.logging.FileHandler(driverLogFile); loggerHandlerFile = driverLogFile; } catch (Exception ex) { System.err.println("Cannot enable FileHandler, fallback to ConsoleHandler."); } } Formatter formatter = new SimpleFormatter(); if ( handler == null ) { if (DriverManager.getLogWriter() != null) { handler = new WriterHandler(DriverManager.getLogWriter()); } else if ( DriverManager.getLogStream() != null) { handler = new StreamHandler(DriverManager.getLogStream(), formatter); } else { handler = new StreamHandler(System.err, formatter); } } else { handler.setFormatter(formatter); } handler.setLevel(PARENT_LOGGER.getLevel()); PARENT_LOGGER.setUseParentHandlers(false); PARENT_LOGGER.addHandler(handler); } }
public class class_name { private void setupLoggerFromProperties(final Properties props) { final String driverLogLevel = PGProperty.LOGGER_LEVEL.get(props); if (driverLogLevel == null) { return; // Don't mess with Logger if not set // depends on control dependency: [if], data = [none] } if ("OFF".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.OFF); // depends on control dependency: [if], data = [none] return; // Don't mess with Logger if set to OFF // depends on control dependency: [if], data = [none] } else if ("DEBUG".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.FINE); // depends on control dependency: [if], data = [none] } else if ("TRACE".equalsIgnoreCase(driverLogLevel)) { PARENT_LOGGER.setLevel(Level.FINEST); // depends on control dependency: [if], data = [none] } ExpressionProperties exprProps = new ExpressionProperties(props, System.getProperties()); final String driverLogFile = PGProperty.LOGGER_FILE.get(exprProps); if (driverLogFile != null && driverLogFile.equals(loggerHandlerFile)) { return; // Same file output, do nothing. // depends on control dependency: [if], data = [none] } for (java.util.logging.Handler handlers : PARENT_LOGGER.getHandlers()) { // Remove previously set Handlers handlers.close(); // depends on control dependency: [for], data = [handlers] PARENT_LOGGER.removeHandler(handlers); // depends on control dependency: [for], data = [handlers] loggerHandlerFile = null; // depends on control dependency: [for], data = [none] } java.util.logging.Handler handler = null; if (driverLogFile != null) { try { handler = new java.util.logging.FileHandler(driverLogFile); // depends on control dependency: [try], data = [none] loggerHandlerFile = driverLogFile; // depends on control dependency: [try], data = [none] } catch (Exception ex) { System.err.println("Cannot enable FileHandler, fallback to ConsoleHandler."); } // depends on control dependency: [catch], data = [none] } Formatter formatter = new SimpleFormatter(); if ( handler == null ) { if (DriverManager.getLogWriter() != null) { handler = new WriterHandler(DriverManager.getLogWriter()); // depends on control dependency: [if], data = [(DriverManager.getLogWriter()] } else if ( DriverManager.getLogStream() != null) { handler = new StreamHandler(DriverManager.getLogStream(), formatter); // depends on control dependency: [if], data = [none] } else { handler = new StreamHandler(System.err, formatter); // depends on control dependency: [if], data = [none] } } else { handler.setFormatter(formatter); // depends on control dependency: [if], data = [none] } handler.setLevel(PARENT_LOGGER.getLevel()); PARENT_LOGGER.setUseParentHandlers(false); PARENT_LOGGER.addHandler(handler); } }
public class class_name { @Override public void close() throws IOException { boolean enqueueOnSocketClose; synchronized(closeLock) { if(closeTime == null) { // Remove this from the context socketContext.onClose(this); closeTime = System.currentTimeMillis(); enqueueOnSocketClose = true; } else { enqueueOnSocketClose = false; } } if(enqueueOnSocketClose) { Future<?> future = listenerManager.enqueueEvent( new ConcurrentListenerManager.Event<SocketListener>() { @Override public Runnable createCall(final SocketListener listener) { return new Runnable() { @Override public void run() { listener.onSocketClose(AbstractSocket.this); } }; } } ); try { logger.log(Level.FINE, "Waiting for calls to onSocketClose to complete"); future.get(); logger.log(Level.FINE, "All calls to onSocketClose finished"); } catch(ExecutionException e) { logger.log(Level.SEVERE, null, e); } catch(InterruptedException e) { logger.log(Level.SEVERE, null, e); // Restore the interrupted status Thread.currentThread().interrupt(); } } listenerManager.close(); } }
public class class_name { @Override public void close() throws IOException { boolean enqueueOnSocketClose; synchronized(closeLock) { if(closeTime == null) { // Remove this from the context socketContext.onClose(this); // depends on control dependency: [if], data = [none] closeTime = System.currentTimeMillis(); // depends on control dependency: [if], data = [none] enqueueOnSocketClose = true; // depends on control dependency: [if], data = [none] } else { enqueueOnSocketClose = false; // depends on control dependency: [if], data = [none] } } if(enqueueOnSocketClose) { Future<?> future = listenerManager.enqueueEvent( new ConcurrentListenerManager.Event<SocketListener>() { @Override public Runnable createCall(final SocketListener listener) { return new Runnable() { @Override public void run() { listener.onSocketClose(AbstractSocket.this); } }; } } ); try { logger.log(Level.FINE, "Waiting for calls to onSocketClose to complete"); // depends on control dependency: [try], data = [none] future.get(); // depends on control dependency: [try], data = [none] logger.log(Level.FINE, "All calls to onSocketClose finished"); // depends on control dependency: [try], data = [none] } catch(ExecutionException e) { logger.log(Level.SEVERE, null, e); } catch(InterruptedException e) { // depends on control dependency: [catch], data = [none] logger.log(Level.SEVERE, null, e); // Restore the interrupted status Thread.currentThread().interrupt(); } // depends on control dependency: [catch], data = [none] } listenerManager.close(); } }
public class class_name { protected void handleBodyLinks(JsonNode jsonBody, Map<String, Map<URI, String>> links, Map<String, String> linkTemplates) { if (jsonBody.getNodeType() != JsonNodeType.OBJECT) { return; } JsonNode linksNode = jsonBody.get("_links"); if (linksNode == null) { linksNode = jsonBody.get("links"); } if (linksNode == null) { return; } linksNode.fields().forEachRemaining(x -> { String rel = x.getKey(); Map<URI, String> linksForRel = getOrAdd(links, rel); switch (x.getValue().getNodeType()) { case ARRAY: x.getValue().forEach(subobj -> { if (subobj.getNodeType() == JsonNodeType.OBJECT) { parseLinkObject(rel, (ObjectNode) subobj, linksForRel, linkTemplates); } }); break; case OBJECT: parseLinkObject(rel, (ObjectNode) x.getValue(), linksForRel, linkTemplates); break; } }); } }
public class class_name { protected void handleBodyLinks(JsonNode jsonBody, Map<String, Map<URI, String>> links, Map<String, String> linkTemplates) { if (jsonBody.getNodeType() != JsonNodeType.OBJECT) { return; // depends on control dependency: [if], data = [none] } JsonNode linksNode = jsonBody.get("_links"); if (linksNode == null) { linksNode = jsonBody.get("links"); // depends on control dependency: [if], data = [none] } if (linksNode == null) { return; // depends on control dependency: [if], data = [none] } linksNode.fields().forEachRemaining(x -> { String rel = x.getKey(); Map<URI, String> linksForRel = getOrAdd(links, rel); switch (x.getValue().getNodeType()) { case ARRAY: x.getValue().forEach(subobj -> { if (subobj.getNodeType() == JsonNodeType.OBJECT) { parseLinkObject(rel, (ObjectNode) subobj, linksForRel, linkTemplates); // depends on control dependency: [if], data = [none] } }); break; case OBJECT: parseLinkObject(rel, (ObjectNode) x.getValue(), linksForRel, linkTemplates); break; } }); } }
public class class_name { @SuppressWarnings("unchecked") public static Object searchProperty(Object leftParameter, String name) throws Exception { Class<?> leftClass = leftParameter.getClass(); Object result; if (leftParameter.getClass().isArray() && "length".equals(name)) { result = Array.getLength(leftParameter); } else if (leftParameter instanceof Map) { result = ((Map<Object, Object>) leftParameter).get(name); } else { try { String getter = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); Method method = leftClass.getMethod(getter); if (!method.isAccessible()) { method.setAccessible(true); } result = method.invoke(leftParameter); } catch (NoSuchMethodException e2) { try { String getter = "is" + name.substring(0, 1).toUpperCase() + name.substring(1); Method method = leftClass.getMethod(getter); if (!method.isAccessible()) { method.setAccessible(true); } result = method.invoke(leftParameter); } catch (NoSuchMethodException e3) { Field field = leftClass.getField(name); result = field.get(leftParameter); } } } return result; } }
public class class_name { @SuppressWarnings("unchecked") public static Object searchProperty(Object leftParameter, String name) throws Exception { Class<?> leftClass = leftParameter.getClass(); Object result; if (leftParameter.getClass().isArray() && "length".equals(name)) { result = Array.getLength(leftParameter); } else if (leftParameter instanceof Map) { result = ((Map<Object, Object>) leftParameter).get(name); } else { try { String getter = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); Method method = leftClass.getMethod(getter); if (!method.isAccessible()) { method.setAccessible(true); // depends on control dependency: [if], data = [none] } result = method.invoke(leftParameter); // depends on control dependency: [try], data = [none] } catch (NoSuchMethodException e2) { try { String getter = "is" + name.substring(0, 1).toUpperCase() + name.substring(1); Method method = leftClass.getMethod(getter); if (!method.isAccessible()) { method.setAccessible(true); // depends on control dependency: [if], data = [none] } result = method.invoke(leftParameter); // depends on control dependency: [try], data = [none] } catch (NoSuchMethodException e3) { Field field = leftClass.getField(name); result = field.get(leftParameter); } // depends on control dependency: [catch], data = [none] } // depends on control dependency: [catch], data = [none] } return result; } }
public class class_name { public BatchListObjectPoliciesResponse withAttachedPolicyIds(String... attachedPolicyIds) { if (this.attachedPolicyIds == null) { setAttachedPolicyIds(new java.util.ArrayList<String>(attachedPolicyIds.length)); } for (String ele : attachedPolicyIds) { this.attachedPolicyIds.add(ele); } return this; } }
public class class_name { public BatchListObjectPoliciesResponse withAttachedPolicyIds(String... attachedPolicyIds) { if (this.attachedPolicyIds == null) { setAttachedPolicyIds(new java.util.ArrayList<String>(attachedPolicyIds.length)); // depends on control dependency: [if], data = [none] } for (String ele : attachedPolicyIds) { this.attachedPolicyIds.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static void main(final String[] args) { SLF4JBridgeHandler.install(); boolean exitWithError = true; StopWatch stopWatch = new StopWatch(); try { RESULT_LOG.info("jFunk started"); stopWatch.start(); int threadCount = 1; boolean parallel = false; Properties scriptProperties = new Properties(); List<File> scripts = Lists.newArrayList(); for (String arg : args) { if (arg.startsWith("-threadcount")) { String[] split = arg.split("="); Preconditions.checkArgument(split.length == 2, "The number of threads must be specified as follows: -threadcount=<value>"); threadCount = Integer.parseInt(split[1]); RESULT_LOG.info("Using " + threadCount + (threadCount == 1 ? " thread" : " threads")); } else if (arg.startsWith("-S")) { arg = arg.substring(2); String[] split = arg.split("="); Preconditions .checkArgument(split.length == 2, "Script parameters must be given in the form -S<name>=<value>"); scriptProperties.setProperty(split[0], normalizeScriptParameterValue(split[1])); RESULT_LOG.info("Using script parameter " + split[0] + " with value " + split[1]); } else if (arg.equals("-parallel")) { parallel = true; RESULT_LOG.info("Using parallel mode"); } else { scripts.add(new File(arg)); } } if (scripts.isEmpty()) { scripts.addAll(requestScriptsViaGui()); if (scripts.isEmpty()) { RESULT_LOG.info("Execution finished (took " + stopWatch + " H:mm:ss.SSS)"); System.exit(0); } } String propsFileName = System.getProperty("jfunk.props.file", "jfunk.properties"); Module module = ModulesLoader.loadModulesFromProperties(new JFunkDefaultModule(), propsFileName); Injector injector = Guice.createInjector(module); JFunkFactory factory = injector.getInstance(JFunkFactory.class); JFunkBase jFunk = factory.create(threadCount, parallel, scripts, scriptProperties); jFunk.execute(); exitWithError = false; } catch (JFunkExecutionException ex) { // no logging necessary } catch (Exception ex) { Logger.getLogger(JFunk.class).error("jFunk terminated unexpectedly.", ex); } finally { stopWatch.stop(); RESULT_LOG.info("Execution finished (took " + stopWatch + " H:mm:ss.SSS)"); } System.exit(exitWithError ? -1 : 0); } }
public class class_name { public static void main(final String[] args) { SLF4JBridgeHandler.install(); boolean exitWithError = true; StopWatch stopWatch = new StopWatch(); try { RESULT_LOG.info("jFunk started"); // depends on control dependency: [try], data = [none] stopWatch.start(); // depends on control dependency: [try], data = [none] int threadCount = 1; boolean parallel = false; Properties scriptProperties = new Properties(); List<File> scripts = Lists.newArrayList(); for (String arg : args) { if (arg.startsWith("-threadcount")) { String[] split = arg.split("="); Preconditions.checkArgument(split.length == 2, "The number of threads must be specified as follows: -threadcount=<value>"); // depends on control dependency: [if], data = [none] threadCount = Integer.parseInt(split[1]); // depends on control dependency: [if], data = [none] RESULT_LOG.info("Using " + threadCount + (threadCount == 1 ? " thread" : " threads")); // depends on control dependency: [if], data = [none] } else if (arg.startsWith("-S")) { arg = arg.substring(2); // depends on control dependency: [if], data = [none] String[] split = arg.split("="); Preconditions .checkArgument(split.length == 2, "Script parameters must be given in the form -S<name>=<value>"); // depends on control dependency: [if], data = [none] scriptProperties.setProperty(split[0], normalizeScriptParameterValue(split[1])); // depends on control dependency: [if], data = [none] RESULT_LOG.info("Using script parameter " + split[0] + " with value " + split[1]); // depends on control dependency: [if], data = [none] } else if (arg.equals("-parallel")) { parallel = true; // depends on control dependency: [if], data = [none] RESULT_LOG.info("Using parallel mode"); // depends on control dependency: [if], data = [none] } else { scripts.add(new File(arg)); // depends on control dependency: [if], data = [none] } } if (scripts.isEmpty()) { scripts.addAll(requestScriptsViaGui()); // depends on control dependency: [if], data = [none] if (scripts.isEmpty()) { RESULT_LOG.info("Execution finished (took " + stopWatch + " H:mm:ss.SSS)"); // depends on control dependency: [if], data = [none] System.exit(0); // depends on control dependency: [if], data = [none] } } String propsFileName = System.getProperty("jfunk.props.file", "jfunk.properties"); Module module = ModulesLoader.loadModulesFromProperties(new JFunkDefaultModule(), propsFileName); Injector injector = Guice.createInjector(module); JFunkFactory factory = injector.getInstance(JFunkFactory.class); JFunkBase jFunk = factory.create(threadCount, parallel, scripts, scriptProperties); jFunk.execute(); // depends on control dependency: [try], data = [none] exitWithError = false; // depends on control dependency: [try], data = [none] } catch (JFunkExecutionException ex) { // no logging necessary } catch (Exception ex) { // depends on control dependency: [catch], data = [none] Logger.getLogger(JFunk.class).error("jFunk terminated unexpectedly.", ex); } finally { // depends on control dependency: [catch], data = [none] stopWatch.stop(); RESULT_LOG.info("Execution finished (took " + stopWatch + " H:mm:ss.SSS)"); } System.exit(exitWithError ? -1 : 0); } }
public class class_name { @Override public BarrierFunction createPhase1BarrierFunction(){ final int dimPh1 = dim +1; ConvexMultivariateRealFunction[] inequalitiesPh1 = new ConvexMultivariateRealFunction[this.fi.length]; for(int i=0; i<inequalitiesPh1.length; i++){ final ConvexMultivariateRealFunction originalFi = this.fi[i]; ConvexMultivariateRealFunction fi = new ConvexMultivariateRealFunction() { @Override public double value(double[] Y) { DoubleMatrix1D y = DoubleFactory1D.dense.make(Y); DoubleMatrix1D X = y.viewPart(0, dim); return originalFi.value(X.toArray()) - y.get(dimPh1-1); } @Override public double[] gradient(double[] Y) { DoubleMatrix1D y = DoubleFactory1D.dense.make(Y); DoubleMatrix1D X = y.viewPart(0, dim); DoubleMatrix1D origGrad = F1.make(originalFi.gradient(X.toArray())); DoubleMatrix1D ret = F1.make(1, -1); ret = F1.append(origGrad, ret); return ret.toArray(); } @Override public double[][] hessian(double[] Y) { DoubleMatrix1D y = DoubleFactory1D.dense.make(Y); DoubleMatrix1D X = y.viewPart(0, dim); DoubleMatrix2D origHess; double[][] origFiHessX = originalFi.hessian(X.toArray()); if(origFiHessX == FunctionsUtils.ZEROES_2D_ARRAY_PLACEHOLDER){ return FunctionsUtils.ZEROES_2D_ARRAY_PLACEHOLDER; }else{ origHess = F2.make(origFiHessX); DoubleMatrix2D[][] parts = new DoubleMatrix2D[][]{{origHess, null},{null,F2.make(1, 1)}}; return F2.compose(parts).toArray(); } } @Override public int getDim() { return dimPh1; } }; inequalitiesPh1[i] = fi; } BarrierFunction bfPh1 = new LogarithmicBarrier(inequalitiesPh1, dimPh1); return bfPh1; } }
public class class_name { @Override public BarrierFunction createPhase1BarrierFunction(){ final int dimPh1 = dim +1; ConvexMultivariateRealFunction[] inequalitiesPh1 = new ConvexMultivariateRealFunction[this.fi.length]; for(int i=0; i<inequalitiesPh1.length; i++){ final ConvexMultivariateRealFunction originalFi = this.fi[i]; ConvexMultivariateRealFunction fi = new ConvexMultivariateRealFunction() { @Override public double value(double[] Y) { DoubleMatrix1D y = DoubleFactory1D.dense.make(Y); DoubleMatrix1D X = y.viewPart(0, dim); return originalFi.value(X.toArray()) - y.get(dimPh1-1); } @Override public double[] gradient(double[] Y) { DoubleMatrix1D y = DoubleFactory1D.dense.make(Y); DoubleMatrix1D X = y.viewPart(0, dim); DoubleMatrix1D origGrad = F1.make(originalFi.gradient(X.toArray())); DoubleMatrix1D ret = F1.make(1, -1); ret = F1.append(origGrad, ret); return ret.toArray(); } @Override public double[][] hessian(double[] Y) { DoubleMatrix1D y = DoubleFactory1D.dense.make(Y); DoubleMatrix1D X = y.viewPart(0, dim); DoubleMatrix2D origHess; double[][] origFiHessX = originalFi.hessian(X.toArray()); if(origFiHessX == FunctionsUtils.ZEROES_2D_ARRAY_PLACEHOLDER){ return FunctionsUtils.ZEROES_2D_ARRAY_PLACEHOLDER; // depends on control dependency: [if], data = [none] }else{ origHess = F2.make(origFiHessX); // depends on control dependency: [if], data = [(origFiHessX] DoubleMatrix2D[][] parts = new DoubleMatrix2D[][]{{origHess, null},{null,F2.make(1, 1)}}; return F2.compose(parts).toArray(); // depends on control dependency: [if], data = [none] } } @Override public int getDim() { return dimPh1; } }; inequalitiesPh1[i] = fi; // depends on control dependency: [for], data = [i] } BarrierFunction bfPh1 = new LogarithmicBarrier(inequalitiesPh1, dimPh1); return bfPh1; } }
public class class_name { @Override public EClass getIfcRationalBSplineSurfaceWithKnots() { if (ifcRationalBSplineSurfaceWithKnotsEClass == null) { ifcRationalBSplineSurfaceWithKnotsEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(501); } return ifcRationalBSplineSurfaceWithKnotsEClass; } }
public class class_name { @Override public EClass getIfcRationalBSplineSurfaceWithKnots() { if (ifcRationalBSplineSurfaceWithKnotsEClass == null) { ifcRationalBSplineSurfaceWithKnotsEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(501); // depends on control dependency: [if], data = [none] } return ifcRationalBSplineSurfaceWithKnotsEClass; } }
public class class_name { public double estimateExcludedVolumeFraction(){ //Calculate volume/area of the of the scene without obstacles if(recalculateVolumeFraction){ CentralRandomNumberGenerator r = CentralRandomNumberGenerator.getInstance(); boolean firstRandomDraw = false; if(randomNumbers==null){ randomNumbers = new double[nRandPoints*dimension]; firstRandomDraw = true; } int countCollision = 0; for(int i = 0; i< nRandPoints; i++){ double[] pos = new double[dimension]; for(int j = 0; j < dimension; j++){ if(firstRandomDraw){ randomNumbers[i*dimension + j] = r.nextDouble(); } pos[j] = randomNumbers[i*dimension + j]*size[j]; } if(checkCollision(pos)){ countCollision++; } } fraction = countCollision*1.0/nRandPoints; recalculateVolumeFraction = false; } return fraction; } }
public class class_name { public double estimateExcludedVolumeFraction(){ //Calculate volume/area of the of the scene without obstacles if(recalculateVolumeFraction){ CentralRandomNumberGenerator r = CentralRandomNumberGenerator.getInstance(); boolean firstRandomDraw = false; if(randomNumbers==null){ randomNumbers = new double[nRandPoints*dimension]; // depends on control dependency: [if], data = [none] firstRandomDraw = true; // depends on control dependency: [if], data = [none] } int countCollision = 0; for(int i = 0; i< nRandPoints; i++){ double[] pos = new double[dimension]; for(int j = 0; j < dimension; j++){ if(firstRandomDraw){ randomNumbers[i*dimension + j] = r.nextDouble(); // depends on control dependency: [if], data = [none] } pos[j] = randomNumbers[i*dimension + j]*size[j]; // depends on control dependency: [for], data = [j] } if(checkCollision(pos)){ countCollision++; // depends on control dependency: [if], data = [none] } } fraction = countCollision*1.0/nRandPoints; // depends on control dependency: [if], data = [none] recalculateVolumeFraction = false; // depends on control dependency: [if], data = [none] } return fraction; } }
public class class_name { public Collection<BoxFileVersion> getVersions() { URL url = VERSIONS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonObject = JsonObject.readFrom(response.getJSON()); JsonArray entries = jsonObject.get("entries").asArray(); Collection<BoxFileVersion> versions = new ArrayList<BoxFileVersion>(); for (JsonValue entry : entries) { versions.add(new BoxFileVersion(this.getAPI(), entry.asObject(), this.getID())); } return versions; } }
public class class_name { public Collection<BoxFileVersion> getVersions() { URL url = VERSIONS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonObject = JsonObject.readFrom(response.getJSON()); JsonArray entries = jsonObject.get("entries").asArray(); Collection<BoxFileVersion> versions = new ArrayList<BoxFileVersion>(); for (JsonValue entry : entries) { versions.add(new BoxFileVersion(this.getAPI(), entry.asObject(), this.getID())); // depends on control dependency: [for], data = [entry] } return versions; } }
public class class_name { @SneakyThrows public static Set<Event> resolveEventViaSingleAttribute(final Principal principal, final Object attributeValue, final RegisteredService service, final Optional<RequestContext> context, final MultifactorAuthenticationProvider provider, final Predicate<String> predicate) { if (!(attributeValue instanceof Collection)) { LOGGER.debug("Attribute value [{}] is a single-valued attribute", attributeValue); if (predicate.test(attributeValue.toString())) { LOGGER.debug("Attribute value predicate [{}] has matched the [{}]", predicate, attributeValue); return evaluateEventForProviderInContext(principal, service, context, provider); } LOGGER.debug("Attribute value predicate [{}] could not match the [{}]", predicate, attributeValue); } LOGGER.debug("Attribute value [{}] is not a single-valued attribute", attributeValue); return null; } }
public class class_name { @SneakyThrows public static Set<Event> resolveEventViaSingleAttribute(final Principal principal, final Object attributeValue, final RegisteredService service, final Optional<RequestContext> context, final MultifactorAuthenticationProvider provider, final Predicate<String> predicate) { if (!(attributeValue instanceof Collection)) { LOGGER.debug("Attribute value [{}] is a single-valued attribute", attributeValue); // depends on control dependency: [if], data = [none] if (predicate.test(attributeValue.toString())) { LOGGER.debug("Attribute value predicate [{}] has matched the [{}]", predicate, attributeValue); // depends on control dependency: [if], data = [none] return evaluateEventForProviderInContext(principal, service, context, provider); // depends on control dependency: [if], data = [none] } LOGGER.debug("Attribute value predicate [{}] could not match the [{}]", predicate, attributeValue); // depends on control dependency: [if], data = [none] } LOGGER.debug("Attribute value [{}] is not a single-valued attribute", attributeValue); return null; } }
public class class_name { static List<TypeMapping> getServiceTypeMappings() { // Build the list of type mappings based on BatchJobOpsService for this version of the API. ImmutableList.Builder<TypeMapping> mappings = ImmutableList.builder(); try { mappings.add( new BatchJobOpsServiceSoapBindingStub() { @Override public Call _createCall() throws ServiceException { try { return super.createCall(); } catch (RemoteException e) { throw new RuntimeException(e); } } }._createCall().getTypeMapping()); } catch (Exception e) { throw new RuntimeException("Failed to initialize service type mappings", e); } return mappings.build(); } }
public class class_name { static List<TypeMapping> getServiceTypeMappings() { // Build the list of type mappings based on BatchJobOpsService for this version of the API. ImmutableList.Builder<TypeMapping> mappings = ImmutableList.builder(); try { mappings.add( new BatchJobOpsServiceSoapBindingStub() { @Override public Call _createCall() throws ServiceException { try { return super.createCall(); } catch (RemoteException e) { // depends on control dependency: [try], data = [none] throw new RuntimeException(e); } } }._createCall().getTypeMapping()); } catch (Exception e) { throw new RuntimeException("Failed to initialize service type mappings", e); } // depends on control dependency: [catch], data = [none] return mappings.build(); } }
public class class_name { public GarbageCollectorMXBean getYoungCollectorMXBean() { GarbageCollectorMXBean bean = this.getGarbageCollectorMXBean(this.youngCollector); if (bean != null) { return bean; } outer: for (GarbageCollectorMXBean bean2 : getGarbageCollectorMXBeans()) { for (String pool : bean2.getMemoryPoolNames()) { for (String name : this.tenuredGen) { if (pool.equals(name)) { continue outer; } } } return bean2; } return null; } }
public class class_name { public GarbageCollectorMXBean getYoungCollectorMXBean() { GarbageCollectorMXBean bean = this.getGarbageCollectorMXBean(this.youngCollector); if (bean != null) { return bean; } // depends on control dependency: [if], data = [none] outer: for (GarbageCollectorMXBean bean2 : getGarbageCollectorMXBeans()) { for (String pool : bean2.getMemoryPoolNames()) { for (String name : this.tenuredGen) { if (pool.equals(name)) { continue outer; } } } return bean2; // depends on control dependency: [for], data = [bean2] } return null; } }
public class class_name { public void visit(Node n, NodeVisitor callback) { callback.visit(n); for (Node cursor = n.getFirstChild(); cursor != null; cursor = cursor.getNext()) { visit(cursor, callback); } } }
public class class_name { public void visit(Node n, NodeVisitor callback) { callback.visit(n); for (Node cursor = n.getFirstChild(); cursor != null; cursor = cursor.getNext()) { visit(cursor, callback); // depends on control dependency: [for], data = [cursor] } } }
public class class_name { public WSStartupRecoveryServiceImpl recoverLocalPartitionsInInflightStates() { String methodName = "recoverLocalPartitionsInInflightStates"; try { List<RemotablePartitionEntity> remotablePartitions = persistenceManagerService.getPartitionsRunningLocalToServer(psu); for (RemotablePartitionEntity partition : remotablePartitions) { StepThreadExecutionEntity stepExecution = partition.getStepExecution(); RemotablePartitionKey key = new RemotablePartitionKey(stepExecution); String newExitStatus = stepExecution.getExitStatus(); if (newExitStatus == null) { newExitStatus = BatchStatus.FAILED.name(); } if (logger.isLoggable(Level.FINE)) { logger.fine(methodName + ": marking [partition = " + key + ",old batchStatus=" + stepExecution.getBatchStatus().name() + " to new batchStatus=FAILED, new exitStatus=" + newExitStatus + "]"); } // The world is a more orderly place with these two timestamp values showing the same! Date markFailedTime = new Date(); try { persistenceManagerService.updateStepExecutionOnRecovery(psu, stepExecution.getStepExecutionId(), BatchStatus.FAILED, newExitStatus, markFailedTime); persistenceManagerService.updateRemotablePartitionOnRecovery(psu, partition); } catch (Exception updateExc) { logger.log(Level.WARNING, "partition.recovery.failed", new Object[] { key, updateExc }); } } } catch (Exception exception) { logger.log(Level.WARNING, "recovery.failed", exception); } return this; } }
public class class_name { public WSStartupRecoveryServiceImpl recoverLocalPartitionsInInflightStates() { String methodName = "recoverLocalPartitionsInInflightStates"; try { List<RemotablePartitionEntity> remotablePartitions = persistenceManagerService.getPartitionsRunningLocalToServer(psu); for (RemotablePartitionEntity partition : remotablePartitions) { StepThreadExecutionEntity stepExecution = partition.getStepExecution(); RemotablePartitionKey key = new RemotablePartitionKey(stepExecution); String newExitStatus = stepExecution.getExitStatus(); if (newExitStatus == null) { newExitStatus = BatchStatus.FAILED.name(); // depends on control dependency: [if], data = [none] } if (logger.isLoggable(Level.FINE)) { logger.fine(methodName + ": marking [partition = " + key + ",old batchStatus=" + stepExecution.getBatchStatus().name() + " to new batchStatus=FAILED, new exitStatus=" + newExitStatus + "]"); } // The world is a more orderly place with these two timestamp values showing the same! Date markFailedTime = new Date(); try { persistenceManagerService.updateStepExecutionOnRecovery(psu, stepExecution.getStepExecutionId(), BatchStatus.FAILED, newExitStatus, markFailedTime); persistenceManagerService.updateRemotablePartitionOnRecovery(psu, partition); } catch (Exception updateExc) { logger.log(Level.WARNING, "partition.recovery.failed", new Object[] { key, updateExc }); } } } catch (Exception exception) { logger.log(Level.WARNING, "recovery.failed", exception); } return this; } }
public class class_name { public static DateTime toDateAdvanced(Object o, TimeZone timeZone, DateTime defaultValue) { if (o instanceof DateTime) return (DateTime) o; else if (o instanceof Date) return new DateTimeImpl((Date) o); else if (o instanceof Castable) { return ((Castable) o).castToDateTime(defaultValue); } else if (o instanceof String) return toDateAdvanced(o.toString(), timeZone, defaultValue); else if (o instanceof Number) return util.toDateTime(((Number) o).doubleValue()); else if (o instanceof Calendar) { return new DateTimeImpl((Calendar) o); } else if (o instanceof ObjectWrap) return toDateAdvanced(((ObjectWrap) o).getEmbededObject(defaultValue), timeZone, defaultValue); return defaultValue; } }
public class class_name { public static DateTime toDateAdvanced(Object o, TimeZone timeZone, DateTime defaultValue) { if (o instanceof DateTime) return (DateTime) o; else if (o instanceof Date) return new DateTimeImpl((Date) o); else if (o instanceof Castable) { return ((Castable) o).castToDateTime(defaultValue); // depends on control dependency: [if], data = [none] } else if (o instanceof String) return toDateAdvanced(o.toString(), timeZone, defaultValue); else if (o instanceof Number) return util.toDateTime(((Number) o).doubleValue()); else if (o instanceof Calendar) { return new DateTimeImpl((Calendar) o); // depends on control dependency: [if], data = [none] } else if (o instanceof ObjectWrap) return toDateAdvanced(((ObjectWrap) o).getEmbededObject(defaultValue), timeZone, defaultValue); return defaultValue; } }
public class class_name { protected String getIsolationLevelAsString() { if (defaultIsolationLevel == IL_READ_UNCOMMITTED) { return LITERAL_IL_READ_UNCOMMITTED; } else if (defaultIsolationLevel == IL_READ_COMMITTED) { return LITERAL_IL_READ_COMMITTED; } else if (defaultIsolationLevel == IL_REPEATABLE_READ) { return LITERAL_IL_REPEATABLE_READ; } else if (defaultIsolationLevel == IL_SERIALIZABLE) { return LITERAL_IL_SERIALIZABLE; } else if (defaultIsolationLevel == IL_OPTIMISTIC) { return LITERAL_IL_OPTIMISTIC; } return LITERAL_IL_READ_UNCOMMITTED; } }
public class class_name { protected String getIsolationLevelAsString() { if (defaultIsolationLevel == IL_READ_UNCOMMITTED) { return LITERAL_IL_READ_UNCOMMITTED; // depends on control dependency: [if], data = [none] } else if (defaultIsolationLevel == IL_READ_COMMITTED) { return LITERAL_IL_READ_COMMITTED; // depends on control dependency: [if], data = [none] } else if (defaultIsolationLevel == IL_REPEATABLE_READ) { return LITERAL_IL_REPEATABLE_READ; // depends on control dependency: [if], data = [none] } else if (defaultIsolationLevel == IL_SERIALIZABLE) { return LITERAL_IL_SERIALIZABLE; // depends on control dependency: [if], data = [none] } else if (defaultIsolationLevel == IL_OPTIMISTIC) { return LITERAL_IL_OPTIMISTIC; // depends on control dependency: [if], data = [none] } return LITERAL_IL_READ_UNCOMMITTED; } }
public class class_name { public static List<MethodNode> findStaticMethods(Collection<MethodNode> methodNodes) { Validate.notNull(methodNodes); Validate.noNullElements(methodNodes); List<MethodNode> ret = new ArrayList<>(); for (MethodNode methodNode : methodNodes) { if ((methodNode.access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC) { ret.add(methodNode); } } return ret; } }
public class class_name { public static List<MethodNode> findStaticMethods(Collection<MethodNode> methodNodes) { Validate.notNull(methodNodes); Validate.noNullElements(methodNodes); List<MethodNode> ret = new ArrayList<>(); for (MethodNode methodNode : methodNodes) { if ((methodNode.access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC) { ret.add(methodNode); // depends on control dependency: [if], data = [none] } } return ret; } }
public class class_name { @Override public Connection<T> newConnection(final Identifier destId) { final Connection<T> connection = connectionMap.get(destId); if (connection == null) { final Connection<T> newConnection = new NetworkConnection<>(this, destId); connectionMap.putIfAbsent(destId, newConnection); return connectionMap.get(destId); } return connection; } }
public class class_name { @Override public Connection<T> newConnection(final Identifier destId) { final Connection<T> connection = connectionMap.get(destId); if (connection == null) { final Connection<T> newConnection = new NetworkConnection<>(this, destId); connectionMap.putIfAbsent(destId, newConnection); // depends on control dependency: [if], data = [none] return connectionMap.get(destId); // depends on control dependency: [if], data = [none] } return connection; } }
public class class_name { public static String longestCommonSequence(String s1, String s2) { int start = 0; int max = 0; for (int i = 0; i < s1.length(); i++) { for (int j = 0; j < s2.length(); j++) { int x = 0; while (s1.charAt(i + x) == s2.charAt(j + x)) { x++; if (((i + x) >= s1.length()) || ((j + x) >= s2.length())) break; } if (x > max) { max = x; start = i; } } } return s1.substring(start, (start + max)); } }
public class class_name { public static String longestCommonSequence(String s1, String s2) { int start = 0; int max = 0; for (int i = 0; i < s1.length(); i++) { for (int j = 0; j < s2.length(); j++) { int x = 0; while (s1.charAt(i + x) == s2.charAt(j + x)) { x++; // depends on control dependency: [while], data = [none] if (((i + x) >= s1.length()) || ((j + x) >= s2.length())) break; } if (x > max) { max = x; // depends on control dependency: [if], data = [none] start = i; // depends on control dependency: [if], data = [none] } } } return s1.substring(start, (start + max)); } }
public class class_name { public ListTranscriptionJobsResult withTranscriptionJobSummaries(TranscriptionJobSummary... transcriptionJobSummaries) { if (this.transcriptionJobSummaries == null) { setTranscriptionJobSummaries(new java.util.ArrayList<TranscriptionJobSummary>(transcriptionJobSummaries.length)); } for (TranscriptionJobSummary ele : transcriptionJobSummaries) { this.transcriptionJobSummaries.add(ele); } return this; } }
public class class_name { public ListTranscriptionJobsResult withTranscriptionJobSummaries(TranscriptionJobSummary... transcriptionJobSummaries) { if (this.transcriptionJobSummaries == null) { setTranscriptionJobSummaries(new java.util.ArrayList<TranscriptionJobSummary>(transcriptionJobSummaries.length)); // depends on control dependency: [if], data = [none] } for (TranscriptionJobSummary ele : transcriptionJobSummaries) { this.transcriptionJobSummaries.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public void marshall(UpdateBillingGroupRequest updateBillingGroupRequest, ProtocolMarshaller protocolMarshaller) { if (updateBillingGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateBillingGroupRequest.getBillingGroupName(), BILLINGGROUPNAME_BINDING); protocolMarshaller.marshall(updateBillingGroupRequest.getBillingGroupProperties(), BILLINGGROUPPROPERTIES_BINDING); protocolMarshaller.marshall(updateBillingGroupRequest.getExpectedVersion(), EXPECTEDVERSION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(UpdateBillingGroupRequest updateBillingGroupRequest, ProtocolMarshaller protocolMarshaller) { if (updateBillingGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateBillingGroupRequest.getBillingGroupName(), BILLINGGROUPNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBillingGroupRequest.getBillingGroupProperties(), BILLINGGROUPPROPERTIES_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateBillingGroupRequest.getExpectedVersion(), EXPECTEDVERSION_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static int nextPowerOf2(int n) { if (n == 0) { return 1; } int b = Integer.highestOneBit(n); return b == n ? n : b << 1; } }
public class class_name { public static int nextPowerOf2(int n) { if (n == 0) { return 1; // depends on control dependency: [if], data = [none] } int b = Integer.highestOneBit(n); return b == n ? n : b << 1; } }
public class class_name { public OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> getOmemoStoreBackend() { if (omemoStore == null) { omemoStore = createDefaultOmemoStoreBackend(); } return omemoStore; } }
public class class_name { public OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> getOmemoStoreBackend() { if (omemoStore == null) { omemoStore = createDefaultOmemoStoreBackend(); // depends on control dependency: [if], data = [none] } return omemoStore; } }
public class class_name { public java.util.List<PipelineIdName> getPipelineIdList() { if (pipelineIdList == null) { pipelineIdList = new com.amazonaws.internal.SdkInternalList<PipelineIdName>(); } return pipelineIdList; } }
public class class_name { public java.util.List<PipelineIdName> getPipelineIdList() { if (pipelineIdList == null) { pipelineIdList = new com.amazonaws.internal.SdkInternalList<PipelineIdName>(); // depends on control dependency: [if], data = [none] } return pipelineIdList; } }
public class class_name { public static void close(Statement stmt) { if (stmt != null) { try { stmt.close(); } catch (SQLException ex) { logger.error("", ex); } } } }
public class class_name { public static void close(Statement stmt) { if (stmt != null) { try { stmt.close(); // depends on control dependency: [try], data = [none] } catch (SQLException ex) { logger.error("", ex); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public Object evaluate() { if( !isCompileTimeConstant() ) { return super.evaluate(); } Object value = getLHS().evaluate(); IType argType = getType(); if( value instanceof IType && argType instanceof IJavaType && JavaTypes.CLASS() == TypeLord.getPureGenericType( argType ) ) { // Don't force class loading during compilation return value; } //============================================================================ // Special Types // TODO cgross: remove these special cases (came from ParsedElement#convertValue) // and allow the coercion manager to handle these cases //============================================================================ if( argType == GosuParserTypes.NUMBER_TYPE() ) { return CommonServices.getCoercionManager().makeDoubleFrom( value ); } else if( argType == GosuParserTypes.STRING_TYPE() ) { return CommonServices.getCoercionManager().makeStringFrom( value ); } else if( argType == GosuParserTypes.DATETIME_TYPE() ) { Date date = CommonServices.getCoercionManager().makeDateFrom( value ); if ( date != null ) { return date; } } //============================================================================ // This is really all we should be doing //============================================================================ if( _coercer != null && (value != null || _coercer.handlesNull()) ) { return _coercer.coerceValue( argType, value ); } return value; } }
public class class_name { public Object evaluate() { if( !isCompileTimeConstant() ) { return super.evaluate(); // depends on control dependency: [if], data = [none] } Object value = getLHS().evaluate(); IType argType = getType(); if( value instanceof IType && argType instanceof IJavaType && JavaTypes.CLASS() == TypeLord.getPureGenericType( argType ) ) { // Don't force class loading during compilation return value; // depends on control dependency: [if], data = [none] } //============================================================================ // Special Types // TODO cgross: remove these special cases (came from ParsedElement#convertValue) // and allow the coercion manager to handle these cases //============================================================================ if( argType == GosuParserTypes.NUMBER_TYPE() ) { return CommonServices.getCoercionManager().makeDoubleFrom( value ); // depends on control dependency: [if], data = [none] } else if( argType == GosuParserTypes.STRING_TYPE() ) { return CommonServices.getCoercionManager().makeStringFrom( value ); // depends on control dependency: [if], data = [none] } else if( argType == GosuParserTypes.DATETIME_TYPE() ) { Date date = CommonServices.getCoercionManager().makeDateFrom( value ); if ( date != null ) { return date; // depends on control dependency: [if], data = [none] } } //============================================================================ // This is really all we should be doing //============================================================================ if( _coercer != null && (value != null || _coercer.handlesNull()) ) { return _coercer.coerceValue( argType, value ); // depends on control dependency: [if], data = [none] } return value; } }
public class class_name { public static String contentShowTagAction( I_CmsXmlContentContainer container, PageContext context, String element, Locale locale, boolean escape) { // get the current users OpenCms context CmsObject cms = CmsFlexController.getCmsObject(context.getRequest()); // get loaded content from content container I_CmsXmlDocument xmlContent = container.getXmlDocument(); if (CmsStringUtil.isEmpty(element)) { element = container.getXmlDocumentElement(); } else { element = CmsXmlUtils.concatXpath(container.getXmlDocumentElement(), element); } String content; if (CmsMacroResolver.isMacro(element)) { // this is a macro, initialize a macro resolver String resourcename = CmsJspTagResourceLoad.getResourceName(cms, container); CmsMacroResolver resolver = CmsMacroResolver.newInstance().setCmsObject(cms).setJspPageContext( context).setResourceName(resourcename).setKeepEmptyMacros(true); // resolve the macro content = resolver.resolveMacros(element); } else if (xmlContent == null) { // no XML content- no output content = null; } else { // determine the locale to display if (locale == null) { // no locale was set, use default from parent tag (usually "contentload") locale = container.getXmlDocumentLocale(); } // now get the content element value to display if (xmlContent.hasValue(element, locale)) { try { // read the element from the content content = xmlContent.getStringValue(cms, element, locale); } catch (Exception e) { LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_CONTENT_SHOW_1, element), e); content = null; } } else { content = null; } // make sure that no null String is returned if (content == null) { content = CmsMessages.formatUnknownKey(element); } if (escape) { // HTML escape the value content = CmsEncoder.escapeHtml(content); } } return content; } }
public class class_name { public static String contentShowTagAction( I_CmsXmlContentContainer container, PageContext context, String element, Locale locale, boolean escape) { // get the current users OpenCms context CmsObject cms = CmsFlexController.getCmsObject(context.getRequest()); // get loaded content from content container I_CmsXmlDocument xmlContent = container.getXmlDocument(); if (CmsStringUtil.isEmpty(element)) { element = container.getXmlDocumentElement(); // depends on control dependency: [if], data = [none] } else { element = CmsXmlUtils.concatXpath(container.getXmlDocumentElement(), element); // depends on control dependency: [if], data = [none] } String content; if (CmsMacroResolver.isMacro(element)) { // this is a macro, initialize a macro resolver String resourcename = CmsJspTagResourceLoad.getResourceName(cms, container); CmsMacroResolver resolver = CmsMacroResolver.newInstance().setCmsObject(cms).setJspPageContext( context).setResourceName(resourcename).setKeepEmptyMacros(true); // resolve the macro content = resolver.resolveMacros(element); // depends on control dependency: [if], data = [none] } else if (xmlContent == null) { // no XML content- no output content = null; // depends on control dependency: [if], data = [none] } else { // determine the locale to display if (locale == null) { // no locale was set, use default from parent tag (usually "contentload") locale = container.getXmlDocumentLocale(); // depends on control dependency: [if], data = [none] } // now get the content element value to display if (xmlContent.hasValue(element, locale)) { try { // read the element from the content content = xmlContent.getStringValue(cms, element, locale); // depends on control dependency: [try], data = [none] } catch (Exception e) { LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_CONTENT_SHOW_1, element), e); content = null; } // depends on control dependency: [catch], data = [none] } else { content = null; // depends on control dependency: [if], data = [none] } // make sure that no null String is returned if (content == null) { content = CmsMessages.formatUnknownKey(element); // depends on control dependency: [if], data = [none] } if (escape) { // HTML escape the value content = CmsEncoder.escapeHtml(content); // depends on control dependency: [if], data = [none] } } return content; } }
public class class_name { public String createTempJob(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUserName, String proxyPassword) { JSONObject job = null; String jobId = null; String hp4mSecret = null; String jsessionId = null; String loginJson = loginToMC(mcUrl, mcUserName, mcPassword, proxyAddress, proxyUserName, proxyPassword).toJSONString(); try { if (loginJson != null) { JSONObject jsonObject = (JSONObject) JSONValue.parseStrict(loginJson); hp4mSecret = (String) jsonObject.get(Constants.LOGIN_SECRET); jsessionId = (String) jsonObject.get(Constants.JSESSIONID); } } catch (Exception e) { e.printStackTrace(); } boolean isValid = argumentsCheck(hp4mSecret, jsessionId); if (isValid) { try { Map<String, String> headers = new HashMap<String, String>(); headers.put(Constants.LOGIN_SECRET, hp4mSecret); headers.put(Constants.COOKIE, Constants.JESEEIONEQ + jsessionId); HttpResponse response = HttpUtils.get(HttpUtils.setProxyCfg(proxyAddress,proxyUserName,proxyPassword), mcUrl + Constants.CREATE_JOB_URL, headers, null); if (response != null && response.getJsonObject() != null) { job = response.getJsonObject(); if(job != null && job.get("data") != null){ JSONObject data = (JSONObject)job.get("data"); jobId = data.getAsString("id"); } } } catch (Exception e) { e.printStackTrace(); } } return jobId; } }
public class class_name { public String createTempJob(String mcUrl, String mcUserName, String mcPassword, String proxyAddress, String proxyUserName, String proxyPassword) { JSONObject job = null; String jobId = null; String hp4mSecret = null; String jsessionId = null; String loginJson = loginToMC(mcUrl, mcUserName, mcPassword, proxyAddress, proxyUserName, proxyPassword).toJSONString(); try { if (loginJson != null) { JSONObject jsonObject = (JSONObject) JSONValue.parseStrict(loginJson); hp4mSecret = (String) jsonObject.get(Constants.LOGIN_SECRET); // depends on control dependency: [if], data = [none] jsessionId = (String) jsonObject.get(Constants.JSESSIONID); // depends on control dependency: [if], data = [none] } } catch (Exception e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] boolean isValid = argumentsCheck(hp4mSecret, jsessionId); if (isValid) { try { Map<String, String> headers = new HashMap<String, String>(); headers.put(Constants.LOGIN_SECRET, hp4mSecret); // depends on control dependency: [try], data = [none] headers.put(Constants.COOKIE, Constants.JESEEIONEQ + jsessionId); // depends on control dependency: [try], data = [none] HttpResponse response = HttpUtils.get(HttpUtils.setProxyCfg(proxyAddress,proxyUserName,proxyPassword), mcUrl + Constants.CREATE_JOB_URL, headers, null); if (response != null && response.getJsonObject() != null) { job = response.getJsonObject(); // depends on control dependency: [if], data = [none] if(job != null && job.get("data") != null){ JSONObject data = (JSONObject)job.get("data"); jobId = data.getAsString("id"); // depends on control dependency: [if], data = [none] } } } catch (Exception e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] } return jobId; } }
public class class_name { protected Configuration getGlobalConfiguration() { if (!globalConfigurationLoaded) { String location = getConfigurationDirectory(); GlobalConfiguration.loadConfiguration(location); globalConfigurationLoaded = true; } return GlobalConfiguration.getConfiguration(); } }
public class class_name { protected Configuration getGlobalConfiguration() { if (!globalConfigurationLoaded) { String location = getConfigurationDirectory(); GlobalConfiguration.loadConfiguration(location); // depends on control dependency: [if], data = [none] globalConfigurationLoaded = true; // depends on control dependency: [if], data = [none] } return GlobalConfiguration.getConfiguration(); } }
public class class_name { private static void appendToBuilder(UriComponentsBuilder builder, TemplateVariable variable, @Nullable Object value) { if (value == null) { if (variable.isRequired()) { throw new IllegalArgumentException( String.format("Template variable %s is required but no value was given!", variable.getName())); } return; } switch (variable.getType()) { case COMPOSITE_PARAM: appendComposite(builder, variable.getName(), value); break; case REQUEST_PARAM: case REQUEST_PARAM_CONTINUED: builder.queryParam(variable.getName(), value); break; case PATH_VARIABLE: case SEGMENT: builder.pathSegment(value.toString()); break; case FRAGMENT: builder.fragment(value.toString()); break; } } }
public class class_name { private static void appendToBuilder(UriComponentsBuilder builder, TemplateVariable variable, @Nullable Object value) { if (value == null) { if (variable.isRequired()) { throw new IllegalArgumentException( String.format("Template variable %s is required but no value was given!", variable.getName())); } return; // depends on control dependency: [if], data = [none] } switch (variable.getType()) { case COMPOSITE_PARAM: appendComposite(builder, variable.getName(), value); break; case REQUEST_PARAM: case REQUEST_PARAM_CONTINUED: builder.queryParam(variable.getName(), value); break; case PATH_VARIABLE: case SEGMENT: builder.pathSegment(value.toString()); break; case FRAGMENT: builder.fragment(value.toString()); break; } } }
public class class_name { static String getLibraryType(String os) { if (os.startsWith("Linux")) { return "so"; } if (os.startsWith("FreeBSD")) { return "so"; } if (os.startsWith("Mac OS X")) { return "dylib"; } if (os.startsWith("Windows")) { return "dll"; } throw new IllegalArgumentException(); } }
public class class_name { static String getLibraryType(String os) { if (os.startsWith("Linux")) { return "so"; // depends on control dependency: [if], data = [none] } if (os.startsWith("FreeBSD")) { return "so"; // depends on control dependency: [if], data = [none] } if (os.startsWith("Mac OS X")) { return "dylib"; } if (os.startsWith("Windows")) { return "dll"; } throw new IllegalArgumentException(); } }