code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public boolean getCritical() { Boolean critical = (Boolean) getCachedValue(TaskField.CRITICAL); if (critical == null) { Duration totalSlack = getTotalSlack(); ProjectProperties props = getParentFile().getProjectProperties(); int criticalSlackLimit = NumberHelper.getInt(props.getCriticalSlackLimit()); if (criticalSlackLimit != 0 && totalSlack.getDuration() != 0 && totalSlack.getUnits() != TimeUnit.DAYS) { totalSlack = totalSlack.convertUnits(TimeUnit.DAYS, props); } critical = Boolean.valueOf(totalSlack.getDuration() <= criticalSlackLimit && NumberHelper.getInt(getPercentageComplete()) != 100 && ((getTaskMode() == TaskMode.AUTO_SCHEDULED) || (getDurationText() == null && getStartText() == null && getFinishText() == null))); set(TaskField.CRITICAL, critical); } return (BooleanHelper.getBoolean(critical)); } }
public class class_name { public boolean getCritical() { Boolean critical = (Boolean) getCachedValue(TaskField.CRITICAL); if (critical == null) { Duration totalSlack = getTotalSlack(); ProjectProperties props = getParentFile().getProjectProperties(); int criticalSlackLimit = NumberHelper.getInt(props.getCriticalSlackLimit()); if (criticalSlackLimit != 0 && totalSlack.getDuration() != 0 && totalSlack.getUnits() != TimeUnit.DAYS) { totalSlack = totalSlack.convertUnits(TimeUnit.DAYS, props); // depends on control dependency: [if], data = [none] } critical = Boolean.valueOf(totalSlack.getDuration() <= criticalSlackLimit && NumberHelper.getInt(getPercentageComplete()) != 100 && ((getTaskMode() == TaskMode.AUTO_SCHEDULED) || (getDurationText() == null && getStartText() == null && getFinishText() == null))); // depends on control dependency: [if], data = [null)] set(TaskField.CRITICAL, critical); // depends on control dependency: [if], data = [none] } return (BooleanHelper.getBoolean(critical)); } }
public class class_name { public DataProviderContext on(final Trigger... triggers) { final List<Trigger> registeredTriggers = new ArrayList<Trigger>(); if (triggers != null) { Collections.addAll(registeredTriggers, triggers); } return new DataProviderContext(registeredTriggers); } }
public class class_name { public DataProviderContext on(final Trigger... triggers) { final List<Trigger> registeredTriggers = new ArrayList<Trigger>(); if (triggers != null) { Collections.addAll(registeredTriggers, triggers); // depends on control dependency: [if], data = [none] } return new DataProviderContext(registeredTriggers); } }
public class class_name { private void rewriteReturns(Node fnNode) { checkState(fnNode.isFunction()); final Node body = fnNode.getLastChild(); NodeUtil.visitPostOrder( body, new NodeUtil.Visitor() { @Override public void visit(Node n) { if (n.isReturn() && n.hasOneChild()) { Node result = n.getFirstChild(); boolean keepValue = !isRemovableValue(result); result.detach(); if (keepValue) { n.getParent().addChildBefore(IR.exprResult(result).srcref(result), n); } else { NodeUtil.markFunctionsDeleted(result, compiler); } compiler.reportChangeToEnclosingScope(body); } } }, new NodeUtil.MatchShallowStatement()); } }
public class class_name { private void rewriteReturns(Node fnNode) { checkState(fnNode.isFunction()); final Node body = fnNode.getLastChild(); NodeUtil.visitPostOrder( body, new NodeUtil.Visitor() { @Override public void visit(Node n) { if (n.isReturn() && n.hasOneChild()) { Node result = n.getFirstChild(); boolean keepValue = !isRemovableValue(result); result.detach(); // depends on control dependency: [if], data = [none] if (keepValue) { n.getParent().addChildBefore(IR.exprResult(result).srcref(result), n); // depends on control dependency: [if], data = [none] } else { NodeUtil.markFunctionsDeleted(result, compiler); // depends on control dependency: [if], data = [none] } compiler.reportChangeToEnclosingScope(body); // depends on control dependency: [if], data = [none] } } }, new NodeUtil.MatchShallowStatement()); } }
public class class_name { public void loadConfiguration(String file) { if(configFile == null) try { Properties props = Util.readProperties(file); Set<String> environments = props.stringPropertyNames().stream().map(n -> n.substring(0, n.lastIndexOf("."))).collect(toSet()); for (String env : environments) { String jndiName = env + "." + "jndi"; if (props.containsKey(jndiName)) { createJndiWrapper(env, props.getProperty(jndiName)); } else { String driver = props.getProperty(env + ".driver"); String userName = props.getProperty(env + ".username"); String password = props.getProperty(env + ".password"); String url = props.getProperty(env + ".url"); checkProps(driver, userName, password, url, env); createJdbcWrapper(env, driver, url, userName, password); } } } catch (InitException e) { throw e; } catch (Exception e) { throw new InitException(e); } } }
public class class_name { public void loadConfiguration(String file) { if(configFile == null) try { Properties props = Util.readProperties(file); Set<String> environments = props.stringPropertyNames().stream().map(n -> n.substring(0, n.lastIndexOf("."))).collect(toSet()); for (String env : environments) { String jndiName = env + "." + "jndi"; if (props.containsKey(jndiName)) { createJndiWrapper(env, props.getProperty(jndiName)); // depends on control dependency: [if], data = [none] } else { String driver = props.getProperty(env + ".driver"); String userName = props.getProperty(env + ".username"); String password = props.getProperty(env + ".password"); String url = props.getProperty(env + ".url"); checkProps(driver, userName, password, url, env); // depends on control dependency: [if], data = [none] createJdbcWrapper(env, driver, url, userName, password); // depends on control dependency: [if], data = [none] } } } catch (InitException e) { throw e; } catch (Exception e) { // depends on control dependency: [catch], data = [none] throw new InitException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static <T> T createInstance(Class<?> rawClass, Class<T> superclass) { try { return rawClass.asSubclass(superclass).getConstructor().newInstance(); } catch (Exception e) { throw new ServiceConfigurationError( "Provider " + rawClass.getName() + " could not be instantiated.", e); } } }
public class class_name { public static <T> T createInstance(Class<?> rawClass, Class<T> superclass) { try { return rawClass.asSubclass(superclass).getConstructor().newInstance(); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new ServiceConfigurationError( "Provider " + rawClass.getName() + " could not be instantiated.", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private Object getPropertyValue(Object pObj, String pProperty) { Method m = null; Class[] cl = new Class[0]; try { //return Util.getPropertyValue(pObj, pProperty); // Find method m = pObj.getClass(). getMethod("get" + StringUtil.capitalize(pProperty), new Class[0]); // Invoke it Object result = m.invoke(pObj, new Object[0]); return result; } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException iae) { iae.printStackTrace(); } catch (InvocationTargetException ite) { ite.printStackTrace(); } return null; } }
public class class_name { private Object getPropertyValue(Object pObj, String pProperty) { Method m = null; Class[] cl = new Class[0]; try { //return Util.getPropertyValue(pObj, pProperty); // Find method m = pObj.getClass(). getMethod("get" + StringUtil.capitalize(pProperty), new Class[0]); // depends on control dependency: [try], data = [none] // Invoke it Object result = m.invoke(pObj, new Object[0]); return result; // depends on control dependency: [try], data = [none] } catch (NoSuchMethodException e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] catch (IllegalAccessException iae) { iae.printStackTrace(); } // depends on control dependency: [catch], data = [none] catch (InvocationTargetException ite) { ite.printStackTrace(); } // depends on control dependency: [catch], data = [none] return null; } }
public class class_name { public static void executorShutDown(ExecutorService executorService, long timeOutSec) { try { executorService.shutdown(); executorService.awaitTermination(timeOutSec, TimeUnit.SECONDS); } catch(Exception e) { logger.warn("Error while stoping executor service.", e); } } }
public class class_name { public static void executorShutDown(ExecutorService executorService, long timeOutSec) { try { executorService.shutdown(); // depends on control dependency: [try], data = [none] executorService.awaitTermination(timeOutSec, TimeUnit.SECONDS); // depends on control dependency: [try], data = [none] } catch(Exception e) { logger.warn("Error while stoping executor service.", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public byte[] sign(byte[] content,PrivateKey privateKey) { try { java.security.Signature signature = java.security.Signature.getInstance(SIGN_ALGORITHMS); signature.initSign(privateKey); signature.update(content); return signature.sign(); }catch (Exception e) { log.error(e.getMessage(),e); } return null; } }
public class class_name { public byte[] sign(byte[] content,PrivateKey privateKey) { try { java.security.Signature signature = java.security.Signature.getInstance(SIGN_ALGORITHMS); signature.initSign(privateKey); // depends on control dependency: [try], data = [none] signature.update(content); // depends on control dependency: [try], data = [none] return signature.sign(); // depends on control dependency: [try], data = [none] }catch (Exception e) { log.error(e.getMessage(),e); } // depends on control dependency: [catch], data = [none] return null; } }
public class class_name { protected void markParseErrors(List<DroolsBuildMarker> markers, List<BaseKnowledgeBuilderResultImpl> parserErrors) { for ( Iterator<BaseKnowledgeBuilderResultImpl> iter = parserErrors.iterator(); iter.hasNext(); ) { Object error = iter.next(); if ( error instanceof ParserError ) { ParserError err = (ParserError) error; markers.add( new DroolsBuildMarker( err.getMessage(), err.getRow() ) ); } else if ( error instanceof KnowledgeBuilderResult) { KnowledgeBuilderResult res = (KnowledgeBuilderResult) error; int[] errorLines = res.getLines(); markers.add( new DroolsBuildMarker( res.getMessage(), errorLines != null && errorLines.length > 0 ? errorLines[0] : -1 ) ); } else if ( error instanceof ExpanderException ) { ExpanderException exc = (ExpanderException) error; // TODO line mapping is incorrect markers.add( new DroolsBuildMarker( exc.getMessage(), -1 ) ); } else { markers.add( new DroolsBuildMarker( error.toString() ) ); } } } }
public class class_name { protected void markParseErrors(List<DroolsBuildMarker> markers, List<BaseKnowledgeBuilderResultImpl> parserErrors) { for ( Iterator<BaseKnowledgeBuilderResultImpl> iter = parserErrors.iterator(); iter.hasNext(); ) { Object error = iter.next(); if ( error instanceof ParserError ) { ParserError err = (ParserError) error; markers.add( new DroolsBuildMarker( err.getMessage(), err.getRow() ) ); // depends on control dependency: [if], data = [none] } else if ( error instanceof KnowledgeBuilderResult) { KnowledgeBuilderResult res = (KnowledgeBuilderResult) error; int[] errorLines = res.getLines(); markers.add( new DroolsBuildMarker( res.getMessage(), errorLines != null && errorLines.length > 0 ? errorLines[0] : -1 ) ); // depends on control dependency: [if], data = [none] } else if ( error instanceof ExpanderException ) { ExpanderException exc = (ExpanderException) error; // TODO line mapping is incorrect markers.add( new DroolsBuildMarker( exc.getMessage(), -1 ) ); // depends on control dependency: [if], data = [none] } else { markers.add( new DroolsBuildMarker( error.toString() ) ); // depends on control dependency: [if], data = [none] } } } }
public class class_name { @SuppressWarnings("WeakerAccess") public ApiFuture<List<String>> listTablesAsync() { ListTablesRequest request = ListTablesRequest.newBuilder() .setParent(NameUtil.formatInstanceName(projectId, instanceId)) .build(); // TODO(igorbernstein2): try to upstream pagination spooling or figure out a way to expose the // paginated responses while maintaining the wrapper facade. // Fetch the first page. ApiFuture<ListTablesPage> firstPageFuture = ApiFutures.transform( stub.listTablesPagedCallable().futureCall(request), new ApiFunction<ListTablesPagedResponse, ListTablesPage>() { @Override public ListTablesPage apply(ListTablesPagedResponse response) { return response.getPage(); } }, MoreExecutors.directExecutor()); // Fetch the rest of the pages by chaining the futures. ApiFuture<List<com.google.bigtable.admin.v2.Table>> allProtos = ApiFutures.transformAsync( firstPageFuture, new ApiAsyncFunction<ListTablesPage, List<com.google.bigtable.admin.v2.Table>>() { List<com.google.bigtable.admin.v2.Table> responseAccumulator = Lists.newArrayList(); @Override public ApiFuture<List<com.google.bigtable.admin.v2.Table>> apply( ListTablesPage page) { // Add all entries from the page responseAccumulator.addAll(Lists.newArrayList(page.getValues())); // If this is the last page, just return the accumulated responses. if (!page.hasNextPage()) { return ApiFutures.immediateFuture(responseAccumulator); } // Otherwise fetch the next page. return ApiFutures.transformAsync( page.getNextPageAsync(), this, MoreExecutors.directExecutor()); } }, MoreExecutors.directExecutor()); // Wrap all of the accumulated protos. return ApiFutures.transform( allProtos, new ApiFunction<List<com.google.bigtable.admin.v2.Table>, List<String>>() { @Override public List<String> apply(List<com.google.bigtable.admin.v2.Table> protos) { List<String> results = Lists.newArrayListWithCapacity(protos.size()); for (com.google.bigtable.admin.v2.Table proto : protos) { results.add(NameUtil.extractTableIdFromTableName(proto.getName())); } return results; } }, MoreExecutors.directExecutor()); } }
public class class_name { @SuppressWarnings("WeakerAccess") public ApiFuture<List<String>> listTablesAsync() { ListTablesRequest request = ListTablesRequest.newBuilder() .setParent(NameUtil.formatInstanceName(projectId, instanceId)) .build(); // TODO(igorbernstein2): try to upstream pagination spooling or figure out a way to expose the // paginated responses while maintaining the wrapper facade. // Fetch the first page. ApiFuture<ListTablesPage> firstPageFuture = ApiFutures.transform( stub.listTablesPagedCallable().futureCall(request), new ApiFunction<ListTablesPagedResponse, ListTablesPage>() { @Override public ListTablesPage apply(ListTablesPagedResponse response) { return response.getPage(); } }, MoreExecutors.directExecutor()); // Fetch the rest of the pages by chaining the futures. ApiFuture<List<com.google.bigtable.admin.v2.Table>> allProtos = ApiFutures.transformAsync( firstPageFuture, new ApiAsyncFunction<ListTablesPage, List<com.google.bigtable.admin.v2.Table>>() { List<com.google.bigtable.admin.v2.Table> responseAccumulator = Lists.newArrayList(); @Override public ApiFuture<List<com.google.bigtable.admin.v2.Table>> apply( ListTablesPage page) { // Add all entries from the page responseAccumulator.addAll(Lists.newArrayList(page.getValues())); // If this is the last page, just return the accumulated responses. if (!page.hasNextPage()) { return ApiFutures.immediateFuture(responseAccumulator); // depends on control dependency: [if], data = [none] } // Otherwise fetch the next page. return ApiFutures.transformAsync( page.getNextPageAsync(), this, MoreExecutors.directExecutor()); } }, MoreExecutors.directExecutor()); // Wrap all of the accumulated protos. return ApiFutures.transform( allProtos, new ApiFunction<List<com.google.bigtable.admin.v2.Table>, List<String>>() { @Override public List<String> apply(List<com.google.bigtable.admin.v2.Table> protos) { List<String> results = Lists.newArrayListWithCapacity(protos.size()); for (com.google.bigtable.admin.v2.Table proto : protos) { results.add(NameUtil.extractTableIdFromTableName(proto.getName())); // depends on control dependency: [for], data = [proto] } return results; } }, MoreExecutors.directExecutor()); } }
public class class_name { public void handle(Emitter e, Object data) { org.yecht.Node n = (org.yecht.Node)((IRubyObject)data).dataGetStructChecked(); switch(n.kind) { case Map: Data.Map dm = (Data.Map)n.data; e.emitMap(n.type_id, dm.style); for(int i = 0; i < dm.idx; i++) { e.emitItem(n.mapRead(MapPart.Key, i)); e.emitItem(n.mapRead(MapPart.Value, i)); } e.emitEnd(); break; case Seq: Data.Seq ds = (Data.Seq)n.data; e.emitSeq(n.type_id, ds.style); for(int i = 0; i < ds.idx; i++) { e.emitItem(n.seqRead(i)); } e.emitEnd(); break; case Str: Data.Str dss = (Data.Str)n.data; e.emitScalar(n.type_id, dss.style, 0, 0, 0, dss.ptr, dss.len); break; } } }
public class class_name { public void handle(Emitter e, Object data) { org.yecht.Node n = (org.yecht.Node)((IRubyObject)data).dataGetStructChecked(); switch(n.kind) { case Map: Data.Map dm = (Data.Map)n.data; e.emitMap(n.type_id, dm.style); for(int i = 0; i < dm.idx; i++) { e.emitItem(n.mapRead(MapPart.Key, i)); // depends on control dependency: [for], data = [i] e.emitItem(n.mapRead(MapPart.Value, i)); // depends on control dependency: [for], data = [i] } e.emitEnd(); break; case Seq: Data.Seq ds = (Data.Seq)n.data; e.emitSeq(n.type_id, ds.style); for(int i = 0; i < ds.idx; i++) { e.emitItem(n.seqRead(i)); // depends on control dependency: [for], data = [i] } e.emitEnd(); break; case Str: Data.Str dss = (Data.Str)n.data; e.emitScalar(n.type_id, dss.style, 0, 0, 0, dss.ptr, dss.len); break; } } }
public class class_name { private void getPropsString(StringBuilder strProps, List<ConfigPropType> propsList, int indent) { for (ConfigPropType props : propsList) { for (int i = 0; i < indent; i++) strProps.append(" "); strProps.append("<config-property name=\""); strProps.append(props.getName()); strProps.append("\">"); strProps.append(props.getValue()); strProps.append("</config-property>"); strProps.append("\n"); } } }
public class class_name { private void getPropsString(StringBuilder strProps, List<ConfigPropType> propsList, int indent) { for (ConfigPropType props : propsList) { for (int i = 0; i < indent; i++) strProps.append(" "); strProps.append("<config-property name=\""); // depends on control dependency: [for], data = [none] strProps.append(props.getName()); // depends on control dependency: [for], data = [props] strProps.append("\">"); // depends on control dependency: [for], data = [none] strProps.append(props.getValue()); // depends on control dependency: [for], data = [props] strProps.append("</config-property>"); // depends on control dependency: [for], data = [none] strProps.append("\n"); // depends on control dependency: [for], data = [none] } } }
public class class_name { public final void destroyObject(Object obj) { log.debug(" !!! destroyObject... !!!" + obj); if (obj instanceof WorkerThread) { WorkerThread rt = (WorkerThread) obj; rt.setStopped(); } } }
public class class_name { public final void destroyObject(Object obj) { log.debug(" !!! destroyObject... !!!" + obj); if (obj instanceof WorkerThread) { WorkerThread rt = (WorkerThread) obj; rt.setStopped(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public Object call(Object comparable1, Object comparable2) { int result = COMPARATOR.compare(comparable1, comparable2); if (result < 0) { return comparable1; } else if (result > 0) { return comparable2; } return comparable1; } }
public class class_name { public Object call(Object comparable1, Object comparable2) { int result = COMPARATOR.compare(comparable1, comparable2); if (result < 0) { return comparable1; // depends on control dependency: [if], data = [none] } else if (result > 0) { return comparable2; // depends on control dependency: [if], data = [none] } return comparable1; } }
public class class_name { private Map<String, Object> getAnnotatedTerms(AnnotatedElement annotatedElement, String name) { final Terms annotatedTerms = findAnnotation(annotatedElement, Terms.class); final Term annotatedTerm = findAnnotation(annotatedElement, Term.class); if (annotatedTerms != null && annotatedTerm != null) { throw new IllegalStateException("found both @Terms and @Term in " + name + ", use either one or the other"); } Map<String, Object> annotatedTermsMap = new LinkedHashMap<String, Object>(); if (annotatedTerms != null) { final Term[] terms = annotatedTerms.value(); for (Term term : terms) { collectTerms(name, annotatedTermsMap, term); } } else if (annotatedTerm != null) { // only one term collectTerms(name, annotatedTermsMap, annotatedTerm); } return annotatedTermsMap; } }
public class class_name { private Map<String, Object> getAnnotatedTerms(AnnotatedElement annotatedElement, String name) { final Terms annotatedTerms = findAnnotation(annotatedElement, Terms.class); final Term annotatedTerm = findAnnotation(annotatedElement, Term.class); if (annotatedTerms != null && annotatedTerm != null) { throw new IllegalStateException("found both @Terms and @Term in " + name + ", use either one or the other"); // depends on control dependency: [if], data = [none] } Map<String, Object> annotatedTermsMap = new LinkedHashMap<String, Object>(); if (annotatedTerms != null) { final Term[] terms = annotatedTerms.value(); for (Term term : terms) { collectTerms(name, annotatedTermsMap, term); // depends on control dependency: [for], data = [term] } } else if (annotatedTerm != null) { // only one term collectTerms(name, annotatedTermsMap, annotatedTerm); // depends on control dependency: [if], data = [none] } return annotatedTermsMap; } }
public class class_name { public BaseAuthorization[] getAuthorizations() { BaseAuthorization[] res = new BaseAuthorization[authorizations.length]; try { for (int i = 0; i < authorizations.length; i++) { ByteArrayInputStream bais = new ByteArrayInputStream(authorizations[i]); JBossObjectInputStream deserialize = new JBossObjectInputStream(bais); Object obj = deserialize.readObject(); res[i] = (BaseAuthorization) obj; } } catch (ClassNotFoundException cnfe) { Logger log = LoggerFactory.getLogger(SavedAuthenticationImpl.class); log.error("Can not deserialize object, may cause rights to be lost.", cnfe); res = new BaseAuthorization[0]; // assure empty list, otherwise risk of NPE } catch (IOException ioe) { Logger log = LoggerFactory.getLogger(SavedAuthenticationImpl.class); log.error("Can not deserialize object, may cause rights to be lost.", ioe); res = new BaseAuthorization[0]; // assure empty list, otherwise risk of NPE } return res; } }
public class class_name { public BaseAuthorization[] getAuthorizations() { BaseAuthorization[] res = new BaseAuthorization[authorizations.length]; try { for (int i = 0; i < authorizations.length; i++) { ByteArrayInputStream bais = new ByteArrayInputStream(authorizations[i]); JBossObjectInputStream deserialize = new JBossObjectInputStream(bais); Object obj = deserialize.readObject(); res[i] = (BaseAuthorization) obj; // depends on control dependency: [for], data = [i] } } catch (ClassNotFoundException cnfe) { Logger log = LoggerFactory.getLogger(SavedAuthenticationImpl.class); log.error("Can not deserialize object, may cause rights to be lost.", cnfe); res = new BaseAuthorization[0]; // assure empty list, otherwise risk of NPE } catch (IOException ioe) { // depends on control dependency: [catch], data = [none] Logger log = LoggerFactory.getLogger(SavedAuthenticationImpl.class); log.error("Can not deserialize object, may cause rights to be lost.", ioe); res = new BaseAuthorization[0]; // assure empty list, otherwise risk of NPE } // depends on control dependency: [catch], data = [none] return res; } }
public class class_name { public boolean validateJMX() { if (getEdenMemoryPoolMXBean() == null || getSurvivorMemoryPoolMXBean() == null || getTenuredMemoryPoolMXBean() == null || getPermGenMemoryPoolMXBean() == null || getYoungCollectorMXBean() == null || getTenuredCollectorMXBean() == null) { return false; } return true; } }
public class class_name { public boolean validateJMX() { if (getEdenMemoryPoolMXBean() == null || getSurvivorMemoryPoolMXBean() == null || getTenuredMemoryPoolMXBean() == null || getPermGenMemoryPoolMXBean() == null || getYoungCollectorMXBean() == null || getTenuredCollectorMXBean() == null) { return false; // depends on control dependency: [if], data = [none] } return true; } }
public class class_name { public void stepSucceeded(StepSucceededMessage stepSuccessMessage) { ExecutingStep s = executingStep.get(); if ( ! s.getExecutionUUID().equals(stepSuccessMessage.getExecutionId())) { //This could happen if chorus interpreter timed out the previous step while waiting for the reply //Hence log to debug rather than error log.debug("Received a StepSucceededMessage for a step execution id " + stepSuccessMessage.getExecutionId() + " which did not match the currently executing step " + s.getExecutionUUID()); } else { s.getCompletableFuture().complete(stepSuccessMessage); } } }
public class class_name { public void stepSucceeded(StepSucceededMessage stepSuccessMessage) { ExecutingStep s = executingStep.get(); if ( ! s.getExecutionUUID().equals(stepSuccessMessage.getExecutionId())) { //This could happen if chorus interpreter timed out the previous step while waiting for the reply //Hence log to debug rather than error log.debug("Received a StepSucceededMessage for a step execution id " + stepSuccessMessage.getExecutionId() + " which did not match the currently executing step " + s.getExecutionUUID()); // depends on control dependency: [if], data = [none] } else { s.getCompletableFuture().complete(stepSuccessMessage); // depends on control dependency: [if], data = [none] } } }
public class class_name { public synchronized void close() { if (zooKeeper != null) { try { zooKeeper.close(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.warning("Interrupted trying to close zooKeeper"); } finally { zooKeeper = null; sessionState = null; } } } }
public class class_name { public synchronized void close() { if (zooKeeper != null) { try { zooKeeper.close(); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.warning("Interrupted trying to close zooKeeper"); } finally { // depends on control dependency: [catch], data = [none] zooKeeper = null; sessionState = null; } } } }
public class class_name { public void applyFilterChanges(Filter declarationFilter) { this.declarationFilter = declarationFilter; Set<ServiceReference<D>> added = new HashSet<ServiceReference<D>>(); Set<ServiceReference<D>> removed = new HashSet<ServiceReference<D>>(); for (Map.Entry<ServiceReference<D>, Boolean> e : declarations.entrySet()) { Map<String, Object> metadata = getDeclaration(e.getKey()).getMetadata(); boolean matchFilter = declarationFilter.matches(metadata); if (matchFilter != e.getValue() && matchFilter) { added.add(e.getKey()); } else if (matchFilter != e.getValue() && !matchFilter) { removed.add(e.getKey()); } e.setValue(matchFilter); } for (ServiceReference<D> declarationSRef : removed) { removeLinks(declarationSRef); } for (ServiceReference<D> declarationSRef : added) { createLinks(declarationSRef); } } }
public class class_name { public void applyFilterChanges(Filter declarationFilter) { this.declarationFilter = declarationFilter; Set<ServiceReference<D>> added = new HashSet<ServiceReference<D>>(); Set<ServiceReference<D>> removed = new HashSet<ServiceReference<D>>(); for (Map.Entry<ServiceReference<D>, Boolean> e : declarations.entrySet()) { Map<String, Object> metadata = getDeclaration(e.getKey()).getMetadata(); boolean matchFilter = declarationFilter.matches(metadata); if (matchFilter != e.getValue() && matchFilter) { added.add(e.getKey()); // depends on control dependency: [if], data = [none] } else if (matchFilter != e.getValue() && !matchFilter) { removed.add(e.getKey()); // depends on control dependency: [if], data = [none] } e.setValue(matchFilter); // depends on control dependency: [for], data = [e] } for (ServiceReference<D> declarationSRef : removed) { removeLinks(declarationSRef); // depends on control dependency: [for], data = [declarationSRef] } for (ServiceReference<D> declarationSRef : added) { createLinks(declarationSRef); // depends on control dependency: [for], data = [declarationSRef] } } }
public class class_name { public synchronized void setPlaybackState(int player, long position, boolean playing) { if (getMonitoredPlayer() != 0 && player != getMonitoredPlayer()) { throw new IllegalStateException("Cannot setPlaybackState for another player when monitoring player " + getMonitoredPlayer()); } if (player < 1) { throw new IllegalArgumentException("player must be positive"); } long oldMaxPosition = 0; PlaybackState furthestState = getFurthestPlaybackState(); if (furthestState != null) { oldMaxPosition = furthestState.position; } PlaybackState newState = new PlaybackState(player, position, playing); PlaybackState oldState = playbackStateMap.put(player, newState); long newMaxPosition = 0; furthestState = getFurthestPlaybackState(); if (furthestState != null) { newMaxPosition = furthestState.position; } repaintDueToPlaybackStateChange(oldMaxPosition, newMaxPosition, oldState, newState); } }
public class class_name { public synchronized void setPlaybackState(int player, long position, boolean playing) { if (getMonitoredPlayer() != 0 && player != getMonitoredPlayer()) { throw new IllegalStateException("Cannot setPlaybackState for another player when monitoring player " + getMonitoredPlayer()); } if (player < 1) { throw new IllegalArgumentException("player must be positive"); } long oldMaxPosition = 0; PlaybackState furthestState = getFurthestPlaybackState(); if (furthestState != null) { oldMaxPosition = furthestState.position; // depends on control dependency: [if], data = [none] } PlaybackState newState = new PlaybackState(player, position, playing); PlaybackState oldState = playbackStateMap.put(player, newState); long newMaxPosition = 0; furthestState = getFurthestPlaybackState(); if (furthestState != null) { newMaxPosition = furthestState.position; // depends on control dependency: [if], data = [none] } repaintDueToPlaybackStateChange(oldMaxPosition, newMaxPosition, oldState, newState); } }
public class class_name { private static void closeQuietly(final InputStream is, final String message) { if(is!=null) { try { is.close(); } catch (final Exception e) { if(LOGGER.isWarnEnabled()) { LOGGER.warn(message,e); } } } } }
public class class_name { private static void closeQuietly(final InputStream is, final String message) { if(is!=null) { try { is.close(); // depends on control dependency: [try], data = [none] } catch (final Exception e) { if(LOGGER.isWarnEnabled()) { LOGGER.warn(message,e); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } } }
public class class_name { @Deprecated public Object[] getValues() { @SuppressWarnings("unchecked") T[] a = (T[])EMPTY_ARRAY; T[] b = getValues(a); if (b == EMPTY_ARRAY) { return new Object[0]; } return b; } }
public class class_name { @Deprecated public Object[] getValues() { @SuppressWarnings("unchecked") T[] a = (T[])EMPTY_ARRAY; T[] b = getValues(a); if (b == EMPTY_ARRAY) { return new Object[0]; // depends on control dependency: [if], data = [none] } return b; } }
public class class_name { private void parsePersistence(Map<Object, Object> props) { parseKeepAliveEnabled(props); if (isKeepAliveEnabled()) { parseMaxPersist(props); } } }
public class class_name { private void parsePersistence(Map<Object, Object> props) { parseKeepAliveEnabled(props); if (isKeepAliveEnabled()) { parseMaxPersist(props); // depends on control dependency: [if], data = [none] } } }
public class class_name { private void cloneExportPoints( CmsModule sourceModule, CmsModule targetModule, String sourcePathPart, String targetPathPart) { for (CmsExportPoint exp : targetModule.getExportPoints()) { if (exp.getUri().contains(sourceModule.getName())) { exp.setUri(exp.getUri().replaceAll(sourceModule.getName(), targetModule.getName())); } if (exp.getUri().contains(sourcePathPart)) { exp.setUri(exp.getUri().replaceAll(sourcePathPart, targetPathPart)); } } } }
public class class_name { private void cloneExportPoints( CmsModule sourceModule, CmsModule targetModule, String sourcePathPart, String targetPathPart) { for (CmsExportPoint exp : targetModule.getExportPoints()) { if (exp.getUri().contains(sourceModule.getName())) { exp.setUri(exp.getUri().replaceAll(sourceModule.getName(), targetModule.getName())); // depends on control dependency: [if], data = [none] } if (exp.getUri().contains(sourcePathPart)) { exp.setUri(exp.getUri().replaceAll(sourcePathPart, targetPathPart)); // depends on control dependency: [if], data = [none] } } } }
public class class_name { protected void storeOsmWayID(int edgeId, long osmWayId) { if (getOsmWayIdSet().contains(osmWayId)) { getEdgeIdToOsmWayIdMap().put(edgeId, osmWayId); } } }
public class class_name { protected void storeOsmWayID(int edgeId, long osmWayId) { if (getOsmWayIdSet().contains(osmWayId)) { getEdgeIdToOsmWayIdMap().put(edgeId, osmWayId); // depends on control dependency: [if], data = [none] } } }
public class class_name { private UserDetailsService getUserDetailsService() { Map<String, ?> beans = getBeansOfType(CachingUserDetailsService.class); if (beans.size() == 0) { beans = getBeansOfType(UserDetailsService.class); } if (beans.size() == 0) { throw new ApplicationContextException("No UserDetailsService registered."); } else if (beans.size() > 1) { throw new ApplicationContextException( "More than one UserDetailsService registered. Please " + "use a specific Id reference in <remember-me/> <openid-login/> or <x509 /> elements."); } return (UserDetailsService) beans.values().toArray()[0]; } }
public class class_name { private UserDetailsService getUserDetailsService() { Map<String, ?> beans = getBeansOfType(CachingUserDetailsService.class); if (beans.size() == 0) { beans = getBeansOfType(UserDetailsService.class); // depends on control dependency: [if], data = [none] } if (beans.size() == 0) { throw new ApplicationContextException("No UserDetailsService registered."); } else if (beans.size() > 1) { throw new ApplicationContextException( "More than one UserDetailsService registered. Please " + "use a specific Id reference in <remember-me/> <openid-login/> or <x509 /> elements."); } return (UserDetailsService) beans.values().toArray()[0]; } }
public class class_name { public EClass getIfcDistributionElementType() { if (ifcDistributionElementTypeEClass == null) { ifcDistributionElementTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(162); } return ifcDistributionElementTypeEClass; } }
public class class_name { public EClass getIfcDistributionElementType() { if (ifcDistributionElementTypeEClass == null) { ifcDistributionElementTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(162); // depends on control dependency: [if], data = [none] } return ifcDistributionElementTypeEClass; } }
public class class_name { public FrequentItemsetsResult run(Database db, final Relation<BitVector> relation) { // TODO: implement with resizable arrays, to not need dim. final int dim = RelationUtil.dimensionality(relation); final VectorFieldTypeInformation<BitVector> meta = RelationUtil.assumeVectorField(relation); // Compute absolute minsupport final int minsupp = getMinimumSupport(relation.size()); LOG.verbose("Build 1-dimensional transaction lists."); Duration ctime = LOG.newDuration(STAT + "eclat.transposition.time").begin(); DBIDs[] idx = buildIndex(relation, dim, minsupp); LOG.statistics(ctime.end()); FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Building frequent itemsets", idx.length, LOG) : null; Duration etime = LOG.newDuration(STAT + "eclat.extraction.time").begin(); final List<Itemset> solution = new ArrayList<>(); for(int i = 0; i < idx.length; i++) { LOG.incrementProcessed(prog); extractItemsets(idx, i, minsupp, solution); } LOG.ensureCompleted(prog); Collections.sort(solution); LOG.statistics(etime.end()); LOG.statistics(new LongStatistic(STAT + "frequent-itemsets", solution.size())); return new FrequentItemsetsResult("Eclat", "eclat", solution, meta, relation.size()); } }
public class class_name { public FrequentItemsetsResult run(Database db, final Relation<BitVector> relation) { // TODO: implement with resizable arrays, to not need dim. final int dim = RelationUtil.dimensionality(relation); final VectorFieldTypeInformation<BitVector> meta = RelationUtil.assumeVectorField(relation); // Compute absolute minsupport final int minsupp = getMinimumSupport(relation.size()); LOG.verbose("Build 1-dimensional transaction lists."); Duration ctime = LOG.newDuration(STAT + "eclat.transposition.time").begin(); DBIDs[] idx = buildIndex(relation, dim, minsupp); LOG.statistics(ctime.end()); FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Building frequent itemsets", idx.length, LOG) : null; Duration etime = LOG.newDuration(STAT + "eclat.extraction.time").begin(); final List<Itemset> solution = new ArrayList<>(); for(int i = 0; i < idx.length; i++) { LOG.incrementProcessed(prog); // depends on control dependency: [for], data = [none] extractItemsets(idx, i, minsupp, solution); // depends on control dependency: [for], data = [i] } LOG.ensureCompleted(prog); Collections.sort(solution); LOG.statistics(etime.end()); LOG.statistics(new LongStatistic(STAT + "frequent-itemsets", solution.size())); return new FrequentItemsetsResult("Eclat", "eclat", solution, meta, relation.size()); } }
public class class_name { public boolean exists(Dn dn) { try { return connection.exists(dn); } catch (LdapException e) { throw new LdapDaoException(e); } } }
public class class_name { public boolean exists(Dn dn) { try { return connection.exists(dn); // depends on control dependency: [try], data = [none] } catch (LdapException e) { throw new LdapDaoException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void label(final ITetrahedralChirality element) { final IAtom focus = element.getChiralAtom(); final IAtom[] atoms = element.getLigands(); final IBond[] bonds = new IBond[4]; int p = parity(element.getStereo()); int n = 0; // unspecified centre, no need to assign labels if (p == 0) return; for (int i = 0; i < 4; i++) { if (atoms[i].equals(focus)) { p *= indexParity(i); // implicit H, adjust parity } else { bonds[n] = container.getBond(focus, atoms[i]); if (bonds[n] == null) throw new IllegalArgumentException("Inconsistent stereo," + " tetrahedral centre" + " contained atom not" + " stored in molecule"); atoms[n] = atoms[i]; n++; } } // sort coordinates and adjust parity (rank gives us the sorted order) int[] rank = new int[n]; for (int i = 0; i < n; i++) rank[i] = i; p *= sortClockwise(rank, focus, atoms, n); // special case when there are three neighbors are acute and an implicit // hydrogen is opposite all three neighbors. The central label needs to // be inverted, atoms could be laid out like this automatically, consider // CC1C[C@H]2CC[C@@H]1C2 int invert = -1; if (n == 3) { // find a triangle of non-sequential neighbors (sorted clockwise) // which has anti-clockwise winding for (int i = 0; i < n; i++) { Point2d a = atoms[rank[i]].getPoint2d(); Point2d b = focus.getPoint2d(); Point2d c = atoms[rank[(i + 2) % n]].getPoint2d(); double det = (a.x - c.x) * (b.y - c.y) - (a.y - c.y) * (b.x - c.x); if (det > 0) { invert = rank[(i + 1) % n]; break; } } } // assign all up/down labels to an auxiliary array IBond.Stereo[] labels = new IBond.Stereo[n]; for (int i = 0; i < n; i++) { int v = rank[i]; // 4 neighbors (invert every other one) if (n == 4) p *= -1; labels[v] = invert == v ? p > 0 ? DOWN : UP : p > 0 ? UP : DOWN; } // set the label for the highest priority and available bond IBond.Stereo firstlabel = null; boolean assignTwoLabels = assignTwoLabels(bonds, labels); for (int v : priority(atomToIndex.get(focus), atoms, n)) { IBond bond = bonds[v]; if (bond.getStereo() != NONE || bond.getOrder() != SINGLE) continue; // first label if (firstlabel == null) { bond.setAtoms(new IAtom[]{focus, atoms[v]}); // avoids UP_INVERTED/DOWN_INVERTED bond.setStereo(labels[v]); firstlabel = labels[v]; // don't assign a second label when there are only three ligands if (!assignTwoLabels) break; } // second label else if (labels[v] != firstlabel) { // don't add if it's possibly a stereo-centre if (isSp3Carbon(atoms[v], graph[container.indexOf(atoms[v])].length)) break; bond.setAtoms(new IAtom[]{focus, atoms[v]}); // avoids UP_INVERTED/DOWN_INVERTED bond.setStereo(labels[v]); break; } } // it should be possible to always assign labels somewhere -> unchecked exception if (firstlabel == null) throw new IllegalArgumentException("could not assign non-planar (up/down) labels"); } }
public class class_name { private void label(final ITetrahedralChirality element) { final IAtom focus = element.getChiralAtom(); final IAtom[] atoms = element.getLigands(); final IBond[] bonds = new IBond[4]; int p = parity(element.getStereo()); int n = 0; // unspecified centre, no need to assign labels if (p == 0) return; for (int i = 0; i < 4; i++) { if (atoms[i].equals(focus)) { p *= indexParity(i); // implicit H, adjust parity // depends on control dependency: [if], data = [none] } else { bonds[n] = container.getBond(focus, atoms[i]); // depends on control dependency: [if], data = [none] if (bonds[n] == null) throw new IllegalArgumentException("Inconsistent stereo," + " tetrahedral centre" + " contained atom not" + " stored in molecule"); atoms[n] = atoms[i]; // depends on control dependency: [if], data = [none] n++; // depends on control dependency: [if], data = [none] } } // sort coordinates and adjust parity (rank gives us the sorted order) int[] rank = new int[n]; for (int i = 0; i < n; i++) rank[i] = i; p *= sortClockwise(rank, focus, atoms, n); // special case when there are three neighbors are acute and an implicit // hydrogen is opposite all three neighbors. The central label needs to // be inverted, atoms could be laid out like this automatically, consider // CC1C[C@H]2CC[C@@H]1C2 int invert = -1; if (n == 3) { // find a triangle of non-sequential neighbors (sorted clockwise) // which has anti-clockwise winding for (int i = 0; i < n; i++) { Point2d a = atoms[rank[i]].getPoint2d(); Point2d b = focus.getPoint2d(); Point2d c = atoms[rank[(i + 2) % n]].getPoint2d(); double det = (a.x - c.x) * (b.y - c.y) - (a.y - c.y) * (b.x - c.x); if (det > 0) { invert = rank[(i + 1) % n]; // depends on control dependency: [if], data = [none] break; } } } // assign all up/down labels to an auxiliary array IBond.Stereo[] labels = new IBond.Stereo[n]; for (int i = 0; i < n; i++) { int v = rank[i]; // 4 neighbors (invert every other one) if (n == 4) p *= -1; labels[v] = invert == v ? p > 0 ? DOWN : UP : p > 0 ? UP : DOWN; // depends on control dependency: [for], data = [none] } // set the label for the highest priority and available bond IBond.Stereo firstlabel = null; boolean assignTwoLabels = assignTwoLabels(bonds, labels); for (int v : priority(atomToIndex.get(focus), atoms, n)) { IBond bond = bonds[v]; if (bond.getStereo() != NONE || bond.getOrder() != SINGLE) continue; // first label if (firstlabel == null) { bond.setAtoms(new IAtom[]{focus, atoms[v]}); // avoids UP_INVERTED/DOWN_INVERTED // depends on control dependency: [if], data = [none] bond.setStereo(labels[v]); // depends on control dependency: [if], data = [none] firstlabel = labels[v]; // depends on control dependency: [if], data = [none] // don't assign a second label when there are only three ligands if (!assignTwoLabels) break; } // second label else if (labels[v] != firstlabel) { // don't add if it's possibly a stereo-centre if (isSp3Carbon(atoms[v], graph[container.indexOf(atoms[v])].length)) break; bond.setAtoms(new IAtom[]{focus, atoms[v]}); // avoids UP_INVERTED/DOWN_INVERTED // depends on control dependency: [if], data = [none] bond.setStereo(labels[v]); // depends on control dependency: [if], data = [(labels[v]] break; } } // it should be possible to always assign labels somewhere -> unchecked exception if (firstlabel == null) throw new IllegalArgumentException("could not assign non-planar (up/down) labels"); } }
public class class_name { public Class<? extends Annotation> detectAnnotationType(final Annotation[] annotations) { for (final Annotation annotation : annotations) { if (annotation instanceof In) { return annotation.annotationType(); } else if (annotation instanceof Out) { return annotation.annotationType(); } } return null; } }
public class class_name { public Class<? extends Annotation> detectAnnotationType(final Annotation[] annotations) { for (final Annotation annotation : annotations) { if (annotation instanceof In) { return annotation.annotationType(); // depends on control dependency: [if], data = [none] } else if (annotation instanceof Out) { return annotation.annotationType(); // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public String availability(AvailabilityCondition condition) { String description; if (condition.getContext() != null && condition.getContext().get(CONTEXT_PROPERTY_DESCRIPTION) != null) { description = condition.getContext().get(CONTEXT_PROPERTY_DESCRIPTION); } else { description = condition.getDataId(); } AvailabilityCondition.Operator operator = condition.getOperator(); switch (operator) { case DOWN: description += " is down"; break; case NOT_UP: description += " is not up"; break; case UP: description += " is up"; break; default: throw new IllegalArgumentException(operator.name()); } return description; } }
public class class_name { public String availability(AvailabilityCondition condition) { String description; if (condition.getContext() != null && condition.getContext().get(CONTEXT_PROPERTY_DESCRIPTION) != null) { description = condition.getContext().get(CONTEXT_PROPERTY_DESCRIPTION); // depends on control dependency: [if], data = [none] } else { description = condition.getDataId(); // depends on control dependency: [if], data = [none] } AvailabilityCondition.Operator operator = condition.getOperator(); switch (operator) { case DOWN: description += " is down"; break; case NOT_UP: description += " is not up"; break; case UP: description += " is up"; break; default: throw new IllegalArgumentException(operator.name()); } return description; } }
public class class_name { public String getWidget() { StringBuffer result = new StringBuffer(); CmsProgressThread thread = getProgressThread(getKey()); // if the thread is finished before the widget is rendered // show directly the result if ((thread != null) && (!thread.isAlive())) { result.append("<script type=\"text/javascript\">\n"); result.append("\tprogressState = 0;\n"); result.append("\tprogressResult = '"); result.append(CmsStringUtil.escapeJavaScript(getActualProgress())); result.append("';\n"); result.append("\t"); result.append(getJsFinishMethod()); result.append("();\n"); result.append("</script>\n"); } else { // check if to show the wait symbol boolean showWait = false; if (getShowWaitTime() > 0) { // show if the thread is running and the time running is smaller than the configured if ((thread != null) && (thread.isAlive()) && (thread.getRuntime() < getShowWaitTime())) { showWait = true; } else if ((thread == null) && (getShowWaitTime() > 0)) { // show if there is no thread showWait = true; } } result.append("<div id=\"progressbar_desc\" style=\"margin-bottom:5px;display:"); result.append(showWait ? "none" : "block"); result.append("\"></div>"); result.append("<div style=\"width:"); result.append(getWidth()); result.append(";border-width:1px;border-style:solid;padding:0px;margin:0px;float:left;display:"); result.append(showWait ? "none" : "inline"); result.append(";\">\n"); result.append("\t<div id=\"progressbar_bar\" style=\"width:0%;background-color:"); result.append(getColor()); result.append(";\">&nbsp;</div>\n"); result.append("</div>\n"); result.append("&nbsp;"); result.append("<div id=\"progressbar_percent\" style=\"display:"); result.append(showWait ? "none" : "inline"); result.append(";\" >0%</div>\n"); result.append( "<div id=\"progressbar_error\" style=\"display:none;color:#B40000;font-weight:bold;\"></div>\n"); result.append("<div id=\"progressbar_wait\" style=\"display:"); result.append(showWait ? "block" : "none"); result.append(";color:#000099;font-weight:bold;\"><img src=\""); result.append(CmsWorkplace.getSkinUri()); result.append("commons/wait.gif\" width='32' height='32' alt='' align='absmiddle' />"); result.append( org.opencms.workplace.Messages.get().getBundle(getJsp().getRequestContext().getLocale()).key( org.opencms.workplace.Messages.GUI_AJAX_REPORT_WAIT_0)); result.append("</div>\n"); result.append("<script type=\"text/javascript\">\n"); result.append("\tstartProgressBar();\n"); result.append("</script>\n"); } return result.toString(); } }
public class class_name { public String getWidget() { StringBuffer result = new StringBuffer(); CmsProgressThread thread = getProgressThread(getKey()); // if the thread is finished before the widget is rendered // show directly the result if ((thread != null) && (!thread.isAlive())) { result.append("<script type=\"text/javascript\">\n"); // depends on control dependency: [if], data = [none] result.append("\tprogressState = 0;\n"); // depends on control dependency: [if], data = [none] result.append("\tprogressResult = '"); result.append(CmsStringUtil.escapeJavaScript(getActualProgress())); result.append("';\n"); // depends on control dependency: [if], data = [none] result.append("\t"); // depends on control dependency: [if], data = [none] result.append(getJsFinishMethod()); // depends on control dependency: [if], data = [none] result.append("();\n"); // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] result.append("</script>\n"); // depends on control dependency: [if], data = [none] } else { // check if to show the wait symbol boolean showWait = false; if (getShowWaitTime() > 0) { // show if the thread is running and the time running is smaller than the configured if ((thread != null) && (thread.isAlive()) && (thread.getRuntime() < getShowWaitTime())) { showWait = true; // depends on control dependency: [if], data = [none] } else if ((thread == null) && (getShowWaitTime() > 0)) { // show if there is no thread showWait = true; // depends on control dependency: [if], data = [none] } } result.append("<div id=\"progressbar_desc\" style=\"margin-bottom:5px;display:"); // depends on control dependency: [if], data = [none] result.append(showWait ? "none" : "block"); // depends on control dependency: [if], data = [none] result.append("\"></div>"); // depends on control dependency: [if], data = [none] result.append("<div style=\"width:"); // depends on control dependency: [if], data = [none] result.append(getWidth()); // depends on control dependency: [if], data = [none] result.append(";border-width:1px;border-style:solid;padding:0px;margin:0px;float:left;display:"); // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] result.append(showWait ? "none" : "inline"); // depends on control dependency: [if], data = [none] result.append(";\">\n"); // depends on control dependency: [if], data = [none] result.append("\t<div id=\"progressbar_bar\" style=\"width:0%;background-color:"); // depends on control dependency: [if], data = [none] result.append(getColor()); // depends on control dependency: [if], data = [none] result.append(";\">&nbsp;</div>\n"); // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] result.append("</div>\n"); // depends on control dependency: [if], data = [none] result.append("&nbsp;"); // depends on control dependency: [if], data = [none] result.append("<div id=\"progressbar_percent\" style=\"display:"); // depends on control dependency: [if], data = [none] result.append(showWait ? "none" : "inline"); // depends on control dependency: [if], data = [none] result.append(";\" >0%</div>\n"); // depends on control dependency: [if], data = [none] result.append( "<div id=\"progressbar_error\" style=\"display:none;color:#B40000;font-weight:bold;\"></div>\n"); // depends on control dependency: [if], data = [none] result.append("<div id=\"progressbar_wait\" style=\"display:"); // depends on control dependency: [if], data = [none] result.append(showWait ? "block" : "none"); // depends on control dependency: [if], data = [none] result.append(";color:#000099;font-weight:bold;\"><img src=\""); // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] result.append(CmsWorkplace.getSkinUri()); // depends on control dependency: [if], data = [none] result.append("commons/wait.gif\" width='32' height='32' alt='' align='absmiddle' />"); // depends on control dependency: [if], data = [none] result.append( org.opencms.workplace.Messages.get().getBundle(getJsp().getRequestContext().getLocale()).key( org.opencms.workplace.Messages.GUI_AJAX_REPORT_WAIT_0)); // depends on control dependency: [if], data = [none] result.append("</div>\n"); // depends on control dependency: [if], data = [none] result.append("<script type=\"text/javascript\">\n"); // depends on control dependency: [if], data = [none] result.append("\tstartProgressBar();\n"); // depends on control dependency: [if], data = [none] result.append("</script>\n"); // depends on control dependency: [if], data = [none] } return result.toString(); } }
public class class_name { public void addAllToProperties(Properties props) { synchronized (this.confData) { for (Map.Entry<String, Object> entry : this.confData.entrySet()) { props.put(entry.getKey(), entry.getValue()); } } } }
public class class_name { public void addAllToProperties(Properties props) { synchronized (this.confData) { for (Map.Entry<String, Object> entry : this.confData.entrySet()) { props.put(entry.getKey(), entry.getValue()); // depends on control dependency: [for], data = [entry] } } } }
public class class_name { private void addMessage(ValidationMessage<Origin> message) { if (message == null) { return; } if( null != defaultOrigin ) { message.addOrigin( defaultOrigin ); } this.messages.add(message); } }
public class class_name { private void addMessage(ValidationMessage<Origin> message) { if (message == null) { return; // depends on control dependency: [if], data = [none] } if( null != defaultOrigin ) { message.addOrigin( defaultOrigin ); // depends on control dependency: [if], data = [defaultOrigin )] } this.messages.add(message); } }
public class class_name { private boolean canContain( int child, int container, int containerIndexOnStack) { Preconditions.checkArgument(containerIndexOnStack >= 0); int anc = container; int ancIndexOnStack = containerIndexOnStack; while (true) { if (METADATA.canContain(anc, child)) { return true; } if (!TRANSPARENT.get(anc)) { return false; } if (ancIndexOnStack == 0) { return METADATA.canContain(BODY_TAG, child); } --ancIndexOnStack; anc = openElements.get(ancIndexOnStack); } } }
public class class_name { private boolean canContain( int child, int container, int containerIndexOnStack) { Preconditions.checkArgument(containerIndexOnStack >= 0); int anc = container; int ancIndexOnStack = containerIndexOnStack; while (true) { if (METADATA.canContain(anc, child)) { return true; // depends on control dependency: [if], data = [none] } if (!TRANSPARENT.get(anc)) { return false; // depends on control dependency: [if], data = [none] } if (ancIndexOnStack == 0) { return METADATA.canContain(BODY_TAG, child); // depends on control dependency: [if], data = [none] } --ancIndexOnStack; // depends on control dependency: [while], data = [none] anc = openElements.get(ancIndexOnStack); // depends on control dependency: [while], data = [none] } } }
public class class_name { protected void keyPressed(final KeyEvent event) { final int keyCode = event.getKeyCode(); final int modifiers = event.getModifiers(); if ((modifiers & Event.CTRL_MASK) != 0 && keyCode == KeyEvent.VK_ADD) { adjustColumnWidths(); } // else if (modifiers == 0) // { // final int selectedColumn = getSelectedColumn() != -1 ? getSelectedColumn() : 0; // final int selectedRow = getSelectedRow() != -1 ? getSelectedRow() : 0; // final int rowCount = getRowCount(); // if (isCellEditable(selectedRow, selectedColumn) || rowCount == 0) // { // return; // } // final String keyChar = String.valueOf(event.getKeyChar()); // String text; // for (int i = selectedRow + 1; i < rowCount; i++) // { // text = getTextAt(i, selectedColumn); // if (text != null && text.regionMatches(true, 0, keyChar, 0, 1)) // { // setRowSelectionInterval(i, i); // setColumnSelectionInterval(selectedColumn, selectedColumn); // scrollRectToVisible(getCellRect(i, selectedColumn, true)); // return; // } // } // for (int i = 0; i <= selectedRow; i++) // { // text = getTextAt(i, selectedColumn); // if (text != null && text.regionMatches(true, 0, keyChar, 0, 1)) // { // setRowSelectionInterval(i, i); // setColumnSelectionInterval(selectedColumn, selectedColumn); // scrollRectToVisible(getCellRect(i, selectedColumn, true)); // return; // } // } // } } }
public class class_name { protected void keyPressed(final KeyEvent event) { final int keyCode = event.getKeyCode(); final int modifiers = event.getModifiers(); if ((modifiers & Event.CTRL_MASK) != 0 && keyCode == KeyEvent.VK_ADD) { adjustColumnWidths(); // depends on control dependency: [if], data = [none] } // else if (modifiers == 0) // { // final int selectedColumn = getSelectedColumn() != -1 ? getSelectedColumn() : 0; // final int selectedRow = getSelectedRow() != -1 ? getSelectedRow() : 0; // final int rowCount = getRowCount(); // if (isCellEditable(selectedRow, selectedColumn) || rowCount == 0) // { // return; // } // final String keyChar = String.valueOf(event.getKeyChar()); // String text; // for (int i = selectedRow + 1; i < rowCount; i++) // { // text = getTextAt(i, selectedColumn); // if (text != null && text.regionMatches(true, 0, keyChar, 0, 1)) // { // setRowSelectionInterval(i, i); // setColumnSelectionInterval(selectedColumn, selectedColumn); // scrollRectToVisible(getCellRect(i, selectedColumn, true)); // return; // } // } // for (int i = 0; i <= selectedRow; i++) // { // text = getTextAt(i, selectedColumn); // if (text != null && text.regionMatches(true, 0, keyChar, 0, 1)) // { // setRowSelectionInterval(i, i); // setColumnSelectionInterval(selectedColumn, selectedColumn); // scrollRectToVisible(getCellRect(i, selectedColumn, true)); // return; // } // } // } } }
public class class_name { private void initMessage() { if (message != null && message.length() > 0) { ((TextView) findViewById(R.id.dmax_spots_title)).setText(message); } } }
public class class_name { private void initMessage() { if (message != null && message.length() > 0) { ((TextView) findViewById(R.id.dmax_spots_title)).setText(message); // depends on control dependency: [if], data = [(message] } } }
public class class_name { @Override public Object getPool(Collection<Object> pools) { try { return Iterables.get(pools, getAndIncrement(pools.size())); } catch (IndexOutOfBoundsException e) { return pools.iterator().next(); } } }
public class class_name { @Override public Object getPool(Collection<Object> pools) { try { return Iterables.get(pools, getAndIncrement(pools.size())); // depends on control dependency: [try], data = [none] } catch (IndexOutOfBoundsException e) { return pools.iterator().next(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void sessionAttributeSet(ISession session, Object name, Object oldValue, Boolean oldIsListener, Object newValue, Boolean newIsListener) { HttpSession httpsession = (HttpSession) _adapter.adapt(session); HttpSessionBindingEvent addEvent = null; // only init if necessary HttpSessionBindingEvent replaceEvent = null; // only init this if // necessary..done below // do binding listeners first to be consistent with v6.1 if ((oldValue != null) && (oldIsListener.booleanValue())) { replaceEvent = new HttpSessionBindingEvent(httpsession, (String) name, oldValue); // if (oldValue instanceof HttpSessionBindingListener) ((HttpSessionBindingListener) oldValue).valueUnbound(replaceEvent); } if ((newValue != null) && (newIsListener.booleanValue())) { // (newValue instanceof HttpSessionBindingListener) ) { addEvent = new HttpSessionBindingEvent(httpsession, (String) name, newValue); ((HttpSessionBindingListener) newValue).valueBound(addEvent); } // now do attribute listeners HttpSessionAttributeListener listener = null; for (int i = 0; i < _sessionAttributeListeners.size(); i++) { listener = (HttpSessionAttributeListener) _sessionAttributeListeners.get(i); if (oldValue != null) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "sessionAttrSet", "Calling attributeReplace on listener:" + listener); } if (replaceEvent == null) replaceEvent = new HttpSessionBindingEvent(httpsession, (String) name, oldValue); listener.attributeReplaced(replaceEvent); } else { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "sessionAttrSet", "Calling attributeCreated on listener:" + listener); } if (addEvent == null) addEvent = new HttpSessionBindingEvent(httpsession, (String) name, newValue); listener.attributeAdded(addEvent); } } } }
public class class_name { public void sessionAttributeSet(ISession session, Object name, Object oldValue, Boolean oldIsListener, Object newValue, Boolean newIsListener) { HttpSession httpsession = (HttpSession) _adapter.adapt(session); HttpSessionBindingEvent addEvent = null; // only init if necessary HttpSessionBindingEvent replaceEvent = null; // only init this if // necessary..done below // do binding listeners first to be consistent with v6.1 if ((oldValue != null) && (oldIsListener.booleanValue())) { replaceEvent = new HttpSessionBindingEvent(httpsession, (String) name, oldValue); // depends on control dependency: [if], data = [none] // if (oldValue instanceof HttpSessionBindingListener) ((HttpSessionBindingListener) oldValue).valueUnbound(replaceEvent); // depends on control dependency: [if], data = [none] } if ((newValue != null) && (newIsListener.booleanValue())) { // (newValue instanceof HttpSessionBindingListener) ) { addEvent = new HttpSessionBindingEvent(httpsession, (String) name, newValue); // depends on control dependency: [if], data = [none] ((HttpSessionBindingListener) newValue).valueBound(addEvent); // depends on control dependency: [if], data = [none] } // now do attribute listeners HttpSessionAttributeListener listener = null; for (int i = 0; i < _sessionAttributeListeners.size(); i++) { listener = (HttpSessionAttributeListener) _sessionAttributeListeners.get(i); // depends on control dependency: [for], data = [i] if (oldValue != null) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "sessionAttrSet", "Calling attributeReplace on listener:" + listener); // depends on control dependency: [if], data = [none] } if (replaceEvent == null) replaceEvent = new HttpSessionBindingEvent(httpsession, (String) name, oldValue); listener.attributeReplaced(replaceEvent); // depends on control dependency: [if], data = [none] } else { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "sessionAttrSet", "Calling attributeCreated on listener:" + listener); // depends on control dependency: [if], data = [none] } if (addEvent == null) addEvent = new HttpSessionBindingEvent(httpsession, (String) name, newValue); listener.attributeAdded(addEvent); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private static void parseRenameFile(List<String> lines, URL url, Map<Class<?>, SerDeserializer> map) { // format allows multiple [deserializers] so file can be merged boolean deserializers = false; for (String line : lines) { try { if (line.equals("[deserializers]")) { deserializers = true; } else if (deserializers) { int equalsPos = line.indexOf('='); String beanName = equalsPos >= 0 ? line.substring(0, equalsPos).trim() : line; String deserName = equalsPos >= 0 ? line.substring(equalsPos + 1).trim() : line; registerFromClasspath(beanName, deserName, map); } else { throw new IllegalArgumentException("JodaBeans.ini must start with [deserializers]"); } } catch (Exception ex) { System.err.println("ERROR: Invalid JodaBeans.ini: " + url + ": " + ex.getMessage()); } } } }
public class class_name { private static void parseRenameFile(List<String> lines, URL url, Map<Class<?>, SerDeserializer> map) { // format allows multiple [deserializers] so file can be merged boolean deserializers = false; for (String line : lines) { try { if (line.equals("[deserializers]")) { deserializers = true; // depends on control dependency: [if], data = [none] } else if (deserializers) { int equalsPos = line.indexOf('='); String beanName = equalsPos >= 0 ? line.substring(0, equalsPos).trim() : line; String deserName = equalsPos >= 0 ? line.substring(equalsPos + 1).trim() : line; registerFromClasspath(beanName, deserName, map); // depends on control dependency: [if], data = [none] } else { throw new IllegalArgumentException("JodaBeans.ini must start with [deserializers]"); } } catch (Exception ex) { System.err.println("ERROR: Invalid JodaBeans.ini: " + url + ": " + ex.getMessage()); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public static <N> MutableGraph<N> inducedSubgraph(Graph<N> graph, Iterable<? extends N> nodes) { MutableGraph<N> subgraph = (nodes instanceof Collection) ? GraphBuilder.from(graph).expectedNodeCount(((Collection) nodes).size()).build() : GraphBuilder.from(graph).build(); for (N node : nodes) { subgraph.addNode(node); } for (N node : subgraph.nodes()) { for (N successorNode : graph.successors(node)) { if (subgraph.nodes().contains(successorNode)) { subgraph.putEdge(node, successorNode); } } } return subgraph; } }
public class class_name { public static <N> MutableGraph<N> inducedSubgraph(Graph<N> graph, Iterable<? extends N> nodes) { MutableGraph<N> subgraph = (nodes instanceof Collection) ? GraphBuilder.from(graph).expectedNodeCount(((Collection) nodes).size()).build() : GraphBuilder.from(graph).build(); for (N node : nodes) { subgraph.addNode(node); // depends on control dependency: [for], data = [node] } for (N node : subgraph.nodes()) { for (N successorNode : graph.successors(node)) { if (subgraph.nodes().contains(successorNode)) { subgraph.putEdge(node, successorNode); // depends on control dependency: [if], data = [none] } } } return subgraph; } }
public class class_name { public static RESTParameter fromUNode(UNode paramNode) { RESTParameter param = new RESTParameter(); String name = paramNode.getName(); Utils.require(!Utils.isEmpty(name), "Missing parameter name: " + paramNode); param.setName(name); for (UNode childNode : paramNode.getMemberList()) { switch (childNode.getName()) { case "_required": param.setRequired(Boolean.parseBoolean(childNode.getValue())); break; case "_type": param.setType(childNode.getValue()); break; default: // Ignore system properties we don't recognize. if (childNode.getName().charAt(0) != '_') { param.add(RESTParameter.fromUNode(childNode)); } break; } } return param; } }
public class class_name { public static RESTParameter fromUNode(UNode paramNode) { RESTParameter param = new RESTParameter(); String name = paramNode.getName(); Utils.require(!Utils.isEmpty(name), "Missing parameter name: " + paramNode); param.setName(name); for (UNode childNode : paramNode.getMemberList()) { switch (childNode.getName()) { case "_required": param.setRequired(Boolean.parseBoolean(childNode.getValue())); break; case "_type": param.setType(childNode.getValue()); break; default: // Ignore system properties we don't recognize. if (childNode.getName().charAt(0) != '_') { param.add(RESTParameter.fromUNode(childNode)); // depends on control dependency: [if], data = [none] } break; } } return param; } }
public class class_name { public final static boolean isEjbQlIdentifier(String s) { if (s == null || s.length() == 0) { return false; } for (int i = 0; i < ejbQlIdentifiers.length; i++) { if (ejbQlIdentifiers[i].equalsIgnoreCase(s)) { return true; } } return false; } }
public class class_name { public final static boolean isEjbQlIdentifier(String s) { if (s == null || s.length() == 0) { return false; // depends on control dependency: [if], data = [none] } for (int i = 0; i < ejbQlIdentifiers.length; i++) { if (ejbQlIdentifiers[i].equalsIgnoreCase(s)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public static String tmpDirName() { String tmpDirName = System.getProperty("java.io.tmpdir"); if (!tmpDirName.endsWith(File.separator)) { tmpDirName += File.separator; } return tmpDirName; } }
public class class_name { public static String tmpDirName() { String tmpDirName = System.getProperty("java.io.tmpdir"); if (!tmpDirName.endsWith(File.separator)) { tmpDirName += File.separator; // depends on control dependency: [if], data = [none] } return tmpDirName; } }
public class class_name { public Map<String, Object> createContext(final Map<String, Object> parent, Map<String, Object> current) { return new DelegateMap<String, Object>(parent, current) { private static final long serialVersionUID = 1L; @Override public Object get(Object key) { Object value = super.get(key); if (value == null && parent == null && resolver != null) { return resolver.get((String) key); } return value; } }; } }
public class class_name { public Map<String, Object> createContext(final Map<String, Object> parent, Map<String, Object> current) { return new DelegateMap<String, Object>(parent, current) { private static final long serialVersionUID = 1L; @Override public Object get(Object key) { Object value = super.get(key); if (value == null && parent == null && resolver != null) { return resolver.get((String) key); // depends on control dependency: [if], data = [none] } return value; } }; } }
public class class_name { public static short[] getTripletFromXSSFColor( final XSSFColor xssfColor) { short[] rgbfix = { RGB8BITS, RGB8BITS, RGB8BITS }; if (xssfColor != null) { byte[] rgb = xssfColor.getRGBWithTint(); if (rgb == null) { rgb = xssfColor.getRGB(); } // Bytes are signed, so values of 128+ are negative! // 0: red, 1: green, 2: blue rgbfix[0] = (short) ((rgb[0] < 0) ? (rgb[0] + RGB8BITS) : rgb[0]); rgbfix[1] = (short) ((rgb[1] < 0) ? (rgb[1] + RGB8BITS) : rgb[1]); rgbfix[2] = (short) ((rgb[2] < 0) ? (rgb[2] + RGB8BITS) : rgb[2]); } return rgbfix; } }
public class class_name { public static short[] getTripletFromXSSFColor( final XSSFColor xssfColor) { short[] rgbfix = { RGB8BITS, RGB8BITS, RGB8BITS }; if (xssfColor != null) { byte[] rgb = xssfColor.getRGBWithTint(); if (rgb == null) { rgb = xssfColor.getRGB(); // depends on control dependency: [if], data = [none] } // Bytes are signed, so values of 128+ are negative! // 0: red, 1: green, 2: blue rgbfix[0] = (short) ((rgb[0] < 0) ? (rgb[0] + RGB8BITS) : rgb[0]); // depends on control dependency: [if], data = [none] rgbfix[1] = (short) ((rgb[1] < 0) ? (rgb[1] + RGB8BITS) : rgb[1]); // depends on control dependency: [if], data = [none] rgbfix[2] = (short) ((rgb[2] < 0) ? (rgb[2] + RGB8BITS) : rgb[2]); // depends on control dependency: [if], data = [none] } return rgbfix; } }
public class class_name { protected void showFinishing(LaJobRuntime runtime, long before, Throwable cause) { final String msg = buildFinishingMsg(runtime, before, cause); // also no use enabled if (noticeLogHook != null) { noticeLogHook.hookFinishing(runtime, msg, OptionalThing.ofNullable(cause, () -> { throw new IllegalStateException("Not found the cause: " + runtime); })); } JobNoticeLog.log(runtime.getNoticeLogLevel(), () -> msg); } }
public class class_name { protected void showFinishing(LaJobRuntime runtime, long before, Throwable cause) { final String msg = buildFinishingMsg(runtime, before, cause); // also no use enabled if (noticeLogHook != null) { noticeLogHook.hookFinishing(runtime, msg, OptionalThing.ofNullable(cause, () -> { throw new IllegalStateException("Not found the cause: " + runtime); })); // depends on control dependency: [if], data = [none] } JobNoticeLog.log(runtime.getNoticeLogLevel(), () -> msg); } }
public class class_name { public boolean refresh(int duration, String eventId, long timeout) { Request req = createSubscribeMessage(duration, eventId); if (req == null) { return false; } req.removeHeader(ProxyAuthorizationHeader.NAME); return refresh(req, timeout); } }
public class class_name { public boolean refresh(int duration, String eventId, long timeout) { Request req = createSubscribeMessage(duration, eventId); if (req == null) { return false; // depends on control dependency: [if], data = [none] } req.removeHeader(ProxyAuthorizationHeader.NAME); return refresh(req, timeout); } }
public class class_name { @Override public String[] getRoles(String username) { if (user_list.containsKey(username)) { return user_list.get(username).toArray(new String[0]); } else { if (defaultRoles == null) { return new String[0]; } else { return defaultRoles; } } } }
public class class_name { @Override public String[] getRoles(String username) { if (user_list.containsKey(username)) { return user_list.get(username).toArray(new String[0]); // depends on control dependency: [if], data = [none] } else { if (defaultRoles == null) { return new String[0]; // depends on control dependency: [if], data = [none] } else { return defaultRoles; // depends on control dependency: [if], data = [none] } } } }
public class class_name { public Observable<LifecycleState> addNode(final NetworkAddress hostname, final NetworkAddress alternate) { Node node = nodeBy(hostname); if (node != null) { LOGGER.debug("Node {} already registered, skipping.", hostname); return Observable.just(node.state()); } return addNode(new CouchbaseNode(hostname, ctx, alternate)); } }
public class class_name { public Observable<LifecycleState> addNode(final NetworkAddress hostname, final NetworkAddress alternate) { Node node = nodeBy(hostname); if (node != null) { LOGGER.debug("Node {} already registered, skipping.", hostname); // depends on control dependency: [if], data = [none] return Observable.just(node.state()); // depends on control dependency: [if], data = [(node] } return addNode(new CouchbaseNode(hostname, ctx, alternate)); } }
public class class_name { protected void initMojoMultiValueParameters() { // Set default values for 'checkFileSets' to "src/main/resources/*.btdesign" if (checkFileSets == null) { FileSet defaultFileSet = new FileSet(); defaultFileSet.setDirectory(project.getBasedir() + "/src/main/resources"); defaultFileSet.addInclude("*.btdesign"); checkFileSets = new FileSet[] { defaultFileSet }; } } }
public class class_name { protected void initMojoMultiValueParameters() { // Set default values for 'checkFileSets' to "src/main/resources/*.btdesign" if (checkFileSets == null) { FileSet defaultFileSet = new FileSet(); defaultFileSet.setDirectory(project.getBasedir() + "/src/main/resources"); // depends on control dependency: [if], data = [none] defaultFileSet.addInclude("*.btdesign"); // depends on control dependency: [if], data = [none] checkFileSets = new FileSet[] { defaultFileSet }; // depends on control dependency: [if], data = [none] } } }
public class class_name { public java.util.List<BundleTask> getBundleTasks() { if (bundleTasks == null) { bundleTasks = new com.amazonaws.internal.SdkInternalList<BundleTask>(); } return bundleTasks; } }
public class class_name { public java.util.List<BundleTask> getBundleTasks() { if (bundleTasks == null) { bundleTasks = new com.amazonaws.internal.SdkInternalList<BundleTask>(); // depends on control dependency: [if], data = [none] } return bundleTasks; } }
public class class_name { public ClassGraph blacklistJars(final String... jarLeafNames) { for (final String jarLeafName : jarLeafNames) { final String leafName = JarUtils.leafName(jarLeafName); if (!leafName.equals(jarLeafName)) { throw new IllegalArgumentException("Can only blacklist jars by leafname: " + jarLeafName); } scanSpec.jarWhiteBlackList.addToBlacklist(leafName); } return this; } }
public class class_name { public ClassGraph blacklistJars(final String... jarLeafNames) { for (final String jarLeafName : jarLeafNames) { final String leafName = JarUtils.leafName(jarLeafName); if (!leafName.equals(jarLeafName)) { throw new IllegalArgumentException("Can only blacklist jars by leafname: " + jarLeafName); } scanSpec.jarWhiteBlackList.addToBlacklist(leafName); // depends on control dependency: [for], data = [none] } return this; } }
public class class_name { public void transform(List<S> transformables, long elapsedTime) { for (S transformable : transformables) transform(transformable, elapsedTime); } /** * Applies this {@link Transformation} to the {@link ITransformable} * * @param transformable the transformable * @param elapsedTime the elapsed time */ public void transform(S transformable, long elapsedTime) { doTransform(transformable, completion(Math.max(0, elapsedTime))); } /** * Calculates the completion of this {@link Transformation} based on the movement and the elapsed time. * * @param elapsedTime the elapsed time * @return the float */ protected float completion(long elapsedTime) { if (duration == 0) return 0; float comp = 0; long loopDuration = getLoopDuration(); elapsedTimeCurrentLoop = elapsedTime - delay; if (loops != -1 && elapsedTimeCurrentLoop > loops * loopDuration) return 1; if (loops != 1) { elapsedTimeCurrentLoop %= loopDuration; if (elapsedTimeCurrentLoop < loopStartDelay) return 0; if (elapsedTimeCurrentLoop + loopResetDelay > loopDuration) return 1; elapsedTimeCurrentLoop -= loopStartDelay; } comp = Math.min((float) elapsedTimeCurrentLoop / duration, 1); comp = Math.max(0, Math.min(1, comp)); if (movement == SINUSOIDAL) { comp = (float) (1 - Math.cos(comp * Math.PI)) / 2; } //MalisisCore.message(comp); return comp; } }
public class class_name { public void transform(List<S> transformables, long elapsedTime) { for (S transformable : transformables) transform(transformable, elapsedTime); } /** * Applies this {@link Transformation} to the {@link ITransformable} * * @param transformable the transformable * @param elapsedTime the elapsed time */ public void transform(S transformable, long elapsedTime) { doTransform(transformable, completion(Math.max(0, elapsedTime))); } /** * Calculates the completion of this {@link Transformation} based on the movement and the elapsed time. * * @param elapsedTime the elapsed time * @return the float */ protected float completion(long elapsedTime) { if (duration == 0) return 0; float comp = 0; long loopDuration = getLoopDuration(); elapsedTimeCurrentLoop = elapsedTime - delay; if (loops != -1 && elapsedTimeCurrentLoop > loops * loopDuration) return 1; if (loops != 1) { elapsedTimeCurrentLoop %= loopDuration; // depends on control dependency: [if], data = [none] if (elapsedTimeCurrentLoop < loopStartDelay) return 0; if (elapsedTimeCurrentLoop + loopResetDelay > loopDuration) return 1; elapsedTimeCurrentLoop -= loopStartDelay; // depends on control dependency: [if], data = [none] } comp = Math.min((float) elapsedTimeCurrentLoop / duration, 1); comp = Math.max(0, Math.min(1, comp)); if (movement == SINUSOIDAL) { comp = (float) (1 - Math.cos(comp * Math.PI)) / 2; // depends on control dependency: [if], data = [none] } //MalisisCore.message(comp); return comp; } }
public class class_name { public CompletableFuture<byte[]> asByteArray(DiscordApi api) { CompletableFuture<byte[]> future = new CompletableFuture<>(); try { if (fileAsByteArray != null) { future.complete(fileAsByteArray); return future; } if (fileAsBufferedImage != null || fileAsFile != null || fileAsIcon != null || fileAsUrl != null || fileAsInputStream != null) { asInputStream(api).thenApply(stream -> { try ( InputStream in = new BufferedInputStream(stream); ByteArrayOutputStream out = new ByteArrayOutputStream() ) { byte[] buf = new byte[1024]; int n; while (-1 != (n = in.read(buf))) { out.write(buf, 0, n); } return out.toByteArray(); } catch (IOException e) { throw new CompletionException(e); } }).whenComplete((bytes, throwable) -> { if (throwable != null) { future.completeExceptionally(throwable); } else { future.complete(bytes); } }); return future; } future.completeExceptionally(new IllegalStateException("No file variant is set")); } catch (Throwable t) { future.completeExceptionally(t); } return future; } }
public class class_name { public CompletableFuture<byte[]> asByteArray(DiscordApi api) { CompletableFuture<byte[]> future = new CompletableFuture<>(); try { if (fileAsByteArray != null) { future.complete(fileAsByteArray); // depends on control dependency: [if], data = [(fileAsByteArray] return future; // depends on control dependency: [if], data = [none] } if (fileAsBufferedImage != null || fileAsFile != null || fileAsIcon != null || fileAsUrl != null || fileAsInputStream != null) { asInputStream(api).thenApply(stream -> { try ( InputStream in = new BufferedInputStream(stream); ByteArrayOutputStream out = new ByteArrayOutputStream() ) { byte[] buf = new byte[1024]; // depends on control dependency: [if], data = [none] int n; while (-1 != (n = in.read(buf))) { out.write(buf, 0, n); // depends on control dependency: [while], data = [none] } return out.toByteArray(); // depends on control dependency: [if], data = [none] } catch (IOException e) { throw new CompletionException(e); } }).whenComplete((bytes, throwable) -> { if (throwable != null) { future.completeExceptionally(throwable); // depends on control dependency: [if], data = [(throwable] } else { future.complete(bytes); // depends on control dependency: [if], data = [none] } }); return future; } future.completeExceptionally(new IllegalStateException("No file variant is set")); } catch (Throwable t) { future.completeExceptionally(t); } // depends on control dependency: [catch], data = [none] return future; } }
public class class_name { void robotRelease(int click) { lastClick = 0; final int button = click; if (button < clicks.length) { clicks[button] = false; clicked[button] = false; } } }
public class class_name { void robotRelease(int click) { lastClick = 0; final int button = click; if (button < clicks.length) { clicks[button] = false; // depends on control dependency: [if], data = [none] clicked[button] = false; // depends on control dependency: [if], data = [none] } } }
public class class_name { protected static Map<String, Object> eventSendPicsInfo(XMLEventReader reader) throws XMLStreamException { Map<String, Object> sendPicsInfoMap = new HashMap<String, Object>(); while (reader.hasNext()){ XMLEvent event = reader.nextEvent(); if (event.isStartElement()) { String tagName = event.asStartElement().getName() .toString(); if("Count".equals(tagName)){ sendPicsInfoMap.put(tagName, reader.getElementText()); }else if("PicList".equals(tagName)){ // StringBuilder sb = new StringBuilder(); List<Map<String, String>> picList = CollectionUtil.newArrayList(); while(reader.hasNext()){ XMLEvent event1 = reader.nextEvent(); if(event1.isStartElement() && "PicMd5Sum".equals(event1.asStartElement().getName() .toString())){ Map<String, String> picMap = new HashMap<String, String>(); picMap.put("PicMd5Sum", reader.getElementText()); // sb.append(reader.getElementText()); // sb.append(","); picList.add(picMap); }else if(event1.isEndElement() && "PicList".equals(event1.asEndElement().getName().toString())){ break; } } // sendPicsInfoMap.put(tagName, sb.substring(0, sb.length())); sendPicsInfoMap.put(tagName, picList); } } } return sendPicsInfoMap; } }
public class class_name { protected static Map<String, Object> eventSendPicsInfo(XMLEventReader reader) throws XMLStreamException { Map<String, Object> sendPicsInfoMap = new HashMap<String, Object>(); while (reader.hasNext()){ XMLEvent event = reader.nextEvent(); if (event.isStartElement()) { String tagName = event.asStartElement().getName() .toString(); if("Count".equals(tagName)){ sendPicsInfoMap.put(tagName, reader.getElementText()); }else if("PicList".equals(tagName)){ // StringBuilder sb = new StringBuilder(); List<Map<String, String>> picList = CollectionUtil.newArrayList(); while(reader.hasNext()){ XMLEvent event1 = reader.nextEvent(); if(event1.isStartElement() && "PicMd5Sum".equals(event1.asStartElement().getName() .toString())){ Map<String, String> picMap = new HashMap<String, String>(); picMap.put("PicMd5Sum", reader.getElementText()); // depends on control dependency: [if], data = [none] // sb.append(reader.getElementText()); // sb.append(","); picList.add(picMap); // depends on control dependency: [if], data = [none] }else if(event1.isEndElement() && "PicList".equals(event1.asEndElement().getName().toString())){ break; } } // sendPicsInfoMap.put(tagName, sb.substring(0, sb.length())); sendPicsInfoMap.put(tagName, picList); } } } return sendPicsInfoMap; } }
public class class_name { @PublicEvolving public static <X extends Tuple> TupleTypeInfo<X> getBasicTupleTypeInfo(Class<?>... basicTypes) { if (basicTypes == null || basicTypes.length == 0) { throw new IllegalArgumentException(); } TypeInformation<?>[] infos = new TypeInformation<?>[basicTypes.length]; for (int i = 0; i < infos.length; i++) { Class<?> type = basicTypes[i]; if (type == null) { throw new IllegalArgumentException("Type at position " + i + " is null."); } TypeInformation<?> info = BasicTypeInfo.getInfoFor(type); if (info == null) { throw new IllegalArgumentException("Type at position " + i + " is not a basic type."); } infos[i] = info; } @SuppressWarnings("unchecked") TupleTypeInfo<X> tupleInfo = (TupleTypeInfo<X>) new TupleTypeInfo<Tuple>(infos); return tupleInfo; } }
public class class_name { @PublicEvolving public static <X extends Tuple> TupleTypeInfo<X> getBasicTupleTypeInfo(Class<?>... basicTypes) { if (basicTypes == null || basicTypes.length == 0) { throw new IllegalArgumentException(); } TypeInformation<?>[] infos = new TypeInformation<?>[basicTypes.length]; for (int i = 0; i < infos.length; i++) { Class<?> type = basicTypes[i]; if (type == null) { throw new IllegalArgumentException("Type at position " + i + " is null."); } TypeInformation<?> info = BasicTypeInfo.getInfoFor(type); if (info == null) { throw new IllegalArgumentException("Type at position " + i + " is not a basic type."); } infos[i] = info; // depends on control dependency: [for], data = [i] } @SuppressWarnings("unchecked") TupleTypeInfo<X> tupleInfo = (TupleTypeInfo<X>) new TupleTypeInfo<Tuple>(infos); return tupleInfo; } }
public class class_name { @Override public byte[] getBytes(K key) { if(key == null) { return null; } return _store.get(_keySerializer.serialize(key)); } }
public class class_name { @Override public byte[] getBytes(K key) { if(key == null) { return null; // depends on control dependency: [if], data = [none] } return _store.get(_keySerializer.serialize(key)); } }
public class class_name { public boolean crawlTopics() { if (prop.get(PROPERTY_LINK_CRAWLER) == null) { return true; } return prop.get(PROPERTY_LINK_CRAWLER).toString().equals(ANT_INVOKER_EXT_PARAM_CRAWL_VALUE_TOPIC); } }
public class class_name { public boolean crawlTopics() { if (prop.get(PROPERTY_LINK_CRAWLER) == null) { return true; // depends on control dependency: [if], data = [none] } return prop.get(PROPERTY_LINK_CRAWLER).toString().equals(ANT_INVOKER_EXT_PARAM_CRAWL_VALUE_TOPIC); } }
public class class_name { @SuppressWarnings("unchecked") public static <T> T getController(BaseComponent comp, Class<T> type) { while (comp != null) { Object controller = getController(comp); if (type.isInstance(controller)) { return (T) controller; } comp = comp.getParent(); } return null; } }
public class class_name { @SuppressWarnings("unchecked") public static <T> T getController(BaseComponent comp, Class<T> type) { while (comp != null) { Object controller = getController(comp); if (type.isInstance(controller)) { return (T) controller; // depends on control dependency: [if], data = [none] } comp = comp.getParent(); // depends on control dependency: [while], data = [none] } return null; } }
public class class_name { void notifyReferenced(Provider provider, T instance) { notifyInstanceCreationWhenNeeded(); if (referencedListeners != null) { int len = referencedListeners.size(); for(int i = 0; i < len; i++) { referencedListeners.get(i).onReferenced(provider, instance); } } } }
public class class_name { void notifyReferenced(Provider provider, T instance) { notifyInstanceCreationWhenNeeded(); if (referencedListeners != null) { int len = referencedListeners.size(); for(int i = 0; i < len; i++) { referencedListeners.get(i).onReferenced(provider, instance); // depends on control dependency: [for], data = [i] } } } }
public class class_name { @Override public int compare(String version1, String version2) { if(version1 == version2) { return 0; } if (version1 == null && version2 == null) { return 0; } else if (version1 == null) {// null视为最小版本,排在前 return -1; } else if (version2 == null) { return 1; } final List<String> v1s = StrUtil.split(version1, CharUtil.DOT); final List<String> v2s = StrUtil.split(version2, CharUtil.DOT); int diff = 0; int minLength = Math.min(v1s.size(), v2s.size());// 取最小长度值 String v1; String v2; for (int i = 0; i < minLength; i++) { v1 = v1s.get(i); v2 = v2s.get(i); // 先比较长度 diff = v1.length() - v2.length(); if (0 == diff) { diff = v1.compareTo(v2); } if(diff != 0) { //已有结果,结束 break; } } // 如果已经分出大小,则直接返回,如果未分出大小,则再比较位数,有子版本的为大; return (diff != 0) ? diff : v1s.size() - v2s.size(); } }
public class class_name { @Override public int compare(String version1, String version2) { if(version1 == version2) { return 0; // depends on control dependency: [if], data = [none] } if (version1 == null && version2 == null) { return 0; // depends on control dependency: [if], data = [none] } else if (version1 == null) {// null视为最小版本,排在前 return -1; // depends on control dependency: [if], data = [none] } else if (version2 == null) { return 1; // depends on control dependency: [if], data = [none] } final List<String> v1s = StrUtil.split(version1, CharUtil.DOT); final List<String> v2s = StrUtil.split(version2, CharUtil.DOT); int diff = 0; int minLength = Math.min(v1s.size(), v2s.size());// 取最小长度值 String v1; String v2; for (int i = 0; i < minLength; i++) { v1 = v1s.get(i); // depends on control dependency: [for], data = [i] v2 = v2s.get(i); // depends on control dependency: [for], data = [i] // 先比较长度 diff = v1.length() - v2.length(); // depends on control dependency: [for], data = [none] if (0 == diff) { diff = v1.compareTo(v2); // depends on control dependency: [if], data = [none] } if(diff != 0) { //已有结果,结束 break; } } // 如果已经分出大小,则直接返回,如果未分出大小,则再比较位数,有子版本的为大; return (diff != 0) ? diff : v1s.size() - v2s.size(); } }
public class class_name { public static Principal[] getGrantedRoles(SecurityIdentity securityIdentity) { Set<String> roles = new HashSet<>(); for (String s : securityIdentity.getRoles("ejb")) { roles.add(s); } List<Principal> list = new ArrayList<>(); Function<String, Principal> mapper = roleName -> (Principal) () -> roleName; for (String role : roles) { Principal principal = mapper.apply(role); list.add(principal); } return list.toArray(NO_PRINCIPALS); } }
public class class_name { public static Principal[] getGrantedRoles(SecurityIdentity securityIdentity) { Set<String> roles = new HashSet<>(); for (String s : securityIdentity.getRoles("ejb")) { roles.add(s); // depends on control dependency: [for], data = [s] } List<Principal> list = new ArrayList<>(); Function<String, Principal> mapper = roleName -> (Principal) () -> roleName; for (String role : roles) { Principal principal = mapper.apply(role); list.add(principal); // depends on control dependency: [for], data = [none] } return list.toArray(NO_PRINCIPALS); } }
public class class_name { public boolean hasPrivileges( SecurityContext sc, Privilege[] privileges ) { for (AccessControlEntryImpl ace : principals.values()) { // check access list for everyone if (ace.getPrincipal().getName().equals(SimplePrincipal.EVERYONE.getName())) { if (ace.hasPrivileges(privileges)) { return true; } } // check user principal if (ace.getPrincipal().getName().equals(username(sc.getUserName()))) { if (ace.hasPrivileges(privileges)) { return true; } } // check group/role principal if (sc.hasRole(ace.getPrincipal().getName())) { if (ace.hasPrivileges(privileges)) { return true; } } } return false; } }
public class class_name { public boolean hasPrivileges( SecurityContext sc, Privilege[] privileges ) { for (AccessControlEntryImpl ace : principals.values()) { // check access list for everyone if (ace.getPrincipal().getName().equals(SimplePrincipal.EVERYONE.getName())) { if (ace.hasPrivileges(privileges)) { return true; // depends on control dependency: [if], data = [none] } } // check user principal if (ace.getPrincipal().getName().equals(username(sc.getUserName()))) { if (ace.hasPrivileges(privileges)) { return true; // depends on control dependency: [if], data = [none] } } // check group/role principal if (sc.hasRole(ace.getPrincipal().getName())) { if (ace.hasPrivileges(privileges)) { return true; // depends on control dependency: [if], data = [none] } } } return false; } }
public class class_name { protected void setDetails(HttpServletRequest request, UsernamePasswordAuthenticationToken authRequest) { try { authRequest.setDetails(authenticationDetailsSource.buildDetails(request)); } catch (Exception e) { // This would happen e.g. for LCDS NIO Endpoints, which only have a "shell" request. // Don't do anything. } } }
public class class_name { protected void setDetails(HttpServletRequest request, UsernamePasswordAuthenticationToken authRequest) { try { authRequest.setDetails(authenticationDetailsSource.buildDetails(request)); // depends on control dependency: [try], data = [none] } catch (Exception e) { // This would happen e.g. for LCDS NIO Endpoints, which only have a "shell" request. // Don't do anything. } // depends on control dependency: [catch], data = [none] } }
public class class_name { static void setHttp2Authority(String authority, Http2Headers out) { // The authority MUST NOT include the deprecated "userinfo" subcomponent if (authority != null) { if (authority.isEmpty()) { out.authority(EMPTY_STRING); } else { int start = authority.indexOf('@') + 1; int length = authority.length() - start; if (length == 0) { throw new IllegalArgumentException("authority: " + authority); } out.authority(new AsciiString(authority, start, length)); } } } }
public class class_name { static void setHttp2Authority(String authority, Http2Headers out) { // The authority MUST NOT include the deprecated "userinfo" subcomponent if (authority != null) { if (authority.isEmpty()) { out.authority(EMPTY_STRING); // depends on control dependency: [if], data = [none] } else { int start = authority.indexOf('@') + 1; int length = authority.length() - start; if (length == 0) { throw new IllegalArgumentException("authority: " + authority); } out.authority(new AsciiString(authority, start, length)); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public boolean addSubject(String subject) { try { return add(new Meta(Element.SUBJECT, subject)); } catch (DocumentException de) { throw new ExceptionConverter(de); } } }
public class class_name { public boolean addSubject(String subject) { try { return add(new Meta(Element.SUBJECT, subject)); // depends on control dependency: [try], data = [none] } catch (DocumentException de) { throw new ExceptionConverter(de); } // depends on control dependency: [catch], data = [none] } }
public class class_name { protected boolean definePropertyBeanMethods(ClassFile cf, SyntheticProperty property) { TypeDesc propertyType = TypeDesc.forClass(property.getType()); // Add property get method. final MethodInfo mi = cf.addMethod(Modifiers.PUBLIC_ABSTRACT, property.getReadMethodName(), propertyType, null); if (property.getName() != null) { // Define @Name Annotation ann = mi.addRuntimeVisibleAnnotation(TypeDesc.forClass(Name.class)); ann.putMemberValue("value", property.getName()); } if (property.isNullable()) { mi.addRuntimeVisibleAnnotation(TypeDesc.forClass(Nullable.class)); } boolean versioned = false; if (property.isVersion()) { mi.addRuntimeVisibleAnnotation(TypeDesc.forClass(Version.class)); versioned = true; } if (property.getAdapter() != null) { StorablePropertyAdapter adapter = property.getAdapter(); Annotation ann = mi.addRuntimeVisibleAnnotation (TypeDesc.forClass(adapter.getAnnotation().getAnnotationType())); java.lang.annotation.Annotation jann = adapter.getAnnotation().getAnnotation(); if (jann != null) { new AnnotationBuilder().visit(jann, ann); } } List<String> annotationDescs = property.getAccessorAnnotationDescriptors(); if (annotationDescs != null && annotationDescs.size() > 0) { for (String desc : annotationDescs) { new AnnotationDescParser(desc) { @Override protected Annotation buildRootAnnotation(TypeDesc rootAnnotationType) { return mi.addRuntimeVisibleAnnotation(rootAnnotationType); } }.parse(null); } } // Add property set method. cf.addMethod(Modifiers.PUBLIC_ABSTRACT, property.getWriteMethodName(), null, new TypeDesc[] { propertyType }); return versioned; } }
public class class_name { protected boolean definePropertyBeanMethods(ClassFile cf, SyntheticProperty property) { TypeDesc propertyType = TypeDesc.forClass(property.getType()); // Add property get method. final MethodInfo mi = cf.addMethod(Modifiers.PUBLIC_ABSTRACT, property.getReadMethodName(), propertyType, null); if (property.getName() != null) { // Define @Name Annotation ann = mi.addRuntimeVisibleAnnotation(TypeDesc.forClass(Name.class)); ann.putMemberValue("value", property.getName()); // depends on control dependency: [if], data = [none] } if (property.isNullable()) { mi.addRuntimeVisibleAnnotation(TypeDesc.forClass(Nullable.class)); // depends on control dependency: [if], data = [none] } boolean versioned = false; if (property.isVersion()) { mi.addRuntimeVisibleAnnotation(TypeDesc.forClass(Version.class)); // depends on control dependency: [if], data = [none] versioned = true; // depends on control dependency: [if], data = [none] } if (property.getAdapter() != null) { StorablePropertyAdapter adapter = property.getAdapter(); Annotation ann = mi.addRuntimeVisibleAnnotation (TypeDesc.forClass(adapter.getAnnotation().getAnnotationType())); java.lang.annotation.Annotation jann = adapter.getAnnotation().getAnnotation(); if (jann != null) { new AnnotationBuilder().visit(jann, ann); // depends on control dependency: [if], data = [(jann] } } List<String> annotationDescs = property.getAccessorAnnotationDescriptors(); if (annotationDescs != null && annotationDescs.size() > 0) { for (String desc : annotationDescs) { new AnnotationDescParser(desc) { @Override protected Annotation buildRootAnnotation(TypeDesc rootAnnotationType) { return mi.addRuntimeVisibleAnnotation(rootAnnotationType); } }.parse(null); // depends on control dependency: [for], data = [none] } } // Add property set method. cf.addMethod(Modifiers.PUBLIC_ABSTRACT, property.getWriteMethodName(), null, new TypeDesc[] { propertyType }); return versioned; } }
public class class_name { private int transpositions(String text1, String text2) { int transpositions = 0; for (int i = 0; i < text1.length(); i++) { if (text1.charAt(i) != text2.charAt(i)) { transpositions++; } } return transpositions; } }
public class class_name { private int transpositions(String text1, String text2) { int transpositions = 0; for (int i = 0; i < text1.length(); i++) { if (text1.charAt(i) != text2.charAt(i)) { transpositions++; // depends on control dependency: [if], data = [none] } } return transpositions; } }
public class class_name { private AttributeDescr intOrChunkAttribute( AttributeSupportBuilder< ? > as, String[] key ) throws RecognitionException { AttributeDescrBuilder< ? > attribute = null; try { StringBuilder builder = new StringBuilder(); for ( String k : key ) { if ( "-".equals( k ) ) { match( input, DRL5Lexer.MINUS, k, null, DroolsEditorType.KEYWORD ); // part of the keyword if ( state.failed ) return null; } else { match( input, DRL5Lexer.ID, k, null, DroolsEditorType.KEYWORD ); if ( state.failed ) return null; } builder.append( k ); } if ( state.backtracking == 0 ) { attribute = helper.start( (DescrBuilder< ? , ? >) as, AttributeDescrBuilder.class, builder.toString() ); } if ( input.LA( 1 ) == DRL5Lexer.LEFT_PAREN ) { String value = chunk( DRL5Lexer.LEFT_PAREN, DRL5Lexer.RIGHT_PAREN, -1 ); if ( state.failed ) return null; if ( state.backtracking == 0 ) { attribute.value( safeStripDelimiters( value, "(", ")" ) ); attribute.type( AttributeDescr.Type.EXPRESSION ); } } else { String value = ""; if ( input.LA( 1 ) == DRL5Lexer.PLUS ) { Token sign = match( input, DRL5Lexer.PLUS, null, null, DroolsEditorType.NUMERIC_CONST ); if ( state.failed ) return null; value += sign.getText(); } else if ( input.LA( 1 ) == DRL5Lexer.MINUS ) { Token sign = match( input, DRL5Lexer.MINUS, null, null, DroolsEditorType.NUMERIC_CONST ); if ( state.failed ) return null; value += sign.getText(); } Token nbr = match( input, DRL5Lexer.DECIMAL, null, null, DroolsEditorType.NUMERIC_CONST ); if ( state.failed ) return null; value += nbr.getText(); if ( state.backtracking == 0 ) { attribute.value( value ); attribute.type( AttributeDescr.Type.NUMBER ); } } } finally { if ( attribute != null ) { helper.end( AttributeDescrBuilder.class, attribute ); } } return attribute != null ? attribute.getDescr() : null; } }
public class class_name { private AttributeDescr intOrChunkAttribute( AttributeSupportBuilder< ? > as, String[] key ) throws RecognitionException { AttributeDescrBuilder< ? > attribute = null; try { StringBuilder builder = new StringBuilder(); for ( String k : key ) { if ( "-".equals( k ) ) { match( input, DRL5Lexer.MINUS, k, null, DroolsEditorType.KEYWORD ); // part of the keyword // depends on control dependency: [if], data = [none] if ( state.failed ) return null; } else { match( input, DRL5Lexer.ID, k, null, DroolsEditorType.KEYWORD ); // depends on control dependency: [if], data = [none] if ( state.failed ) return null; } builder.append( k ); // depends on control dependency: [for], data = [k] } if ( state.backtracking == 0 ) { attribute = helper.start( (DescrBuilder< ? , ? >) as, AttributeDescrBuilder.class, builder.toString() ); // depends on control dependency: [if], data = [none] } if ( input.LA( 1 ) == DRL5Lexer.LEFT_PAREN ) { String value = chunk( DRL5Lexer.LEFT_PAREN, DRL5Lexer.RIGHT_PAREN, -1 ); if ( state.failed ) return null; if ( state.backtracking == 0 ) { attribute.value( safeStripDelimiters( value, "(", ")" ) ); // depends on control dependency: [if], data = [none] attribute.type( AttributeDescr.Type.EXPRESSION ); // depends on control dependency: [if], data = [none] } } else { String value = ""; if ( input.LA( 1 ) == DRL5Lexer.PLUS ) { Token sign = match( input, DRL5Lexer.PLUS, null, null, DroolsEditorType.NUMERIC_CONST ); if ( state.failed ) return null; value += sign.getText(); // depends on control dependency: [if], data = [none] } else if ( input.LA( 1 ) == DRL5Lexer.MINUS ) { Token sign = match( input, DRL5Lexer.MINUS, null, null, DroolsEditorType.NUMERIC_CONST ); if ( state.failed ) return null; value += sign.getText(); // depends on control dependency: [if], data = [none] } Token nbr = match( input, DRL5Lexer.DECIMAL, null, null, DroolsEditorType.NUMERIC_CONST ); if ( state.failed ) return null; value += nbr.getText(); // depends on control dependency: [if], data = [none] if ( state.backtracking == 0 ) { attribute.value( value ); // depends on control dependency: [if], data = [none] attribute.type( AttributeDescr.Type.NUMBER ); // depends on control dependency: [if], data = [none] } } } finally { if ( attribute != null ) { helper.end( AttributeDescrBuilder.class, attribute ); // depends on control dependency: [if], data = [none] } } return attribute != null ? attribute.getDescr() : null; } }
public class class_name { protected NextJourney handleJsonResponse(JsonResponse<?> response) { if (!response.isReturnAsEmptyBody() && !response.isReturnAsJsonDirectly()) { validateJsonBeanIfNeeds(response.getJsonResult(), response); // not lazy to be in action transaction } // lazy because of same reason as HTML response (see the comment) return createSelfContainedJourney(() -> { adjustActionResponseJustBefore(response); final ResponseManager responseManager = requestManager.getResponseManager(); setupActionResponseHeader(responseManager, response); setupActionResponseHttpStatus(responseManager, response); final String json; if (response.isReturnAsEmptyBody()) { // asEmptyBody() if (adjustResponseReflecting().isJsonEmptyBodyTreatedAsEmptyObject()) { // for e.g. client fitting json = "{}"; // is empty object } else { // basically here if empty body return; // no write } } else { // mainly here, normal body if (response.isReturnAsJsonDirectly()) { // asJsonDirectly() json = response.getDirectJson().get(); } else { // mainly here final JsonManager jsonManager = requestManager.getJsonManager(); final Object jsonResult = response.getJsonResult(); final OptionalThing<Supplier<RealJsonEngine>> jsonEngineSwitcher = response.getJsonEngineSwitcher(); if (jsonEngineSwitcher.isPresent()) { // switchJsonEngine() for different rule action json = toJsonBySwitchedJsonEngine(jsonManager, jsonResult, jsonEngineSwitcher.get()); } else { // mainly here final OptionalThing<Consumer<JsonMappingOption>> mappingOptionSwitcher = response.getMappingOptionSwitcher(); if (mappingOptionSwitcher.isPresent()) { // switchMappingOption(), e.g. SwaggerAction@json() json = toJsonBySwitchedMappingOption(jsonManager, jsonResult, mappingOptionSwitcher.get()); } else { // mainly here json = jsonManager.toJson(jsonResult); } } } } keepOriginalBodyForInOutLoggingIfNeeds(json, "json"); response.getCallback().ifPresent(callback -> { final String script = callback + "(" + json + ")"; responseManager.writeAsJavaScript(script); }).orElse(() -> { /* responseManager might have debug logging so no logging here */ if (response.isForcedlyJavaScript()) { responseManager.writeAsJavaScript(json); } else { /* as JSON (default) */ responseManager.writeAsJson(json); } }); }); } }
public class class_name { protected NextJourney handleJsonResponse(JsonResponse<?> response) { if (!response.isReturnAsEmptyBody() && !response.isReturnAsJsonDirectly()) { validateJsonBeanIfNeeds(response.getJsonResult(), response); // not lazy to be in action transaction // depends on control dependency: [if], data = [none] } // lazy because of same reason as HTML response (see the comment) return createSelfContainedJourney(() -> { adjustActionResponseJustBefore(response); final ResponseManager responseManager = requestManager.getResponseManager(); setupActionResponseHeader(responseManager, response); setupActionResponseHttpStatus(responseManager, response); final String json; if (response.isReturnAsEmptyBody()) { // asEmptyBody() if (adjustResponseReflecting().isJsonEmptyBodyTreatedAsEmptyObject()) { // for e.g. client fitting json = "{}"; // is empty object // depends on control dependency: [if], data = [none] } else { // basically here if empty body return; // no write // depends on control dependency: [if], data = [none] } } else { // mainly here, normal body if (response.isReturnAsJsonDirectly()) { // asJsonDirectly() json = response.getDirectJson().get(); // depends on control dependency: [if], data = [none] } else { // mainly here final JsonManager jsonManager = requestManager.getJsonManager(); final Object jsonResult = response.getJsonResult(); final OptionalThing<Supplier<RealJsonEngine>> jsonEngineSwitcher = response.getJsonEngineSwitcher(); if (jsonEngineSwitcher.isPresent()) { // switchJsonEngine() for different rule action json = toJsonBySwitchedJsonEngine(jsonManager, jsonResult, jsonEngineSwitcher.get()); // depends on control dependency: [if], data = [none] } else { // mainly here final OptionalThing<Consumer<JsonMappingOption>> mappingOptionSwitcher = response.getMappingOptionSwitcher(); if (mappingOptionSwitcher.isPresent()) { // switchMappingOption(), e.g. SwaggerAction@json() json = toJsonBySwitchedMappingOption(jsonManager, jsonResult, mappingOptionSwitcher.get()); // depends on control dependency: [if], data = [none] } else { // mainly here json = jsonManager.toJson(jsonResult); // depends on control dependency: [if], data = [none] } } } } keepOriginalBodyForInOutLoggingIfNeeds(json, "json"); response.getCallback().ifPresent(callback -> { final String script = callback + "(" + json + ")"; responseManager.writeAsJavaScript(script); }).orElse(() -> { /* responseManager might have debug logging so no logging here */ if (response.isForcedlyJavaScript()) { responseManager.writeAsJavaScript(json); } else { /* as JSON (default) */ responseManager.writeAsJson(json); } }); }); } }
public class class_name { @Override public void restore() { if (type == ChangeType.ADD) { System.clearProperty(key); } else { System.setProperty(key, originalValue); } if (log.isDebugEnabled()) { log.debug("Restored " + toString()); } } }
public class class_name { @Override public void restore() { if (type == ChangeType.ADD) { System.clearProperty(key); // depends on control dependency: [if], data = [none] } else { System.setProperty(key, originalValue); // depends on control dependency: [if], data = [none] } if (log.isDebugEnabled()) { log.debug("Restored " + toString()); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected CmsMessages getMessages() { if (m_messages == null) { // initialize the localized messages m_messages = new CmsMessages(Messages.get().getBundleName(), getLocale().toString()); } return m_messages; } }
public class class_name { protected CmsMessages getMessages() { if (m_messages == null) { // initialize the localized messages m_messages = new CmsMessages(Messages.get().getBundleName(), getLocale().toString()); // depends on control dependency: [if], data = [none] } return m_messages; } }
public class class_name { public int getUnknownViewCount() { int total = 0; for (int i = 0; i < views.length; i++) { if( !views[i].known) { total++; } } return total; } }
public class class_name { public int getUnknownViewCount() { int total = 0; for (int i = 0; i < views.length; i++) { if( !views[i].known) { total++; // depends on control dependency: [if], data = [none] } } return total; } }
public class class_name { @Override public boolean collectionExists(String collectionName) { CollectionMetaData collectionMeta = cmdMap.get(collectionName); if(null == collectionMeta) { return false; } collectionMeta.getCollectionLock().readLock().lock(); try { return collectionsRef.get().containsKey(collectionName); } finally { collectionMeta.getCollectionLock().readLock().unlock(); } } }
public class class_name { @Override public boolean collectionExists(String collectionName) { CollectionMetaData collectionMeta = cmdMap.get(collectionName); if(null == collectionMeta) { return false; // depends on control dependency: [if], data = [none] } collectionMeta.getCollectionLock().readLock().lock(); try { return collectionsRef.get().containsKey(collectionName); // depends on control dependency: [try], data = [none] } finally { collectionMeta.getCollectionLock().readLock().unlock(); } } }
public class class_name { protected void updateConfiguration(Map<String, Object> properties) { if (properties != null) { this.properties.clear(); this.properties.putAll(properties); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Current Properties: " + this.properties); } } }
public class class_name { protected void updateConfiguration(Map<String, Object> properties) { if (properties != null) { this.properties.clear(); // depends on control dependency: [if], data = [none] this.properties.putAll(properties); // depends on control dependency: [if], data = [(properties] } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Current Properties: " + this.properties); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void attachToLayerColorMap() { final Layer layer = getLayer(); if (null != layer) { final NFastArrayList<T> list = getChildNodes(); if (null != list) { final int size = list.size(); for (int i = 0; i < size; i++) { list.get(i).attachToLayerColorMap(); } } } } }
public class class_name { @Override public void attachToLayerColorMap() { final Layer layer = getLayer(); if (null != layer) { final NFastArrayList<T> list = getChildNodes(); if (null != list) { final int size = list.size(); for (int i = 0; i < size; i++) { list.get(i).attachToLayerColorMap(); // depends on control dependency: [for], data = [i] } } } } }
public class class_name { public void marshall(GetApnsSandboxChannelRequest getApnsSandboxChannelRequest, ProtocolMarshaller protocolMarshaller) { if (getApnsSandboxChannelRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getApnsSandboxChannelRequest.getApplicationId(), APPLICATIONID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(GetApnsSandboxChannelRequest getApnsSandboxChannelRequest, ProtocolMarshaller protocolMarshaller) { if (getApnsSandboxChannelRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getApnsSandboxChannelRequest.getApplicationId(), APPLICATIONID_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public final void setCurrentBalanceDate(final Date pCurrentBalanceDate) { if (pCurrentBalanceDate == null) { this.currentBalanceDate = null; } else { this.currentBalanceDate = new Date(pCurrentBalanceDate.getTime()); } } }
public class class_name { public final void setCurrentBalanceDate(final Date pCurrentBalanceDate) { if (pCurrentBalanceDate == null) { this.currentBalanceDate = null; // depends on control dependency: [if], data = [none] } else { this.currentBalanceDate = new Date(pCurrentBalanceDate.getTime()); // depends on control dependency: [if], data = [(pCurrentBalanceDate] } } }
public class class_name { @SuppressWarnings({"ConstantConditions"}) private Pair<Class<?>, Class<?>[]> getGenericTypePair(Type type) { if (ParameterizedType.class.isAssignableFrom(type.getClass())) { Class<?>[] optionalValueTypes = null; @SuppressWarnings({"ConstantConditions"}) ParameterizedType ptype = (ParameterizedType) type; if (Map.class.isAssignableFrom((Class<?>) ptype.getRawType())) { optionalValueTypes = new Class<?>[] { (Class<?>) ptype.getActualTypeArguments()[0], (Class<?>) ptype.getActualTypeArguments()[1] }; } else if (Iterable.class.isAssignableFrom((Class<?>) ptype.getRawType())) { optionalValueTypes = new Class<?>[] { (Class<?>) ptype.getActualTypeArguments()[0] }; } return new Pair<Class<?>, Class<?>[]>((Class<?>) ptype.getRawType(), optionalValueTypes); } else { return new Pair<Class<?>, Class<?>[]>((Class<?>) type, new Class<?>[]{}); } } }
public class class_name { @SuppressWarnings({"ConstantConditions"}) private Pair<Class<?>, Class<?>[]> getGenericTypePair(Type type) { if (ParameterizedType.class.isAssignableFrom(type.getClass())) { Class<?>[] optionalValueTypes = null; // depends on control dependency: [if], data = [none] @SuppressWarnings({"ConstantConditions"}) ParameterizedType ptype = (ParameterizedType) type; if (Map.class.isAssignableFrom((Class<?>) ptype.getRawType())) { optionalValueTypes = new Class<?>[] { (Class<?>) ptype.getActualTypeArguments()[0], (Class<?>) ptype.getActualTypeArguments()[1] }; // depends on control dependency: [if], data = [none] } else if (Iterable.class.isAssignableFrom((Class<?>) ptype.getRawType())) { optionalValueTypes = new Class<?>[] { (Class<?>) ptype.getActualTypeArguments()[0] }; // depends on control dependency: [if], data = [none] } return new Pair<Class<?>, Class<?>[]>((Class<?>) ptype.getRawType(), optionalValueTypes); // depends on control dependency: [if], data = [none] } else { return new Pair<Class<?>, Class<?>[]>((Class<?>) type, new Class<?>[]{}); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(DescribeOrderableReplicationInstancesRequest describeOrderableReplicationInstancesRequest, ProtocolMarshaller protocolMarshaller) { if (describeOrderableReplicationInstancesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeOrderableReplicationInstancesRequest.getMaxRecords(), MAXRECORDS_BINDING); protocolMarshaller.marshall(describeOrderableReplicationInstancesRequest.getMarker(), MARKER_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DescribeOrderableReplicationInstancesRequest describeOrderableReplicationInstancesRequest, ProtocolMarshaller protocolMarshaller) { if (describeOrderableReplicationInstancesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeOrderableReplicationInstancesRequest.getMaxRecords(), MAXRECORDS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(describeOrderableReplicationInstancesRequest.getMarker(), MARKER_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 Builder predicateMultiplier(int count, Predicate... predicates) { for (int i = 0; i < count; i++) { addPredicates(predicates); } return self(); } }
public class class_name { public Builder predicateMultiplier(int count, Predicate... predicates) { for (int i = 0; i < count; i++) { addPredicates(predicates); // depends on control dependency: [for], data = [none] } return self(); } }
public class class_name { public static String derivedAutomaticModuleName(final String jarPath) { // If jar path does not end in a file extension (with ".jar" most likely), strip off everything after // the last '!', in order to remove package root int endIdx = jarPath.length(); final int lastPlingIdx = jarPath.lastIndexOf('!'); if (lastPlingIdx > 0 // If there is no '.' after the last '/' (if any) after the last '!' && jarPath.lastIndexOf('.') <= Math.max(lastPlingIdx, jarPath.lastIndexOf('/'))) { // Then truncate at last '!' endIdx = lastPlingIdx; } // Find the second to last '!' (or -1, if none) final int secondToLastPlingIdx = endIdx == 0 ? -1 : jarPath.lastIndexOf("!", endIdx - 1); // Find last '/' between the second to last and the last '!' final int startIdx = Math.max(secondToLastPlingIdx, jarPath.lastIndexOf('/', endIdx - 1)) + 1; // Find last '.' after that '/' final int lastDotBeforeLastPlingIdx = jarPath.lastIndexOf('.', endIdx - 1); if (lastDotBeforeLastPlingIdx > startIdx) { // Strip off extension endIdx = lastDotBeforeLastPlingIdx; } // Remove .jar extension String moduleName = jarPath.substring(startIdx, endIdx); // Find first occurrence of "-[0-9]" final Matcher matcher = DASH_VERSION.matcher(moduleName); if (matcher.find()) { moduleName = moduleName.substring(0, matcher.start()); } // Replace non-alphanumeric characters with dots moduleName = NON_ALPHANUM.matcher(moduleName).replaceAll("."); // Collapse repeating dots into a single dot moduleName = REPEATING_DOTS.matcher(moduleName).replaceAll("."); // Drop leading dots if (moduleName.length() > 0 && moduleName.charAt(0) == '.') { moduleName = LEADING_DOTS.matcher(moduleName).replaceAll(""); } // Drop trailing dots final int len = moduleName.length(); if (len > 0 && moduleName.charAt(len - 1) == '.') { moduleName = TRAILING_DOTS.matcher(moduleName).replaceAll(""); } return moduleName; } }
public class class_name { public static String derivedAutomaticModuleName(final String jarPath) { // If jar path does not end in a file extension (with ".jar" most likely), strip off everything after // the last '!', in order to remove package root int endIdx = jarPath.length(); final int lastPlingIdx = jarPath.lastIndexOf('!'); if (lastPlingIdx > 0 // If there is no '.' after the last '/' (if any) after the last '!' && jarPath.lastIndexOf('.') <= Math.max(lastPlingIdx, jarPath.lastIndexOf('/'))) { // Then truncate at last '!' endIdx = lastPlingIdx; // depends on control dependency: [if], data = [none] } // Find the second to last '!' (or -1, if none) final int secondToLastPlingIdx = endIdx == 0 ? -1 : jarPath.lastIndexOf("!", endIdx - 1); // Find last '/' between the second to last and the last '!' final int startIdx = Math.max(secondToLastPlingIdx, jarPath.lastIndexOf('/', endIdx - 1)) + 1; // Find last '.' after that '/' final int lastDotBeforeLastPlingIdx = jarPath.lastIndexOf('.', endIdx - 1); if (lastDotBeforeLastPlingIdx > startIdx) { // Strip off extension endIdx = lastDotBeforeLastPlingIdx; // depends on control dependency: [if], data = [none] } // Remove .jar extension String moduleName = jarPath.substring(startIdx, endIdx); // Find first occurrence of "-[0-9]" final Matcher matcher = DASH_VERSION.matcher(moduleName); if (matcher.find()) { moduleName = moduleName.substring(0, matcher.start()); // depends on control dependency: [if], data = [none] } // Replace non-alphanumeric characters with dots moduleName = NON_ALPHANUM.matcher(moduleName).replaceAll("."); // Collapse repeating dots into a single dot moduleName = REPEATING_DOTS.matcher(moduleName).replaceAll("."); // Drop leading dots if (moduleName.length() > 0 && moduleName.charAt(0) == '.') { moduleName = LEADING_DOTS.matcher(moduleName).replaceAll(""); // depends on control dependency: [if], data = [none] } // Drop trailing dots final int len = moduleName.length(); if (len > 0 && moduleName.charAt(len - 1) == '.') { moduleName = TRAILING_DOTS.matcher(moduleName).replaceAll(""); // depends on control dependency: [if], data = [none] } return moduleName; } }
public class class_name { public void marshall(DeleteLoadBalancerRequest deleteLoadBalancerRequest, ProtocolMarshaller protocolMarshaller) { if (deleteLoadBalancerRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteLoadBalancerRequest.getLoadBalancerName(), LOADBALANCERNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DeleteLoadBalancerRequest deleteLoadBalancerRequest, ProtocolMarshaller protocolMarshaller) { if (deleteLoadBalancerRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteLoadBalancerRequest.getLoadBalancerName(), LOADBALANCERNAME_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 { final ArrayList getLPConfigObjects() { String thisMethodName = "getLPConfigObjects"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, this); SibTr.exit(tc, thisMethodName, _lpConfig); } return _lpConfig; } }
public class class_name { final ArrayList getLPConfigObjects() { String thisMethodName = "getLPConfigObjects"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, this); // depends on control dependency: [if], data = [none] SibTr.exit(tc, thisMethodName, _lpConfig); // depends on control dependency: [if], data = [none] } return _lpConfig; } }
public class class_name { private String removeProperty(Node node, HierarchicalProperty property) { try { node.getProperty(property.getStringName()).remove(); node.save(); return WebDavConst.getStatusDescription(HTTPStatus.OK); } catch (AccessDeniedException e) { return WebDavConst.getStatusDescription(HTTPStatus.FORBIDDEN); } catch (ItemNotFoundException e) { return WebDavConst.getStatusDescription(HTTPStatus.NOT_FOUND); } catch (PathNotFoundException e) { return WebDavConst.getStatusDescription(HTTPStatus.NOT_FOUND); } catch (RepositoryException e) { return WebDavConst.getStatusDescription(HTTPStatus.CONFLICT); } } }
public class class_name { private String removeProperty(Node node, HierarchicalProperty property) { try { node.getProperty(property.getStringName()).remove(); // depends on control dependency: [try], data = [none] node.save(); // depends on control dependency: [try], data = [none] return WebDavConst.getStatusDescription(HTTPStatus.OK); // depends on control dependency: [try], data = [none] } catch (AccessDeniedException e) { return WebDavConst.getStatusDescription(HTTPStatus.FORBIDDEN); } // depends on control dependency: [catch], data = [none] catch (ItemNotFoundException e) { return WebDavConst.getStatusDescription(HTTPStatus.NOT_FOUND); } // depends on control dependency: [catch], data = [none] catch (PathNotFoundException e) { return WebDavConst.getStatusDescription(HTTPStatus.NOT_FOUND); } // depends on control dependency: [catch], data = [none] catch (RepositoryException e) { return WebDavConst.getStatusDescription(HTTPStatus.CONFLICT); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public ProxySettings setServer(URI uri) { if (uri == null) { return this; } String scheme = uri.getScheme(); String userInfo = uri.getUserInfo(); String host = uri.getHost(); int port = uri.getPort(); return setServer(scheme, userInfo, host, port); } }
public class class_name { public ProxySettings setServer(URI uri) { if (uri == null) { return this; // depends on control dependency: [if], data = [none] } String scheme = uri.getScheme(); String userInfo = uri.getUserInfo(); String host = uri.getHost(); int port = uri.getPort(); return setServer(scheme, userInfo, host, port); } }
public class class_name { public GenericUser getUserForUserReference(String userReference) { GenericUser user = getReference(GenericUser.class, userReference); if (user == null) { fail("No user of type '" + userReference + "' is found. Available user references are: " + getObjectReferenceMap(GenericUser.class).keySet().toString()); } return user; } }
public class class_name { public GenericUser getUserForUserReference(String userReference) { GenericUser user = getReference(GenericUser.class, userReference); if (user == null) { fail("No user of type '" + userReference + "' is found. Available user references are: " + getObjectReferenceMap(GenericUser.class).keySet().toString()); // depends on control dependency: [if], data = [none] } return user; } }
public class class_name { public boolean isGoogleTiles() { // Convert the bounding box to wgs84 BoundingBox boundingBox = tileMatrixSet.getBoundingBox(); BoundingBox wgs84BoundingBox = boundingBox.transform( projection.getTransformation( ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM)); boolean googleTiles = false; // Verify the bounds are the entire world if (wgs84BoundingBox.getMinLatitude() <= ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE && wgs84BoundingBox.getMaxLatitude() >= ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE && wgs84BoundingBox.getMinLongitude() <= -ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH && wgs84BoundingBox.getMaxLongitude() >= ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH) { googleTiles = true; // Verify each tile matrix is the correct width and height for (TileMatrix tileMatrix : tileMatrices) { long zoomLevel = tileMatrix.getZoomLevel(); long tilesPerSide = TileBoundingBoxUtils .tilesPerSide((int) zoomLevel); if (tileMatrix.getMatrixWidth() != tilesPerSide || tileMatrix.getMatrixHeight() != tilesPerSide) { googleTiles = false; break; } } } return googleTiles; } }
public class class_name { public boolean isGoogleTiles() { // Convert the bounding box to wgs84 BoundingBox boundingBox = tileMatrixSet.getBoundingBox(); BoundingBox wgs84BoundingBox = boundingBox.transform( projection.getTransformation( ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM)); boolean googleTiles = false; // Verify the bounds are the entire world if (wgs84BoundingBox.getMinLatitude() <= ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE && wgs84BoundingBox.getMaxLatitude() >= ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE && wgs84BoundingBox.getMinLongitude() <= -ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH && wgs84BoundingBox.getMaxLongitude() >= ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH) { googleTiles = true; // depends on control dependency: [if], data = [none] // Verify each tile matrix is the correct width and height for (TileMatrix tileMatrix : tileMatrices) { long zoomLevel = tileMatrix.getZoomLevel(); long tilesPerSide = TileBoundingBoxUtils .tilesPerSide((int) zoomLevel); if (tileMatrix.getMatrixWidth() != tilesPerSide || tileMatrix.getMatrixHeight() != tilesPerSide) { googleTiles = false; // depends on control dependency: [if], data = [none] break; } } } return googleTiles; } }
public class class_name { public static String substring(final String str, final int beginIndex) { assertStringNotNull(str); if (str.length() < beginIndex) { String msg = "The length of the string was smaller than the begin index:"; msg = msg + " str=" + str + ", beginIndex=" + beginIndex; throw new StringIndexOutOfBoundsException(msg); } return str.substring(beginIndex); } }
public class class_name { public static String substring(final String str, final int beginIndex) { assertStringNotNull(str); if (str.length() < beginIndex) { String msg = "The length of the string was smaller than the begin index:"; msg = msg + " str=" + str + ", beginIndex=" + beginIndex; // depends on control dependency: [if], data = [none] throw new StringIndexOutOfBoundsException(msg); } return str.substring(beginIndex); } }
public class class_name { private void parseSeeString() { int len = text.length(); if (len == 0) { return; } switch (text.charAt(0)) { case '<': if (text.charAt(len-1) != '>') { docenv().warning(holder, "tag.see.no_close_bracket_on_url", name, text); } return; case '"': if (len == 1 || text.charAt(len-1) != '"') { docenv().warning(holder, "tag.see.no_close_quote", name, text); } else { // text = text.substring(1,len-1); // strip quotes } return; } // check that the text is one word, with possible parentheses // this part of code doesn't allow // @see <a href=.....>asfd</a> // comment it. // the code assumes that there is no initial white space. int parens = 0; int commentstart = 0; int start = 0; int cp; for (int i = start; i < len ; i += Character.charCount(cp)) { cp = text.codePointAt(i); switch (cp) { case '(': parens++; break; case ')': parens--; break; case '[': case ']': case '.': case '#': break; case ',': if (parens <= 0) { docenv().warning(holder, "tag.see.malformed_see_tag", name, text); return; } break; case ' ': case '\t': case '\n': case CR: if (parens == 0) { //here onwards the comment starts. commentstart = i; i = len; } break; default: if (!Character.isJavaIdentifierPart(cp)) { docenv().warning(holder, "tag.see.illegal_character", name, ""+cp, text); } break; } } if (parens != 0) { docenv().warning(holder, "tag.see.malformed_see_tag", name, text); return; } String seetext = ""; String labeltext = ""; if (commentstart > 0) { seetext = text.substring(start, commentstart); labeltext = text.substring(commentstart + 1); // strip off the white space which can be between seetext and the // actual label. for (int i = 0; i < labeltext.length(); i++) { char ch2 = labeltext.charAt(i); if (!(ch2 == ' ' || ch2 == '\t' || ch2 == '\n')) { label = labeltext.substring(i); break; } } } else { seetext = text; label = ""; } int sharp = seetext.indexOf('#'); if (sharp >= 0) { // class#member where = seetext.substring(0, sharp); what = seetext.substring(sharp + 1); } else { if (seetext.indexOf('(') >= 0) { docenv().warning(holder, "tag.see.missing_sharp", name, text); where = ""; what = seetext; } else { // no member specified, text names class where = seetext; what = null; } } } }
public class class_name { private void parseSeeString() { int len = text.length(); if (len == 0) { return; // depends on control dependency: [if], data = [none] } switch (text.charAt(0)) { case '<': if (text.charAt(len-1) != '>') { docenv().warning(holder, "tag.see.no_close_bracket_on_url", name, text); // depends on control dependency: [if], data = [none] } return; case '"': if (len == 1 || text.charAt(len-1) != '"') { docenv().warning(holder, "tag.see.no_close_quote", name, text); // depends on control dependency: [if], data = [none] } else { // text = text.substring(1,len-1); // strip quotes } return; } // check that the text is one word, with possible parentheses // this part of code doesn't allow // @see <a href=.....>asfd</a> // comment it. // the code assumes that there is no initial white space. int parens = 0; int commentstart = 0; int start = 0; int cp; for (int i = start; i < len ; i += Character.charCount(cp)) { cp = text.codePointAt(i); switch (cp) { case '(': parens++; break; case ')': parens--; break; case '[': case ']': case '.': case '#': break; case ',': if (parens <= 0) { docenv().warning(holder, "tag.see.malformed_see_tag", name, text); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } break; case ' ': case '\t': case '\n': case CR: if (parens == 0) { //here onwards the comment starts. commentstart = i; // depends on control dependency: [if], data = [none] i = len; // depends on control dependency: [if], data = [none] } break; default: if (!Character.isJavaIdentifierPart(cp)) { docenv().warning(holder, "tag.see.illegal_character", name, ""+cp, text); // depends on control dependency: [if], data = [none] } break; } } if (parens != 0) { docenv().warning(holder, "tag.see.malformed_see_tag", name, text); return; } String seetext = ""; String labeltext = ""; if (commentstart > 0) { seetext = text.substring(start, commentstart); labeltext = text.substring(commentstart + 1); // strip off the white space which can be between seetext and the // actual label. for (int i = 0; i < labeltext.length(); i++) { char ch2 = labeltext.charAt(i); if (!(ch2 == ' ' || ch2 == '\t' || ch2 == '\n')) { label = labeltext.substring(i); break; } } } else { seetext = text; label = ""; } int sharp = seetext.indexOf('#'); if (sharp >= 0) { // class#member where = seetext.substring(0, sharp); what = seetext.substring(sharp + 1); } else { if (seetext.indexOf('(') >= 0) { docenv().warning(holder, "tag.see.missing_sharp", name, text); where = ""; what = seetext; } else { // no member specified, text names class where = seetext; what = null; } } } }
public class class_name { public static QName buildQName(String namespace, String localName) { String namespaceURI = namespace; if (!isEmpty(namespace) && !namespace.trim().endsWith("/")) { namespaceURI += "/"; } return new QName(namespaceURI, localName); } }
public class class_name { public static QName buildQName(String namespace, String localName) { String namespaceURI = namespace; if (!isEmpty(namespace) && !namespace.trim().endsWith("/")) { namespaceURI += "/"; // depends on control dependency: [if], data = [none] } return new QName(namespaceURI, localName); } }
public class class_name { public static boolean isValidKillSessionsToken(String token) { if (token == null || token.isEmpty()) { return false; } for (String validToken:VALID_TOKENS) { if (token.equals (validToken)) { return true; } } return false; } }
public class class_name { public static boolean isValidKillSessionsToken(String token) { if (token == null || token.isEmpty()) { return false; // depends on control dependency: [if], data = [none] } for (String validToken:VALID_TOKENS) { if (token.equals (validToken)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { private String[] annotatedParameterNames(Method method) { Annotation[][] parameterAnnotations = method.getParameterAnnotations(); String[] names = new String[parameterAnnotations.length]; for (int i = 0; i < parameterAnnotations.length; i++) { for (Annotation annotation : parameterAnnotations[i]) { names[i] = annotationName(annotation); } } return names; } }
public class class_name { private String[] annotatedParameterNames(Method method) { Annotation[][] parameterAnnotations = method.getParameterAnnotations(); String[] names = new String[parameterAnnotations.length]; for (int i = 0; i < parameterAnnotations.length; i++) { for (Annotation annotation : parameterAnnotations[i]) { names[i] = annotationName(annotation); // depends on control dependency: [for], data = [annotation] } } return names; } }
public class class_name { Collection<URL> getURLs(String path) { // Go through all of the items that match this path and get the URIs for them Collection<URL> urls = new HashSet<URL>(); for (EntryInfo ei : _entries) { if (ei.matches(path)) { urls.addAll(ei.getURLs(path)); } } return urls; } }
public class class_name { Collection<URL> getURLs(String path) { // Go through all of the items that match this path and get the URIs for them Collection<URL> urls = new HashSet<URL>(); for (EntryInfo ei : _entries) { if (ei.matches(path)) { urls.addAll(ei.getURLs(path)); // depends on control dependency: [if], data = [none] } } return urls; } }
public class class_name { Expression unpack( CssFormatter formatter ) { Expression unpack = this; do { // unpack packed expressions like parenthesis or variables if( unpack.getClass() == FunctionExpression.class && ((FunctionExpression)unpack).toString().isEmpty() ) { //Parenthesis unpack = ((FunctionExpression)unpack).get( 0 ); continue; } if( unpack.getClass() == VariableExpression.class ) { unpack = ((VariableExpression)unpack).getValue( formatter ); continue; } break; } while(true); return unpack; } }
public class class_name { Expression unpack( CssFormatter formatter ) { Expression unpack = this; do { // unpack packed expressions like parenthesis or variables if( unpack.getClass() == FunctionExpression.class && ((FunctionExpression)unpack).toString().isEmpty() ) { //Parenthesis unpack = ((FunctionExpression)unpack).get( 0 ); // depends on control dependency: [if], data = [none] continue; } if( unpack.getClass() == VariableExpression.class ) { unpack = ((VariableExpression)unpack).getValue( formatter ); // depends on control dependency: [if], data = [none] continue; } break; } while(true); return unpack; } }
public class class_name { private void parseTemporalExtentForm() { // from the form if (temporal == null) { errs.format("form must have temporal=(all|range|point)%n"); fatal = true; return; } if (temporal.equalsIgnoreCase("all")) temporalSelection = TemporalSelection.all; else if (temporal.equalsIgnoreCase("range")) temporalSelection = TemporalSelection.range; else if (temporal.equalsIgnoreCase("point")) temporalSelection = TemporalSelection.point; if (temporal.equalsIgnoreCase("range")) { try { parseTimeExtent(); } catch (Throwable t) { errs.format("badly specified time range"); fatal = true; } } else if (temporal.equalsIgnoreCase("point")) { timePoint = parseDate("time", time); } } }
public class class_name { private void parseTemporalExtentForm() { // from the form if (temporal == null) { errs.format("form must have temporal=(all|range|point)%n"); // depends on control dependency: [if], data = [none] fatal = true; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } if (temporal.equalsIgnoreCase("all")) temporalSelection = TemporalSelection.all; else if (temporal.equalsIgnoreCase("range")) temporalSelection = TemporalSelection.range; else if (temporal.equalsIgnoreCase("point")) temporalSelection = TemporalSelection.point; if (temporal.equalsIgnoreCase("range")) { try { parseTimeExtent(); // depends on control dependency: [try], data = [none] } catch (Throwable t) { errs.format("badly specified time range"); fatal = true; } // depends on control dependency: [catch], data = [none] } else if (temporal.equalsIgnoreCase("point")) { timePoint = parseDate("time", time); // depends on control dependency: [if], data = [none] } } }