Runtime type of Collection contents?

I'm pretty certain I know the answer to this question, but anyway:
In a JavaBean editor, one property of the bean may be a collection of (potentially editable) beans. To edit the property I can display the appropriate editor if I can determine the type of the bean in the collection. A dirty but effective solution is to sample the collection and see what's actually in it. But in the case of an empty collection that isn't possible. (One function of the editor is to add a new bean to the collection.)
It seems that my only alternative is myCollection.getClass().getTypeParameters(), which tells you what the parameters were when the type was declared, e.g. for Vector<E>, "E", which obviously isn't any help, although it is consonant with the rule that the type parameter "disappears at runtime". (In other words, that Java is a statically typed language.)
I just want to confirm that I'm not missing something.
(Btw, a potential, though labor-intensive, solution is to set the collection element type in a BeanInfo attribute. So it's not like this is a dead end. I just want to confirm that I'm understanding it correctly.)
TIA

AH HA! It works, but don't ask me why (yet). Here's some test code, using a Method rather than a Field since accessor methods are available through Introspection while Fields aren't:
public class ATestBean {
    public static void main ( final String[] args ) throws Throwable
        ATestBean bean = new ATestBean();
    public ATestBean ( ) throws Throwable {  super();
        Method m = getClass().getDeclaredMethod("getCollection", new Class[0] );
        Class<?> c = getClassType( m );
    public Collection<AConcreteClass> getCollection()  {
        return null;
    public Class<?> getClassType(final Method meth ) throws Throwable {
        Type type = meth.getGenericReturnType();
        String strType = null;
        if (type instanceof ParameterizedType) {
            String actual = Arrays.toString( ((ParameterizedType)type).getActualTypeArguments() );
               // actual <- "[class com.x.y.z.AConcreteClass]"
            strType = actual.substring( 7, actual.length()-1 );
        if (strType != null) {
            Class<?> klass = Class.forName(strType);
            return klass;
        return null;
}Learn something new every day. Thanks.
Hmmm, looks like Introspector is due for an update...

Similar Messages

  • Type Safe Collections

    Hello All,
    I want to have type safe collections. Today. when we do programming with collections it almost behaves like a scripting language with no data types. any thing which is an object goes in and comes out freely.
    what about having a Collection(vector, ArrayList) class which can contain objects of only one type.
    something like
    ArrayList<Integer> a = new ArrayList();
    regards,
    Abhishek.

    Here's my way of using generics in normal Java - not quite as good as a compile error - but it works, and gives you a runtime error on inserting an object of the wrong type.
    I did this when at Uni, hence all the funky comments (well, you can't expect the lecturers to actually read the code, can you?).
    Just something you may find useful:
    import java.util.*;
    ���An implementation of the Proxy pattern, designed to wrap any list, and make it accept
    ���objects of the specified type (subclasses are allowed) only, hence allowing a user of
    ���this class to 'trust' the Proxy list.
    public class TypeSafeList extends AbstractList implements Serializable
    ���protected List source;
    ���protected Class acceptable;
    ���/**
    ������@param list the list to assign.
    ������@exception java.lang.IllegalArgumentException if the list contains elements of a
    ������different type to that specified
    ���*/
    ���public TypeSafeList(List list,Class acceptable)
    ���{
    ������Iterator iterator = list.iterator();
    ������while( iterator.hasNext() )
    ���������if( !acceptable.isInstance( iterator.next() ) )
    ������������throw new IllegalArgumentException( list+" contains elements not of type "+acceptable);
    ������this.source=list;
    ������this.acceptable=acceptable;
    ���}
    ���/**
    ������Passes on the request to the underlying list. See java.util.List.
    ���*/
    ���public Object get(int index)
    ���{
    ������return source.get(index);
    ���}
    ���/**
    ������Passes on the request to the underlying list. See java.util.List.
    ���*/
    ���public int size()
    ���{
    ������return source.size();
    ���}
    ���/**
    ������Checks that the type of the parameter is valid, and then passes on the
    ������request to the underlying list. See java.util.List.
    ������
    ������@exception java.lang.IllegalArgumentException if the type of the parameter is
    ������invalid.
    ���*/
    ���public Object set(int index,Object element)
    ���{
    ������return source.set(index,checkType(element));
    ���}
    ���/**
    ������Passes on the request to the underlying list. See java.util.List.
    ���*/
    ���public Object remove(int index)
    ���{
    ������return source.remove(index);
    ���}
    ���/**
    ������Checks that the type of the parameter is valid, and then passes on the
    ������request to the underlying list. See java.util.List.
    ���*/���
    ���public void add(int index,Object object)
    ���{
    ������source.add(index,checkType(object));
    ���}
    ���/**
    ������Return the Class object this List is configured to accept.
    ���*/
    ���public Class getAcceptable()
    ���{
    ������return acceptable;
    ���}
    ���
    ���/**���
    ������Checks the validity of the parameter against the protected field 'acceptable'.
    ������@return object if object is valid.
    ������@exception java.lang.IllegalArgumentException if the argument is invalid.
    ���*/
    ���protected Object checkType(Object object) throws IllegalArgumentException
    ���{
    ������if (acceptable.isInstance(object))
    ���������return object;
    ������throw new IllegalArgumentException(object+" needs to be of type "+acceptable.getName());
    ���}
    }

  • How to exclude stock of a particular storage type from collective availabil

    How to exclude stock of a particular storage type from collective availability check in MDVP.

    you can set the storage location as 'Storage location stock excluded from MRP' value '1' in the field
    Sloc MRP indicator , in MRP view $ when you enter a storage location accessing the material master.
    Thsi is the only way to exclude the storage location, you have to do it per each material and also it is excluded from the MRP.
    With this option the stock is not considered in ATP.
    IF you need the storage location in the MRP, then you should consider the use of MRP Areas.
    With the MRP Areas you define which plants/storage locations belong to each MRP area and the ATP is performed for eah area with the stocks that exist in each of them.
    Please if the issue is solved set the thread  as answered and provide the points to the useful replies.
    thanks for your cooperation

  • 1067: Implicit coercion of a value of type void to an unrelated type mx.collections:ArrayCollection.

    Here is what I have going on.
    When a button in my app is clicked it will instantiate a new object called ButtonCommand, within that object I create a new instance of a ListVO called vo.  I then reference my model object that also has a separate instance of the same Value Object ListVO class, reference its properties and place it into the corresponding property of the new VO object. Here is the code.
    var vo:ListVO = new ListVO();
    vo.name = model.list.name;
    vo.id = model.list.id;
    vo.amount = model.list.amount;
    vo.category = model.list.category;
    Within that same ButtonCommand class, next line I am trying to add the new ListVO instance to an arrayCollection that is also referenced from my model object, so here is the code for that.
    model.listCollection = model.listCollection.addItem(vo);
    I get the following error : -1067: Implicit coercion of a value of type void to an unrelated type mx.collections:ArrayCollection.
    And here is my getter/setter for the model.listCollection.
    public function get listCollection ():ArrayCollection
          return _listCollection;
    public function set listCollection(value:ArrayCollection):void
          _listCollection = value;
    Any Ideas?

    I thought model.listCollection is an ArrayCollection?
    model.listCollection is an ArrayCollection as shown in the example model code a few posts back.
    public class Model extends Actor
         //- PROPERTIES - //
         //-- other properties are here
         private var _listCollection:ArrayCollection = new ArrayCollection();
         public function Model()
         super();
         //other getter and setters here
         public function get listCollection ():ArrayCollection
         return _listCollection;
         public function set listCollection(value:ArrayCollection):void
         _listCollection = value;
    I am finding this to be very odd, seems like a simple getter setter situation, but I feel I must be missing something. The code trace(model.listCollection); should trace out as an ArrayCollection and not the VO object I am trying to add to it. Also when i run the code model.listCollection.addItem(vo); it should add the vo to the array collection through my setter, but yet it seems to try to access my getter.
    I took Kglads advice and traced out  _listCollection within my getter before my return statement and it returns [object ListVO]..... confused for sure. I am going to change the _listCollection property in the model from private with a getter/setter to a public and see what happens.

  • Runtime Type Services

    Hi All,
    I need introduction to ABAP Runtime Type Services. Also, it would be highly helpful if you could provide links that explain this concept in more detail.
    Thanks and Regards,
    Vidya.

    Hi Vidya,
    Go through this link,
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=abapRuntimeType+Services&cat=sdn_all
    cheers
    Mohinder Singh Chauhan

  • TYPE003: Runtime Type Mismatch

    A general question:
    ODSI 10gR3
    Has anyone seen the "TYPE003: Runtime Type Mismatch" error returned when you pass a variable through a function rather than a literal? The variable is the exact same value as the literal and I have casted all to a xs:double before passing through the "getReferencesByVersionID" function in code below.
    =============================================================
    (: Always tested with the same $VersionID and only 1 order in the database :)
    for $Order in tns:getOrdersByVersionID($VersionID)
    return
    (: let $OrderNum := tns:getOrderNum(fn:data($Order/ns1:OrderNum)) :) (: Fail :)
    let $OrderNum := xs:double(fn:data($Order/ns1:OrderNum)) (: Fail :)
    (: let $OrderNum := xs:double(12001002) :) (: Success :)
    let $References := tns:getReferencesByVersionID($VersionID, $OrderNum)
    return
    Returned XML snippet when run successfully:
    <ns0:Order ns0:TransactionPurpose="ADD/UPDATE">
    <ns0:ShipperRef>J10310ST12001002</ns0:ShipperRef>
    <ns0:OrderNum>12001002</ns0:OrderNum> (: Populated by: "data($Order/ns1:OrderNum)". "ns0:OrderNum" defined as xs:double in schema. Note: same value as literal :)
    <ns0:Comments/>
    <ns0:OrderType>O</ns0:OrderType>
    <ns0:Workflow>O</ns0:Workflow>
    Returned Trace when not working:
    com.bea.dsp.das.exception.DASException: weblogic.xml.query.exceptions.XQueryTypeException: {bea-err}TYPE003: Runtime Type Mismatch
         at com.bea.dsp.das.ejb.EJBClient.invokeOperation(EJBClient.java:160)
         at com.bea.dsp.das.DataAccessServiceImpl.invokeOperation(DataAccessServiceImpl.java:171)
         at com.bea.dsp.das.DataAccessServiceImpl.invoke(DataAccessServiceImpl.java:122)
         at com.bea.dsp.ide.xquery.views.test.QueryExecutor.invokeFunctionOrProcedure(QueryExecutor.java:113)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.getFunctionExecutionResult(XQueryTestView.java:1041)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.executeFunction(XQueryTestView.java:1176)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedImpl(XQueryTestView.java:1866)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.access$300(XQueryTestView.java:174)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent$3.run(XQueryTestView.java:1594)
         at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedBusy(XQueryTestView.java:1597)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelected(XQueryTestView.java:1560)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3687)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3298)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
         at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
         at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
         at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
         at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
         at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
    The obvious answer is that "fn:data($Order/ns1:OrderNum)" does not equal "xs:double(12001002)" when passed through the " tns:getReferencesByVersionID()" function but it appears to be the same value.
    This is happening in the Application layer so too much to include all the code. Thoughts/Comments on where to look or what I am missing?
    Thanks
    Tom

    Thanks Mike. No other web services... all physical ODSI to a single Oracle 11g denormalized table, selected several times to get different parts of the data (order header, shipping info, items, etc) and bubbled up through the layers via transformations finally getting into a single XML ORDER at the app layer.
    I'm not a guru at reading traces but it appears numieric vs double issue?
    The full stack trace:
    weblogic.xml.query.exceptions.XQueryTypeException: {bea-err}TYPE003: Runtime Type Mismatch
         at weblogic.xml.query.runtime.core.ExecutionWrapper.asXQueryException(ExecutionWrapper.java:165)
         at weblogic.xml.query.runtime.core.ExecutionWrapper.fetchNext(ExecutionWrapper.java:94)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:133)
         at weblogic.xml.query.runtime.node.DeflateRec.fetchNext(DeflateRec.java:43)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at com.bea.ld.server.ResultPusher$ChunkyBinxmlChunker.nextChunk(ResultPusher.java:402)
         at com.bea.ld.server.ResultPusher$AsyncChunkyBinxmlChunker.nextChunk(ResultPusher.java:520)
         at com.bea.ld.server.ResultPusher$BinxmlChunker.next(ResultPusher.java:292)
         at com.bea.ld.EJBRequestHandler$1.next(EJBRequestHandler.java:938)
         at com.bea.ld.ServerBean.maybeStreamResult(ServerBean.java:97)
         at com.bea.ld.ServerBean.executeOperationStreaming(ServerBean.java:86)
         at com.bea.ld.Server_ydm4ie_EOImpl.executeOperationStreaming(Server_ydm4ie_EOImpl.java:72)
         at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    java.lang.ClassCastException: weblogic.xml.query.tokens.basic.Basic_StringToken
         at weblogic.xml.query.runtime.numeric.compare.DoubleEqual.compare(DoubleEqual.java:31)
         at weblogic.xml.query.runtime.compare.ComparisonIterator.execute(ComparisonIterator.java:45)
         at weblogic.xml.query.iterators.FunctionIterator.fetchNext(FunctionIterator.java:30)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.logic.BoolEffValue.exec(BoolEffValue.java:47)
         at weblogic.xml.query.runtime.logic.BoolEffValue.execute(BoolEffValue.java:43)
         at weblogic.xml.query.iterators.FunctionIterator.fetchNext(FunctionIterator.java:30)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:79)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.CountMapIterator.fetchNext(CountMapIterator.java:167)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:388)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.matEverything(PartMatElemConstructor.java:123)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:197)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:91)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:91)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.navigation.ChildPath.fetchNext(ChildPath.java:221)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.iterators.BasicMaterializedTokenStream.next(BasicMaterializedTokenStream.java:109)
         at weblogic.xml.query.iterators.BasicMaterializedTokenStream$MatStreamIterator.fetchNext(BasicMaterializedTokenStream.java:448)
         at weblogic.xml.query.iterators.LegacyGenericIterator.next(LegacyGenericIterator.java:109)
         at weblogic.xml.query.runtime.core.RTVariable.fetchNext(RTVariable.java:53)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.sequences.Exists.execute(Exists.java:37)
         at weblogic.xml.query.iterators.FunctionIterator.fetchNext(FunctionIterator.java:30)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:79)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:388)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.matEverything(PartMatElemConstructor.java:123)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:197)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.iterators.BasicMaterializedTokenStream.next(BasicMaterializedTokenStream.java:109)
         at weblogic.xml.query.iterators.BasicMaterializedTokenStream$MatStreamIterator.fetchNext(BasicMaterializedTokenStream.java:448)
         at weblogic.xml.query.iterators.LegacyGenericIterator.next(LegacyGenericIterator.java:109)
         at weblogic.xml.query.runtime.core.RTVariable.fetchNext(RTVariable.java:53)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.navigation.ChildPath.fetchNext(ChildPath.java:221)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.sequences.Exists.execute(Exists.java:37)
         at weblogic.xml.query.iterators.FunctionIterator.fetchNext(FunctionIterator.java:30)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:79)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.buildPreserveModeTextNode(SuperElementConstructor.java:320)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:405)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.matEverything(PartMatElemConstructor.java:123)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:197)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:388)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:229)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.CountMapIterator.fetchNext(CountMapIterator.java:167)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:388)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:229)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.debug.Trace.fetchNext(Trace.java:70)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
         at weblogic.xml.query.iterators.LegacyGenericIterator.hasNext(LegacyGenericIterator.java:130)
         at weblogic.xml.query.runtime.sequences.Subsequence.fetchNext(Subsequence.java:101)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.querycide.QueryAssassin.fetchNext(QueryAssassin.java:54)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.qname.InsertNamespaces.fetchNext(InsertNamespaces.java:237)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.ExecutionWrapper.fetchNext(ExecutionWrapper.java:88)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:133)
         at weblogic.xml.query.runtime.node.DeflateRec.fetchNext(DeflateRec.java:43)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at com.bea.ld.server.ResultPusher$ChunkyBinxmlChunker.nextChunk(ResultPusher.java:402)
         at com.bea.ld.server.ResultPusher$AsyncChunkyBinxmlChunker.nextChunk(ResultPusher.java:520)
         at com.bea.ld.server.ResultPusher$BinxmlChunker.next(ResultPusher.java:292)
         at com.bea.ld.EJBRequestHandler$1.next(EJBRequestHandler.java:938)
         at com.bea.ld.ServerBean.maybeStreamResult(ServerBean.java:97)
         at com.bea.ld.ServerBean.executeOperationStreaming(ServerBean.java:86)
         at com.bea.ld.Server_ydm4ie_EOImpl.executeOperationStreaming(Server_ydm4ie_EOImpl.java:72)
         at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

  • Which type of collection is suitable for below scenario?

    which type of collection is suitable for below scenario?
    A) session.getAttibute("userPref",dad_re);
    possible values inside session are rad_eu,tcd_nid,aa,iod_po
    B)Need to compare with below set of values .
    dad_re
    rad_eu
    aad_vv
    bbd_rt
    ccd_ff
    If matched
    sysout("Matched values"+rad_eu)
    else
      sysout("Non matching with B"+tcd_ni)
    A - will contain only one value for each time and it is superset
    Which collection will use to store B?

    A HashSet.

  • Which order type gets collected and is used for forecast consumption

    Hi all,
    I would like to know which Order Types (transaction types) get collected into ASCP (appear as demand) and which Order Types are used for forecast consumption.
    I tried to find something in the user guides, but had not yet success :(
    What I want to do:
    1. decide which order types are collected or not
    2. decide which order types consume forecast or not
    Anyone any advices?
    Big thanks in advance,
    David.

    Hi,
    Rather speaking like Order types, we may use word Sales Order. ASCP will collect all the Sales Orders for which we need to intiate action for Supplies. How it is determined?. It is determined from SO lines where in we have So lines are scheduled(it is prt of Workflow action too) and It is flaged 'Yes' for "Visible Demand Flag" . This is what designed functionality. We do not care what type of order type it is.
    thanks,
    dr

  • Memory cost of each type of Collection class

    Hi, I wonder what is the memory cost of each type of Collection?
    Suppose I want to keep a set of non-duplicate objects, HashSet removes duplicates automatically, but calculating hash is extra cost; instead i can use ArrayList and do a check "if contains, then adds" before adding an element. Which one is faster? And which costs less memory?
    Thanks alot!

    Use a Set, that's what it is there for.

  • Wrapping xml-fragment into AnyDocument looses runtime type information

    I would like to store a fragment of xml in a database. However, to stay XML compatible,
    I don't want to have <xml-fragment> tags. To avoid this, I attempt to "wrap"
    the xml-fragment inside of an AnyDocument using the following code:
    private static AnyDocument wrap(final XmlObject o) {
    final AnyDocument anyDocument = AnyDocument.Factory.newInstance();
    final AnyDocument.Any any = anyDocument.addNewAny();
    any.set(o);
    return anyDocument;
    The problem, is that somehow my runtime type is getting lost after the wrapping
    occurs.
    Here is how the data looks BEFORE wrap (o.save()):
    <?xml version="1.0" encoding="UTF-8"?>
    <xml-fragment xsi:type="loc:AddTermRequestT" xmlns:loc="http://www.overture.com/service/common/local"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dis="http://www.overture.com/service/display">
    <loc:accountId>1123223ZZZ</loc:accountId>
    <loc:term>dog</loc:term>
    <loc:price>0.55</loc:price>
    </xml-fragment>
    Note that in the above XML the runtime type is set as: xsi:type="loc:AddTermRequestT
    Here is how the data looks after I attempt to wrap it with AnyDocument:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:any xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:dis="http://www.overture.com/service/display"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:loc="http://www.overture.com/service/common/local">
    <loc:accountId>1123223ZZZ</loc:accountId>
    <loc:term>dog</loc:term>
    <loc:price>0.55</loc:price>
    </xsd:any>
    The runtime type is gone and it's not clear how to parse the new XML.
    Am I doing something wrong? Why does the runtime type go away? Is this the correct
    way to "warp" some fragment with a valid document.
    Again, the intent here is to store something to the database that a different
    tool can understand later.
    Thanks.
    -AP_

    Use:
    xmlOptions.setSaveOuter();

  • Bad index type for collection access ???

    Hi there,
    I am writing a script in VBA to connect to SAP.
    I encountered something strange.
    Why does this work:
    Set oSession = oConnection.Children(0)
    But this isn't:
    X = 0
    Set oSession = oConnection.Children(X)
    It results in an error: "Bad index type for collection access"
    Regards, Bas Prins

    Thanks,
    Although that is not proper VBA syntax I understand your suggestion.
    In VBA that would be:
    DIM X AS INTEGER
    X = 0
    Set oSession = oConnection.Children(X)
    But I tried several datatypes, all resulted in error.
    Regards, Bas.

  • Runtime Error Purchasing BI Content initial setup

    Hi all,
    I'm trying to setup Purchasing BI Content and i have the dump error during the initial setup in T-Code "OLI3BW" Statistical setup of info structures from purchasing documents.
    "Runtime Errors COMPUTE_BCD_OVERFLOW
    Except. CX_SY_ARITHMETIC_OVERFLOW
    Short text
    Overflow during the arithmetical operation (type P) in program "SAPLMCEX02"."
    Thanks.

    Hi,
    Check
    SAP notes: 1165576 and  1176819
    Thanks
    Reddy

  • Runtime error while collecting objects for activaton from  BC

    Hi gurus,
    While collecting objects from busines content for installation, it is giving runtime error whith below description.
    "UNCAUGHT_EXCEPTION" "CX_RSD_NAME_ERROR"               
    "SAPLRSDN_IOBJ" or "LRSDN_IOBJU35"               
    "RSD_IOBJNM_PARSE"               
    R3TR     FUGR     RSDN_IOBJ     
    An exception occurred which is explained in detail below.               
    The exception, which is assigned to class 'CX_RSD_NAME_ERROR', was not caught               
      and               
    therefore caused a runtime error.               
    The reason for the exception is:               
    Name 0SRVE_IS3___F00133 is invalid               
    Pl spot light on this .
    Thanks in advance.
    Message was edited by:
            sri sri

    Hi Sri / Vach,
    this note can help you and implement the same
    1102743 - Dump during activation of business content
    Thanks
    kishore

  • Error_1_Inconsistent accessibility: property type 'System.Collections.ObjectModel.ObservableCollection WindowsBlogReader.FeedData ' is less accessible than property 'WindowsBlogReader.FeedDataSource.Feeds'

    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Windows.Web.Syndication;
    namespace WindowsBlogReader
       public class FeedData
            public string Title { get; set; }
            public string Description { get; set; }
            public DateTime PubDate { get; set; }
            private List<FeedItem> _Items = new List<FeedItem>();
            public List<FeedItem> Items
                get
                    return this._Items;
        // FeedItem
        // Holds info for a single blog post.
        public class FeedItem
            public string Title { get; set; }
            public string Author { get; set; }
            public string Content { get; set; }
            public DateTime PubDate { get; set; }
            public Uri Link { get; set; }
        // FeedDataSource
        // Holds a collection of blog feeds (FeedData), and contains methods needed to
        // retreive the feeds.
        public class FeedDataSource
            private ObservableCollection<FeedData> _Feeds = new ObservableCollection<FeedData>();
            public ObservableCollection<FeedData> Feeds         //Error Here//
                get
                    return this._Feeds;
            public async Task GetFeedsAsync()
                Task<FeedData> feed1 =
                    GetFeedAsync("http://windowsteamblog.com/windows/b/developers/atom.aspx");
                Task<FeedData> feed2 =
                    GetFeedAsync("http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx");
                Task<FeedData> feed3 =
                    GetFeedAsync("http://windowsteamblog.com/windows/b/extremewindows/atom.aspx");
                Task<FeedData> feed4 =
                    GetFeedAsync("http://windowsteamblog.com/windows/b/business/atom.aspx");
                Task<FeedData> feed5 =
                    GetFeedAsync("http://windowsteamblog.com/windows/b/bloggingwindows/atom.aspx");
                Task<FeedData> feed6 =
                    GetFeedAsync("http://windowsteamblog.com/windows/b/windowssecurity/atom.aspx");
                Task<FeedData> feed7 =
                    GetFeedAsync("http://windowsteamblog.com/windows/b/springboard/atom.aspx");
                Task<FeedData> feed8 =
                    GetFeedAsync("http://windowsteamblog.com/windows/b/windowshomeserver/atom.aspx");
                // There is no Atom feed for this blog, so use the RSS feed.
                Task<FeedData> feed9 =
                    GetFeedAsync("http://windowsteamblog.com/windows_live/b/windowslive/rss.aspx");
                Task<FeedData> feed10 =
                    GetFeedAsync("http://windowsteamblog.com/windows_live/b/developer/atom.aspx");
                Task<FeedData> feed11 =
                    GetFeedAsync("http://windowsteamblog.com/ie/b/ie/atom.aspx");
                Task<FeedData> feed12 =
                    GetFeedAsync("http://windowsteamblog.com/windows_phone/b/wpdev/atom.aspx");
                Task<FeedData> feed13 =
                    GetFeedAsync("http://windowsteamblog.com/windows_phone/b/wmdev/atom.aspx");
                Task<FeedData> feed14 =
                    GetFeedAsync("http://windowsteamblog.com/windows_phone/b/windowsphone/atom.aspx");
                this.Feeds.Add(await feed1);
                this.Feeds.Add(await feed2);
                this.Feeds.Add(await feed3);
                this.Feeds.Add(await feed4);
                this.Feeds.Add(await feed5);
                this.Feeds.Add(await feed6);
                this.Feeds.Add(await feed7);
                this.Feeds.Add(await feed8);
                this.Feeds.Add(await feed9);
                this.Feeds.Add(await feed10);
                this.Feeds.Add(await feed11);
                this.Feeds.Add(await feed12);
                this.Feeds.Add(await feed13);
                this.Feeds.Add(await feed14);
            private async Task<FeedData> GetFeedAsync(string feedUriString)
                Windows.Web.Syndication.SyndicationClient client = new SyndicationClient();
                Uri feedUri = new Uri(feedUriString);
                try
                    SyndicationFeed feed = await client.RetrieveFeedAsync(feedUri);
                    // This code is executed after RetrieveFeedAsync returns the SyndicationFeed.
                    // Process the feed and copy the data you want into the FeedData and FeedItem classes.
                    FeedData feedData = new FeedData();
                    if (feed.Title != null && feed.Title.Text != null)
                        feedData.Title = feed.Title.Text;
                    if (feed.Subtitle != null && feed.Subtitle.Text != null)
                        feedData.Description = feed.Subtitle.Text;
                    if (feed.Items != null && feed.Items.Count > 0)
                        // Use the date of the latest post as the last updated date.
                        feedData.PubDate = feed.Items[0].PublishedDate.DateTime;
                        foreach (SyndicationItem item in feed.Items)
                            FeedItem feedItem = new FeedItem();
                            if (item.Title != null && item.Title.Text != null)
                                feedItem.Title = item.Title.Text;
                            if (item.PublishedDate != null)
                                feedItem.PubDate = item.PublishedDate.DateTime;
                            if (item.Authors != null && item.Authors.Count > 0)
                                feedItem.Author = item.Authors[0].Name.ToString();
                            // Handle the differences between RSS and Atom feeds.
                            if (feed.SourceFormat == SyndicationFormat.Atom10)
                                if (item.Content != null && item.Content.Text != null)
                                    feedItem.Content = item.Content.Text;
                                if (item.Id != null)
                                    feedItem.Link = new Uri("http://windowsteamblog.com" + item.Id);
                            else if (feed.SourceFormat == SyndicationFormat.Rss20)
                                if (item.Summary != null && item.Summary.Text != null)
                                    feedItem.Content = item.Summary.Text;
                                if (item.Links != null && item.Links.Count > 0)
                                    feedItem.Link = item.Links[0].Uri;
                            feedData.Items.Add(feedItem);
                    return feedData;
                catch (Exception)
                    return null;
            // Returns the feed that has the specified title.
            public static FeedData GetFeed(string title)             //ERROR HERE
                // Simple linear search is acceptable for small data sets
                var _feedDataSource = App.Current.Resources["feedDataSource"] as FeedDataSource;
                var matches = _feedDataSource.Feeds.Where((feed) => feed.Title.Equals(title));
                if (matches.Count() == 1) return matches.First();
                FeedData feeddata = null;
                return feeddata;
            // Returns the post that has the specified title.
            public static FeedItem GetItem(string uniqueId)
                // Simple linear search is acceptable for small data sets
                var _feedDataSource = App.Current.Resources["feedDataSource"] as FeedDataSource;
                var _feeds = _feedDataSource.Feeds;
                var matches = _feedDataSource.Feeds.SelectMany(group => group.Items).Where((item) => item.Title.Equals(uniqueId));
                if (matches.Count() == 1) return matches.First();
                return null;
    }

    The feed links given in the msdn site are already broken because now the official site for windows blogs is "blogs.windows.com" & not "windowsteamblogs.com". I am posting the updated code here :-
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Linq;
    using System.Threading.Tasks;
    using Windows.Web.Syndication;
    namespace WindowsBlogReader
    // FeedData
    // Holds info for a single blog feed, including a list of blog posts (FeedItem).
    public class FeedData
    public string Title { get; set; }
    public string Description { get; set; }
    public DateTime PubDate { get; set; }
    private List<FeedItem> _Items = new List<FeedItem>();
    public List<FeedItem> Items
    get
    return this._Items;
    // FeedItem
    // Holds info for a single blog post.
    public class FeedItem
    public string Title { get; set; }
    public string Author { get; set; }
    public string Content { get; set; }
    public DateTime PubDate { get; set; }
    public Uri Link { get; set; }
    // FeedDataSource
    // Holds a collection of blog feeds (FeedData), and contains methods needed to
    // retreive the feeds.
    public class FeedDataSource
    private ObservableCollection<FeedData> _Feeds = new ObservableCollection<FeedData>();
    public ObservableCollection<FeedData> Feeds
    get
    return this._Feeds;
    public async Task GetFeedsAsync()
    #region WindowsTeamBlogs Feed Links
    //Task<FeedData> feed1 =
    // GetFeedAsync("http://windowsteamblog.com/windows/b/developers/atom.aspx");
    //Task<FeedData> feed2 =
    // GetFeedAsync("http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx");
    //Task<FeedData> feed3 =
    // GetFeedAsync("http://windowsteamblog.com/windows/b/extremewindows/atom.aspx");
    //Task<FeedData> feed4 =
    // GetFeedAsync("http://windowsteamblog.com/windows/b/business/atom.aspx");
    //Task<FeedData> feed5 =
    // GetFeedAsync("http://windowsteamblog.com/windows/b/bloggingwindows/atom.aspx");
    //Task<FeedData> feed6 =
    // GetFeedAsync("http://windowsteamblog.com/windows/b/windowssecurity/atom.aspx");
    //Task<FeedData> feed7 =
    // GetFeedAsync("http://windowsteamblog.com/windows/b/springboard/atom.aspx");
    //Task<FeedData> feed8 =
    // GetFeedAsync("http://windowsteamblog.com/windows/b/windowshomeserver/atom.aspx");
    //// There is no Atom feed for this blog, so use the RSS feed.
    //Task<FeedData> feed9 =
    // GetFeedAsync("http://windowsteamblog.com/windows_live/b/windowslive/rss.aspx");
    //Task<FeedData> feed10 =
    // GetFeedAsync("http://windowsteamblog.com/windows_live/b/developer/atom.aspx");
    //Task<FeedData> feed11 =
    // GetFeedAsync("http://windowsteamblog.com/ie/b/ie/atom.aspx");
    //Task<FeedData> feed12 =
    // GetFeedAsync("http://windowsteamblog.com/windows_phone/b/wpdev/atom.aspx");
    //Task<FeedData> feed13 =
    // GetFeedAsync("http://windowsteamblog.com/windows_phone/b/wmdev/atom.aspx");
    //Task<FeedData> feed14 =
    // GetFeedAsync("http://windowsteamblog.com/windows_phone/b/windowsphone/atom.aspx");
    #endregion
    #region Windows Blogs Broken Links
    //Task<FeedData> feed1 =
    // GetFeedAsync("http://blogs.windows.com/skydrive/b/skydrive/atom.aspx");
    //Task<FeedData> feed2 =
    // GetFeedAsync("http://blogs.windows.com/windows/b/windowsexperience/atom.aspx");
    //Task<FeedData> feed3 =
    // GetFeedAsync("http://blogs.windows.com/windows/b/extremewindows/atom.aspx");
    //Task<FeedData> feed4 =
    // GetFeedAsync("http://blogs.windows.com/windows/b/business/atom.aspx");
    //Task<FeedData> feed5 =
    // GetFeedAsync("http://blogs.windows.com/windows/b/bloggingwindows/atom.aspx");
    //Task<FeedData> feed6 =
    // GetFeedAsync("http://blogs.windows.com/windows/b/windowssecurity/atom.aspx");
    //Task<FeedData> feed7 =
    // GetFeedAsync("http://blogs.windows.com/windows/b/springboard/atom.aspx");
    //Task<FeedData> feed8 =
    // GetFeedAsync("http://blogs.windows.com/windows/b/windowshomeserver/atom.aspx");
    //// There is no Atom feed for this blog, so use the RSS feed.
    //Task<FeedData> feed9 =
    // GetFeedAsync("http://blogs.windows.com/windows_live/b/windowslive/rss.aspx");
    //Task<FeedData> feed10 =
    // GetFeedAsync("http://blogs.windows.com/windows_live/b/developer/atom.aspx");
    //Task<FeedData> feed11 =
    // GetFeedAsync("http://blogs.windows.com/ie/b/ie/atom.aspx");
    //Task<FeedData> feed12 =
    // GetFeedAsync("http://blogs.windows.com/windows_phone/b/wpdev/atom.aspx");
    //Task<FeedData> feed13 =
    // GetFeedAsync("http://blogs.windows.com/windows_phone/b/wmdev/atom.aspx");
    //Task<FeedData> feed14 =
    // GetFeedAsync("http://blogs.windows.com/windows_phone/b/windowsphone/atom.aspx");
    #endregion
    #region Windows Blogs Feeds
    Task<FeedData> feed1 =
    GetFeedAsync("http://blogs.windows.com/windows/b/bloggingwindows/rss.aspx");
    Task<FeedData> feed2 =
    GetFeedAsync("http://blogs.windows.com/windows/b/windowsexperience/rss.aspx");
    Task<FeedData> feed3 =
    GetFeedAsync("http://blogs.windows.com/windows/b/extremewindows/rss.aspx");
    Task<FeedData> feed4 =
    GetFeedAsync("http://blogs.windows.com/windows/b/business/rss.aspx");
    Task<FeedData> feed5 =
    GetFeedAsync("http://blogs.windows.com/windows/b/windowssecurity/rss.aspx");
    Task<FeedData> feed6 =
    GetFeedAsync("http://blogs.windows.com/windows/b/springboard/rss.aspx");
    Task<FeedData> feed7 =
    GetFeedAsync("http://blogs.windows.com/windows/b/windowshomeserver/rss.aspx");
    Task<FeedData> feed8 =
    GetFeedAsync("http://blogs.windows.com/windows_live/b/windowslive/rss.aspx");
    Task<FeedData> feed9 =
    GetFeedAsync("http://blogs.windows.com/windows_live/b/developer/rss.aspx");
    Task<FeedData> feed10 =
    GetFeedAsync("http://blogs.windows.com/ie/b/ie/rss.aspx");
    Task<FeedData> feed11 =
    GetFeedAsync("http://blogs.windows.com/skydrive/b/skydrive/rss.aspx");
    Task<FeedData> feed12 =
    GetFeedAsync("http://blogs.windows.com/windows_phone/b/windowsphone/rss.aspx");
    Task<FeedData> feed13 =
    GetFeedAsync("http://blogs.windows.com/windows_phone/b/wpdev/rss.aspx");
    Task<FeedData> feed14 =
    GetFeedAsync("http://blogs.windows.com/windows_phone/b/wmdev/rss.aspx");
    #endregion
    #region Downloading the Feeds
    this.Feeds.Add(await feed1);
    this.Feeds.Add(await feed2);
    this.Feeds.Add(await feed3);
    this.Feeds.Add(await feed4);
    this.Feeds.Add(await feed5);
    this.Feeds.Add(await feed6);
    this.Feeds.Add(await feed7);
    this.Feeds.Add(await feed8);
    this.Feeds.Add(await feed9);
    this.Feeds.Add(await feed10);
    this.Feeds.Add(await feed11);
    this.Feeds.Add(await feed12);
    this.Feeds.Add(await feed13);
    this.Feeds.Add(await feed14);
    #endregion
    private async Task<FeedData> GetFeedAsync(string feedUriString)
    Windows.Web.Syndication.SyndicationClient client = new SyndicationClient();
    Uri feedUri = new Uri(feedUriString);
    try
    SyndicationFeed feed = await client.RetrieveFeedAsync(feedUri);
    // This code is executed after RetrieveFeedAsync returns the SyndicationFeed.
    // Process the feed and copy the data you want into the FeedData and FeedItem classes.
    FeedData feedData = new FeedData();
    if (feed.Title != null && feed.Title.Text != null)
    feedData.Title = feed.Title.Text;
    if (feed.Subtitle != null && feed.Subtitle.Text != null)
    feedData.Description = feed.Subtitle.Text;
    if (feed.Items != null && feed.Items.Count > 0)
    // Use the date of the latest post as the last updated date.
    feedData.PubDate = feed.Items[0].PublishedDate.DateTime;
    foreach (SyndicationItem item in feed.Items)
    FeedItem feedItem = new FeedItem();
    if (item.Title != null && item.Title.Text != null)
    feedItem.Title = item.Title.Text;
    if (item.PublishedDate != null)
    feedItem.PubDate = item.PublishedDate.DateTime;
    if (item.Authors != null && item.Authors.Count > 0)
    feedItem.Author = item.Authors[0].Name.ToString();
    // Handle the differences between RSS and Atom feeds.
    if (feed.SourceFormat == SyndicationFormat.Atom10)
    if (item.Content != null && item.Content.Text != null)
    feedItem.Content = item.Content.Text;
    if (item.Id != null)
    feedItem.Link = new Uri("http://windowsteamblog.com" + item.Id);
    else if (feed.SourceFormat == SyndicationFormat.Rss20)
    if (item.Summary != null && item.Summary.Text != null)
    feedItem.Content = item.Summary.Text;
    if (item.Links != null && item.Links.Count > 0)
    feedItem.Link = item.Links[0].Uri;
    feedData.Items.Add(feedItem);
    return feedData;
    catch (Exception)
    return null;
    // Returns the feed that has the specified title.
    public static FeedData GetFeed(string title)
    // Simple linear search is acceptable for small data sets
    var _feedDataSource = App.Current.Resources["feedDataSource"] as FeedDataSource;
    //var matches = _feedDataSource.Feeds.Where((feed) => feed.Title.Equals(title));
    var matches = _feedDataSource.Feeds.Where((feed) => feed != null && feed.Title.Equals(title));
    if (matches.Count() == 1) return matches.First();
    return null;
    // Returns the post that has the specified title.
    public static FeedItem GetItem(string uniqueId)
    // Simple linear search is acceptable for small data sets
    var _feedDataSource = App.Current.Resources["feedDataSource"] as FeedDataSource;
    var _feeds = _feedDataSource.Feeds;
    //var matches = _feedDataSource.Feeds.SelectMany(group => group.Items).Where((item) => item.Title.Equals(uniqueId));
    var matches = _feedDataSource.Feeds.SelectMany(group => group.Items).Where((item) => item != null && item.Title.Equals(uniqueId));
    if (matches.Count() == 1) return matches.First();
    return null;
    U will notice that there are 3 sets of list available here.
    The first set of links contain the old broken links from  "windowsteamblogs.com",
    the second set of links contain the links from  "blogs.windows.com" which are now also broken,
    the last set of links contain the links from  "blogs.windows.com" some of which are also broken.
    So if u run the program using those links u will get a "nullpointerexception" error.
    To solve this problem i updated a line of code in the "GetFeed" method from :- 
    var matches = _feedDataSource.Feeds.Where((feed) => feed.Title.Equals(title));
    to :- 
    var matches = _feedDataSource.Feeds.Where((feed) => feed != null && feed.Title.Equals(title));
    This line of code will ignore those empty(null) feeds.
    For safety sake i also updated the code in the "GetItem" method, and this "FeedDataSource" class will compile without any error, but he program will crash in split.xaml without giving any proper
    error message.
    Here are some of the links where people have faced similar problems :- 
    Runtime
    Error
    Parsing
    null feeds
    Problem
    in Page Navigation

  • Collection content and many-many relation

    I have a collection mapped on an intermediate table with the many-many
    system.
    when I read the content of the collection, I find all the expected entries
    but also container of the collection.
    for example, if a person contains a collection of cars, in the collection I
    find all the cars of the person but also the person.
    Is there any explanation for that ?

    First of all, I do not understand how it could be possible for a JDO
    implementation to provide a heterogeneous collection whereas it is defined
    in the jdo file that it is not heterogeneous.
    In this case, I've defined in the metadata that the collection contains Cars
    and Kodo return Cars and Persons.
    My database is fully consistent and I do not understand how it could not be
    consistent in such cases.
    The same application is also used on other JDO implementations ( LiDO ) for
    my tests and everything works well.
    The differences between the application with LiDO and Kodo in this
    application are only located in the settings and the mapping.
    Here is my mapping, I think my setting are not involved in the problem :
    <class name="Car">
    <jdbc-class-map type="base" table="CARS"/>
    <field name="id">
    <jdbc-field-map type="value" column="ID"/>
    </field>
    <field name="name">
    <jdbc-field-map type="value" column="NAME"/>
    </field>
    </class>
    <class name="Person">
    <jdbc-class-map type="base" table="PERSONS"/>
    <field name="cars">
    <jdbc-field-map type="many-many" element-column.ID="CAR_ID"
    ref-column.ID="PERS_ID" table="PERS_CARS"/>
    </field>
    <field name="id">
    <jdbc-field-map type="value" column="ID"/>
    </field>
    </class>
    Unfortunately it is not possible to send my application nor to invest time
    creating test-cases.
    If you have some test-cases, I would be please to compare them to my
    application.
    Thx
    "Abe White" <[email protected]> a __crit dans le message de
    news:[email protected]...
    Do the owner class and the collection's element type share a common
    ancestor? If so, then have you checked to be sure that the database's
    data doesn't have the owner in the collection, and Kodo isn't just
    reading the data as-is?
    Either way, I would check your application logic first. We have lots
    and lots of customers using m-m relations, and no one has ever reported
    an error like this. It also hasn't shown up in any of our internal m-m
    tests. So my first guesses are that either your database's data has the
    owner within the collection, or you are putting the owner in the
    collection in your application logic.
    If you find that this is not the case and can reproduce the problem,
    please send your test case to [email protected] and we'll be
    happy to check it out.

Maybe you are looking for

  • When using SUS, clients say software's up to date when it's not.

    I'm trying to get my Software Update service up and running and it all seems to be working (clients see server) except that every client reports that software is up to date even though I've got all updates copied and enabled (just trying to save band

  • Authorization for Manual Maintenance of Logon Data

    Dear Experts, In LRFMD, I can see the field maintain logon data. Normally it is unchecked. Can any one let me know what is the impact of checking this field? In order to lovk the screen variant in LM00, I need to check this field in LRFMD. What will

  • Important Folder can only be accessed by dock

    Somehow a folder decided to disappear from the regular directory heirarchy. I first noticed it missing when trying to access the folder from another computer. It is a fairly important folder, so luckily, on the computer thatit is located, I have it i

  • Photoshop CS3 Macrovision Flexnet Licensing problem

    HI I have a Lenovo 9129-A3m ThinkCentre running Vista 32 Business with 4gigs ram. I can not get Photoshop to run, I am pretty sure it is because the Flexnet licensing is not working, when I run Photoshop it just sits on a gray screen with the hour gl

  • Removing app from Melrose?

    If I list an app in the Melrose marketplace am I committed to Melrose for the life of the app? Can I remove it from Melrose at a later date?