code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public boolean put(final int key) { if (isFull()) { // full resizeArray(); } int slot = findSlotByKey(key); if (slot >= 0) { if (log.isDebugEnabled()) { log.debug("key already exists: " + key); } return false; // key already exist } slot = ((-slot) - 1); return addSlot(slot, key); } }
public class class_name { public boolean put(final int key) { if (isFull()) { // full resizeArray(); // depends on control dependency: [if], data = [none] } int slot = findSlotByKey(key); if (slot >= 0) { if (log.isDebugEnabled()) { log.debug("key already exists: " + key); // depends on control dependency: [if], data = [none] } return false; // key already exist // depends on control dependency: [if], data = [none] } slot = ((-slot) - 1); return addSlot(slot, key); } }
public class class_name { private String findGemVersion(String gemName, String pathToGems) { String version = null; File maxVersionFile = findMaxVersionFile(gemName, pathToGems); if (maxVersionFile != null) { String fileName = maxVersionFile.getName(); version = getVersionFromFileName(fileName, gemName); } return version; } }
public class class_name { private String findGemVersion(String gemName, String pathToGems) { String version = null; File maxVersionFile = findMaxVersionFile(gemName, pathToGems); if (maxVersionFile != null) { String fileName = maxVersionFile.getName(); version = getVersionFromFileName(fileName, gemName); // depends on control dependency: [if], data = [none] } return version; } }
public class class_name { public List<Node> getConnectedNodes() { List<Node> nodes = new ArrayList<>(); for (Link l : links) { if (l.getElement() instanceof Node) { nodes.add((Node) l.getElement()); } } return nodes; } }
public class class_name { public List<Node> getConnectedNodes() { List<Node> nodes = new ArrayList<>(); for (Link l : links) { if (l.getElement() instanceof Node) { nodes.add((Node) l.getElement()); // depends on control dependency: [if], data = [none] } } return nodes; } }
public class class_name { protected void addPropertyReferenceForList(String id, ParserContext context, MutableBeanMetadata beanMetadata, List<String> values) { MutableCollectionMetadata collectionMetadata = context.createMetadata(MutableCollectionMetadata.class); collectionMetadata.setCollectionClass(List.class); for (String value : values) { collectionMetadata.addValue(createStringValue(context, value)); } beanMetadata.addProperty(id, collectionMetadata); } }
public class class_name { protected void addPropertyReferenceForList(String id, ParserContext context, MutableBeanMetadata beanMetadata, List<String> values) { MutableCollectionMetadata collectionMetadata = context.createMetadata(MutableCollectionMetadata.class); collectionMetadata.setCollectionClass(List.class); for (String value : values) { collectionMetadata.addValue(createStringValue(context, value)); // depends on control dependency: [for], data = [value] } beanMetadata.addProperty(id, collectionMetadata); } }
public class class_name { public SubscriberEndpoint getNewOrExistingSubscriber(String senderPublicId) { SubscriberEndpoint subscriberEndpoint = new SubscriberEndpoint(webParticipant, this, senderPublicId, this.getPipeline(), this.openviduConfig); SubscriberEndpoint existingSendingEndpoint = this.subscribers.putIfAbsent(senderPublicId, subscriberEndpoint); if (existingSendingEndpoint != null) { subscriberEndpoint = existingSendingEndpoint; log.trace("PARTICIPANT {}: Already exists a subscriber endpoint to user {}", this.getParticipantPublicId(), senderPublicId); } else { log.debug("PARTICIPANT {}: New subscriber endpoint to user {}", this.getParticipantPublicId(), senderPublicId); } return subscriberEndpoint; } }
public class class_name { public SubscriberEndpoint getNewOrExistingSubscriber(String senderPublicId) { SubscriberEndpoint subscriberEndpoint = new SubscriberEndpoint(webParticipant, this, senderPublicId, this.getPipeline(), this.openviduConfig); SubscriberEndpoint existingSendingEndpoint = this.subscribers.putIfAbsent(senderPublicId, subscriberEndpoint); if (existingSendingEndpoint != null) { subscriberEndpoint = existingSendingEndpoint; // depends on control dependency: [if], data = [none] log.trace("PARTICIPANT {}: Already exists a subscriber endpoint to user {}", this.getParticipantPublicId(), senderPublicId); // depends on control dependency: [if], data = [none] } else { log.debug("PARTICIPANT {}: New subscriber endpoint to user {}", this.getParticipantPublicId(), senderPublicId); // depends on control dependency: [if], data = [none] } return subscriberEndpoint; } }
public class class_name { public void setPath(String path) { this.path = path; if (null != path) { int i = path.lastIndexOf('.'); if (i == path.length() - 4) { i = path.lastIndexOf('/'); String p = path.substring(0, i); String f = path.substring(i + 1); recorder.setPath(p); recorder.setName(f); } else { recorder.setPath(path); //recorder.setName(VoiceRecorder.generateName()); } } } }
public class class_name { public void setPath(String path) { this.path = path; if (null != path) { int i = path.lastIndexOf('.'); if (i == path.length() - 4) { i = path.lastIndexOf('/'); // depends on control dependency: [if], data = [none] String p = path.substring(0, i); String f = path.substring(i + 1); recorder.setPath(p); // depends on control dependency: [if], data = [none] recorder.setName(f); // depends on control dependency: [if], data = [none] } else { recorder.setPath(path); // depends on control dependency: [if], data = [none] //recorder.setName(VoiceRecorder.generateName()); } } } }
public class class_name { public java.util.List<String> getAddNetworkLoadBalancerArns() { if (addNetworkLoadBalancerArns == null) { addNetworkLoadBalancerArns = new com.amazonaws.internal.SdkInternalList<String>(); } return addNetworkLoadBalancerArns; } }
public class class_name { public java.util.List<String> getAddNetworkLoadBalancerArns() { if (addNetworkLoadBalancerArns == null) { addNetworkLoadBalancerArns = new com.amazonaws.internal.SdkInternalList<String>(); // depends on control dependency: [if], data = [none] } return addNetworkLoadBalancerArns; } }
public class class_name { public List<InetAddress> discoverHosts (int udpPort, int timeoutMillis) { List<InetAddress> hosts = new ArrayList<InetAddress>(); DatagramSocket socket = null; try { socket = new DatagramSocket(); broadcast(udpPort, socket); socket.setSoTimeout(timeoutMillis); while (true) { DatagramPacket packet = discoveryHandler.onRequestNewDatagramPacket(); try { socket.receive(packet); } catch (SocketTimeoutException ex) { if (INFO) info("kryonet", "Host discovery timed out."); return hosts; } if (INFO) info("kryonet", "Discovered server: " + packet.getAddress()); discoveryHandler.onDiscoveredHost(packet, getKryo()); hosts.add(packet.getAddress()); } } catch (IOException ex) { if (ERROR) error("kryonet", "Host discovery failed.", ex); return hosts; } finally { if (socket != null) socket.close(); discoveryHandler.onFinally(); } } }
public class class_name { public List<InetAddress> discoverHosts (int udpPort, int timeoutMillis) { List<InetAddress> hosts = new ArrayList<InetAddress>(); DatagramSocket socket = null; try { socket = new DatagramSocket(); // depends on control dependency: [try], data = [none] broadcast(udpPort, socket); // depends on control dependency: [try], data = [none] socket.setSoTimeout(timeoutMillis); // depends on control dependency: [try], data = [none] while (true) { DatagramPacket packet = discoveryHandler.onRequestNewDatagramPacket(); try { socket.receive(packet); // depends on control dependency: [try], data = [none] } catch (SocketTimeoutException ex) { if (INFO) info("kryonet", "Host discovery timed out."); return hosts; } // depends on control dependency: [catch], data = [none] if (INFO) info("kryonet", "Discovered server: " + packet.getAddress()); discoveryHandler.onDiscoveredHost(packet, getKryo()); // depends on control dependency: [while], data = [none] hosts.add(packet.getAddress()); // depends on control dependency: [while], data = [none] } } catch (IOException ex) { if (ERROR) error("kryonet", "Host discovery failed.", ex); return hosts; } finally { // depends on control dependency: [catch], data = [none] if (socket != null) socket.close(); discoveryHandler.onFinally(); } } }
public class class_name { public void setFirstAxisProperties(Vector3d vector, DoubleProperty extent, CoordinateSystem3D system) { this.axis1.setProperties(vector.xProperty,vector.yProperty,vector.zProperty); assert(this.axis1.isUnitVector()); if (system.isLeftHanded()) { this.axis3.set(this.axis1.crossLeftHand(this.axis2)); } else { this.axis3.set(this.axis3.crossRightHand(this.axis2)); } this.extent1Property = extent; } }
public class class_name { public void setFirstAxisProperties(Vector3d vector, DoubleProperty extent, CoordinateSystem3D system) { this.axis1.setProperties(vector.xProperty,vector.yProperty,vector.zProperty); assert(this.axis1.isUnitVector()); if (system.isLeftHanded()) { this.axis3.set(this.axis1.crossLeftHand(this.axis2)); // depends on control dependency: [if], data = [none] } else { this.axis3.set(this.axis3.crossRightHand(this.axis2)); // depends on control dependency: [if], data = [none] } this.extent1Property = extent; } }
public class class_name { public <T> void link(PushMeasure<T> measure) { if (linkedMeasures.containsKey(measure)) { // already linked } else { MeasureListener<T> listener = new MeasureListener<T>() { @Override public void measureGenerated(T value) { increment(); } }; measure.register(listener); linkedMeasures.put(measure, listener); } } }
public class class_name { public <T> void link(PushMeasure<T> measure) { if (linkedMeasures.containsKey(measure)) { // already linked } else { MeasureListener<T> listener = new MeasureListener<T>() { @Override public void measureGenerated(T value) { increment(); } }; measure.register(listener); // depends on control dependency: [if], data = [none] linkedMeasures.put(measure, listener); // depends on control dependency: [if], data = [none] } } }
public class class_name { private void reinitializeIfNecessary() { if (this.resourceCache == null || this.resourceCache.size() > 0) { this.resourcesGraph = new ListenableDirectedGraph<>(DefaultEdge.class); this.neighborIndex = new DirectedNeighborIndex<>(this.resourcesGraph); this.resourcesGraph.addGraphListener(neighborIndex); this.resourceCache = new HashMap<>(); this.resourcesGraph.addVertexSetListener(new VertexCacheListener()); } } }
public class class_name { private void reinitializeIfNecessary() { if (this.resourceCache == null || this.resourceCache.size() > 0) { this.resourcesGraph = new ListenableDirectedGraph<>(DefaultEdge.class); // depends on control dependency: [if], data = [none] this.neighborIndex = new DirectedNeighborIndex<>(this.resourcesGraph); // depends on control dependency: [if], data = [none] this.resourcesGraph.addGraphListener(neighborIndex); // depends on control dependency: [if], data = [none] this.resourceCache = new HashMap<>(); // depends on control dependency: [if], data = [none] this.resourcesGraph.addVertexSetListener(new VertexCacheListener()); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setColor(float r, float g, float b, float a) { if (color == Color.white) { color = new Color(r,g,b,a); } else { color.r = r; color.g = g; color.b = b; color.a = a; } } }
public class class_name { public void setColor(float r, float g, float b, float a) { if (color == Color.white) { color = new Color(r,g,b,a); // depends on control dependency: [if], data = [none] } else { color.r = r; // depends on control dependency: [if], data = [none] color.g = g; // depends on control dependency: [if], data = [none] color.b = b; // depends on control dependency: [if], data = [none] color.a = a; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public final Integer getReportFeedback() { Integer result = (Integer) getApi().getField(JsApiAccess.REPORTFEEDBACKINT_VALUE); if (result == null) { // if the integer report feedback field is unset theres a chance that the byte // version may have been set by a down level sender. If the message is backed // by an MQ encapsulation this wont be the case since both these operations // end up looking in the same place in the MQMD, but if its native JMF // then the values may differ. Byte temp = (Byte) getApi().getField(JsApiAccess.REPORTFEEDBACK_VALUE); result = (temp == null) ? null : Integer.valueOf(temp.intValue()); } return result; } }
public class class_name { @Override public final Integer getReportFeedback() { Integer result = (Integer) getApi().getField(JsApiAccess.REPORTFEEDBACKINT_VALUE); if (result == null) { // if the integer report feedback field is unset theres a chance that the byte // version may have been set by a down level sender. If the message is backed // by an MQ encapsulation this wont be the case since both these operations // end up looking in the same place in the MQMD, but if its native JMF // then the values may differ. Byte temp = (Byte) getApi().getField(JsApiAccess.REPORTFEEDBACK_VALUE); result = (temp == null) ? null : Integer.valueOf(temp.intValue()); // depends on control dependency: [if], data = [null)] } return result; } }
public class class_name { public List<TaskSummary> doCriteriaQuery(String userId, UserGroupCallback userGroupCallback, QueryWhere queryWhere) { // 1. create builder and query instances CriteriaBuilder builder = getCriteriaBuilder(); CriteriaQuery<Tuple> criteriaQuery = builder.createTupleQuery(); // 2. query base Root<TaskImpl> taskRoot = criteriaQuery.from(TaskImpl.class); criteriaQuery = criteriaQuery.multiselect( taskRoot.get(TaskImpl_.id), // 0 taskRoot.get(TaskImpl_.name), // 1 taskRoot.get(TaskImpl_.subject), // 2 taskRoot.get(TaskImpl_.description), // 3 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.status), // 4 taskRoot.get(TaskImpl_.priority), // 5 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.skipable), // 6 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.actualOwner).get(UserImpl_.id), // 7 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.createdBy).get(UserImpl_.id), // 8 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.createdOn), // 9 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.activationTime), // 10 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.expirationTime), // 11 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.processId), // 12 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.processSessionId), // 13 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.processInstanceId), // 14 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.deploymentId), // 15 taskRoot.get(TaskImpl_.subTaskStrategy), // 16 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.parentId) // 17 ); taskRoot.join(TaskImpl_.taskData); // added for convienence sake, since other logic expects to find this join addUserGroupsViaCallBackToQueryWhere(userGroupCallback, queryWhere.getCriteria()); // 3. check to see if there's already a user(/security)-limitation in the search checkExistingCriteriaForUserBasedLimit(queryWhere, userId, userGroupCallback); for( QueryModificationService queryModificationService : queryModificationServiceLoader ) { queryModificationService.optimizeCriteria(queryWhere); } // 4. process query criteria fillCriteriaQuery(criteriaQuery, queryWhere, builder, TaskImpl.class); // 5. retrieve result (after also applying meta-criteria) useDistinctWhenLefOuterJoinsPresent(criteriaQuery); List<Tuple> result = createQueryAndCallApplyMetaCriteriaAndGetResult(queryWhere, criteriaQuery, builder); List<TaskSummary> taskSummaryList = new ArrayList<TaskSummary>(result.size()); for( Tuple tupleRow : result ) { int i = 0; //@formatter:off TaskSummaryImpl taskSummaryImpl = new TaskSummaryImpl( // id tupleRow.get(i++, Long.class), // name, subject, description tupleRow.get(i++, String.class), tupleRow.get(i++, String.class), tupleRow.get(i++, String.class), // status, prio, skippable tupleRow.get(i++, Status.class), tupleRow.get(i++, Integer.class), tupleRow.get(i++, Boolean.class), // actual owner, created by tupleRow.get(i++, String.class), tupleRow.get(i++, String.class), // created on, activation time, expiration time tupleRow.get(i++, Date.class), tupleRow.get(i++, Date.class), tupleRow.get(i++, Date.class), // process id, process session id, process inst id, deployment id tupleRow.get(i++, String.class), tupleRow.get(i++, Long.class), tupleRow.get(i++, Long.class), tupleRow.get(i++, String.class), tupleRow.get(i++, SubTasksStrategy.class), tupleRow.get(i++, Long.class) ); //@formatter:on taskSummaryList.add(taskSummaryImpl); } return taskSummaryList; } }
public class class_name { public List<TaskSummary> doCriteriaQuery(String userId, UserGroupCallback userGroupCallback, QueryWhere queryWhere) { // 1. create builder and query instances CriteriaBuilder builder = getCriteriaBuilder(); CriteriaQuery<Tuple> criteriaQuery = builder.createTupleQuery(); // 2. query base Root<TaskImpl> taskRoot = criteriaQuery.from(TaskImpl.class); criteriaQuery = criteriaQuery.multiselect( taskRoot.get(TaskImpl_.id), // 0 taskRoot.get(TaskImpl_.name), // 1 taskRoot.get(TaskImpl_.subject), // 2 taskRoot.get(TaskImpl_.description), // 3 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.status), // 4 taskRoot.get(TaskImpl_.priority), // 5 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.skipable), // 6 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.actualOwner).get(UserImpl_.id), // 7 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.createdBy).get(UserImpl_.id), // 8 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.createdOn), // 9 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.activationTime), // 10 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.expirationTime), // 11 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.processId), // 12 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.processSessionId), // 13 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.processInstanceId), // 14 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.deploymentId), // 15 taskRoot.get(TaskImpl_.subTaskStrategy), // 16 taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.parentId) // 17 ); taskRoot.join(TaskImpl_.taskData); // added for convienence sake, since other logic expects to find this join addUserGroupsViaCallBackToQueryWhere(userGroupCallback, queryWhere.getCriteria()); // 3. check to see if there's already a user(/security)-limitation in the search checkExistingCriteriaForUserBasedLimit(queryWhere, userId, userGroupCallback); for( QueryModificationService queryModificationService : queryModificationServiceLoader ) { queryModificationService.optimizeCriteria(queryWhere); // depends on control dependency: [for], data = [queryModificationService] } // 4. process query criteria fillCriteriaQuery(criteriaQuery, queryWhere, builder, TaskImpl.class); // 5. retrieve result (after also applying meta-criteria) useDistinctWhenLefOuterJoinsPresent(criteriaQuery); List<Tuple> result = createQueryAndCallApplyMetaCriteriaAndGetResult(queryWhere, criteriaQuery, builder); List<TaskSummary> taskSummaryList = new ArrayList<TaskSummary>(result.size()); for( Tuple tupleRow : result ) { int i = 0; //@formatter:off TaskSummaryImpl taskSummaryImpl = new TaskSummaryImpl( // id tupleRow.get(i++, Long.class), // name, subject, description tupleRow.get(i++, String.class), tupleRow.get(i++, String.class), tupleRow.get(i++, String.class), // status, prio, skippable tupleRow.get(i++, Status.class), tupleRow.get(i++, Integer.class), tupleRow.get(i++, Boolean.class), // actual owner, created by tupleRow.get(i++, String.class), tupleRow.get(i++, String.class), // created on, activation time, expiration time tupleRow.get(i++, Date.class), tupleRow.get(i++, Date.class), tupleRow.get(i++, Date.class), // process id, process session id, process inst id, deployment id tupleRow.get(i++, String.class), tupleRow.get(i++, Long.class), tupleRow.get(i++, Long.class), tupleRow.get(i++, String.class), tupleRow.get(i++, SubTasksStrategy.class), tupleRow.get(i++, Long.class) ); //@formatter:on taskSummaryList.add(taskSummaryImpl); // depends on control dependency: [for], data = [none] } return taskSummaryList; } }
public class class_name { @Override protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); if (onClickedDrawable != null) { onClickedDrawable.draw(canvas); } } }
public class class_name { @Override protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); if (onClickedDrawable != null) { onClickedDrawable.draw(canvas); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override protected IIOMetadataNode getStandardTransparencyNode() { if (header.hasMasks() && header.masks[3] != 0) { IIOMetadataNode transparency = new IIOMetadataNode("Transparency"); IIOMetadataNode alpha = new IIOMetadataNode("Alpha"); alpha.setAttribute("value", "nonpremultiplied"); transparency.appendChild(alpha); return transparency; } return null; } }
public class class_name { @Override protected IIOMetadataNode getStandardTransparencyNode() { if (header.hasMasks() && header.masks[3] != 0) { IIOMetadataNode transparency = new IIOMetadataNode("Transparency"); IIOMetadataNode alpha = new IIOMetadataNode("Alpha"); alpha.setAttribute("value", "nonpremultiplied"); // depends on control dependency: [if], data = [none] transparency.appendChild(alpha); // depends on control dependency: [if], data = [none] return transparency; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public void postClassLoaderInit() { // bartender.setLocalShard(pod.getNode(podNode)); ServiceManagerBuilderAmp builder = ServicesAmp.newManager(); builder.name(EnvLoader.getEnvironmentName()); BartenderSystem bartender = BartenderSystem.current(); if (bartender != null) { PodBartender pod = bartender.findActivePod(getPodName()); Objects.requireNonNull(pod); int podNode = _builder.getPodNode(); bartender.setLocalPod(pod); //builder.setPodNode(new ServiceNodeImpl(pod.getNode(podNode))); } /* //builder.setJournalMaxCount(_builder.getJournalMaxCount()); builder.setJournalDelay(_builder.getJournalDelay()); // XXX: config timing issue builder.debug(_builder.isDebug()); builder.debugQueryTimeout(_builder.getDebugQueryTimeout()); builder.autoStart(false); */ _ampManager = builder.start(); /* if (_controller.getConfigException() != null) { setAmpConfigException(_controller.getConfigException()); } else if (_configException != null) { setAmpConfigException(_configException); } */ Amp.contextManager(_ampManager); /* _ampManager.run(()->{ EmbedBuilder embedBuilder = new EmbedBuilder(); embedBuilder.scanClassLoader(); embedBuilder.build(); }); */ } }
public class class_name { public void postClassLoaderInit() { // bartender.setLocalShard(pod.getNode(podNode)); ServiceManagerBuilderAmp builder = ServicesAmp.newManager(); builder.name(EnvLoader.getEnvironmentName()); BartenderSystem bartender = BartenderSystem.current(); if (bartender != null) { PodBartender pod = bartender.findActivePod(getPodName()); Objects.requireNonNull(pod); // depends on control dependency: [if], data = [none] int podNode = _builder.getPodNode(); bartender.setLocalPod(pod); // depends on control dependency: [if], data = [none] //builder.setPodNode(new ServiceNodeImpl(pod.getNode(podNode))); } /* //builder.setJournalMaxCount(_builder.getJournalMaxCount()); builder.setJournalDelay(_builder.getJournalDelay()); // XXX: config timing issue builder.debug(_builder.isDebug()); builder.debugQueryTimeout(_builder.getDebugQueryTimeout()); builder.autoStart(false); */ _ampManager = builder.start(); /* if (_controller.getConfigException() != null) { setAmpConfigException(_controller.getConfigException()); } else if (_configException != null) { setAmpConfigException(_configException); } */ Amp.contextManager(_ampManager); /* _ampManager.run(()->{ EmbedBuilder embedBuilder = new EmbedBuilder(); embedBuilder.scanClassLoader(); embedBuilder.build(); }); */ } }
public class class_name { protected void emitTuples(List<String> fileLines, TridentCollector collector) { for (String targetLine : fileLines) { collector.emit(new Values(targetLine)); } } }
public class class_name { protected void emitTuples(List<String> fileLines, TridentCollector collector) { for (String targetLine : fileLines) { collector.emit(new Values(targetLine)); // depends on control dependency: [for], data = [targetLine] } } }
public class class_name { public BackupChainLog[] getBackupsLogs() { File[] cfs = PrivilegedFileHelper.listFiles(logsDirectory, new BackupLogsFilter()); List<BackupChainLog> logs = new ArrayList<BackupChainLog>(); for (int i = 0; i < cfs.length; i++) { File cf = cfs[i]; try { if (!isCurrentBackup(cf)) { logs.add(new BackupChainLog(cf)); } } catch (BackupOperationException e) { LOG.warn("Log file " + PrivilegedFileHelper.getAbsolutePath(cf) + " is bussy or corrupted. Skipped. " + e, e); } } BackupChainLog[] ls = new BackupChainLog[logs.size()]; logs.toArray(ls); return ls; } }
public class class_name { public BackupChainLog[] getBackupsLogs() { File[] cfs = PrivilegedFileHelper.listFiles(logsDirectory, new BackupLogsFilter()); List<BackupChainLog> logs = new ArrayList<BackupChainLog>(); for (int i = 0; i < cfs.length; i++) { File cf = cfs[i]; try { if (!isCurrentBackup(cf)) { logs.add(new BackupChainLog(cf)); // depends on control dependency: [if], data = [none] } } catch (BackupOperationException e) { LOG.warn("Log file " + PrivilegedFileHelper.getAbsolutePath(cf) + " is bussy or corrupted. Skipped. " + e, e); } // depends on control dependency: [catch], data = [none] } BackupChainLog[] ls = new BackupChainLog[logs.size()]; logs.toArray(ls); return ls; } }
public class class_name { public BldResPath jsPostProcessors( JSPostProcessor ... procs) { prodModePostProcessors.clear(); for (int i = 0; i < procs.length; i++) { prodModePostProcessors.add(procs[i]); } return this; } }
public class class_name { public BldResPath jsPostProcessors( JSPostProcessor ... procs) { prodModePostProcessors.clear(); for (int i = 0; i < procs.length; i++) { prodModePostProcessors.add(procs[i]); // depends on control dependency: [for], data = [i] } return this; } }
public class class_name { private static final ArrayList<String> convertStringToArrayList(String value) { if (value != null && value.length() > 0) { ArrayList<String> result = new ArrayList<String>(); StringTokenizer st = new StringTokenizer(value, STRING_ATTRIB_DELIM); while (st.hasMoreTokens()) { String nextString = unescape(st.nextToken()); if (nextString != null) { result.add(nextString); } } return result; } return null; } }
public class class_name { private static final ArrayList<String> convertStringToArrayList(String value) { if (value != null && value.length() > 0) { ArrayList<String> result = new ArrayList<String>(); StringTokenizer st = new StringTokenizer(value, STRING_ATTRIB_DELIM); while (st.hasMoreTokens()) { String nextString = unescape(st.nextToken()); if (nextString != null) { result.add(nextString); // depends on control dependency: [if], data = [(nextString] } } return result; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { @Override public void removeByCPOptionId(long CPOptionId) { for (CPOptionValue cpOptionValue : findByCPOptionId(CPOptionId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpOptionValue); } } }
public class class_name { @Override public void removeByCPOptionId(long CPOptionId) { for (CPOptionValue cpOptionValue : findByCPOptionId(CPOptionId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpOptionValue); // depends on control dependency: [for], data = [cpOptionValue] } } }
public class class_name { public static String createGenerationPath(String path, GeneratorRegistry registry, String randomParam) { String requestPath = null; try { requestPath = registry.getDebugModeGenerationPath(path); if (randomParam != null) { requestPath += "?" + randomParam + "&"; } else { requestPath += "?"; } requestPath += JawrRequestHandler.GENERATION_PARAM + "=" + URLEncoder.encode(path, "UTF-8"); } catch (UnsupportedEncodingException neverHappens) { /* URLEncoder:how not to use checked exceptions... */ throw new JawrLinkRenderingException( "Something went unexpectedly wrong while encoding a URL for a generator. ", neverHappens); } return requestPath; } }
public class class_name { public static String createGenerationPath(String path, GeneratorRegistry registry, String randomParam) { String requestPath = null; try { requestPath = registry.getDebugModeGenerationPath(path); // depends on control dependency: [try], data = [none] if (randomParam != null) { requestPath += "?" + randomParam + "&"; // depends on control dependency: [if], data = [none] } else { requestPath += "?"; // depends on control dependency: [if], data = [none] } requestPath += JawrRequestHandler.GENERATION_PARAM + "=" + URLEncoder.encode(path, "UTF-8"); // depends on control dependency: [try], data = [none] } catch (UnsupportedEncodingException neverHappens) { /* URLEncoder:how not to use checked exceptions... */ throw new JawrLinkRenderingException( "Something went unexpectedly wrong while encoding a URL for a generator. ", neverHappens); } // depends on control dependency: [catch], data = [none] return requestPath; } }
public class class_name { public static String formatDistributions(List<Integer[]> distributions) { if (distributions.isEmpty()) { return null; } String[] distributionsFormatted = new String[distributions.size()]; for (int i = 0; i < distributions.size(); i++) { if (distributions.get(i).length == 0) { distributionsFormatted[i] = ""; } else { distributionsFormatted[i] = String.format(Locale.US, "%s,%s", TextUtils.formatCoordinate(distributions.get(i)[0]), TextUtils.formatCoordinate(distributions.get(i)[1])); } } return TextUtils.join(";", distributionsFormatted); } }
public class class_name { public static String formatDistributions(List<Integer[]> distributions) { if (distributions.isEmpty()) { return null; // depends on control dependency: [if], data = [none] } String[] distributionsFormatted = new String[distributions.size()]; for (int i = 0; i < distributions.size(); i++) { if (distributions.get(i).length == 0) { distributionsFormatted[i] = ""; // depends on control dependency: [if], data = [none] } else { distributionsFormatted[i] = String.format(Locale.US, "%s,%s", TextUtils.formatCoordinate(distributions.get(i)[0]), TextUtils.formatCoordinate(distributions.get(i)[1])); // depends on control dependency: [if], data = [none] } } return TextUtils.join(";", distributionsFormatted); } }
public class class_name { public static byte[] concat(byte[]... arrays) { int size = 0; for (byte[] a: arrays) { size += a.length; } byte[] result = new byte[size]; int index = 0; for (byte[] a: arrays) { System.arraycopy(a, 0, result, index, a.length); index += a.length; } return result; } }
public class class_name { public static byte[] concat(byte[]... arrays) { int size = 0; for (byte[] a: arrays) { size += a.length; // depends on control dependency: [for], data = [a] } byte[] result = new byte[size]; int index = 0; for (byte[] a: arrays) { System.arraycopy(a, 0, result, index, a.length); // depends on control dependency: [for], data = [a] index += a.length; // depends on control dependency: [for], data = [a] } return result; } }
public class class_name { private static String getReplacement(Matcher matcher, Closure closure) { if (!hasGroup(matcher)) { return InvokerHelper.toString(closure.call(matcher.group())); } int count = matcher.groupCount(); List<String> groups = new ArrayList<String>(); for (int i = 0; i <= count; i++) { groups.add(matcher.group(i)); } if (closure.getParameterTypes().length == 1 && closure.getParameterTypes()[0] == Object[].class) { return InvokerHelper.toString(closure.call(groups.toArray())); } return InvokerHelper.toString(closure.call(groups)); } }
public class class_name { private static String getReplacement(Matcher matcher, Closure closure) { if (!hasGroup(matcher)) { return InvokerHelper.toString(closure.call(matcher.group())); // depends on control dependency: [if], data = [none] } int count = matcher.groupCount(); List<String> groups = new ArrayList<String>(); for (int i = 0; i <= count; i++) { groups.add(matcher.group(i)); // depends on control dependency: [for], data = [i] } if (closure.getParameterTypes().length == 1 && closure.getParameterTypes()[0] == Object[].class) { return InvokerHelper.toString(closure.call(groups.toArray())); // depends on control dependency: [if], data = [none] } return InvokerHelper.toString(closure.call(groups)); } }
public class class_name { public void onDestroy(Activity activity) { if (sameActivity(activity)) { hideCurrentScreen(); this.activity = null; container = null; menu = null; } } }
public class class_name { public void onDestroy(Activity activity) { if (sameActivity(activity)) { hideCurrentScreen(); // depends on control dependency: [if], data = [none] this.activity = null; // depends on control dependency: [if], data = [none] container = null; // depends on control dependency: [if], data = [none] menu = null; // depends on control dependency: [if], data = [none] } } }
public class class_name { public boolean addCSV(String name, String... values) { QuotedCSV existing = null; for (HttpField f : this) { if (f.getName().equalsIgnoreCase(name)) { if (existing == null) existing = new QuotedCSV(false); existing.addValue(f.getValue()); } } String value = addCSV(existing, values); if (value != null) { add(name, value); return true; } return false; } }
public class class_name { public boolean addCSV(String name, String... values) { QuotedCSV existing = null; for (HttpField f : this) { if (f.getName().equalsIgnoreCase(name)) { if (existing == null) existing = new QuotedCSV(false); existing.addValue(f.getValue()); // depends on control dependency: [if], data = [none] } } String value = addCSV(existing, values); if (value != null) { add(name, value); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { protected static int getEmojiEndPos(char[] text, int startPos) { int best = -1; for (int j = startPos + 1; j <= text.length; j++) { EmojiTrie.Matches status = EmojiManager.isEmoji(Arrays.copyOfRange( text, startPos, j )); if (status.exactMatch()) { best = j; } else if (status.impossibleMatch()) { return best; } } return best; } }
public class class_name { protected static int getEmojiEndPos(char[] text, int startPos) { int best = -1; for (int j = startPos + 1; j <= text.length; j++) { EmojiTrie.Matches status = EmojiManager.isEmoji(Arrays.copyOfRange( text, startPos, j )); if (status.exactMatch()) { best = j; // depends on control dependency: [if], data = [none] } else if (status.impossibleMatch()) { return best; // depends on control dependency: [if], data = [none] } } return best; } }
public class class_name { @Override public boolean add(String str) { boolean flag = true; for (BloomFilter filter : filters) { flag |= filter.add(str); } return flag; } }
public class class_name { @Override public boolean add(String str) { boolean flag = true; for (BloomFilter filter : filters) { flag |= filter.add(str); // depends on control dependency: [for], data = [filter] } return flag; } }
public class class_name { public static void Forward(double[][] data) { int rows = data.length; int cols = data[0].length; double[] row = new double[cols]; double[] col = new double[rows]; for (int i = 0; i < rows; i++) { for (int j = 0; j < row.length; j++) row[j] = data[i][j]; Forward(row); for (int j = 0; j < row.length; j++) data[i][j] = row[j]; } for (int j = 0; j < cols; j++) { for (int i = 0; i < col.length; i++) col[i] = data[i][j]; Forward(col); for (int i = 0; i < col.length; i++) data[i][j] = col[i]; } } }
public class class_name { public static void Forward(double[][] data) { int rows = data.length; int cols = data[0].length; double[] row = new double[cols]; double[] col = new double[rows]; for (int i = 0; i < rows; i++) { for (int j = 0; j < row.length; j++) row[j] = data[i][j]; Forward(row); // depends on control dependency: [for], data = [none] for (int j = 0; j < row.length; j++) data[i][j] = row[j]; } for (int j = 0; j < cols; j++) { for (int i = 0; i < col.length; i++) col[i] = data[i][j]; Forward(col); // depends on control dependency: [for], data = [none] for (int i = 0; i < col.length; i++) data[i][j] = col[i]; } } }
public class class_name { public boolean isAlwaysFalse() { if (shardingConditions.isEmpty()) { return false; } for (ShardingCondition each : shardingConditions) { if (!(each instanceof AlwaysFalseShardingCondition)) { return false; } } return true; } }
public class class_name { public boolean isAlwaysFalse() { if (shardingConditions.isEmpty()) { return false; // depends on control dependency: [if], data = [none] } for (ShardingCondition each : shardingConditions) { if (!(each instanceof AlwaysFalseShardingCondition)) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { public List<Integer> matchOccurence(int maxAttachments) { List<Integer> validValues = new ArrayList<Integer>(); for (int val = 0; val <= maxAttachments; val++) { boolean addVal = false; StringTokenizer st = new StringTokenizer(occurrence, ","); while (st.hasMoreTokens() && !addVal) { String cond = st.nextToken().trim().replaceAll(" ", ""); if (match("^\\d+$", cond)) { // n if (Integer.valueOf(cond) == val) addVal = true; } if (match("^\\d+-\\d+$", cond)) { // n-m int from = Integer.valueOf(cond.substring(0, cond.indexOf('-'))); int to = Integer.valueOf(cond.substring(cond.indexOf('-') + 1, cond.length())); if (val >= from && val <= to) { addVal = true; } } if (match("^>\\d+$", cond)) { // <n int n = Integer.valueOf(cond.substring(cond.indexOf('>') + 1, cond.length())); if (val > n) { addVal = true; } } if (match("^<\\d+$", cond)) { // >n int n = Integer.valueOf(cond.substring(cond.indexOf('<') + 1, cond.length())); if (val < n) { addVal = true; } } if (addVal) { validValues.add(val); } } } return validValues; } }
public class class_name { public List<Integer> matchOccurence(int maxAttachments) { List<Integer> validValues = new ArrayList<Integer>(); for (int val = 0; val <= maxAttachments; val++) { boolean addVal = false; StringTokenizer st = new StringTokenizer(occurrence, ","); while (st.hasMoreTokens() && !addVal) { String cond = st.nextToken().trim().replaceAll(" ", ""); if (match("^\\d+$", cond)) { // n if (Integer.valueOf(cond) == val) addVal = true; } if (match("^\\d+-\\d+$", cond)) { // n-m int from = Integer.valueOf(cond.substring(0, cond.indexOf('-'))); int to = Integer.valueOf(cond.substring(cond.indexOf('-') + 1, cond.length())); if (val >= from && val <= to) { addVal = true; // depends on control dependency: [if], data = [none] } } if (match("^>\\d+$", cond)) { // <n int n = Integer.valueOf(cond.substring(cond.indexOf('>') + 1, cond.length())); if (val > n) { addVal = true; // depends on control dependency: [if], data = [none] } } if (match("^<\\d+$", cond)) { // >n int n = Integer.valueOf(cond.substring(cond.indexOf('<') + 1, cond.length())); if (val < n) { addVal = true; // depends on control dependency: [if], data = [none] } } if (addVal) { validValues.add(val); // depends on control dependency: [if], data = [none] } } } return validValues; } }
public class class_name { public void validate() throws EJBConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "validate " + j2eeName); boolean asAttributesDefined = false; if (ivModuleVersion <= J2EE_EJB_VERSION_1_1) { // it is an EJB Module version 1.1 // 1.a if (ACTIVATION_POLICY_ACTIVITY_SESSION == activationPolicy) { Tr.error(tc, "INVALID_ACTIVITY_SESSION_POLICY_CNTR0069E", enterpriseBeanName); throw new EJBConfigurationException("CNTR0069E: Bean \"" + enterpriseBeanName + "\" in an EJB 1.1 module attempted to use an invalid \"Activate at\" policy of \"Activity Session\"."); } // 1.b if (LocalTransactionSettings.BOUNDARY_ACTIVITY_SESSION == _localTran.getBoundary()) { Tr.error(tc, "INVALID_ACTIVITY_SESSION_POLICY_CNTR0070E", enterpriseBeanName); throw new EJBConfigurationException("CNTR0070E: Bean \"" + enterpriseBeanName + "\" in an EJB 1.1 module attempted to use an invalid Local Transactions Boundary of \"Activity Session\"."); } // 1.c if (LocalTransactionSettings.RESOLVER_CONTAINER_AT_BOUNDARY == _localTran.getResolver() && type != InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY) { //d138543 Tr.error(tc, "INVALID_LOCAL_TRANSACTION_RESOLVER_CNTR0071E", enterpriseBeanName); throw new EJBConfigurationException("CNTR0071E: Bean \"" + enterpriseBeanName + "\" in an EJB 1.1 module attempted to use an invalid Local Transactions Resolution control of \"ContainerAtBoundary\"."); } } if (ivModuleVersion >= J2EE_EJB_VERSION_2_0) //LI2110.41 { // EJB Module version 2.x // 2.a if ejb2.0 module + CMAS, then only supported ActivateAt policy // is Activity Session or ReadOnly if (isEntityBean() || isStatefulSessionBean()) { // This is an Entity Bean or a Stateful Session bean if (!usesBeanManagedTx) { String temp_method_name = null; // for these CMAS/TX, check if method have AS Attributes defined // Need to check all methods on all interfaces.... d174057 EJBMethodInterface[] mtypes = EJBMethodInterface.values(); for (int j = 0; j < mtypes.length && !asAttributesDefined; ++j) { List<EJBMethodMetaData> emi = getEJBMethodMetaData(mtypes[j]); int length = 0; if (emi != null) // PK31372 { length = emi.size() - 1; for (int i = 0; i < length && !asAttributesDefined; ++i) { ActivitySessionAttribute asa = ((EJBMethodInfoImpl) emi.get(i)).getActivitySessionAttribute(); switch (asa.getValue()) { case ActivitySessionAttribute.BEAN_MANAGED: case ActivitySessionAttribute.REQUIRED: case ActivitySessionAttribute.SUPPORTS: case ActivitySessionAttribute.REQUIRES_NEW: case ActivitySessionAttribute.MANDATORY: temp_method_name = emi.get(i).getMethodName(); asAttributesDefined = true; // FIXME: Fallthrough makes this all dead code. default: asAttributesDefined = false; } } // end for (i) methodInfos } // end if } // end for (j) methodInterfaces if (asAttributesDefined && ACTIVATION_POLICY_ACTIVITY_SESSION != activationPolicy && !ivReadOnlyCommitOption) // LI3408 { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception thrown for method " + temp_method_name); Tr.error(tc, "INVALID_ACTIVITY_SESSION_POLICY_CNTR0072E", enterpriseBeanClassName); throw new EJBConfigurationException("Invalid activateAt policy with Container Managed " + "Activity Session for = " + enterpriseBeanClassName); } } } /* * //2.b if ActivateAt = AS, then loadAt must be Transaction * Already taken care of in method setActivationLoadPolicy. Throws CNTR0044W exception */ //2.c if (usesBeanManagedTx) { //flags usesBeanManagedTx and usesBeanManagedAS are same. They are set if bean is BMT //It is a BMT //LTC must NOT be ContainerAtBoundary if (_localTran.getResolver() == LocalTransactionSettings.RESOLVER_CONTAINER_AT_BOUNDARY) { Tr.error(tc, "INVALID_LOCAL_TRANSACTION_RESOLVER_CNTR0073E", j2eeName); throw new EJBConfigurationException("Unsupported Local Transaction resolution control for BeanManaged ."); } } } //end ejb 2.0 module if block // Check for invalid local transaction configuration. // First, check for invalid resolver configuration // and then check for invalid boundary. // 130016 and 132312 - start if (type == InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY) { //2.d if (_localTran.getResolver() == LocalTransactionSettings.RESOLVER_APPLICATION) { Tr.error(tc, "INVALID_CONFIGURATION_CMP_RESOLVER_APPLICATION_CNTR0065E", j2eeName); throw new EJBConfigurationException("Unsupported Local Transaction resolution control for CMP Beans."); } } else if (/* type == STATELESS_SESSION || */type == InternalConstants.TYPE_MESSAGE_DRIVEN) { //2.e//d180809 if (_localTran.getBoundary() == LocalTransactionSettings.BOUNDARY_ACTIVITY_SESSION) { Tr.error(tc, "LOCAL_TRAN_BOUNDARY_ACTIVITY_INVALID_CNTR0066E", j2eeName); throw new EJBConfigurationException("Local Transaction Boundary of activity session is invalid for Message Driven Beans."); } } //check for invalid resolver configuration 130016 and 132312- stop TransactionAttribute txAttr; // ----------------------------------------------------------------------- // Perform EJB Specification validation for MessageDriven beans. LI2281.07 // ----------------------------------------------------------------------- if (type == InternalConstants.TYPE_MESSAGE_DRIVEN) { // MDBs may only implement some Tx Atributes... for (int i = 0; i < localMethodInfos.length; i++) // LIDB2110.41 { txAttr = localMethodInfos[i].getTransactionAttribute(); if (!(txAttr == TransactionAttribute.TX_REQUIRED || txAttr == TransactionAttribute.TX_NOT_SUPPORTED || txAttr == TransactionAttribute.TX_BEAN_MANAGED)) { String method = localMethodInfos[i].getMethodName(); Tr.error(tc, "INVALID_TX_ATTR_CNTR0089E", // d170741 new Object[] { txAttr.toString(), method, j2eeName }); throw new EJBConfigurationException("Transaction attribute " + txAttr.toString() + " is not allowed " + "for method " + method + " on EJB " + j2eeName); } } } // ----------------------------------------------------------------------- // Perform EJB Specification validation for beans that implement the // javax.ejb.TimedObject interface. LI2281.07 // ----------------------------------------------------------------------- if (timedMethodInfos != null) // F743-506 { // Per the EJB Spec, if this bean implements the javax.ejb.TimedObject // interface, verify that it is a EJB 2.0 or later bean, and is not // a Stateful Session bean. if (ivModuleVersion < J2EE_EJB_VERSION_2_0 || cmpVersion == InternalConstants.CMP_VERSION_1_X || type == InternalConstants.TYPE_STATEFUL_SESSION || type == InternalConstants.TYPE_MANAGED_BEAN) { Tr.error(tc, "INVALID_TIMEDOBJECT_IMPL_CNTR0088E", j2eeName); // d170741 throw new EJBConfigurationException("EJB 1.x, 2.0, and Stateful Session " + "beans may not implement the " + "javax.ejb.TimedObject interface : " + j2eeName); } // F743-506 - Validate all timer methods for (int i = 0; i < timedMethodInfos.length; i++) { // Per the Spec. TimedObject.ejbTimeout may only implement some Tx Atributes... // Note: In the 2.X specifications TX_REQUIRED was not specified as a valid // transaction attribute for TimedObjects. This did not make much sense and // was changed in the 3.0 specification to allow it. We will no longer // consider this to be an error situation (even for 2.X beans). //d366845.8 txAttr = timedMethodInfos[i].getTransactionAttribute(); if (!(txAttr == TransactionAttribute.TX_REQUIRED || txAttr == TransactionAttribute.TX_REQUIRES_NEW || txAttr == TransactionAttribute.TX_NOT_SUPPORTED || txAttr == TransactionAttribute.TX_BEAN_MANAGED)) { String method = timedMethodInfos[i].getMethodName(); Tr.error(tc, "INVALID_TX_ATTR_CNTR0089E", // d170741 new Object[] { txAttr.toString(), method, j2eeName }); throw new EJBConfigurationException("Transaction attribute " + txAttr.toString() + " is not allowed " + "for method " + method + " on EJB " + j2eeName); } } } if (lifecycleInterceptorMethodInfos != null) // F743-1751 { for (EJBMethodInfoImpl methodInfo : lifecycleInterceptorMethodInfos) { txAttr = methodInfo.getTransactionAttribute(); // REQUIRED must have already been translated to REQUIRES_NEW. if (txAttr != TransactionAttribute.TX_REQUIRES_NEW && txAttr != TransactionAttribute.TX_NOT_SUPPORTED && txAttr != TransactionAttribute.TX_BEAN_MANAGED) { String method = methodInfo.getMethodName(); Tr.error(tc, "INVALID_TX_ATTR_CNTR0089E", new Object[] { txAttr.toString(), method, j2eeName }); throw new EJBConfigurationException("Transaction attribute " + txAttr.toString() + " is not allowed " + "for method " + method + " on EJB " + j2eeName); } } } // ReadOnly / Interval caching option beans must be CMP 2.x or later, // since that is the only way to insure the state of the bean is not // changed/updated. LI3408 if (ivCacheReloadType != CACHE_RELOAD_NONE) { if (cmpVersion < InternalConstants.CMP_VERSION_2_X) { Tr.error(tc, "INVALID_CACHE_RELOAD_POLICY_CNTR0094E", enterpriseBeanClassName); StringBuffer exText = new StringBuffer(); exText.append("Bean ").append(j2eeName).append(" with LoadPolicy "); exText.append(getCacheReloadIntervalString()); exText.append(" must be CMP Version 2.x or later."); throw new EJBConfigurationException(exText.toString()); } } // ----------------------------------------------------------------------- // Perform validation for beans that implement the LightweightLocal // interface. LI3795-56 // ----------------------------------------------------------------------- if (isLightweight) { // ------------------------------------------------------------------------- // A special check for temporary WPS hack, allowing SLSBs to be Lightweight. // As a performance fix for WPS, SLSBs may be Lightweight. This is only // enabled by an undocumented EJB environment variable. It cannot be // enabled by a WCCM config switch, nor by inheriting the Lightweight // interface. The latter is flagged as an error here. The former can // not happen since we do not support this in the WCCM model for SLSBs. // PK21246 // ------------------------------------------------------------------------- if (type == InternalConstants.TYPE_STATELESS_SESSION && (LightweightLocal.class).isAssignableFrom(enterpriseBeanAbstractClass)) { Tr.error(tc, "INVALID_LIGHTWEIGHT_IMPL_CNTR0119E", new Object[] { j2eeName, "1" }); throw new EJBConfigurationException("Only Entity EJBs may implement " + "the LightweightLocal interface : " + j2eeName); } // LightweightLocal support has the following restrictions: // - must be an Entity bean // - must be an EJB 2.0 bean (and CMP 2.x or later) // - must contain a local interface // - might be a WPS hacked SLSB (ie. see above check) PK21246 else if (type != InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY && type != InternalConstants.TYPE_BEAN_MANAGED_ENTITY && type != InternalConstants.TYPE_STATELESS_SESSION) { Tr.error(tc, "INVALID_LIGHTWEIGHT_IMPL_CNTR0119E", new Object[] { j2eeName, "1" }); throw new EJBConfigurationException("Only Entity EJBs may implement " + "the LightweightLocal interface : " + j2eeName); } if (ivModuleVersion < J2EE_EJB_VERSION_2_0 || cmpVersion == InternalConstants.CMP_VERSION_1_X) { Tr.error(tc, "INVALID_LIGHTWEIGHT_IMPL_CNTR0119E", new Object[] { j2eeName, "2" }); throw new EJBConfigurationException("EJB 1.x and CMP 1.x beans may not " + "implement the LightweightLocal " + "interface : " + j2eeName); } if (localHomeInterfaceClassName == null) { Tr.error(tc, "INVALID_LIGHTWEIGHT_IMPL_CNTR0119E", new Object[] { j2eeName, "3" }); throw new EJBConfigurationException("EJBs that implement the " + "LightweightLocal interface must " + "define a local interface : " + j2eeName); } } // ----------------------------------------------------------------------- // Pre-Load Pool / Max Creation Hard Limit // PK20648 // - must be a 2.0 Stateless Session bean. // ----------------------------------------------------------------------- if (ivInitialPoolSize > 0 && (type != InternalConstants.TYPE_STATELESS_SESSION || ivModuleVersion <= J2EE_EJB_VERSION_1_1)) { Tr.warning(tc, "INVALID_MIN_POOLSIZE_CNTR0057W", new Object[] { j2eeName.toString(), "H" + Integer.toString(minPoolSize) }); throw new EJBConfigurationException("A hard (H) minimum pool size may only be " + "specified for EJB 2.x Stateless Session " + "EJBs : " + j2eeName); } if (ivMaxCreation > 0 && (type != InternalConstants.TYPE_STATELESS_SESSION || ivModuleVersion <= J2EE_EJB_VERSION_1_1)) { Tr.warning(tc, "INVALID_MAX_POOLSIZE_CNTR0058W", new Object[] { j2eeName.toString(), "H" + Integer.toString(maxPoolSize) }); throw new EJBConfigurationException("A hard (H) maximum pool size may only be " + "specified for EJB 2.x Stateless Session " + "EJBs : " + j2eeName); } // ----------------------------------------------------------------------- // Option A caching and Optimistic Concurrency Control not allowed // 116394.3 // ----------------------------------------------------------------------- if (optionACommitOption && optimisticConcurrencyControl) { Tr.warning(tc, "COMMIT_OPTION_A_AND_OPTIMISTIC_CONCURRENCY_CONTROL_NOT_SUPPORTED_CNTR0049E"); throw new EJBConfigurationException("Using Commit Option A with Optimistic Concurrency is not supported. EJB = " + enterpriseBeanClassName); } // ----------------------------------------------------------------------------------- // Test configuration errors for beans with asynchronous methods (ie. new in EJB 3.1). 116394.3 // ----------------------------------------------------------------------------------- if (ivHasAsynchMethod) { // Asynch methods are only allowed on session beans if (!isSessionBean()) { Tr.error(tc, "INVALID_BEAN_TYPE_FOR_ASYNCH_METHOD_CNTR0185E", new Object[] { j2eeName.getComponent(), j2eeName.getModule(), j2eeName.getApplication() }); throw new EJBConfigurationException("The " + j2eeName.getComponent() + " bean in the " + j2eeName.getModule() + " module of the " + j2eeName.getApplication() + " application has one or more asynchronous methods configured, but is not a session bean. " + "Asynchronous methods can only be configured on session beans."); } } // Validation of asynchronous methods if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "validate"); } }
public class class_name { public void validate() throws EJBConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "validate " + j2eeName); boolean asAttributesDefined = false; if (ivModuleVersion <= J2EE_EJB_VERSION_1_1) { // it is an EJB Module version 1.1 // 1.a if (ACTIVATION_POLICY_ACTIVITY_SESSION == activationPolicy) { Tr.error(tc, "INVALID_ACTIVITY_SESSION_POLICY_CNTR0069E", enterpriseBeanName); throw new EJBConfigurationException("CNTR0069E: Bean \"" + enterpriseBeanName + "\" in an EJB 1.1 module attempted to use an invalid \"Activate at\" policy of \"Activity Session\"."); } // 1.b if (LocalTransactionSettings.BOUNDARY_ACTIVITY_SESSION == _localTran.getBoundary()) { Tr.error(tc, "INVALID_ACTIVITY_SESSION_POLICY_CNTR0070E", enterpriseBeanName); throw new EJBConfigurationException("CNTR0070E: Bean \"" + enterpriseBeanName + "\" in an EJB 1.1 module attempted to use an invalid Local Transactions Boundary of \"Activity Session\"."); } // 1.c if (LocalTransactionSettings.RESOLVER_CONTAINER_AT_BOUNDARY == _localTran.getResolver() && type != InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY) { //d138543 Tr.error(tc, "INVALID_LOCAL_TRANSACTION_RESOLVER_CNTR0071E", enterpriseBeanName); throw new EJBConfigurationException("CNTR0071E: Bean \"" + enterpriseBeanName + "\" in an EJB 1.1 module attempted to use an invalid Local Transactions Resolution control of \"ContainerAtBoundary\"."); } } if (ivModuleVersion >= J2EE_EJB_VERSION_2_0) //LI2110.41 { // EJB Module version 2.x // 2.a if ejb2.0 module + CMAS, then only supported ActivateAt policy // is Activity Session or ReadOnly if (isEntityBean() || isStatefulSessionBean()) { // This is an Entity Bean or a Stateful Session bean if (!usesBeanManagedTx) { String temp_method_name = null; // for these CMAS/TX, check if method have AS Attributes defined // Need to check all methods on all interfaces.... d174057 EJBMethodInterface[] mtypes = EJBMethodInterface.values(); for (int j = 0; j < mtypes.length && !asAttributesDefined; ++j) { List<EJBMethodMetaData> emi = getEJBMethodMetaData(mtypes[j]); int length = 0; if (emi != null) // PK31372 { length = emi.size() - 1; // depends on control dependency: [if], data = [none] for (int i = 0; i < length && !asAttributesDefined; ++i) { ActivitySessionAttribute asa = ((EJBMethodInfoImpl) emi.get(i)).getActivitySessionAttribute(); switch (asa.getValue()) { case ActivitySessionAttribute.BEAN_MANAGED: case ActivitySessionAttribute.REQUIRED: case ActivitySessionAttribute.SUPPORTS: case ActivitySessionAttribute.REQUIRES_NEW: case ActivitySessionAttribute.MANDATORY: temp_method_name = emi.get(i).getMethodName(); asAttributesDefined = true; // depends on control dependency: [for], data = [none] // FIXME: Fallthrough makes this all dead code. default: asAttributesDefined = false; } } // end for (i) methodInfos } // end if } // end for (j) methodInterfaces if (asAttributesDefined && ACTIVATION_POLICY_ACTIVITY_SESSION != activationPolicy && !ivReadOnlyCommitOption) // LI3408 { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception thrown for method " + temp_method_name); Tr.error(tc, "INVALID_ACTIVITY_SESSION_POLICY_CNTR0072E", enterpriseBeanClassName); // depends on control dependency: [if], data = [none] throw new EJBConfigurationException("Invalid activateAt policy with Container Managed " + "Activity Session for = " + enterpriseBeanClassName); } } } /* * //2.b if ActivateAt = AS, then loadAt must be Transaction * Already taken care of in method setActivationLoadPolicy. Throws CNTR0044W exception */ //2.c if (usesBeanManagedTx) { //flags usesBeanManagedTx and usesBeanManagedAS are same. They are set if bean is BMT //It is a BMT //LTC must NOT be ContainerAtBoundary if (_localTran.getResolver() == LocalTransactionSettings.RESOLVER_CONTAINER_AT_BOUNDARY) { Tr.error(tc, "INVALID_LOCAL_TRANSACTION_RESOLVER_CNTR0073E", j2eeName); // depends on control dependency: [if], data = [none] throw new EJBConfigurationException("Unsupported Local Transaction resolution control for BeanManaged ."); } } } //end ejb 2.0 module if block // Check for invalid local transaction configuration. // First, check for invalid resolver configuration // and then check for invalid boundary. // 130016 and 132312 - start if (type == InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY) { //2.d if (_localTran.getResolver() == LocalTransactionSettings.RESOLVER_APPLICATION) { Tr.error(tc, "INVALID_CONFIGURATION_CMP_RESOLVER_APPLICATION_CNTR0065E", j2eeName); throw new EJBConfigurationException("Unsupported Local Transaction resolution control for CMP Beans."); } } else if (/* type == STATELESS_SESSION || */type == InternalConstants.TYPE_MESSAGE_DRIVEN) { //2.e//d180809 if (_localTran.getBoundary() == LocalTransactionSettings.BOUNDARY_ACTIVITY_SESSION) { Tr.error(tc, "LOCAL_TRAN_BOUNDARY_ACTIVITY_INVALID_CNTR0066E", j2eeName); throw new EJBConfigurationException("Local Transaction Boundary of activity session is invalid for Message Driven Beans."); } } //check for invalid resolver configuration 130016 and 132312- stop TransactionAttribute txAttr; // ----------------------------------------------------------------------- // Perform EJB Specification validation for MessageDriven beans. LI2281.07 // ----------------------------------------------------------------------- if (type == InternalConstants.TYPE_MESSAGE_DRIVEN) { // MDBs may only implement some Tx Atributes... for (int i = 0; i < localMethodInfos.length; i++) // LIDB2110.41 { txAttr = localMethodInfos[i].getTransactionAttribute(); if (!(txAttr == TransactionAttribute.TX_REQUIRED || txAttr == TransactionAttribute.TX_NOT_SUPPORTED || txAttr == TransactionAttribute.TX_BEAN_MANAGED)) { String method = localMethodInfos[i].getMethodName(); Tr.error(tc, "INVALID_TX_ATTR_CNTR0089E", // d170741 new Object[] { txAttr.toString(), method, j2eeName }); throw new EJBConfigurationException("Transaction attribute " + txAttr.toString() + " is not allowed " + "for method " + method + " on EJB " + j2eeName); } } } // ----------------------------------------------------------------------- // Perform EJB Specification validation for beans that implement the // javax.ejb.TimedObject interface. LI2281.07 // ----------------------------------------------------------------------- if (timedMethodInfos != null) // F743-506 { // Per the EJB Spec, if this bean implements the javax.ejb.TimedObject // interface, verify that it is a EJB 2.0 or later bean, and is not // a Stateful Session bean. if (ivModuleVersion < J2EE_EJB_VERSION_2_0 || cmpVersion == InternalConstants.CMP_VERSION_1_X || type == InternalConstants.TYPE_STATEFUL_SESSION || type == InternalConstants.TYPE_MANAGED_BEAN) { Tr.error(tc, "INVALID_TIMEDOBJECT_IMPL_CNTR0088E", j2eeName); // d170741 throw new EJBConfigurationException("EJB 1.x, 2.0, and Stateful Session " + "beans may not implement the " + "javax.ejb.TimedObject interface : " + j2eeName); } // F743-506 - Validate all timer methods for (int i = 0; i < timedMethodInfos.length; i++) { // Per the Spec. TimedObject.ejbTimeout may only implement some Tx Atributes... // Note: In the 2.X specifications TX_REQUIRED was not specified as a valid // transaction attribute for TimedObjects. This did not make much sense and // was changed in the 3.0 specification to allow it. We will no longer // consider this to be an error situation (even for 2.X beans). //d366845.8 txAttr = timedMethodInfos[i].getTransactionAttribute(); if (!(txAttr == TransactionAttribute.TX_REQUIRED || txAttr == TransactionAttribute.TX_REQUIRES_NEW || txAttr == TransactionAttribute.TX_NOT_SUPPORTED || txAttr == TransactionAttribute.TX_BEAN_MANAGED)) { String method = timedMethodInfos[i].getMethodName(); Tr.error(tc, "INVALID_TX_ATTR_CNTR0089E", // d170741 new Object[] { txAttr.toString(), method, j2eeName }); throw new EJBConfigurationException("Transaction attribute " + txAttr.toString() + " is not allowed " + "for method " + method + " on EJB " + j2eeName); } } } if (lifecycleInterceptorMethodInfos != null) // F743-1751 { for (EJBMethodInfoImpl methodInfo : lifecycleInterceptorMethodInfos) { txAttr = methodInfo.getTransactionAttribute(); // REQUIRED must have already been translated to REQUIRES_NEW. if (txAttr != TransactionAttribute.TX_REQUIRES_NEW && txAttr != TransactionAttribute.TX_NOT_SUPPORTED && txAttr != TransactionAttribute.TX_BEAN_MANAGED) { String method = methodInfo.getMethodName(); Tr.error(tc, "INVALID_TX_ATTR_CNTR0089E", new Object[] { txAttr.toString(), method, j2eeName }); throw new EJBConfigurationException("Transaction attribute " + txAttr.toString() + " is not allowed " + "for method " + method + " on EJB " + j2eeName); } } } // ReadOnly / Interval caching option beans must be CMP 2.x or later, // since that is the only way to insure the state of the bean is not // changed/updated. LI3408 if (ivCacheReloadType != CACHE_RELOAD_NONE) { if (cmpVersion < InternalConstants.CMP_VERSION_2_X) { Tr.error(tc, "INVALID_CACHE_RELOAD_POLICY_CNTR0094E", enterpriseBeanClassName); StringBuffer exText = new StringBuffer(); exText.append("Bean ").append(j2eeName).append(" with LoadPolicy "); exText.append(getCacheReloadIntervalString()); exText.append(" must be CMP Version 2.x or later."); throw new EJBConfigurationException(exText.toString()); } } // ----------------------------------------------------------------------- // Perform validation for beans that implement the LightweightLocal // interface. LI3795-56 // ----------------------------------------------------------------------- if (isLightweight) { // ------------------------------------------------------------------------- // A special check for temporary WPS hack, allowing SLSBs to be Lightweight. // As a performance fix for WPS, SLSBs may be Lightweight. This is only // enabled by an undocumented EJB environment variable. It cannot be // enabled by a WCCM config switch, nor by inheriting the Lightweight // interface. The latter is flagged as an error here. The former can // not happen since we do not support this in the WCCM model for SLSBs. // PK21246 // ------------------------------------------------------------------------- if (type == InternalConstants.TYPE_STATELESS_SESSION && (LightweightLocal.class).isAssignableFrom(enterpriseBeanAbstractClass)) { Tr.error(tc, "INVALID_LIGHTWEIGHT_IMPL_CNTR0119E", new Object[] { j2eeName, "1" }); throw new EJBConfigurationException("Only Entity EJBs may implement " + "the LightweightLocal interface : " + j2eeName); } // LightweightLocal support has the following restrictions: // - must be an Entity bean // - must be an EJB 2.0 bean (and CMP 2.x or later) // - must contain a local interface // - might be a WPS hacked SLSB (ie. see above check) PK21246 else if (type != InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY && type != InternalConstants.TYPE_BEAN_MANAGED_ENTITY && type != InternalConstants.TYPE_STATELESS_SESSION) { Tr.error(tc, "INVALID_LIGHTWEIGHT_IMPL_CNTR0119E", new Object[] { j2eeName, "1" }); throw new EJBConfigurationException("Only Entity EJBs may implement " + "the LightweightLocal interface : " + j2eeName); } if (ivModuleVersion < J2EE_EJB_VERSION_2_0 || cmpVersion == InternalConstants.CMP_VERSION_1_X) { Tr.error(tc, "INVALID_LIGHTWEIGHT_IMPL_CNTR0119E", new Object[] { j2eeName, "2" }); throw new EJBConfigurationException("EJB 1.x and CMP 1.x beans may not " + "implement the LightweightLocal " + "interface : " + j2eeName); } if (localHomeInterfaceClassName == null) { Tr.error(tc, "INVALID_LIGHTWEIGHT_IMPL_CNTR0119E", new Object[] { j2eeName, "3" }); throw new EJBConfigurationException("EJBs that implement the " + "LightweightLocal interface must " + "define a local interface : " + j2eeName); } } // ----------------------------------------------------------------------- // Pre-Load Pool / Max Creation Hard Limit // PK20648 // - must be a 2.0 Stateless Session bean. // ----------------------------------------------------------------------- if (ivInitialPoolSize > 0 && (type != InternalConstants.TYPE_STATELESS_SESSION || ivModuleVersion <= J2EE_EJB_VERSION_1_1)) { Tr.warning(tc, "INVALID_MIN_POOLSIZE_CNTR0057W", new Object[] { j2eeName.toString(), "H" + Integer.toString(minPoolSize) }); throw new EJBConfigurationException("A hard (H) minimum pool size may only be " + "specified for EJB 2.x Stateless Session " + "EJBs : " + j2eeName); } if (ivMaxCreation > 0 && (type != InternalConstants.TYPE_STATELESS_SESSION || ivModuleVersion <= J2EE_EJB_VERSION_1_1)) { Tr.warning(tc, "INVALID_MAX_POOLSIZE_CNTR0058W", new Object[] { j2eeName.toString(), "H" + Integer.toString(maxPoolSize) }); throw new EJBConfigurationException("A hard (H) maximum pool size may only be " + "specified for EJB 2.x Stateless Session " + "EJBs : " + j2eeName); } // ----------------------------------------------------------------------- // Option A caching and Optimistic Concurrency Control not allowed // 116394.3 // ----------------------------------------------------------------------- if (optionACommitOption && optimisticConcurrencyControl) { Tr.warning(tc, "COMMIT_OPTION_A_AND_OPTIMISTIC_CONCURRENCY_CONTROL_NOT_SUPPORTED_CNTR0049E"); throw new EJBConfigurationException("Using Commit Option A with Optimistic Concurrency is not supported. EJB = " + enterpriseBeanClassName); } // ----------------------------------------------------------------------------------- // Test configuration errors for beans with asynchronous methods (ie. new in EJB 3.1). 116394.3 // ----------------------------------------------------------------------------------- if (ivHasAsynchMethod) { // Asynch methods are only allowed on session beans if (!isSessionBean()) { Tr.error(tc, "INVALID_BEAN_TYPE_FOR_ASYNCH_METHOD_CNTR0185E", new Object[] { j2eeName.getComponent(), j2eeName.getModule(), j2eeName.getApplication() }); throw new EJBConfigurationException("The " + j2eeName.getComponent() + " bean in the " + j2eeName.getModule() + " module of the " + j2eeName.getApplication() + " application has one or more asynchronous methods configured, but is not a session bean. " + "Asynchronous methods can only be configured on session beans."); } } // Validation of asynchronous methods if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "validate"); } }
public class class_name { public static void divide( GrayU8 input , double denominator , GrayU8 output ) { output.reshape(input.width,input.height); int columns = input.width; if(BoofConcurrency.USE_CONCURRENT ) { ImplPixelMath_MT.divideU_A(input.data,input.startIndex,input.stride,denominator , output.data,output.startIndex,output.stride, input.height,columns); } else { ImplPixelMath.divideU_A(input.data,input.startIndex,input.stride,denominator , output.data,output.startIndex,output.stride, input.height,columns); } } }
public class class_name { public static void divide( GrayU8 input , double denominator , GrayU8 output ) { output.reshape(input.width,input.height); int columns = input.width; if(BoofConcurrency.USE_CONCURRENT ) { ImplPixelMath_MT.divideU_A(input.data,input.startIndex,input.stride,denominator , output.data,output.startIndex,output.stride, input.height,columns); // depends on control dependency: [if], data = [none] } else { ImplPixelMath.divideU_A(input.data,input.startIndex,input.stride,denominator , output.data,output.startIndex,output.stride, input.height,columns); // depends on control dependency: [if], data = [none] } } }
public class class_name { public PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails buildDetails( HttpServletRequest context) { Collection<String> j2eeUserRoles = getUserRoles(context); Collection<? extends GrantedAuthority> userGas = j2eeUserRoles2GrantedAuthoritiesMapper .getGrantedAuthorities(j2eeUserRoles); if (logger.isDebugEnabled()) { logger.debug("J2EE roles [" + j2eeUserRoles + "] mapped to Granted Authorities: [" + userGas + "]"); } PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails result = new PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails( context, userGas); return result; } }
public class class_name { public PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails buildDetails( HttpServletRequest context) { Collection<String> j2eeUserRoles = getUserRoles(context); Collection<? extends GrantedAuthority> userGas = j2eeUserRoles2GrantedAuthoritiesMapper .getGrantedAuthorities(j2eeUserRoles); if (logger.isDebugEnabled()) { logger.debug("J2EE roles [" + j2eeUserRoles + "] mapped to Granted Authorities: [" + userGas + "]"); // depends on control dependency: [if], data = [none] } PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails result = new PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails( context, userGas); return result; } }
public class class_name { public static CreateUserRequest checkRequest( final FormItemList formItemList, final CreateRequest createRequest, final CreateUserResponse createUserResponse) { final String userId = checkUserIdentifier(formItemList, createUserResponse); if (userId != null) { final String displayName = checkDisplayName(formItemList, createUserResponse); if (displayName != null) { final String profilePicturePath = checkProfilePicturePath( formItemList, createUserResponse); return new CreateUserRequest(createRequest.getType(), userId, displayName, profilePicturePath); } } return null; } }
public class class_name { public static CreateUserRequest checkRequest( final FormItemList formItemList, final CreateRequest createRequest, final CreateUserResponse createUserResponse) { final String userId = checkUserIdentifier(formItemList, createUserResponse); if (userId != null) { final String displayName = checkDisplayName(formItemList, createUserResponse); if (displayName != null) { final String profilePicturePath = checkProfilePicturePath( formItemList, createUserResponse); return new CreateUserRequest(createRequest.getType(), userId, displayName, profilePicturePath); // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public boolean containsOfType(final Class<? extends Tag> type) { read.lock(); try { return tags.containsKey(type); } finally { read.unlock(); } } }
public class class_name { public boolean containsOfType(final Class<? extends Tag> type) { read.lock(); try { return tags.containsKey(type); // depends on control dependency: [try], data = [none] } finally { read.unlock(); } } }
public class class_name { public void destroyOnShutdownHook() { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { LifeCycleManager.this.destroy(); } catch (Exception e) { System.err.print("Exception in life cycle shutdown handler "); e.printStackTrace(System.err); } } }); } }
public class class_name { public void destroyOnShutdownHook() { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { LifeCycleManager.this.destroy(); // depends on control dependency: [try], data = [none] } catch (Exception e) { System.err.print("Exception in life cycle shutdown handler "); e.printStackTrace(System.err); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { public void computeRemainingTrailers() { if (tc.isEntryEnabled()) { Tr.entry(tc, "computeRemainingTrailers"); } Iterator<HeaderKeys> knowns = this.knownTGs.keySet().iterator(); while (knowns.hasNext()) { HeaderKeys key = knowns.next(); setHeader(key, this.knownTGs.get(key).generateTrailerValue(key, this)); } if (tc.isEntryEnabled()) { Tr.exit(tc, "computeRemainingTrailers"); } } }
public class class_name { public void computeRemainingTrailers() { if (tc.isEntryEnabled()) { Tr.entry(tc, "computeRemainingTrailers"); // depends on control dependency: [if], data = [none] } Iterator<HeaderKeys> knowns = this.knownTGs.keySet().iterator(); while (knowns.hasNext()) { HeaderKeys key = knowns.next(); setHeader(key, this.knownTGs.get(key).generateTrailerValue(key, this)); // depends on control dependency: [while], data = [none] } if (tc.isEntryEnabled()) { Tr.exit(tc, "computeRemainingTrailers"); // depends on control dependency: [if], data = [none] } } }
public class class_name { static void splitHeaders(ClassList classes) { Set<String> ctVersions = new HashSet<>(); for (ClassDescription cd : classes) { for (ClassHeaderDescription header : cd.header) { for (char c : header.versions.toCharArray()) { ctVersions.add("" + c); } } } classes.sort(); for (ClassDescription cd : classes) { Map<String, String> outerSignatures2Version = new HashMap<>(); for (String version : ctVersions) { //XXX ClassDescription outer = cd; String outerSignatures = ""; while ((outer = classes.enclosingClass(outer)) != null) { for (ClassHeaderDescription outerHeader : outer.header) { if (outerHeader.versions.contains(version)) { outerSignatures += outerHeader.signature; } } } outerSignatures2Version.compute(outerSignatures, (key, value) -> value != null ? value + version : version); } List<ClassHeaderDescription> newHeaders = new ArrayList<>(); HEADER_LOOP: for (ClassHeaderDescription header : cd.header) { for (String versions : outerSignatures2Version.values()) { if (containsAll(versions, header.versions)) { newHeaders.add(header); continue HEADER_LOOP; } if (disjoint(versions, header.versions)) { continue; } ClassHeaderDescription newHeader = new ClassHeaderDescription(); newHeader.classAnnotations = header.classAnnotations; newHeader.deprecated = header.deprecated; newHeader.extendsAttr = header.extendsAttr; newHeader.flags = header.flags; newHeader.implementsAttr = header.implementsAttr; newHeader.innerClasses = header.innerClasses; newHeader.runtimeAnnotations = header.runtimeAnnotations; newHeader.signature = header.signature; newHeader.versions = reduce(versions, header.versions); newHeaders.add(newHeader); } } cd.header = newHeaders; } } }
public class class_name { static void splitHeaders(ClassList classes) { Set<String> ctVersions = new HashSet<>(); for (ClassDescription cd : classes) { for (ClassHeaderDescription header : cd.header) { for (char c : header.versions.toCharArray()) { ctVersions.add("" + c); // depends on control dependency: [for], data = [c] } } } classes.sort(); for (ClassDescription cd : classes) { Map<String, String> outerSignatures2Version = new HashMap<>(); for (String version : ctVersions) { //XXX ClassDescription outer = cd; String outerSignatures = ""; while ((outer = classes.enclosingClass(outer)) != null) { for (ClassHeaderDescription outerHeader : outer.header) { if (outerHeader.versions.contains(version)) { outerSignatures += outerHeader.signature; // depends on control dependency: [if], data = [none] } } } outerSignatures2Version.compute(outerSignatures, (key, value) -> value != null ? value + version : version); // depends on control dependency: [for], data = [none] } List<ClassHeaderDescription> newHeaders = new ArrayList<>(); HEADER_LOOP: for (ClassHeaderDescription header : cd.header) { for (String versions : outerSignatures2Version.values()) { if (containsAll(versions, header.versions)) { newHeaders.add(header); // depends on control dependency: [if], data = [none] continue HEADER_LOOP; } if (disjoint(versions, header.versions)) { continue; } ClassHeaderDescription newHeader = new ClassHeaderDescription(); newHeader.classAnnotations = header.classAnnotations; // depends on control dependency: [for], data = [none] newHeader.deprecated = header.deprecated; // depends on control dependency: [for], data = [none] newHeader.extendsAttr = header.extendsAttr; // depends on control dependency: [for], data = [none] newHeader.flags = header.flags; // depends on control dependency: [for], data = [none] newHeader.implementsAttr = header.implementsAttr; // depends on control dependency: [for], data = [none] newHeader.innerClasses = header.innerClasses; // depends on control dependency: [for], data = [none] newHeader.runtimeAnnotations = header.runtimeAnnotations; // depends on control dependency: [for], data = [none] newHeader.signature = header.signature; // depends on control dependency: [for], data = [none] newHeader.versions = reduce(versions, header.versions); // depends on control dependency: [for], data = [versions] newHeaders.add(newHeader); // depends on control dependency: [for], data = [none] } } cd.header = newHeaders; // depends on control dependency: [for], data = [cd] } } }
public class class_name { public Cursor<SingleValue> readSingleValue(Filter filter, DateTime timestamp, DateTimeZone timezone, Direction direction) { URI uri = null; try { URIBuilder builder = new URIBuilder(String.format("/%s/single/", API_VERSION)); addFilterToURI(builder, filter); addTimestampToURI(builder, timestamp); addTimeZoneToURI(builder, timezone); addDirectionToURI(builder, direction); uri = builder.build(); } catch (URISyntaxException e) { String message = String.format("Could not build URI with input - filter: %s", filter); throw new IllegalArgumentException(message, e); } Cursor<SingleValue> cursor = new SingleValueCursor(uri, this); return cursor; } }
public class class_name { public Cursor<SingleValue> readSingleValue(Filter filter, DateTime timestamp, DateTimeZone timezone, Direction direction) { URI uri = null; try { URIBuilder builder = new URIBuilder(String.format("/%s/single/", API_VERSION)); addFilterToURI(builder, filter); // depends on control dependency: [try], data = [none] addTimestampToURI(builder, timestamp); // depends on control dependency: [try], data = [none] addTimeZoneToURI(builder, timezone); // depends on control dependency: [try], data = [none] addDirectionToURI(builder, direction); // depends on control dependency: [try], data = [none] uri = builder.build(); // depends on control dependency: [try], data = [none] } catch (URISyntaxException e) { String message = String.format("Could not build URI with input - filter: %s", filter); throw new IllegalArgumentException(message, e); } // depends on control dependency: [catch], data = [none] Cursor<SingleValue> cursor = new SingleValueCursor(uri, this); return cursor; } }
public class class_name { public void increment(double val) { if (!enabled) return; lastSampleTime = System.currentTimeMillis(); if (!sync) { count += val; } else { synchronized (this) { count += val; } } } }
public class class_name { public void increment(double val) { if (!enabled) return; lastSampleTime = System.currentTimeMillis(); if (!sync) { count += val; // depends on control dependency: [if], data = [none] } else { synchronized (this) { // depends on control dependency: [if], data = [none] count += val; } } } }
public class class_name { public void marshall(AssessmentRunAgent assessmentRunAgent, ProtocolMarshaller protocolMarshaller) { if (assessmentRunAgent == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(assessmentRunAgent.getAgentId(), AGENTID_BINDING); protocolMarshaller.marshall(assessmentRunAgent.getAssessmentRunArn(), ASSESSMENTRUNARN_BINDING); protocolMarshaller.marshall(assessmentRunAgent.getAgentHealth(), AGENTHEALTH_BINDING); protocolMarshaller.marshall(assessmentRunAgent.getAgentHealthCode(), AGENTHEALTHCODE_BINDING); protocolMarshaller.marshall(assessmentRunAgent.getAgentHealthDetails(), AGENTHEALTHDETAILS_BINDING); protocolMarshaller.marshall(assessmentRunAgent.getAutoScalingGroup(), AUTOSCALINGGROUP_BINDING); protocolMarshaller.marshall(assessmentRunAgent.getTelemetryMetadata(), TELEMETRYMETADATA_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(AssessmentRunAgent assessmentRunAgent, ProtocolMarshaller protocolMarshaller) { if (assessmentRunAgent == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(assessmentRunAgent.getAgentId(), AGENTID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(assessmentRunAgent.getAssessmentRunArn(), ASSESSMENTRUNARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(assessmentRunAgent.getAgentHealth(), AGENTHEALTH_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(assessmentRunAgent.getAgentHealthCode(), AGENTHEALTHCODE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(assessmentRunAgent.getAgentHealthDetails(), AGENTHEALTHDETAILS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(assessmentRunAgent.getAutoScalingGroup(), AUTOSCALINGGROUP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(assessmentRunAgent.getTelemetryMetadata(), TELEMETRYMETADATA_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 CompletableFuture<Void> accept(T event) { List<CompletableFuture<Void>> futures = new ArrayList<>(listeners.size()); for (ListenerHolder listener : listeners) { if (listener.context != null) { futures.add(listener.context.execute(() -> listener.listener.accept(event))); } else { listener.listener.accept(event); } } return CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])); } }
public class class_name { public CompletableFuture<Void> accept(T event) { List<CompletableFuture<Void>> futures = new ArrayList<>(listeners.size()); for (ListenerHolder listener : listeners) { if (listener.context != null) { futures.add(listener.context.execute(() -> listener.listener.accept(event))); // depends on control dependency: [if], data = [(listener.context] } else { listener.listener.accept(event); // depends on control dependency: [if], data = [none] } } return CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])); } }
public class class_name { protected void downgradeAusrichtBalkonTerrasseElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:ausricht_balkon_terrasse[@NORDOST or @NORDWEST or @SUEDOST or @SUEDWEST]", doc).selectNodes(doc); for (Object item : nodes) { Element node = (Element) item; if (node.hasAttribute("NORDOST")) { String value = StringUtils.trimToEmpty(node.getAttribute("NORDOST")).toLowerCase(); if (value.equals("1") || value.equals("true")) { node.setAttribute("NORD", "true"); node.setAttribute("OST", "true"); } node.removeAttribute("NORDOST"); } if (node.hasAttribute("NORDWEST")) { String value = StringUtils.trimToEmpty(node.getAttribute("NORDWEST")).toLowerCase(); if (value.equals("1") || value.equals("true")) { node.setAttribute("NORD", "true"); node.setAttribute("WEST", "true"); } node.removeAttribute("NORDWEST"); } if (node.hasAttribute("SUEDOST")) { String value = StringUtils.trimToEmpty(node.getAttribute("SUEDOST")).toLowerCase(); if (value.equals("1") || value.equals("true")) { node.setAttribute("SUED", "true"); node.setAttribute("OST", "true"); } node.removeAttribute("SUEDOST"); } if (node.hasAttribute("SUEDWEST")) { String value = StringUtils.trimToEmpty(node.getAttribute("SUEDWEST")).toLowerCase(); if (value.equals("1") || value.equals("true")) { node.setAttribute("SUED", "true"); node.setAttribute("WEST", "true"); } node.removeAttribute("SUEDWEST"); } } } }
public class class_name { protected void downgradeAusrichtBalkonTerrasseElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:ausricht_balkon_terrasse[@NORDOST or @NORDWEST or @SUEDOST or @SUEDWEST]", doc).selectNodes(doc); for (Object item : nodes) { Element node = (Element) item; if (node.hasAttribute("NORDOST")) { String value = StringUtils.trimToEmpty(node.getAttribute("NORDOST")).toLowerCase(); if (value.equals("1") || value.equals("true")) { node.setAttribute("NORD", "true"); // depends on control dependency: [if], data = [none] node.setAttribute("OST", "true"); // depends on control dependency: [if], data = [none] } node.removeAttribute("NORDOST"); // depends on control dependency: [if], data = [none] } if (node.hasAttribute("NORDWEST")) { String value = StringUtils.trimToEmpty(node.getAttribute("NORDWEST")).toLowerCase(); if (value.equals("1") || value.equals("true")) { node.setAttribute("NORD", "true"); // depends on control dependency: [if], data = [none] node.setAttribute("WEST", "true"); // depends on control dependency: [if], data = [none] } node.removeAttribute("NORDWEST"); // depends on control dependency: [if], data = [none] } if (node.hasAttribute("SUEDOST")) { String value = StringUtils.trimToEmpty(node.getAttribute("SUEDOST")).toLowerCase(); if (value.equals("1") || value.equals("true")) { node.setAttribute("SUED", "true"); // depends on control dependency: [if], data = [none] node.setAttribute("OST", "true"); // depends on control dependency: [if], data = [none] } node.removeAttribute("SUEDOST"); // depends on control dependency: [if], data = [none] } if (node.hasAttribute("SUEDWEST")) { String value = StringUtils.trimToEmpty(node.getAttribute("SUEDWEST")).toLowerCase(); if (value.equals("1") || value.equals("true")) { node.setAttribute("SUED", "true"); // depends on control dependency: [if], data = [none] node.setAttribute("WEST", "true"); // depends on control dependency: [if], data = [none] } node.removeAttribute("SUEDWEST"); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static int combineMultisetHash(boolean finalize, int... hashes) { int hash = 0; for (int h : hashes) { hash = hash + h; } if (finalize) { hash = combineListHash(hash); } return hash; } }
public class class_name { public static int combineMultisetHash(boolean finalize, int... hashes) { int hash = 0; for (int h : hashes) { hash = hash + h; // depends on control dependency: [for], data = [h] } if (finalize) { hash = combineListHash(hash); // depends on control dependency: [if], data = [none] } return hash; } }
public class class_name { public int encodedLength() { int length = 0; for (final Type t : containedTypeByNameMap.values()) { if (t.isVariableLength()) { return Token.VARIABLE_LENGTH; } if (t.offsetAttribute() != -1) { length = t.offsetAttribute(); } if (t.presence() != Presence.CONSTANT) { length += t.encodedLength(); } } return length; } }
public class class_name { public int encodedLength() { int length = 0; for (final Type t : containedTypeByNameMap.values()) { if (t.isVariableLength()) { return Token.VARIABLE_LENGTH; // depends on control dependency: [if], data = [none] } if (t.offsetAttribute() != -1) { length = t.offsetAttribute(); // depends on control dependency: [if], data = [none] } if (t.presence() != Presence.CONSTANT) { length += t.encodedLength(); // depends on control dependency: [if], data = [none] } } return length; } }
public class class_name { private void restoreColumnSettings(IDialogSettings settings) { this.list.getTable().layout(true); restoreColumnWidths(settings); if (!this.isSortedElements) { this.sort = Column.SOURCE; try { final String columnName = settings.get(getPreferenceContainerID() + getColumnSortCriteraDialogSettingsKey()); if (!Strings.isEmpty(columnName)) { this.sort = Column.valueOf(columnName); if (this.sort == null) { this.sort = Column.SOURCE; } } } catch (Throwable exception) { // } assert this.sort != null; switch (this.sort) { case SOURCE: sortBySourceColumn(); break; case TARGET: sortByTargetColumn(); break; default: } } else { noSort(); } } }
public class class_name { private void restoreColumnSettings(IDialogSettings settings) { this.list.getTable().layout(true); restoreColumnWidths(settings); if (!this.isSortedElements) { this.sort = Column.SOURCE; // depends on control dependency: [if], data = [none] try { final String columnName = settings.get(getPreferenceContainerID() + getColumnSortCriteraDialogSettingsKey()); if (!Strings.isEmpty(columnName)) { this.sort = Column.valueOf(columnName); // depends on control dependency: [if], data = [none] if (this.sort == null) { this.sort = Column.SOURCE; // depends on control dependency: [if], data = [none] } } } catch (Throwable exception) { // } // depends on control dependency: [catch], data = [none] assert this.sort != null; switch (this.sort) { case SOURCE: sortBySourceColumn(); break; case TARGET: sortByTargetColumn(); break; default: } } else { noSort(); } } }
public class class_name { public boolean initOutPathDistFS(Path outPath, WriteMode writeMode, boolean createDirectory) throws IOException { if (!isDistributedFS()) { return false; } // NOTE: We actually need to lock here (process wide). Otherwise, multiple threads that // concurrently work in this method (multiple output formats writing locally) might end // up deleting each other's directories and leave non-retrievable files, without necessarily // causing an exception. That results in very subtle issues, like output files looking as if // they are not getting created. // we acquire the lock interruptibly here, to make sure that concurrent threads waiting // here can cancel faster try { OUTPUT_DIRECTORY_INIT_LOCK.lockInterruptibly(); } catch (InterruptedException e) { // restore the interruption state Thread.currentThread().interrupt(); // leave the method - we don't have the lock anyways throw new IOException("The thread was interrupted while trying to initialize the output directory"); } try { // check if path exists if (exists(outPath)) { // path exists, check write mode switch(writeMode) { case NO_OVERWRITE: // file or directory may not be overwritten throw new IOException("File or directory already exists. Existing files and directories are not overwritten in " + WriteMode.NO_OVERWRITE.name() + " mode. Use " + WriteMode.OVERWRITE.name() + " mode to overwrite existing files and directories."); case OVERWRITE: // output path exists. We delete it and all contained files in case of a directory. try { delete(outPath, true); } catch (IOException e) { // Some other thread might already have deleted the path. // If - for some other reason - the path could not be deleted, // this will be handled later. } break; default: throw new IllegalArgumentException("Invalid write mode: " + writeMode); } } if (createDirectory) { // Output directory needs to be created try { if (!exists(outPath)) { mkdirs(outPath); } } catch (IOException ioe) { // Some other thread might already have created the directory. // If - for some other reason - the directory could not be created // and the path does not exist, this will be handled later. } // double check that the output directory exists return exists(outPath) && getFileStatus(outPath).isDir(); } else { // single file case: check that the output path does not exist and // an output file can be created by the output format. return !exists(outPath); } } finally { OUTPUT_DIRECTORY_INIT_LOCK.unlock(); } } }
public class class_name { public boolean initOutPathDistFS(Path outPath, WriteMode writeMode, boolean createDirectory) throws IOException { if (!isDistributedFS()) { return false; } // NOTE: We actually need to lock here (process wide). Otherwise, multiple threads that // concurrently work in this method (multiple output formats writing locally) might end // up deleting each other's directories and leave non-retrievable files, without necessarily // causing an exception. That results in very subtle issues, like output files looking as if // they are not getting created. // we acquire the lock interruptibly here, to make sure that concurrent threads waiting // here can cancel faster try { OUTPUT_DIRECTORY_INIT_LOCK.lockInterruptibly(); } catch (InterruptedException e) { // restore the interruption state Thread.currentThread().interrupt(); // leave the method - we don't have the lock anyways throw new IOException("The thread was interrupted while trying to initialize the output directory"); } try { // check if path exists if (exists(outPath)) { // path exists, check write mode switch(writeMode) { case NO_OVERWRITE: // file or directory may not be overwritten throw new IOException("File or directory already exists. Existing files and directories are not overwritten in " + WriteMode.NO_OVERWRITE.name() + " mode. Use " + WriteMode.OVERWRITE.name() + " mode to overwrite existing files and directories."); case OVERWRITE: // output path exists. We delete it and all contained files in case of a directory. try { delete(outPath, true); // depends on control dependency: [try], data = [none] } catch (IOException e) { // Some other thread might already have deleted the path. // If - for some other reason - the path could not be deleted, // this will be handled later. } // depends on control dependency: [catch], data = [none] break; default: throw new IllegalArgumentException("Invalid write mode: " + writeMode); } } if (createDirectory) { // Output directory needs to be created try { if (!exists(outPath)) { mkdirs(outPath); // depends on control dependency: [if], data = [none] } } catch (IOException ioe) { // Some other thread might already have created the directory. // If - for some other reason - the directory could not be created // and the path does not exist, this will be handled later. } // depends on control dependency: [catch], data = [none] // double check that the output directory exists return exists(outPath) && getFileStatus(outPath).isDir(); // depends on control dependency: [if], data = [none] } else { // single file case: check that the output path does not exist and // an output file can be created by the output format. return !exists(outPath); // depends on control dependency: [if], data = [none] } } finally { OUTPUT_DIRECTORY_INIT_LOCK.unlock(); } } }
public class class_name { public StringGrabber appendRepeat(String str, int repeatCount) { for (int i = 0; i < repeatCount; i++) { if (str != null) { sb.append(str); } } return StringGrabber.this; } }
public class class_name { public StringGrabber appendRepeat(String str, int repeatCount) { for (int i = 0; i < repeatCount; i++) { if (str != null) { sb.append(str); // depends on control dependency: [if], data = [(str] } } return StringGrabber.this; } }
public class class_name { public void viewLocationDidChange (int dx, int dy) { // let our media know for (int ii = 0, ll = _media.size(); ii < ll; ii++) { _media.get(ii).viewLocationDidChange(dx, dy); } } }
public class class_name { public void viewLocationDidChange (int dx, int dy) { // let our media know for (int ii = 0, ll = _media.size(); ii < ll; ii++) { _media.get(ii).viewLocationDidChange(dx, dy); // depends on control dependency: [for], data = [ii] } } }
public class class_name { public static boolean matches(PrecedencedSelfDescribing self, Matcher<?> matcher, Object item, Description mismatch, String message) { if (message == null) { return matches(self, matcher, item, mismatch); } boolean paren = useParen(self, matcher); if (paren) message = message.replace("$1", "($1)"); return QuickDiagnose.matches(matcher, item, mismatch, message); } }
public class class_name { public static boolean matches(PrecedencedSelfDescribing self, Matcher<?> matcher, Object item, Description mismatch, String message) { if (message == null) { return matches(self, matcher, item, mismatch); // depends on control dependency: [if], data = [none] } boolean paren = useParen(self, matcher); if (paren) message = message.replace("$1", "($1)"); return QuickDiagnose.matches(matcher, item, mismatch, message); } }
public class class_name { public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) { Content serializedSummariesTree = writer.getSerializedSummariesHeader(); PackageDoc[] packages = configuration.packages; for (int i = 0; i < packages.length; i++) { currentPackage = packages[i]; buildChildren(node, serializedSummariesTree); } serializedTree.addContent(writer.getSerializedContent( serializedSummariesTree)); } }
public class class_name { public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) { Content serializedSummariesTree = writer.getSerializedSummariesHeader(); PackageDoc[] packages = configuration.packages; for (int i = 0; i < packages.length; i++) { currentPackage = packages[i]; // depends on control dependency: [for], data = [i] buildChildren(node, serializedSummariesTree); // depends on control dependency: [for], data = [none] } serializedTree.addContent(writer.getSerializedContent( serializedSummariesTree)); } }
public class class_name { public void paintPerf (Graphics2D gfx) { if (_perfRect != null && FrameManager._perfDebug.getValue()) { gfx.setClip(null); _perfLabel.render(gfx, _perfRect.x, _perfRect.y); } } }
public class class_name { public void paintPerf (Graphics2D gfx) { if (_perfRect != null && FrameManager._perfDebug.getValue()) { gfx.setClip(null); // depends on control dependency: [if], data = [none] _perfLabel.render(gfx, _perfRect.x, _perfRect.y); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public AbstractHttpEntity harvest(long generation) { DecoderHelper decoder = null; DataFileWriter<GenericRecord> fileWriter = null; ByteBufferEntity entity = null; //Now iterate over records and write Iterator<GenericRecord> itr = m_records.iterator(); try { while (itr.hasNext()) { GenericRecord record = itr.next(); if (decoder == null) { decoder = decoder(generation, record.getSchema()); } fileWriter = decoder.m_fileWriter; fileWriter.append(record); itr.remove(); } if (fileWriter != null) { fileWriter.flush(); } if (decoder != null) { entity = new ByteBufferEntity(decoder.m_bbos.toByteBuffer(), AvroContentType); } } catch (IOException e) { throw new BulkException("failed to append to the avro data container", e); } finally { if (decoder != null) { decoder.m_bbos.reset(); } m_records.clear(); } return entity; } }
public class class_name { @Override public AbstractHttpEntity harvest(long generation) { DecoderHelper decoder = null; DataFileWriter<GenericRecord> fileWriter = null; ByteBufferEntity entity = null; //Now iterate over records and write Iterator<GenericRecord> itr = m_records.iterator(); try { while (itr.hasNext()) { GenericRecord record = itr.next(); if (decoder == null) { decoder = decoder(generation, record.getSchema()); // depends on control dependency: [if], data = [none] } fileWriter = decoder.m_fileWriter; // depends on control dependency: [while], data = [none] fileWriter.append(record); // depends on control dependency: [while], data = [none] itr.remove(); // depends on control dependency: [while], data = [none] } if (fileWriter != null) { fileWriter.flush(); // depends on control dependency: [if], data = [none] } if (decoder != null) { entity = new ByteBufferEntity(decoder.m_bbos.toByteBuffer(), AvroContentType); // depends on control dependency: [if], data = [(decoder] } } catch (IOException e) { throw new BulkException("failed to append to the avro data container", e); } // depends on control dependency: [catch], data = [none] finally { if (decoder != null) { decoder.m_bbos.reset(); // depends on control dependency: [if], data = [none] } m_records.clear(); } return entity; } }
public class class_name { public static boolean setAttribute(String word, String... natures) { if (natures == null) return false; Nature[] natureArray = new Nature[natures.length]; for (int i = 0; i < natureArray.length; i++) { natureArray[i] = Nature.create(natures[i]); } return setAttribute(word, natureArray); } }
public class class_name { public static boolean setAttribute(String word, String... natures) { if (natures == null) return false; Nature[] natureArray = new Nature[natures.length]; for (int i = 0; i < natureArray.length; i++) { natureArray[i] = Nature.create(natures[i]); // depends on control dependency: [for], data = [i] } return setAttribute(word, natureArray); } }
public class class_name { @Trivial // disable autotrace because tracing of the JCache operations will include all of the useful information void configureMonitoring(String cacheName) { final boolean trace = TraceComponent.isAnyTracingEnabled(); boolean enable = monitorRef.get() != null; if (trace && tc.isDebugEnabled()) CacheHashMap.tcInvoke(tcCacheManager, "enableManagement", cacheName, enable); cacheManager.enableManagement(cacheName, enable); if (trace && tc.isDebugEnabled()) { CacheHashMap.tcReturn(tcCacheManager, "enableManagement"); CacheHashMap.tcInvoke(tcCacheManager, "enableStatistics", cacheName, enable); } cacheManager.enableStatistics(cacheName, enable); if (trace && tc.isDebugEnabled()) CacheHashMap.tcReturn(tcCacheManager, "enableStatistics"); } }
public class class_name { @Trivial // disable autotrace because tracing of the JCache operations will include all of the useful information void configureMonitoring(String cacheName) { final boolean trace = TraceComponent.isAnyTracingEnabled(); boolean enable = monitorRef.get() != null; if (trace && tc.isDebugEnabled()) CacheHashMap.tcInvoke(tcCacheManager, "enableManagement", cacheName, enable); cacheManager.enableManagement(cacheName, enable); if (trace && tc.isDebugEnabled()) { CacheHashMap.tcReturn(tcCacheManager, "enableManagement"); // depends on control dependency: [if], data = [none] CacheHashMap.tcInvoke(tcCacheManager, "enableStatistics", cacheName, enable); // depends on control dependency: [if], data = [none] } cacheManager.enableStatistics(cacheName, enable); if (trace && tc.isDebugEnabled()) CacheHashMap.tcReturn(tcCacheManager, "enableStatistics"); } }
public class class_name { private void extractJsonPathValidateExpressions( Element validateElement, Map<String, Object> validateJsonPathExpressions) { //check for jsonPath validation - old style with direct attribute String pathExpression = validateElement.getAttribute("path"); if (JsonPathMessageValidationContext.isJsonPathExpression(pathExpression)) { validateJsonPathExpressions.put(pathExpression, validateElement.getAttribute("value")); } //check for jsonPath validation elements - new style preferred ValidateMessageParserUtil.parseJsonPathElements(validateElement, validateJsonPathExpressions); } }
public class class_name { private void extractJsonPathValidateExpressions( Element validateElement, Map<String, Object> validateJsonPathExpressions) { //check for jsonPath validation - old style with direct attribute String pathExpression = validateElement.getAttribute("path"); if (JsonPathMessageValidationContext.isJsonPathExpression(pathExpression)) { validateJsonPathExpressions.put(pathExpression, validateElement.getAttribute("value")); // depends on control dependency: [if], data = [none] } //check for jsonPath validation elements - new style preferred ValidateMessageParserUtil.parseJsonPathElements(validateElement, validateJsonPathExpressions); } }
public class class_name { public String getDescription() { String result = super.getDescription(); if (result == null) { switch (this.code) { case 100: result = "The client should continue with its request"; break; case 101: result = "The server is willing to change the application protocol being used on this connection"; break; case 102: result = "Interim response used to inform the client that the server has accepted the complete request, but has not yet completed it"; break; case 200: result = "The request has succeeded"; break; case 201: result = "The request has been fulfilled and resulted in a new resource being created"; break; case 202: result = "The request has been accepted for processing, but the processing has not been completed"; break; case 203: result = "The returned metainformation is not the definitive set as available from the origin server"; break; case 204: result = "The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation"; break; case 205: result = "The server has fulfilled the request and the user agent should reset the document view which caused the request to be sent"; break; case 206: result = "The server has fulfilled the partial get request for the resource"; break; case 207: result = "Provides status for multiple independent operations"; break; case 300: result = "The requested resource corresponds to any one of a set of representations"; break; case 301: result = "The requested resource has been assigned a new permanent URI"; break; case 302: result = "The requested resource can be found under a different URI"; break; case 303: result = "The response to the request can be found under a different URI"; break; case 304: result = "The client has performed a conditional GET request and the document has not been modified"; break; case 305: result = "The requested resource must be accessed through the proxy given by the location field"; break; case 307: result = "The requested resource resides temporarily under a different URI"; break; case 400: result = "The request could not be understood by the server due to malformed syntax"; break; case 401: result = "The request requires user authentication"; break; case 402: result = "This code is reserved for future use"; break; case 403: result = "The server understood the request, but is refusing to fulfill it"; break; case 404: result = "The server has not found anything matching the request URI"; break; case 405: result = "The method specified in the request is not allowed for the resource identified by the request URI"; break; case 406: result = "The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request"; break; case 407: result = "This code is similar to Unauthorized, but indicates that the client must first authenticate itself with the proxy"; break; case 408: result = "The client did not produce a request within the time that the server was prepared to wait"; break; case 409: result = "The request could not be completed due to a conflict with the current state of the resource"; break; case 410: result = "The requested resource is no longer available at the server and no forwarding address is known"; break; case 411: result = "The server refuses to accept the request without a defined content length"; break; case 412: result = "The precondition given in one or more of the request header fields evaluated to false when it was tested on the server"; break; case 413: result = "The server is refusing to process a request because the request entity is larger than the server is willing or able to process"; break; case 414: result = "The server is refusing to service the request because the request URI is longer than the server is willing to interpret"; break; case 415: result = "The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method"; break; case 416: result = "For byte ranges, this means that the first byte position were greater than the current length of the selected resource"; break; case 417: result = "The expectation given in the request header could not be met by this server"; break; case 422: result = "The server understands the content type of the request entity and the syntax of the request entity is correct but was unable to process the contained instructions"; break; case 423: result = "The source or destination resource of a method is locked"; break; case 424: result = "The method could not be performed on the resource because the requested action depended on another action and that action failed"; break; case 500: result = "The server encountered an unexpected condition which prevented it from fulfilling the request"; break; case 501: result = "The server does not support the functionality required to fulfill the request"; break; case 502: result = "The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request"; break; case 503: result = "The server is currently unable to handle the request due to a temporary overloading or maintenance of the server"; break; case 504: result = "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request"; break; case 505: result = "The server does not support, or refuses to support, the protocol version that was used in the request message"; break; case 507: result = "The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request"; break; case 1000: result = "The connector failed to connect to the server"; break; case 1001: result = "The connector failed to complete the communication with the server"; break; case 1002: result = "The connector encountered an unexpected condition which prevented it from fulfilling the request"; break; } } return result; } }
public class class_name { public String getDescription() { String result = super.getDescription(); if (result == null) { switch (this.code) { // depends on control dependency: [if], data = [none] case 100: result = "The client should continue with its request"; break; case 101: result = "The server is willing to change the application protocol being used on this connection"; break; case 102: result = "Interim response used to inform the client that the server has accepted the complete request, but has not yet completed it"; break; case 200: result = "The request has succeeded"; break; case 201: result = "The request has been fulfilled and resulted in a new resource being created"; break; case 202: result = "The request has been accepted for processing, but the processing has not been completed"; break; case 203: result = "The returned metainformation is not the definitive set as available from the origin server"; break; case 204: result = "The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation"; break; case 205: result = "The server has fulfilled the request and the user agent should reset the document view which caused the request to be sent"; break; case 206: result = "The server has fulfilled the partial get request for the resource"; break; case 207: result = "Provides status for multiple independent operations"; break; case 300: result = "The requested resource corresponds to any one of a set of representations"; break; case 301: result = "The requested resource has been assigned a new permanent URI"; break; case 302: result = "The requested resource can be found under a different URI"; break; case 303: result = "The response to the request can be found under a different URI"; break; case 304: result = "The client has performed a conditional GET request and the document has not been modified"; break; case 305: result = "The requested resource must be accessed through the proxy given by the location field"; break; case 307: result = "The requested resource resides temporarily under a different URI"; break; case 400: result = "The request could not be understood by the server due to malformed syntax"; break; case 401: result = "The request requires user authentication"; break; case 402: result = "This code is reserved for future use"; break; case 403: result = "The server understood the request, but is refusing to fulfill it"; break; case 404: result = "The server has not found anything matching the request URI"; break; case 405: result = "The method specified in the request is not allowed for the resource identified by the request URI"; break; case 406: result = "The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request"; break; case 407: result = "This code is similar to Unauthorized, but indicates that the client must first authenticate itself with the proxy"; break; case 408: result = "The client did not produce a request within the time that the server was prepared to wait"; break; case 409: result = "The request could not be completed due to a conflict with the current state of the resource"; break; case 410: result = "The requested resource is no longer available at the server and no forwarding address is known"; break; case 411: result = "The server refuses to accept the request without a defined content length"; break; case 412: result = "The precondition given in one or more of the request header fields evaluated to false when it was tested on the server"; break; case 413: result = "The server is refusing to process a request because the request entity is larger than the server is willing or able to process"; break; case 414: result = "The server is refusing to service the request because the request URI is longer than the server is willing to interpret"; break; case 415: result = "The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method"; break; case 416: result = "For byte ranges, this means that the first byte position were greater than the current length of the selected resource"; break; case 417: result = "The expectation given in the request header could not be met by this server"; break; case 422: result = "The server understands the content type of the request entity and the syntax of the request entity is correct but was unable to process the contained instructions"; break; case 423: result = "The source or destination resource of a method is locked"; break; case 424: result = "The method could not be performed on the resource because the requested action depended on another action and that action failed"; break; case 500: result = "The server encountered an unexpected condition which prevented it from fulfilling the request"; break; case 501: result = "The server does not support the functionality required to fulfill the request"; break; case 502: result = "The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request"; break; case 503: result = "The server is currently unable to handle the request due to a temporary overloading or maintenance of the server"; break; case 504: result = "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request"; break; case 505: result = "The server does not support, or refuses to support, the protocol version that was used in the request message"; break; case 507: result = "The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request"; break; case 1000: result = "The connector failed to connect to the server"; break; case 1001: result = "The connector failed to complete the communication with the server"; break; case 1002: result = "The connector encountered an unexpected condition which prevented it from fulfilling the request"; break; } } return result; } }
public class class_name { final boolean resolve(final byte[] code, final int bytecodeOffset) { this.flags |= FLAG_RESOLVED; this.bytecodeOffset = bytecodeOffset; if (forwardReferences == null) { return false; } boolean hasAsmInstructions = false; for (int i = forwardReferences[0]; i > 0; i -= 2) { final int sourceInsnBytecodeOffset = forwardReferences[i - 1]; final int reference = forwardReferences[i]; final int relativeOffset = bytecodeOffset - sourceInsnBytecodeOffset; int handle = reference & FORWARD_REFERENCE_HANDLE_MASK; if ((reference & FORWARD_REFERENCE_TYPE_MASK) == FORWARD_REFERENCE_TYPE_SHORT) { if (relativeOffset < Short.MIN_VALUE || relativeOffset > Short.MAX_VALUE) { // Change the opcode of the jump instruction, in order to be able to find it later in // ClassReader. These ASM specific opcodes are similar to jump instruction opcodes, except // that the 2 bytes offset is unsigned (and can therefore represent values from 0 to // 65535, which is sufficient since the size of a method is limited to 65535 bytes). int opcode = code[sourceInsnBytecodeOffset] & 0xFF; if (opcode < Opcodes.IFNULL) { // Change IFEQ ... JSR to ASM_IFEQ ... ASM_JSR. code[sourceInsnBytecodeOffset] = (byte) (opcode + Constants.ASM_OPCODE_DELTA); } else { // Change IFNULL and IFNONNULL to ASM_IFNULL and ASM_IFNONNULL. code[sourceInsnBytecodeOffset] = (byte) (opcode + Constants.ASM_IFNULL_OPCODE_DELTA); } hasAsmInstructions = true; } code[handle++] = (byte) (relativeOffset >>> 8); code[handle] = (byte) relativeOffset; } else { code[handle++] = (byte) (relativeOffset >>> 24); code[handle++] = (byte) (relativeOffset >>> 16); code[handle++] = (byte) (relativeOffset >>> 8); code[handle] = (byte) relativeOffset; } } return hasAsmInstructions; } }
public class class_name { final boolean resolve(final byte[] code, final int bytecodeOffset) { this.flags |= FLAG_RESOLVED; this.bytecodeOffset = bytecodeOffset; if (forwardReferences == null) { return false; // depends on control dependency: [if], data = [none] } boolean hasAsmInstructions = false; for (int i = forwardReferences[0]; i > 0; i -= 2) { final int sourceInsnBytecodeOffset = forwardReferences[i - 1]; final int reference = forwardReferences[i]; final int relativeOffset = bytecodeOffset - sourceInsnBytecodeOffset; int handle = reference & FORWARD_REFERENCE_HANDLE_MASK; if ((reference & FORWARD_REFERENCE_TYPE_MASK) == FORWARD_REFERENCE_TYPE_SHORT) { if (relativeOffset < Short.MIN_VALUE || relativeOffset > Short.MAX_VALUE) { // Change the opcode of the jump instruction, in order to be able to find it later in // ClassReader. These ASM specific opcodes are similar to jump instruction opcodes, except // that the 2 bytes offset is unsigned (and can therefore represent values from 0 to // 65535, which is sufficient since the size of a method is limited to 65535 bytes). int opcode = code[sourceInsnBytecodeOffset] & 0xFF; if (opcode < Opcodes.IFNULL) { // Change IFEQ ... JSR to ASM_IFEQ ... ASM_JSR. code[sourceInsnBytecodeOffset] = (byte) (opcode + Constants.ASM_OPCODE_DELTA); // depends on control dependency: [if], data = [(opcode] } else { // Change IFNULL and IFNONNULL to ASM_IFNULL and ASM_IFNONNULL. code[sourceInsnBytecodeOffset] = (byte) (opcode + Constants.ASM_IFNULL_OPCODE_DELTA); // depends on control dependency: [if], data = [(opcode] } hasAsmInstructions = true; // depends on control dependency: [if], data = [none] } code[handle++] = (byte) (relativeOffset >>> 8); // depends on control dependency: [if], data = [none] code[handle] = (byte) relativeOffset; // depends on control dependency: [if], data = [none] } else { code[handle++] = (byte) (relativeOffset >>> 24); // depends on control dependency: [if], data = [none] code[handle++] = (byte) (relativeOffset >>> 16); // depends on control dependency: [if], data = [none] code[handle++] = (byte) (relativeOffset >>> 8); // depends on control dependency: [if], data = [none] code[handle] = (byte) relativeOffset; // depends on control dependency: [if], data = [none] } } return hasAsmInstructions; } }
public class class_name { private List<DropForeignKeyConstraintChange> generateChildren(Database database) { // Make a new list List<DropForeignKeyConstraintChange> childDropChanges = new ArrayList<>(); try { SnapshotControl control = new SnapshotControl(database); control.getTypesToInclude().add(ForeignKey.class); CatalogAndSchema catalogAndSchema = new CatalogAndSchema(getBaseTableCatalogName(), getBaseTableSchemaName()); catalogAndSchema = catalogAndSchema.standardize(database); Table target = SnapshotGeneratorFactory.getInstance().createSnapshot( new Table(catalogAndSchema.getCatalogName(), catalogAndSchema.getSchemaName(), database.correctObjectName(getBaseTableName(), Table.class)) , database); List<ForeignKey> results = ((target == null) ? null : target.getOutgoingForeignKeys()); Set<String> handledConstraints = new HashSet<>(); if ((results != null) && (!results.isEmpty())) { for (ForeignKey fk : results) { Table baseTable = fk.getForeignKeyTable(); String constraintName = fk.getName(); if (DatabaseObjectComparatorFactory.getInstance().isSameObject( baseTable, target, null, database )) { if( !handledConstraints.contains(constraintName)) { DropForeignKeyConstraintChange dropForeignKeyConstraintChange = new DropForeignKeyConstraintChange(); dropForeignKeyConstraintChange.setBaseTableSchemaName(getBaseTableSchemaName()); dropForeignKeyConstraintChange.setBaseTableName(baseTableName); dropForeignKeyConstraintChange.setConstraintName(constraintName); childDropChanges.add(dropForeignKeyConstraintChange); handledConstraints.add(constraintName); } } else { throw new UnexpectedLiquibaseException( "Expected to return only foreign keys for base table name: " + getBaseTableName() + " and got results for table: " + baseTableName); } } } return childDropChanges; } catch (DatabaseException | InvalidExampleException e) { throw new UnexpectedLiquibaseException("Failed to find foreign keys for table: " + getBaseTableName(), e); } } }
public class class_name { private List<DropForeignKeyConstraintChange> generateChildren(Database database) { // Make a new list List<DropForeignKeyConstraintChange> childDropChanges = new ArrayList<>(); try { SnapshotControl control = new SnapshotControl(database); control.getTypesToInclude().add(ForeignKey.class); // depends on control dependency: [try], data = [none] CatalogAndSchema catalogAndSchema = new CatalogAndSchema(getBaseTableCatalogName(), getBaseTableSchemaName()); catalogAndSchema = catalogAndSchema.standardize(database); // depends on control dependency: [try], data = [none] Table target = SnapshotGeneratorFactory.getInstance().createSnapshot( new Table(catalogAndSchema.getCatalogName(), catalogAndSchema.getSchemaName(), database.correctObjectName(getBaseTableName(), Table.class)) , database); List<ForeignKey> results = ((target == null) ? null : target.getOutgoingForeignKeys()); Set<String> handledConstraints = new HashSet<>(); if ((results != null) && (!results.isEmpty())) { for (ForeignKey fk : results) { Table baseTable = fk.getForeignKeyTable(); String constraintName = fk.getName(); if (DatabaseObjectComparatorFactory.getInstance().isSameObject( baseTable, target, null, database )) { if( !handledConstraints.contains(constraintName)) { DropForeignKeyConstraintChange dropForeignKeyConstraintChange = new DropForeignKeyConstraintChange(); dropForeignKeyConstraintChange.setBaseTableSchemaName(getBaseTableSchemaName()); // depends on control dependency: [if], data = [none] dropForeignKeyConstraintChange.setBaseTableName(baseTableName); // depends on control dependency: [if], data = [none] dropForeignKeyConstraintChange.setConstraintName(constraintName); // depends on control dependency: [if], data = [none] childDropChanges.add(dropForeignKeyConstraintChange); // depends on control dependency: [if], data = [none] handledConstraints.add(constraintName); // depends on control dependency: [if], data = [none] } } else { throw new UnexpectedLiquibaseException( "Expected to return only foreign keys for base table name: " + getBaseTableName() + " and got results for table: " + baseTableName); } } } return childDropChanges; // depends on control dependency: [try], data = [none] } catch (DatabaseException | InvalidExampleException e) { throw new UnexpectedLiquibaseException("Failed to find foreign keys for table: " + getBaseTableName(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private String createForwardCurve(ScheduleInterface swapTenorDefinition, String forwardCurveName) { /* * Temporary "hack" - we try to infer index maturity codes from curve name. */ String indexMaturityCode = null; if(forwardCurveName.contains("_12M") || forwardCurveName.contains("-12M") || forwardCurveName.contains(" 12M")) { indexMaturityCode = "12M"; } if(forwardCurveName.contains("_1M") || forwardCurveName.contains("-1M") || forwardCurveName.contains(" 1M")) { indexMaturityCode = "1M"; } if(forwardCurveName.contains("_6M") || forwardCurveName.contains("-6M") || forwardCurveName.contains(" 6M")) { indexMaturityCode = "6M"; } if(forwardCurveName.contains("_3M") || forwardCurveName.contains("-3M") || forwardCurveName.contains(" 3M")) { indexMaturityCode = "3M"; } if(forwardCurveName == null || forwardCurveName.isEmpty()) { return null; } // Check if the curves exists, if not create it CurveInterface curve = model.getCurve(forwardCurveName); CurveInterface forwardCurve = null; if(curve == null) { // Create a new forward curve if(isUseForwardCurve) { curve = new ForwardCurve(forwardCurveName, swapTenorDefinition.getReferenceDate(), indexMaturityCode, ForwardCurve.InterpolationEntityForward.FORWARD, null); } else { // Alternative: Model the forward curve through an underlying discount curve. curve = DiscountCurve.createDiscountCurveFromDiscountFactors(forwardCurveName, new double[] { 0.0 }, new double[] { 1.0 }); model = model.addCurves(curve); } } // Check if the curve is a discount curve, if yes - create a forward curve wrapper. if(DiscountCurveInterface.class.isInstance(curve)) { /* * If the specified forward curve exits as a discount curve, we generate a forward curve * by wrapping the discount curve and calculating the * forward from discount factors using the formula (df(T)/df(T+Delta T) - 1) / Delta T). * * If no index maturity is used, the forward curve is interpreted "single curve", i.e. * T+Delta T is always the payment. */ forwardCurve = new ForwardCurveFromDiscountCurve(curve.getName(), swapTenorDefinition.getReferenceDate(), indexMaturityCode); } else { // Use a given forward curve forwardCurve = curve; } model = model.addCurves(forwardCurve); return forwardCurve.getName(); } }
public class class_name { private String createForwardCurve(ScheduleInterface swapTenorDefinition, String forwardCurveName) { /* * Temporary "hack" - we try to infer index maturity codes from curve name. */ String indexMaturityCode = null; if(forwardCurveName.contains("_12M") || forwardCurveName.contains("-12M") || forwardCurveName.contains(" 12M")) { indexMaturityCode = "12M"; // depends on control dependency: [if], data = [none] } if(forwardCurveName.contains("_1M") || forwardCurveName.contains("-1M") || forwardCurveName.contains(" 1M")) { indexMaturityCode = "1M"; // depends on control dependency: [if], data = [none] } if(forwardCurveName.contains("_6M") || forwardCurveName.contains("-6M") || forwardCurveName.contains(" 6M")) { indexMaturityCode = "6M"; // depends on control dependency: [if], data = [none] } if(forwardCurveName.contains("_3M") || forwardCurveName.contains("-3M") || forwardCurveName.contains(" 3M")) { indexMaturityCode = "3M"; // depends on control dependency: [if], data = [none] } if(forwardCurveName == null || forwardCurveName.isEmpty()) { return null; // depends on control dependency: [if], data = [none] } // Check if the curves exists, if not create it CurveInterface curve = model.getCurve(forwardCurveName); CurveInterface forwardCurve = null; if(curve == null) { // Create a new forward curve if(isUseForwardCurve) { curve = new ForwardCurve(forwardCurveName, swapTenorDefinition.getReferenceDate(), indexMaturityCode, ForwardCurve.InterpolationEntityForward.FORWARD, null); // depends on control dependency: [if], data = [none] } else { // Alternative: Model the forward curve through an underlying discount curve. curve = DiscountCurve.createDiscountCurveFromDiscountFactors(forwardCurveName, new double[] { 0.0 }, new double[] { 1.0 }); // depends on control dependency: [if], data = [none] model = model.addCurves(curve); // depends on control dependency: [if], data = [none] } } // Check if the curve is a discount curve, if yes - create a forward curve wrapper. if(DiscountCurveInterface.class.isInstance(curve)) { /* * If the specified forward curve exits as a discount curve, we generate a forward curve * by wrapping the discount curve and calculating the * forward from discount factors using the formula (df(T)/df(T+Delta T) - 1) / Delta T). * * If no index maturity is used, the forward curve is interpreted "single curve", i.e. * T+Delta T is always the payment. */ forwardCurve = new ForwardCurveFromDiscountCurve(curve.getName(), swapTenorDefinition.getReferenceDate(), indexMaturityCode); // depends on control dependency: [if], data = [none] } else { // Use a given forward curve forwardCurve = curve; // depends on control dependency: [if], data = [none] } model = model.addCurves(forwardCurve); return forwardCurve.getName(); } }
public class class_name { public void marshall(ListPublicKeysRequest listPublicKeysRequest, ProtocolMarshaller protocolMarshaller) { if (listPublicKeysRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listPublicKeysRequest.getStartTime(), STARTTIME_BINDING); protocolMarshaller.marshall(listPublicKeysRequest.getEndTime(), ENDTIME_BINDING); protocolMarshaller.marshall(listPublicKeysRequest.getNextToken(), NEXTTOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ListPublicKeysRequest listPublicKeysRequest, ProtocolMarshaller protocolMarshaller) { if (listPublicKeysRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listPublicKeysRequest.getStartTime(), STARTTIME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listPublicKeysRequest.getEndTime(), ENDTIME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listPublicKeysRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override final public void destroy() throws ResourceException { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "destroy"); } // Invalidate all of the sessions for (final Iterator iterator = _sessions.iterator(); iterator.hasNext();) { final Object object = iterator.next(); if (object instanceof JmsJcaSessionImpl) { final JmsJcaSessionImpl session = (JmsJcaSessionImpl) object; session.invalidate(); } } // Empty the set _sessions.clear(); try { // Deregister the connection listener _coreConnection.removeConnectionListener(_connectionListener); // Close the core connection // when destroy calls close connections then connection cannot be reset for future usage so force close by passing boolean true. - PM39926 _coreConnection.close(true); } catch (final SIConnectionLostException exception) { // No FFDC code needed // d352473 // We are remote to the ME and the ME connection has been lost // we shall surpress this exception as we want the destroy to complete } catch (final SIConnectionDroppedException exception) { // No FFDC code needed // d352473 // We are remote to the ME and the ME connection has been dropped // we shall surpress this exception as we want the destroy to complete } catch (final SIException exception) { FFDCFilter.processException(exception, CLASS_NAME + "destroy", "1:408:1.91", this); throw new ResourceException(NLS.getFormattedMessage( "EXCEPTION_RECEIVED_CWSJR1110", new Object[] { exception, "createManagedConnection" }, null), exception); } catch (final SIErrorException exception) { FFDCFilter.processException(exception, CLASS_NAME + "destroy", "1:416:1.91", this); throw new ResourceException(NLS.getFormattedMessage( "EXCEPTION_RECEIVED_CWSJR1110", new Object[] { exception, "createManagedConnection" }, null), exception); } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, "destroy"); } } }
public class class_name { @Override final public void destroy() throws ResourceException { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "destroy"); } // Invalidate all of the sessions for (final Iterator iterator = _sessions.iterator(); iterator.hasNext();) { final Object object = iterator.next(); if (object instanceof JmsJcaSessionImpl) { final JmsJcaSessionImpl session = (JmsJcaSessionImpl) object; session.invalidate(); // depends on control dependency: [if], data = [none] } } // Empty the set _sessions.clear(); try { // Deregister the connection listener _coreConnection.removeConnectionListener(_connectionListener); // Close the core connection // when destroy calls close connections then connection cannot be reset for future usage so force close by passing boolean true. - PM39926 _coreConnection.close(true); } catch (final SIConnectionLostException exception) { // No FFDC code needed // d352473 // We are remote to the ME and the ME connection has been lost // we shall surpress this exception as we want the destroy to complete } catch (final SIConnectionDroppedException exception) { // No FFDC code needed // d352473 // We are remote to the ME and the ME connection has been dropped // we shall surpress this exception as we want the destroy to complete } catch (final SIException exception) { FFDCFilter.processException(exception, CLASS_NAME + "destroy", "1:408:1.91", this); throw new ResourceException(NLS.getFormattedMessage( "EXCEPTION_RECEIVED_CWSJR1110", new Object[] { exception, "createManagedConnection" }, null), exception); } catch (final SIErrorException exception) { FFDCFilter.processException(exception, CLASS_NAME + "destroy", "1:416:1.91", this); throw new ResourceException(NLS.getFormattedMessage( "EXCEPTION_RECEIVED_CWSJR1110", new Object[] { exception, "createManagedConnection" }, null), exception); } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, "destroy"); } } }
public class class_name { public ProcessRecord setProcessState(ProcessRecord processRecord, ProcessState newState) throws IOException { Put put = new Put(keyConv.toBytes(processRecord.getKey())); put.addColumn(Constants.INFO_FAM_BYTES, Constants.PROCESSING_STATE_COLUMN_BYTES, Bytes.toBytes(newState.getCode())); Table processRecordTable = null; try { processRecordTable = hbaseConnection .getTable(TableName.valueOf(Constants.JOB_FILE_PROCESS_TABLE)); processRecordTable.put(put); } finally { if (processRecordTable != null) { processRecordTable.close(); } } ProcessRecord updatedProcessRecord = new ProcessRecord( processRecord.getCluster(), newState, processRecord.getMinModificationTimeMillis(), processRecord.getMaxModificationTimeMillis(), processRecord.getProcessedJobFiles(), processRecord.getProcessFile(), processRecord.getMinJobId(), processRecord.getMaxJobId()); return updatedProcessRecord; } }
public class class_name { public ProcessRecord setProcessState(ProcessRecord processRecord, ProcessState newState) throws IOException { Put put = new Put(keyConv.toBytes(processRecord.getKey())); put.addColumn(Constants.INFO_FAM_BYTES, Constants.PROCESSING_STATE_COLUMN_BYTES, Bytes.toBytes(newState.getCode())); Table processRecordTable = null; try { processRecordTable = hbaseConnection .getTable(TableName.valueOf(Constants.JOB_FILE_PROCESS_TABLE)); processRecordTable.put(put); } finally { if (processRecordTable != null) { processRecordTable.close(); // depends on control dependency: [if], data = [none] } } ProcessRecord updatedProcessRecord = new ProcessRecord( processRecord.getCluster(), newState, processRecord.getMinModificationTimeMillis(), processRecord.getMaxModificationTimeMillis(), processRecord.getProcessedJobFiles(), processRecord.getProcessFile(), processRecord.getMinJobId(), processRecord.getMaxJobId()); return updatedProcessRecord; } }
public class class_name { static List<String> pathParts(String path) { String[] pathParts = path.split("/"); List<String> parts = new ArrayList<>(pathParts.length); String pathSoFar = ""; for (String pathPart : pathParts) { if (!pathPart.equals("")) { pathSoFar += "/" + pathPart; parts.add(pathSoFar); } } return parts; } }
public class class_name { static List<String> pathParts(String path) { String[] pathParts = path.split("/"); List<String> parts = new ArrayList<>(pathParts.length); String pathSoFar = ""; for (String pathPart : pathParts) { if (!pathPart.equals("")) { pathSoFar += "/" + pathPart; // depends on control dependency: [if], data = [none] parts.add(pathSoFar); // depends on control dependency: [if], data = [none] } } return parts; } }
public class class_name { @Override public void enterSourceElement(QueryParser.SourceElementContext ctx) { queryExprMeta = QueryExprMeta.create(); infoMap.put(ctx, queryExprMeta); // root source element if (ctx.getParent() instanceof QueryParser.SourceElementsContext) { queryExprMetaList.add(queryExprMeta); } else { QueryExprMeta parentInfo = infoMap.get(getParentSourceElement(ctx)).arguments(queryExprMeta); queryExprMeta.parent(parentInfo); } } }
public class class_name { @Override public void enterSourceElement(QueryParser.SourceElementContext ctx) { queryExprMeta = QueryExprMeta.create(); infoMap.put(ctx, queryExprMeta); // root source element if (ctx.getParent() instanceof QueryParser.SourceElementsContext) { queryExprMetaList.add(queryExprMeta); // depends on control dependency: [if], data = [none] } else { QueryExprMeta parentInfo = infoMap.get(getParentSourceElement(ctx)).arguments(queryExprMeta); queryExprMeta.parent(parentInfo); // depends on control dependency: [if], data = [none] } } }
public class class_name { private static void addProposalCommitteeeSummary(final String processedIn, final List<ProposalCommitteeeSummary> summary, final DocumentStatusContainer document) { if (document.getDocumentProposal() != null && document.getDocumentProposal().getProposal() != null) { final DocumentProposalData proposal = document.getDocumentProposal().getProposal(); if (proposal.getProcessedIn() != null && !proposal.getProcessedIn().isEmpty() && proposal.getCommittee() != null && !proposal.getCommittee().isEmpty() && proposal.getProcessedIn().contains(processedIn) && proposal.getChamber().length() <= "återförvisning till utskottet".length() && proposal.getChamber().length() >= "avslag".length()) { summary.add(new ProposalCommitteeeSummary(getCommittteeShortName(proposal), getDocumentName(document) , cleanupDecision(proposal.getChamber()) , document.getDocument().getHangarId())); } } } }
public class class_name { private static void addProposalCommitteeeSummary(final String processedIn, final List<ProposalCommitteeeSummary> summary, final DocumentStatusContainer document) { if (document.getDocumentProposal() != null && document.getDocumentProposal().getProposal() != null) { final DocumentProposalData proposal = document.getDocumentProposal().getProposal(); if (proposal.getProcessedIn() != null && !proposal.getProcessedIn().isEmpty() && proposal.getCommittee() != null && !proposal.getCommittee().isEmpty() && proposal.getProcessedIn().contains(processedIn) && proposal.getChamber().length() <= "återförvisning till utskottet".length() && proposal.getChamber().length() >= "avslag".length()) { summary.add(new ProposalCommitteeeSummary(getCommittteeShortName(proposal), getDocumentName(document) , cleanupDecision(proposal.getChamber()) , document.getDocument().getHangarId())); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void delTemplateEntry(String template, Object entry) { if (htod.delTemplateEntry(template, entry) == HTODDynacache.DISK_EXCEPTION) { stopOnError(this.htod.diskCacheException); } } }
public class class_name { public void delTemplateEntry(String template, Object entry) { if (htod.delTemplateEntry(template, entry) == HTODDynacache.DISK_EXCEPTION) { stopOnError(this.htod.diskCacheException); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void updateResourceInCache(ResourceType type, String location) { try { if (ResourceType.NAMESPACES.equals(type)) { rebuildNamespace(location); } else { downloadResource(location, type); } reportable.output("Updated resource: " + location); } catch (ResourceDownloadError e) { reportable.error(e.getUserFacingMessage()); } catch (IndexingFailure e) { reportable.error(e.getUserFacingMessage()); } catch (IOException e) { logExceptionSimple(location, e); } } }
public class class_name { @Override public void updateResourceInCache(ResourceType type, String location) { try { if (ResourceType.NAMESPACES.equals(type)) { rebuildNamespace(location); // depends on control dependency: [if], data = [none] } else { downloadResource(location, type); // depends on control dependency: [if], data = [none] } reportable.output("Updated resource: " + location); // depends on control dependency: [try], data = [none] } catch (ResourceDownloadError e) { reportable.error(e.getUserFacingMessage()); } catch (IndexingFailure e) { // depends on control dependency: [catch], data = [none] reportable.error(e.getUserFacingMessage()); } catch (IOException e) { // depends on control dependency: [catch], data = [none] logExceptionSimple(location, e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private void fastAddAll(ArrayBackedSortedColumns other) { if (other.isInsertReversed() == isInsertReversed()) { cells = Arrays.copyOf(other.cells, other.cells.length); size = other.size; sortedSize = other.sortedSize; isSorted = other.isSorted; } else { if (cells.length < other.getColumnCount()) cells = new Cell[Math.max(MINIMAL_CAPACITY, other.getColumnCount())]; Iterator<Cell> iterator = reversed ? other.reverseIterator() : other.iterator(); while (iterator.hasNext()) cells[size++] = iterator.next(); sortedSize = size; isSorted = true; } } }
public class class_name { private void fastAddAll(ArrayBackedSortedColumns other) { if (other.isInsertReversed() == isInsertReversed()) { cells = Arrays.copyOf(other.cells, other.cells.length); // depends on control dependency: [if], data = [none] size = other.size; // depends on control dependency: [if], data = [none] sortedSize = other.sortedSize; // depends on control dependency: [if], data = [none] isSorted = other.isSorted; // depends on control dependency: [if], data = [none] } else { if (cells.length < other.getColumnCount()) cells = new Cell[Math.max(MINIMAL_CAPACITY, other.getColumnCount())]; Iterator<Cell> iterator = reversed ? other.reverseIterator() : other.iterator(); while (iterator.hasNext()) cells[size++] = iterator.next(); sortedSize = size; // depends on control dependency: [if], data = [none] isSorted = true; // depends on control dependency: [if], data = [none] } } }
public class class_name { private Node tryFoldGetElem(Node n, Node left, Node right) { checkArgument(n.isGetElem()); if (left.isObjectLit()) { return tryFoldObjectPropAccess(n, left, right); } if (left.isArrayLit()) { return tryFoldArrayAccess(n, left, right); } if (left.isString()) { return tryFoldStringArrayAccess(n, left, right); } return n; } }
public class class_name { private Node tryFoldGetElem(Node n, Node left, Node right) { checkArgument(n.isGetElem()); if (left.isObjectLit()) { return tryFoldObjectPropAccess(n, left, right); // depends on control dependency: [if], data = [none] } if (left.isArrayLit()) { return tryFoldArrayAccess(n, left, right); // depends on control dependency: [if], data = [none] } if (left.isString()) { return tryFoldStringArrayAccess(n, left, right); // depends on control dependency: [if], data = [none] } return n; } }
public class class_name { public String toLongString() { String plz = this.getCode(); if (this.hasLandeskennung()) { plz = toLongString(plz); } return plz; } }
public class class_name { public String toLongString() { String plz = this.getCode(); if (this.hasLandeskennung()) { plz = toLongString(plz); // depends on control dependency: [if], data = [none] } return plz; } }
public class class_name { public SIMPIterator getQueuedMessageIterator() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getQueuedMessageIterator"); List<ControlAdapter> messages = new ArrayList<ControlAdapter>(); NonLockingCursor cursor = null; MessageItem referredItem = null; try { cursor = consumerDispatcher.getReferenceStream().newNonLockingCursor(null); cursor.allowUnavailableItems(); MessageItemReference item = (MessageItemReference) cursor.next(); while(item != null) { try { referredItem = (MessageItem)item.getReferredItem(); if(referredItem != null) { // force the arrival time to be written to the jsMessage referredItem.forceCurrentMEArrivalTimeToJsMessage(); } // It's possible to get a null adapter back ControlAdapter cAdapter = item.getControlAdapter(); if(cAdapter != null) messages.add(cAdapter); item = (MessageItemReference) cursor.next(); } catch (NotInMessageStore ef) { // No FFDC code needed // The message has already been consumed. Trace the exception but allow processing to continue. SibTr.exception(tc, ef); } catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.runtime.LocalSubscriptionControl.getQueuedMessageIterator", "1:275:1.36", this); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.runtime.LocalSubscriptionControl.getQueuedMessageIterator", "1:281:1.36", SIMPUtils.getStackTrace(e) }); } } } catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.runtime.LocalSubscriptionControl.getQueuedMessageIterator", "1:292:1.36", this); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.runtime.LocalSubscriptionControl.getQueuedMessageIterator", "1:298:1.36", SIMPUtils.getStackTrace(e) }); } finally { if (cursor != null) cursor.finished(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getQueuedMessageIterator"); return new BasicSIMPIterator(messages.iterator()); } }
public class class_name { public SIMPIterator getQueuedMessageIterator() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getQueuedMessageIterator"); List<ControlAdapter> messages = new ArrayList<ControlAdapter>(); NonLockingCursor cursor = null; MessageItem referredItem = null; try { cursor = consumerDispatcher.getReferenceStream().newNonLockingCursor(null); // depends on control dependency: [try], data = [none] cursor.allowUnavailableItems(); // depends on control dependency: [try], data = [none] MessageItemReference item = (MessageItemReference) cursor.next(); while(item != null) { try { referredItem = (MessageItem)item.getReferredItem(); // depends on control dependency: [try], data = [none] if(referredItem != null) { // force the arrival time to be written to the jsMessage referredItem.forceCurrentMEArrivalTimeToJsMessage(); // depends on control dependency: [if], data = [none] } // It's possible to get a null adapter back ControlAdapter cAdapter = item.getControlAdapter(); if(cAdapter != null) messages.add(cAdapter); item = (MessageItemReference) cursor.next(); // depends on control dependency: [try], data = [none] } catch (NotInMessageStore ef) { // No FFDC code needed // The message has already been consumed. Trace the exception but allow processing to continue. SibTr.exception(tc, ef); } // depends on control dependency: [catch], data = [none] catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.runtime.LocalSubscriptionControl.getQueuedMessageIterator", "1:275:1.36", this); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.runtime.LocalSubscriptionControl.getQueuedMessageIterator", "1:281:1.36", SIMPUtils.getStackTrace(e) }); } // depends on control dependency: [catch], data = [none] } } catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.runtime.LocalSubscriptionControl.getQueuedMessageIterator", "1:292:1.36", this); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.runtime.LocalSubscriptionControl.getQueuedMessageIterator", "1:298:1.36", SIMPUtils.getStackTrace(e) }); } // depends on control dependency: [catch], data = [none] finally { if (cursor != null) cursor.finished(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getQueuedMessageIterator"); return new BasicSIMPIterator(messages.iterator()); } }
public class class_name { public static JaxRx getInstance(final String impl) { final String path = Systems.getSystems().get(impl); if (path == null) { throw new JaxRxException(404, "Unknown implementation: " + impl); } JaxRx jaxrx = INSTANCES.get(path); if (jaxrx == null) { try { jaxrx = (JaxRx)Class.forName(path).newInstance(); INSTANCES.put(path, jaxrx); } catch (final Exception ex) { throw new JaxRxException(ex); } } return jaxrx; } }
public class class_name { public static JaxRx getInstance(final String impl) { final String path = Systems.getSystems().get(impl); if (path == null) { throw new JaxRxException(404, "Unknown implementation: " + impl); } JaxRx jaxrx = INSTANCES.get(path); if (jaxrx == null) { try { jaxrx = (JaxRx)Class.forName(path).newInstance(); // depends on control dependency: [try], data = [none] INSTANCES.put(path, jaxrx); // depends on control dependency: [try], data = [none] } catch (final Exception ex) { throw new JaxRxException(ex); } // depends on control dependency: [catch], data = [none] } return jaxrx; } }
public class class_name { private JPanel getSpecialRuleValuePanel() { JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); GridBagConstraints cons = new GridBagConstraints(); cons.gridx = 0; cons.gridy = 0; cons.weightx = 0.0f; cons.anchor = GridBagConstraints.WEST; List<JCheckBox> ruleCheckboxes = new ArrayList<JCheckBox>(); List<JLabel> ruleLabels = new ArrayList<JLabel>(); List<JTextField> ruleValueFields = new ArrayList<JTextField>(); for(int i = 0; i < configurableRules.size(); i++) { Rule rule = configurableRules.get(i); JCheckBox ruleCheckbox = new JCheckBox(rule.getDescription()); ruleCheckboxes.add(ruleCheckbox); ruleCheckbox.setSelected(getEnabledState(rule)); cons.insets = new Insets(3, 0, 0, 0); panel.add(ruleCheckbox, cons); cons.insets = new Insets(0, 24, 0, 0); cons.gridy++; JLabel ruleLabel = new JLabel(rule.getConfigureText()); ruleLabels.add(ruleLabel); ruleLabel.setEnabled(ruleCheckbox.isSelected()); panel.add(ruleLabel, cons); cons.gridx++; int value = config.getConfigurableValue(rule.getId()); if(config.getConfigurableValue(rule.getId()) < 0) { value = rule.getDefaultValue(); } JTextField ruleValueField = new JTextField(Integer.toString(value), 2); ruleValueFields.add(ruleValueField); ruleValueField.setEnabled(ruleCheckbox.isSelected()); ruleValueField.setMinimumSize(new Dimension(35, 25)); // without this the box is just a few pixels small, but why? panel.add(ruleValueField, cons); ruleCheckbox.addActionListener(new ActionListener() { @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { ruleValueField.setEnabled(ruleCheckbox.isSelected()); ruleLabel.setEnabled(ruleCheckbox.isSelected()); if (ruleCheckbox.isSelected()) { config.getEnabledRuleIds().add(rule.getId()); config.getDisabledRuleIds().remove(rule.getId()); } else { config.getEnabledRuleIds().remove(rule.getId()); config.getDisabledRuleIds().add(rule.getId()); } } }); ruleValueField.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { changedUpdate(e); } @Override public void removeUpdate(DocumentEvent e) { changedUpdate(e); } @Override public void changedUpdate(DocumentEvent e) { try { int num = Integer.parseInt(ruleValueField.getText()); if (num < rule.getMinConfigurableValue()) { num = rule.getMinConfigurableValue(); ruleValueField.setForeground(Color.RED); } else if (num > rule.getMaxConfigurableValue()) { num = rule.getMaxConfigurableValue(); ruleValueField.setForeground(Color.RED); } else { ruleValueField.setForeground(null); } config.setConfigurableValue(rule.getId(), num); } catch (Exception ex) { ruleValueField.setForeground(Color.RED); } } }); cons.gridx = 0; cons.gridy++; } return panel; } }
public class class_name { private JPanel getSpecialRuleValuePanel() { JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); GridBagConstraints cons = new GridBagConstraints(); cons.gridx = 0; cons.gridy = 0; cons.weightx = 0.0f; cons.anchor = GridBagConstraints.WEST; List<JCheckBox> ruleCheckboxes = new ArrayList<JCheckBox>(); List<JLabel> ruleLabels = new ArrayList<JLabel>(); List<JTextField> ruleValueFields = new ArrayList<JTextField>(); for(int i = 0; i < configurableRules.size(); i++) { Rule rule = configurableRules.get(i); JCheckBox ruleCheckbox = new JCheckBox(rule.getDescription()); ruleCheckboxes.add(ruleCheckbox); // depends on control dependency: [for], data = [none] ruleCheckbox.setSelected(getEnabledState(rule)); // depends on control dependency: [for], data = [none] cons.insets = new Insets(3, 0, 0, 0); // depends on control dependency: [for], data = [none] panel.add(ruleCheckbox, cons); // depends on control dependency: [for], data = [none] cons.insets = new Insets(0, 24, 0, 0); // depends on control dependency: [for], data = [none] cons.gridy++; // depends on control dependency: [for], data = [none] JLabel ruleLabel = new JLabel(rule.getConfigureText()); ruleLabels.add(ruleLabel); // depends on control dependency: [for], data = [none] ruleLabel.setEnabled(ruleCheckbox.isSelected()); // depends on control dependency: [for], data = [none] panel.add(ruleLabel, cons); // depends on control dependency: [for], data = [none] cons.gridx++; // depends on control dependency: [for], data = [none] int value = config.getConfigurableValue(rule.getId()); if(config.getConfigurableValue(rule.getId()) < 0) { value = rule.getDefaultValue(); // depends on control dependency: [if], data = [none] } JTextField ruleValueField = new JTextField(Integer.toString(value), 2); ruleValueFields.add(ruleValueField); // depends on control dependency: [for], data = [none] ruleValueField.setEnabled(ruleCheckbox.isSelected()); // depends on control dependency: [for], data = [none] ruleValueField.setMinimumSize(new Dimension(35, 25)); // without this the box is just a few pixels small, but why? // depends on control dependency: [for], data = [none] panel.add(ruleValueField, cons); // depends on control dependency: [for], data = [none] ruleCheckbox.addActionListener(new ActionListener() { @Override public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { ruleValueField.setEnabled(ruleCheckbox.isSelected()); ruleLabel.setEnabled(ruleCheckbox.isSelected()); if (ruleCheckbox.isSelected()) { config.getEnabledRuleIds().add(rule.getId()); // depends on control dependency: [if], data = [none] config.getDisabledRuleIds().remove(rule.getId()); // depends on control dependency: [if], data = [none] } else { config.getEnabledRuleIds().remove(rule.getId()); // depends on control dependency: [if], data = [none] config.getDisabledRuleIds().add(rule.getId()); // depends on control dependency: [if], data = [none] } } }); // depends on control dependency: [for], data = [none] ruleValueField.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { changedUpdate(e); } @Override public void removeUpdate(DocumentEvent e) { changedUpdate(e); } @Override public void changedUpdate(DocumentEvent e) { try { int num = Integer.parseInt(ruleValueField.getText()); if (num < rule.getMinConfigurableValue()) { num = rule.getMinConfigurableValue(); // depends on control dependency: [if], data = [none] ruleValueField.setForeground(Color.RED); // depends on control dependency: [if], data = [none] } else if (num > rule.getMaxConfigurableValue()) { num = rule.getMaxConfigurableValue(); // depends on control dependency: [if], data = [none] ruleValueField.setForeground(Color.RED); // depends on control dependency: [if], data = [none] } else { ruleValueField.setForeground(null); // depends on control dependency: [if], data = [none] } config.setConfigurableValue(rule.getId(), num); // depends on control dependency: [try], data = [none] } catch (Exception ex) { ruleValueField.setForeground(Color.RED); } // depends on control dependency: [catch], data = [none] } }); // depends on control dependency: [for], data = [none] cons.gridx = 0; // depends on control dependency: [for], data = [none] cons.gridy++; // depends on control dependency: [for], data = [none] } return panel; } }
public class class_name { public MerkleTreeConfig findMapMerkleTreeConfig(String name) { name = getBaseName(name); final MerkleTreeConfig config = lookupByPattern(configPatternMatcher, mapMerkleTreeConfigs, name); if (config != null) { return config.getAsReadOnly(); } return getMapMerkleTreeConfig("default").getAsReadOnly(); } }
public class class_name { public MerkleTreeConfig findMapMerkleTreeConfig(String name) { name = getBaseName(name); final MerkleTreeConfig config = lookupByPattern(configPatternMatcher, mapMerkleTreeConfigs, name); if (config != null) { return config.getAsReadOnly(); // depends on control dependency: [if], data = [none] } return getMapMerkleTreeConfig("default").getAsReadOnly(); } }
public class class_name { protected void setTimeoutTime(int time) { int timeout = time; if (timeout == TCPRequestContext.NO_TIMEOUT) { this.timeoutTime = TCPRequestContext.NO_TIMEOUT; this.timeoutInterval = 0; } else { if (timeout == TCPRequestContext.USE_CHANNEL_TIMEOUT) { timeout = getConfig().getInactivityTimeout(); } if (timeout != ValidateUtils.INACTIVITY_TIMEOUT_NO_TIMEOUT) { this.timeoutTime = System.currentTimeMillis() + timeout; this.timeoutInterval = timeout; } else { this.timeoutTime = TCPRequestContext.NO_TIMEOUT; this.timeoutInterval = 0; } } } }
public class class_name { protected void setTimeoutTime(int time) { int timeout = time; if (timeout == TCPRequestContext.NO_TIMEOUT) { this.timeoutTime = TCPRequestContext.NO_TIMEOUT; // depends on control dependency: [if], data = [none] this.timeoutInterval = 0; // depends on control dependency: [if], data = [none] } else { if (timeout == TCPRequestContext.USE_CHANNEL_TIMEOUT) { timeout = getConfig().getInactivityTimeout(); // depends on control dependency: [if], data = [none] } if (timeout != ValidateUtils.INACTIVITY_TIMEOUT_NO_TIMEOUT) { this.timeoutTime = System.currentTimeMillis() + timeout; // depends on control dependency: [if], data = [none] this.timeoutInterval = timeout; // depends on control dependency: [if], data = [none] } else { this.timeoutTime = TCPRequestContext.NO_TIMEOUT; // depends on control dependency: [if], data = [none] this.timeoutInterval = 0; // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static <E> List<E> toList(Iterator<E> iter) { final List<E> list = new ArrayList<>(); while (iter.hasNext()) { list.add(iter.next()); } return list; } }
public class class_name { public static <E> List<E> toList(Iterator<E> iter) { final List<E> list = new ArrayList<>(); while (iter.hasNext()) { list.add(iter.next()); // depends on control dependency: [while], data = [none] } return list; } }
public class class_name { @Override public boolean getThenSetBit(int index, boolean value) { index = adjIndex(index); checkMutability(); int i = index >> ADDRESS_BITS; int m = 1 << (index & ADDRESS_MASK); boolean v = (bits[i] & m) != 0; if (value) { bits[i] |= m; } else { bits[i] &= ~m; } return v; } }
public class class_name { @Override public boolean getThenSetBit(int index, boolean value) { index = adjIndex(index); checkMutability(); int i = index >> ADDRESS_BITS; int m = 1 << (index & ADDRESS_MASK); boolean v = (bits[i] & m) != 0; if (value) { bits[i] |= m; // depends on control dependency: [if], data = [none] } else { bits[i] &= ~m; // depends on control dependency: [if], data = [none] } return v; } }
public class class_name { public static Map<String, String> getLayerFiltersForCriterion(Criterion critter, MapModel mapModel) { Map<String, String> filters = new HashMap<String, String>(); Set<String> serverLayerIds = new HashSet<String>(); critter.serverLayerIdVisitor(serverLayerIds); for (VectorLayer vectorLayer : mapModel.getVectorLayers()) { if (serverLayerIds.contains(vectorLayer.getServerLayerId())) { if (vectorLayer.getFilter() != null && !"".equals(vectorLayer.getFilter())) { filters.put(vectorLayer.getServerLayerId(), vectorLayer.getFilter()); } } } return filters; } }
public class class_name { public static Map<String, String> getLayerFiltersForCriterion(Criterion critter, MapModel mapModel) { Map<String, String> filters = new HashMap<String, String>(); Set<String> serverLayerIds = new HashSet<String>(); critter.serverLayerIdVisitor(serverLayerIds); for (VectorLayer vectorLayer : mapModel.getVectorLayers()) { if (serverLayerIds.contains(vectorLayer.getServerLayerId())) { if (vectorLayer.getFilter() != null && !"".equals(vectorLayer.getFilter())) { filters.put(vectorLayer.getServerLayerId(), vectorLayer.getFilter()); // depends on control dependency: [if], data = [none] } } } return filters; } }
public class class_name { public static Geometry longestLine(Geometry geomA, Geometry geomB) { Coordinate[] coords = new MaxDistanceOp(geomA, geomB).getCoordinatesDistance(); if(coords!=null){ return geomA.getFactory().createLineString(coords); } return null; } }
public class class_name { public static Geometry longestLine(Geometry geomA, Geometry geomB) { Coordinate[] coords = new MaxDistanceOp(geomA, geomB).getCoordinatesDistance(); if(coords!=null){ return geomA.getFactory().createLineString(coords); // depends on control dependency: [if], data = [(coords] } return null; } }
public class class_name { synchronized final JsMsgPart getHdr2() { if (hdr2 == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "getHdr2 will call getPart"); hdr2 = jmo.getPart(JsHdrAccess.HDR2, JsHdr2Access.schema); } return hdr2; } }
public class class_name { synchronized final JsMsgPart getHdr2() { if (hdr2 == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "getHdr2 will call getPart"); hdr2 = jmo.getPart(JsHdrAccess.HDR2, JsHdr2Access.schema); // depends on control dependency: [if], data = [none] } return hdr2; } }
public class class_name { private static void vswap(int[] fmap, int p1, int p2, int n) { n += p1; while (p1 < n) { int t = fmap[p1]; fmap[p1++] = fmap[p2]; fmap[p2++] = t; } } }
public class class_name { private static void vswap(int[] fmap, int p1, int p2, int n) { n += p1; while (p1 < n) { int t = fmap[p1]; fmap[p1++] = fmap[p2]; // depends on control dependency: [while], data = [none] fmap[p2++] = t; // depends on control dependency: [while], data = [none] } } }
public class class_name { public static void init(final CertManAPI cmAPI) throws Exception { cmAPI.route(HttpMethods.POST, "/cert/artifacts", API.ARTIFACTS, new Code(cmAPI,"Create Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.createArtifacts(trans, req, resp); if(r.isOK()) { resp.setStatus(HttpStatus.CREATED_201); } else { context.error(trans,resp,r); } } }); cmAPI.route(HttpMethods.GET, "/cert/artifacts/:mechid/:machine", API.ARTIFACTS, new Code(cmAPI,GET_ARTIFACTS) { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.readArtifacts(trans, resp, pathParam(req,":mechid"), pathParam(req,":machine")); if(r.isOK()) { resp.setStatus(HttpStatus.CREATED_201); } else { context.error(trans,resp,r); } } }); cmAPI.route(HttpMethods.GET, "/cert/artifacts", API.ARTIFACTS, new Code(cmAPI,GET_ARTIFACTS) { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.readArtifacts(trans, req, resp); if(r.isOK()) { resp.setStatus(HttpStatus.CREATED_201); } else { context.error(trans,resp,r); } } }); cmAPI.route(HttpMethods.PUT, "/cert/artifacts", API.ARTIFACTS, new Code(cmAPI,"Update Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.updateArtifacts(trans, req, resp); if(r.isOK()) { resp.setStatus(HttpStatus.OK_200); } else { context.error(trans,resp,r); } } }); cmAPI.route(HttpMethods.DELETE, "/cert/artifacts/:mechid/:machine", API.VOID, new Code(cmAPI,"Delete Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.deleteArtifacts(trans, resp, pathParam(req, ":mechid"), pathParam(req,":machine")); if(r.isOK()) { resp.setStatus(HttpStatus.OK_200); } else { context.error(trans,resp,r); } } }); cmAPI.route(HttpMethods.DELETE, "/cert/artifacts", API.VOID, new Code(cmAPI,"Delete Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.deleteArtifacts(trans, req, resp); if(r.isOK()) { resp.setStatus(HttpStatus.OK_200); } else { context.error(trans,resp,r); } } }); } }
public class class_name { public static void init(final CertManAPI cmAPI) throws Exception { cmAPI.route(HttpMethods.POST, "/cert/artifacts", API.ARTIFACTS, new Code(cmAPI,"Create Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.createArtifacts(trans, req, resp); if(r.isOK()) { resp.setStatus(HttpStatus.CREATED_201); // depends on control dependency: [if], data = [none] } else { context.error(trans,resp,r); // depends on control dependency: [if], data = [none] } } }); cmAPI.route(HttpMethods.GET, "/cert/artifacts/:mechid/:machine", API.ARTIFACTS, new Code(cmAPI,GET_ARTIFACTS) { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.readArtifacts(trans, resp, pathParam(req,":mechid"), pathParam(req,":machine")); if(r.isOK()) { resp.setStatus(HttpStatus.CREATED_201); } else { context.error(trans,resp,r); } } }); cmAPI.route(HttpMethods.GET, "/cert/artifacts", API.ARTIFACTS, new Code(cmAPI,GET_ARTIFACTS) { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.readArtifacts(trans, req, resp); if(r.isOK()) { resp.setStatus(HttpStatus.CREATED_201); } else { context.error(trans,resp,r); } } }); cmAPI.route(HttpMethods.PUT, "/cert/artifacts", API.ARTIFACTS, new Code(cmAPI,"Update Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.updateArtifacts(trans, req, resp); if(r.isOK()) { resp.setStatus(HttpStatus.OK_200); } else { context.error(trans,resp,r); } } }); cmAPI.route(HttpMethods.DELETE, "/cert/artifacts/:mechid/:machine", API.VOID, new Code(cmAPI,"Delete Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.deleteArtifacts(trans, resp, pathParam(req, ":mechid"), pathParam(req,":machine")); if(r.isOK()) { resp.setStatus(HttpStatus.OK_200); } else { context.error(trans,resp,r); } } }); cmAPI.route(HttpMethods.DELETE, "/cert/artifacts", API.VOID, new Code(cmAPI,"Delete Artifacts") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { Result<Void> r = context.deleteArtifacts(trans, req, resp); if(r.isOK()) { resp.setStatus(HttpStatus.OK_200); } else { context.error(trans,resp,r); } } }); } }
public class class_name { public static boolean parseBoolean(String valueName, String value, boolean defaultValue) { boolean result = defaultValue; if (value != null) { boolean valid = true; result = Boolean.parseBoolean(value); // parseBoolean allows any value, e.g. so a typo like "trye" would be silently interpreted as false if (!result) { if (!Boolean.FALSE.toString().equalsIgnoreCase(value)) { valid = false; } } if (!valid) { String message = String.format("Invalid value \"%s\" for %s, must be \"%s\" or \"%s\"", value, valueName, Boolean.TRUE.toString(), Boolean.FALSE.toString()); throw new IllegalArgumentException(message); } } return result; } }
public class class_name { public static boolean parseBoolean(String valueName, String value, boolean defaultValue) { boolean result = defaultValue; if (value != null) { boolean valid = true; result = Boolean.parseBoolean(value); // depends on control dependency: [if], data = [(value] // parseBoolean allows any value, e.g. so a typo like "trye" would be silently interpreted as false if (!result) { if (!Boolean.FALSE.toString().equalsIgnoreCase(value)) { valid = false; // depends on control dependency: [if], data = [none] } } if (!valid) { String message = String.format("Invalid value \"%s\" for %s, must be \"%s\" or \"%s\"", value, valueName, Boolean.TRUE.toString(), Boolean.FALSE.toString()); throw new IllegalArgumentException(message); } } return result; } }
public class class_name { protected EncodedImage getByteBufferBackedEncodedImage( InputStream inputStream, int length) throws IOException { CloseableReference<PooledByteBuffer> ref = null; try { if (length <= 0) { ref = CloseableReference.of(mPooledByteBufferFactory.newByteBuffer(inputStream)); } else { ref = CloseableReference.of(mPooledByteBufferFactory.newByteBuffer(inputStream, length)); } return new EncodedImage(ref); } finally { Closeables.closeQuietly(inputStream); CloseableReference.closeSafely(ref); } } }
public class class_name { protected EncodedImage getByteBufferBackedEncodedImage( InputStream inputStream, int length) throws IOException { CloseableReference<PooledByteBuffer> ref = null; try { if (length <= 0) { ref = CloseableReference.of(mPooledByteBufferFactory.newByteBuffer(inputStream)); // depends on control dependency: [if], data = [none] } else { ref = CloseableReference.of(mPooledByteBufferFactory.newByteBuffer(inputStream, length)); // depends on control dependency: [if], data = [none] } return new EncodedImage(ref); } finally { Closeables.closeQuietly(inputStream); CloseableReference.closeSafely(ref); } } }
public class class_name { public static Integer durationSeconds(String duration) { BigDecimal ns = durationNs(duration); if (ns == null) { return null; } BigDecimal sec = ns.divide(new BigDecimal(1_000_000_000)); if (sec.compareTo(new BigDecimal(Integer.MAX_VALUE)) > 0) { throw new IllegalArgumentException("Integer Overflow"); } return sec.intValue(); } }
public class class_name { public static Integer durationSeconds(String duration) { BigDecimal ns = durationNs(duration); if (ns == null) { return null; // depends on control dependency: [if], data = [none] } BigDecimal sec = ns.divide(new BigDecimal(1_000_000_000)); if (sec.compareTo(new BigDecimal(Integer.MAX_VALUE)) > 0) { throw new IllegalArgumentException("Integer Overflow"); } return sec.intValue(); } }
public class class_name { private synchronized void makeOrphans(@Nullable ArrayList<Entry<K, V>> oldEntries) { if (oldEntries != null) { for (Entry<K, V> oldEntry : oldEntries) { makeOrphan(oldEntry); } } } }
public class class_name { private synchronized void makeOrphans(@Nullable ArrayList<Entry<K, V>> oldEntries) { if (oldEntries != null) { for (Entry<K, V> oldEntry : oldEntries) { makeOrphan(oldEntry); // depends on control dependency: [for], data = [oldEntry] } } } }
public class class_name { public void add(String str) { String[] tmp; if (size == data.length) { tmp = new String[data.length + GROW]; System.arraycopy(data, 0, tmp, 0, data.length); data = tmp; } data[size] = str; size++; } }
public class class_name { public void add(String str) { String[] tmp; if (size == data.length) { tmp = new String[data.length + GROW]; // depends on control dependency: [if], data = [none] System.arraycopy(data, 0, tmp, 0, data.length); // depends on control dependency: [if], data = [data.length)] data = tmp; // depends on control dependency: [if], data = [none] } data[size] = str; size++; } }
public class class_name { public static long genSeed(final String ident) { try { MessageDigest instance = MessageDigest.getInstance("SHA-1"); byte[] strbytes = ident.getBytes("UTF-8"); byte[] digest = instance.digest(strbytes); //use first 8 bytes as a long return ByteBuffer.wrap(digest, 0, Long.BYTES).getLong(); } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { //not random looking return ident.hashCode(); } } }
public class class_name { public static long genSeed(final String ident) { try { MessageDigest instance = MessageDigest.getInstance("SHA-1"); byte[] strbytes = ident.getBytes("UTF-8"); byte[] digest = instance.digest(strbytes); //use first 8 bytes as a long return ByteBuffer.wrap(digest, 0, Long.BYTES).getLong(); // depends on control dependency: [try], data = [none] } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { //not random looking return ident.hashCode(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void open() { try { switch(this.documentSettings.getDataCacheStyle()) { case RtfDataCache.CACHE_MEMORY_EFFICIENT: this.data = new RtfEfficientMemoryCache(); break; case RtfDataCache.CACHE_MEMORY: this.data = new RtfMemoryCache(); break; case RtfDataCache.CACHE_DISK: this.data = new RtfDiskCache(); break; default: throw new RuntimeException("unknown"); } } catch(IOException ioe) { System.err.println("Could not initialize disk cache. Using memory cache."); ioe.printStackTrace(); this.data = new RtfMemoryCache(); } } }
public class class_name { public void open() { try { switch(this.documentSettings.getDataCacheStyle()) { case RtfDataCache.CACHE_MEMORY_EFFICIENT: this.data = new RtfEfficientMemoryCache(); break; case RtfDataCache.CACHE_MEMORY: this.data = new RtfMemoryCache(); break; case RtfDataCache.CACHE_DISK: this.data = new RtfDiskCache(); break; default: throw new RuntimeException("unknown"); } } catch(IOException ioe) { System.err.println("Could not initialize disk cache. Using memory cache."); ioe.printStackTrace(); this.data = new RtfMemoryCache(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { protected void fireBroadcast(String broadcastName, List<BroadcastFilter> broadcastFilters, Object... values) { if (!broadcastListeners.containsKey(broadcastName)) { return; } List<BroadcastListener> listeners = broadcastListeners.get(broadcastName); synchronized (listeners) { for (BroadcastListener listener : listeners) { listener.broadcastOccurred(broadcastFilters, values); } } } }
public class class_name { protected void fireBroadcast(String broadcastName, List<BroadcastFilter> broadcastFilters, Object... values) { if (!broadcastListeners.containsKey(broadcastName)) { return; // depends on control dependency: [if], data = [none] } List<BroadcastListener> listeners = broadcastListeners.get(broadcastName); synchronized (listeners) { for (BroadcastListener listener : listeners) { listener.broadcastOccurred(broadcastFilters, values); // depends on control dependency: [for], data = [listener] } } } }
public class class_name { private boolean lessThan(int i, int j) { if (sortOnValues) { if (values[i] < values[j]) { return true; } } else { if (keys[i] < keys[j]) { return true; } } return false; } }
public class class_name { private boolean lessThan(int i, int j) { if (sortOnValues) { if (values[i] < values[j]) { return true; // depends on control dependency: [if], data = [none] } } else { if (keys[i] < keys[j]) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public void setFilters(java.util.Collection<ImportTaskFilter> filters) { if (filters == null) { this.filters = null; return; } this.filters = new java.util.ArrayList<ImportTaskFilter>(filters); } }
public class class_name { public void setFilters(java.util.Collection<ImportTaskFilter> filters) { if (filters == null) { this.filters = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.filters = new java.util.ArrayList<ImportTaskFilter>(filters); } }
public class class_name { private TermsBuilder processGroupByClause(Expression expression, EntityMetadata entityMetadata, KunderaQuery query) { MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( entityMetadata.getPersistenceUnit()); Expression groupByClause = ((GroupByClause) expression).getGroupByItems(); if (groupByClause instanceof CollectionExpression) { logger.error("More than one item found in group by clause."); throw new UnsupportedOperationException("Currently, Group By on more than one field is not supported."); } SelectStatement selectStatement = query.getSelectStatement(); // To apply terms and tophits aggregation to serve group by String jPAField = KunderaCoreUtils.getJPAColumnName(groupByClause.toParsedText(), entityMetadata, metaModel); TermsBuilder termsBuilder = AggregationBuilders.terms(ESConstants.GROUP_BY).field(jPAField).size(0); // Hard coded value for a max number of record that a group can contain. TopHitsBuilder topHitsBuilder = getTopHitsAggregation(selectStatement, null, entityMetadata); termsBuilder.subAggregation(topHitsBuilder); // To apply the metric aggregations (Min, max... etc) in select clause buildSelectAggregations(termsBuilder, query.getSelectStatement(), entityMetadata); if (KunderaQueryUtils.hasHaving(query.getJpqlExpression())) { addHavingClause(((HavingClause) selectStatement.getHavingClause()).getConditionalExpression(), termsBuilder, entityMetadata); } if (KunderaQueryUtils.hasOrderBy(query.getJpqlExpression())) { processOrderByClause(termsBuilder, KunderaQueryUtils.getOrderByClause(query.getJpqlExpression()), groupByClause, entityMetadata); } return termsBuilder; } }
public class class_name { private TermsBuilder processGroupByClause(Expression expression, EntityMetadata entityMetadata, KunderaQuery query) { MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( entityMetadata.getPersistenceUnit()); Expression groupByClause = ((GroupByClause) expression).getGroupByItems(); if (groupByClause instanceof CollectionExpression) { logger.error("More than one item found in group by clause."); // depends on control dependency: [if], data = [none] throw new UnsupportedOperationException("Currently, Group By on more than one field is not supported."); } SelectStatement selectStatement = query.getSelectStatement(); // To apply terms and tophits aggregation to serve group by String jPAField = KunderaCoreUtils.getJPAColumnName(groupByClause.toParsedText(), entityMetadata, metaModel); TermsBuilder termsBuilder = AggregationBuilders.terms(ESConstants.GROUP_BY).field(jPAField).size(0); // Hard coded value for a max number of record that a group can contain. TopHitsBuilder topHitsBuilder = getTopHitsAggregation(selectStatement, null, entityMetadata); termsBuilder.subAggregation(topHitsBuilder); // To apply the metric aggregations (Min, max... etc) in select clause buildSelectAggregations(termsBuilder, query.getSelectStatement(), entityMetadata); if (KunderaQueryUtils.hasHaving(query.getJpqlExpression())) { addHavingClause(((HavingClause) selectStatement.getHavingClause()).getConditionalExpression(), termsBuilder, entityMetadata); // depends on control dependency: [if], data = [none] } if (KunderaQueryUtils.hasOrderBy(query.getJpqlExpression())) { processOrderByClause(termsBuilder, KunderaQueryUtils.getOrderByClause(query.getJpqlExpression()), groupByClause, entityMetadata); // depends on control dependency: [if], data = [none] } return termsBuilder; } }
public class class_name { public static <T> T doAs(final boolean inflowed, final SecurityIdentity securityIdentity, final InetAddress remoteAddress, final PrivilegedAction<T> action) { final AccessAuditContext previous = contextThreadLocal.get(); try { contextThreadLocal.set(new AccessAuditContext(inflowed, securityIdentity, remoteAddress, previous)); return securityIdentity != null ? securityIdentity.runAs(action) : action.run(); } finally { contextThreadLocal.set(previous); } } }
public class class_name { public static <T> T doAs(final boolean inflowed, final SecurityIdentity securityIdentity, final InetAddress remoteAddress, final PrivilegedAction<T> action) { final AccessAuditContext previous = contextThreadLocal.get(); try { contextThreadLocal.set(new AccessAuditContext(inflowed, securityIdentity, remoteAddress, previous)); // depends on control dependency: [try], data = [none] return securityIdentity != null ? securityIdentity.runAs(action) : action.run(); // depends on control dependency: [try], data = [none] } finally { contextThreadLocal.set(previous); } } }
public class class_name { public EClass getIfcRectangularPyramid() { if (ifcRectangularPyramidEClass == null) { ifcRectangularPyramidEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(428); } return ifcRectangularPyramidEClass; } }
public class class_name { public EClass getIfcRectangularPyramid() { if (ifcRectangularPyramidEClass == null) { ifcRectangularPyramidEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(428); // depends on control dependency: [if], data = [none] } return ifcRectangularPyramidEClass; } }
public class class_name { @Override public List<BaseStyler> getStylers(String... styleClasses) throws VectorPrintException { if (styleClasses == null || styleClasses.length == 0 || styleClasses[0] == null || styleClasses[0].isEmpty()) { return Collections.EMPTY_LIST; } List<BaseStyler> stylers = new ArrayList<>(styleClasses.length + 4); preOrPostStyle(PRESTYLERS, stylers, styleClasses); BaseStyler first = null; for (String name : styleClasses) { List<BaseStyler> parameterizables = getParameterizables(name, STYLERPACKAGENAME); if (first == null && parameterizables.size() > 0) { first = parameterizables.get(0); if (first instanceof SimpleColumns || (!(first instanceof Advanced) && first.creates()) || (first instanceof Image && first.getValue(Image.DOSTYLE, Boolean.class))) { log.warning(String.format("putting %s in front of all stylers because it creates an element", first)); stylers.add(0, first); for (int i = 1; i < parameterizables.size(); i++) { stylers.add(parameterizables.get(i)); } continue; } } stylers.addAll(parameterizables); } preOrPostStyle(POSTSTYLERS, stylers, styleClasses); impdf.clear(); imtiff.clear(); imcol.clear(); debug(stylers, styleClasses); return stylers; } }
public class class_name { @Override public List<BaseStyler> getStylers(String... styleClasses) throws VectorPrintException { if (styleClasses == null || styleClasses.length == 0 || styleClasses[0] == null || styleClasses[0].isEmpty()) { return Collections.EMPTY_LIST; // depends on control dependency: [if], data = [none] } List<BaseStyler> stylers = new ArrayList<>(styleClasses.length + 4); preOrPostStyle(PRESTYLERS, stylers, styleClasses); BaseStyler first = null; for (String name : styleClasses) { List<BaseStyler> parameterizables = getParameterizables(name, STYLERPACKAGENAME); if (first == null && parameterizables.size() > 0) { first = parameterizables.get(0); // depends on control dependency: [if], data = [none] if (first instanceof SimpleColumns || (!(first instanceof Advanced) && first.creates()) || (first instanceof Image && first.getValue(Image.DOSTYLE, Boolean.class))) { log.warning(String.format("putting %s in front of all stylers because it creates an element", first)); // depends on control dependency: [if], data = [none] stylers.add(0, first); // depends on control dependency: [if], data = [none] for (int i = 1; i < parameterizables.size(); i++) { stylers.add(parameterizables.get(i)); // depends on control dependency: [for], data = [i] } continue; } } stylers.addAll(parameterizables); // depends on control dependency: [for], data = [none] } preOrPostStyle(POSTSTYLERS, stylers, styleClasses); impdf.clear(); imtiff.clear(); imcol.clear(); debug(stylers, styleClasses); return stylers; } }