Order of Object Creation
I need to know what order various objects are created and processed. An example will be most helpful.
class A {
A() { myFunc(); }
public void myFunc() {}
class B extends A {
class innerB { public void funcInnerB() { ... do some work ... } }
public void myFunc() { someVar.funcInnerB(); }
innerB someVar = new innerB();
When class B is instantiated the following happens [assuming I coded my example properly :) ]
1. The default B constructor is called.
2. It calls the A constructor.
3. The method myFunc in class B is called from A constructor.
4. a NULL Pointer error occurs because someVar has appearantly not yet been assigned to the new innerB object.
This is my problem, why is someVar not being created immediately? I don't know if this problem is universal, but in my particular application, it is happening this way. (I can't post the actual code, because it is way, way too long.)
I tried using an initialization block in class B to assign someVar, but the same problem occurs.
Here's my current workaround:
in class B:
public void myFunc() { if (someVar == null) { someVar = new innerB() }
someVar.funcInnerB(); }
But I am hoping there is a better solution and I am worried about when I may run into this situation. So, I am hoping there is a definitive guide to the order everything is created.
Thanks in advance.
It's not a good idea to call non-final methods from a non-final class because of exactly what you found. The NullPointerException happens because of the order of processing that you described - by the time you get to B.myFunc(), the B members have not been initialized. First, the superclass is fully initialized. All members are set to their initial values, then the constructor is executed. After the superclass constructor finishes, then the subclass members are initialized, and any further subclass constructor processing occurs.
Similar Messages
-
Defining the order of objects when using Distribute?
VERSION: Illustrator CC Mac
So, I've always assumed that the order of the layers determined the order and position that shapes are moved in the Distribute function.
I'm having a wierd problem today and the order seems to be defined by something I can't figure out. I'm trying to vertically distribute a set of the same shape and instead of counting the shapes in order from left to right or vise versa the distribute function seems to be randomly picking the order of the shape, not basing it on location or layer order.
Here are a couple of examples:
In both examples I have used a Vertical Distribute Center and both groups of shapes are ordered from left to right in the layers palette with the left most layer being the first layer and the right most shape being the last.
What is causing the shapes to be distributed in this order? How do I specify what the order is if it isn't based on layer or position order?So, I've always assumed that the order of the layers determined the order and position that shapes are moved....
Wrong assumption. Only true sometimes.
...instead of counting the shapes in order from left to right...
Wrong assumption again.
So first, let's deal with the above assumptions:
When distributing objects, you are not usually talking about stacking order at all. You are talking about modifying initial reading order based on the initial relative X or Y positions.
Although you want stacking order to be a factor in some cases, you wouldn't want it in every case. Nor would you want it to be the default criteria. To understand this, consider the matter of reading order in text objects:
You open a PDF. As is often the case, it has a plethora of individual text objects. Those objects have a particular reading order which is really nothing but a perception of the viewer based on their relative positions. There is no guarantee whatsoever that the object stacking order corresponds to the reading order (creation order). For all the viewer knows, the body text may in fact have been created before the decorative headlines. The subheads, bullets, and callouts may also have been created in any unknown order.
In fact, I have just such a real-world frequently-reccuring situation: DXFs exported from engineering drawings frequently contain columns/rows of text in which the reading order does not correspond to the object stacking order. If the DXF is opened in Illustrator and then those text objects are threaded, or if their text is copied and pasted to concatenate them into a single text object, their reading order becomes scrambled, because threading and concatenating text is indeed dependent upon object stacking order (as are Blends, Mesh patches, and Pattern Brush tiles). By the same token, if those "lines" of text are distributed for uniform spacing and if the result were determined by the object stacking order, the text reading order would be similarly ruined.
So for this and similar situations I wrote a set of Javascripts which I use to rearrnage the stacking order of objects according to their relative positions on the page (i.e.; their reading order) first, before concatenating the text. But you wouldn't want to have to do this in every situation in which you want to distribute every and all kind(s) of objects.
The concept of "reading order" is not limited to text. Consider a fan of playing cards in a poker player's hand. Or chess pieces on a board. Or a row of houses on a map. Fence slats. Deck boards. Bricks or stones. Holiday icons on a calendar grid. You might want to make the XY spacing of such objects uniform, but that doesn't mean you want the stacking order changed, and inversely it doesn't mean you want the XY positions to be determined by stacking order.
So unless and until there is an "Ordered By:" control with which the user specifies "Stacking Order" or "Reading Order" (which there isn't), the feature just uses initial position values (reading order) as the first sorting criteria, and this is the most "normal" behavior.
...drawing a set of overlapping squares in decreasing size order, smallest on top. Drag the top square out of alignment.
I start with a group of shapes, all repeatedly copied from the first one on the far left...Then I move up the last one up...
On the left is before with two circles on top of each other...
In all the above instances, note that the situation starts with multiple objects already aligned in the direction of desired distribution, and moving only one of them before performing the distribution. So think of the math:
You have a set of horizontal position values: [0,0,0,3]. You want to "equally space" those values. How do you do that if, as explained above, stacking order is not a determinant? How do you "order" three zeros based on their numeric values? The instructions are ambiguous. In such situations, you have to use some other secondary criteria, even if it is arbitrary; even if it is random. Example:
Understand, I'm just replying to your initial post here. I'm not saying there is no bug in the Distribute interface. There may be, and if so, the bug(s) may be version-specific. I'm not addressing what Steve is trying to explain in Post 18: But note that when you do what he describes, the Distrubute Spacing value field automatically changes to zero, even if it is initially set to Auto and you are only clicking the Horizontal Distribute Space button. (At least in CS3; I don't have later versions in front of me right now because I'm not in the studio and I don't have CC at all because I'm not going to rent Adobe's software),
JET -
Purchase Order and Invoice creation
Hi All,
I am having some fields related to Purchase order and Invoice creation, i have to find out the tables to which tables these fields belongs to.
Below are the Header fields:
Wrbtr Tcode - MIRO,
Lfsnr Tcode - MIGO,
Evertn Tcode - Me32k,
Kbetr Tcode - Me32k,
Kschl Tcode - Mek1,
Selkz Tcode - Mek1,
Werks Tcode - Mek1,
Evart Tcode - Me31k,
Frgco Tcode - Me35k,
Sddat Tcode - Me35k,
Below are the Detail fields:
Kbetr Tcode - Mek1,
Konwa Tcode - Mek1,
Lgobe Tcode - Me21n,
Planloc Tcode - Me31k,
Datab Tcode - Mek1,
Datbi Tcode - Mek1,
Fromdate Tcode - Me31k,
Todate Tcode - Me31k,
i have to retrive all these fields from tables, so plz anybody give me exact tables to use in the select quries to retrive these fields.
Thanks in advance,
Balu.Hi,
U can get the req fields as follows:
Below are the Header fields:
1)Wrbtr Tcode - MIRO- table rseg ,field-wrbtr
give belnr (invoice no ) & BUZEI(item) if known, else, give ebeln,ebelp.
2)Lfsnr Tcode - MIGO,-table mkpf,give mblnr (mat doc no ) & ZEILE(item) field-xblnr or give ebeln,ebelp
3)Kbetr Tcode - Me32k,
table:konp or konv.
Pass ebeln to ekko, wil get KNUMV.Pass KNUMV as KNUMH in 1 of the tables- konp or konv,wil get kbetr.
4)Kschl Tcode - Mek1,
Pass ebeln,ebelp to table ekpo, get mwskx(taxcode), u will get condition type kschl from FM -FI_TAX_GET_CONDITION_TYPES.
or
table:konh or konp or konv.
Pass ebeln to ekko, wil get KNUMV.Pass KNUMV as KNUMH in 1 of the tables-konh or konp or konv, wil get kschl.
5)Werks Tcode - Mek1,-table-ekpo, field-werks(give ebeln,ebelp)
Below are the Detail fields:
1)Kbetr Tcode - Mek1,
Pass ebeln to ekko, wil get KNUMV.Pass KNUMV as KNUMH in 1 of the tables- konp or konv,wil get kbetr.
2)Konwa Tcode - Mek1,
Pass ebeln to ekko, wil get KNUMV.Pass KNUMV as KNUMH in 1 of the tables- konp or konv,wil get konwa.
3)Lgobe Tcode - Me21n,give ebeln.ebelp in table ekpo, get lgort.pass lgort to table t001l, u wil get lgobe.
4)Datab Tcode - Mek1,table-konh,field datab
Pass ebeln to ekko, wil get KNUMV.Pass KNUMV as KNUMH in - konh ,wil get datab.
5)Datbi Tcode - Mek1,table-konh,field databi
Pass ebeln to ekko, wil get KNUMV.Pass KNUMV as KNUMH in table- konh,wil get databi.
Hope its useful to u. -
Sales order cost objective vs OKB9 Internal order cost object.
Hi All,
we facing an issue with sales order cost objective vs OKB9 cost object.
For IC PO service material, we assigned account assignment category 4.Reasonis Service material was not showing on G\R account.
The G\L account 7898788, we assigned to Service Item (material type DIEN) , for G\Cost 7898788 cost element is assigned in OKB9. Combination business + order 3478787.
Now conflict with sales order cost objective vs OKB9 internal order cost object.
While posting intercompany IR posting system thronging below error messageu2026
Enter only one true account assignment
Message no. KI249
Diagnosis
You made assignments to several objects in CO (cost center, order, project etc.). 2 of these have been created as true objects.
System Response
You are allowed only one account assignment for each cost-relevant account
How to resolve this issue.. Do I make any config changes in the system to overcome this issue?
Or any sub account to assin in VKOA config for internal orderu2026
Regards,
AdiHi Waman,
Thanks for your inputs.
Issue : IR failed to post for wax Sales Order -> ICPO - Error: Enter only one true account assignmentu2019.
Background:
Original setup in Test system & Productionu2013 account determination for servive (DIEN) account assignment category u20184u2019 was linked to G/L Account 34444444, As part of project orange u2019, account determination was linked to account u201889710100u2019.
Account u20188970100u2019 34444444 was replaced with 8970100 ,is not linked to any cost center & always post with reference to IC Sales Order as per config in OKB9 based on company code (US99) + cost element (89701100) + business area (9yyy). This caused a conflict while posting IR, system could not determine exact order for posting financial value.
Conflict: Actual Sales Order 34789343 is linked to PO via account assignment category & IC dummy sales order (8014331) is determine via config setting. Two cost objects cannot be linked to one IR G/L account booking.
Regards,
Adi -
How to show object creation in UML
How to show object creation in UML
In a sequence diagram, it's a line (with arrow) pointing to the new object and the <creates> or <new> tag as mentioned above.
| obj 1 |
|
| <creates> ----------
| --------------> | obj 2 |
| ----------or----------
| obj 1 |
|
| <new> ----------
| --------------> | obj 2 |
| ---------- -
Ascending Order of Objects at universe Level
Hi Techies.
I am working on BO 3.1 Designer SP5.
I have one Period (Month Year) object at universe level and I have arranged the order of object as Descending by editing the properties of the object.
and when I use this object in the Query Filter section and making it as a Mandatory prompt, the values are loading in a different way rather than descending order.
Please help me on this......
thanks in Advance...Hi
If you want to sort the LOV’s, use the LOV’s based on custom SQL option.
Please find the below sample code.
Sample Code
SELECT DISTINCT FIELD
FROM
TABLE
ORDER BY 1
And find the below link for more info.
http://scn.sap.com/community/semantic-layer/blog/2014/06/11/how-to-sort-the-list-of-values-in-the-prompts-screen -
FIM MA Export errors. There is an error executing a web service object creation.
While checking for the permission, we have figured that the Built-In Synchronization account is being deleted by an Expiration Workflow.
FIM MA Export errors. There is an error executing a web service object creation.
While checking for the permission, we have figured that the Built-in Synchronization account was deleted by an Expiration Workflow
Is there a way to restore. Thanks.I would re-run FIM setup - I think it can re-create this account
If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. -
Xdb_installation_trigger does not support object creation of type SNAPSHOT
hi everyone, i'm using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit on solaris sparc 5.10
we like to send an email through SSL, and after searching here and there I found out that oracle DB 11g able to go throught the SSL.
since upgrade our DB to 11g would not be an option, so i tried to export XDB of 11g and import it into XDB 10gR2 schema, it was a mess...
then i just reinstall XDB using catnoqm.sql & catqm.sql
and now one of our programmer cant run some script like above
CREATE MATERIALIZED VIEW FIFSYS_MKT_SCHEME_MV_COY
TABLESPACE MARKETING_TABLES
PCTUSED 40
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
+)+
NOCACHE
LOGGING
NOCOMPRESS
NOPARALLEL
BUILD IMMEDIATE
REFRESH FORCE ON DEMAND
WITH PRIMARY KEY
AS
+/* Formatted on 9/23/2010 1:07:42 PM (QP5 v5.114.809.3010) */+
SELECT coy_id,
appl_branch_id,
appl_object_code,
product_type,
ppdcf_paid_date,
SUM (scheme_adm) scheme_adm,
SUM (appl_unit) appl_unit,
SYSDATE mkt_sysdate
FROM (SELECT NVL (a.coy_id, '01') coy_id,
a.branch_id appl_branch_id,
DECODE (a.buss_unit, 'NMC', '2101', 'UMC', '2102', '2352')
appl_object_code,
a.platform product_type,
TRUNC (c.contract_active_date) ppdcf_paid_date,
NVL (s.ms_amt, 0) scheme_adm,
NVL (o.total_item, 0) appl_unit
FROM ordmgmt.om_trn_appl_ms_lvl_object s,
ordmgmt.om_trn_appl_hdr a,
acctmgmt.ar_trn_sum_contracts c,
+( SELECT appl_no, COUNT ( * ) total_item+
FROM ordmgmt.om_trn_appl_object
GROUP BY appl_no) o
WHERE s.appl_no = a.appl_no
AND a.appl_no = o.appl_no
AND s.ms_code IN ('MS03', 'MS14')
AND c.appl_no = a.appl_no
AND c.contract_no = a.contract_no
+/*AND c.office_code = a.branch_id*/+
AND NVL (a.coy_id, '01') = NVL (c.coy_id, '01'))
GROUP BY coy_id,
appl_branch_id,
appl_object_code,
product_type,
ppdcf_paid_date;
COMMENT ON MATERIALIZED VIEW FIFSYS_MKT_SCHEME_MV_COY IS 'snapshot table for snapshot MARKETING.FIFSYS_MKT_SCHEME_MV_COY';
and this error shown:
ORA-00604 error occurred at recursive SQL level 1
ORA-20000 Trigger xdb_installation_trigger does not support object creation of type SNAPSHOT
ORA-06512 at line 32
maybe some of you know how to solve this problem??
and, this in the script of the xdb_installation_trigger
DROP TRIGGER SYS.XDB_INSTALLATION_TRIGGER;
CREATE OR REPLACE TRIGGER SYS.xdb_installation_trigger
BEFORE
CREATE ON DATABASE
DECLARE
sql_text varchar2(200);
val number;
BEGIN
if (dictionary_obj_owner != 'XDB') then
if (dictionary_obj_type = 'FUNCTION' or
dictionary_obj_type = 'INDEX' or
dictionary_obj_type = 'PACKAGE' or
dictionary_obj_type = 'PACKAGE BODY' or
dictionary_obj_type = 'PROCEDURE' or
dictionary_obj_type = 'SYNONYM' or
dictionary_obj_type = 'TABLE' or
dictionary_obj_type = 'TABLESPACE' or
dictionary_obj_type = 'TYPE' or
dictionary_obj_type = 'VIEW' or
dictionary_obj_type = 'USER'
+)then+
if (dictionary_obj_type != 'PACKAGE BODY'
+) then+
sql_text := 'select count(*) from ALL_OBJECTS where owner = :1 and object_name = :2 and object_type = :3';
execute immediate sql_text into val using dictionary_obj_owner, dictionary_obj_name, dictionary_obj_type;
if (val = 0) then
sql_text := 'select count(*) from dropped_xdb_instll_tab where owner = :1 and object_name = :2 and object_type = :3';
execute immediate sql_text into val using dictionary_obj_owner, dictionary_obj_name, dictionary_obj_type;
if (val = 0) then
insert into xdb_installation_tab values
+(dictionary_obj_owner, dictionary_obj_name, dictionary_obj_type);+
end if;
end if;
end if;
else
raise_application_error(-20000, 'Trigger xdb_installation_trigger does not support object creation of type '||dictionary_obj_type);
end if;
end if;
end;
+/+
/********************************************************************************/i'm so careless, after checking a fresh installation of the same version DB, i dont found xdb_installation_trigger.
so just by simply remove that trigger & everything works just fine. :) -
Hello
Please tell me what is the difference between these two object creation of string.
String str = new String("Hello");.
String str="Hello";
Thanks.RGEO wrote:
hello,
Is the string pool is part of a heap? Huh? I suppose yes, you could regard the String pool as part of the heap... but (I guess) that interned String objects would be placed directly into the permanent generation, which is not garbage collected... and therefore I don't really think of the permanent generation as part of the heap (except when tuning heap allocations)... but I think I'm talking over your noob head here, yes... and so to the noob-stuff.
If you get bored you might like to scan (for now) http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#generations ... and come back to it in a couple of years time (when every second word isn't new and baffling to you;-)
jvm what will do when he encounter the following code,
String s1 = new String ("hello");The VM will:
1. Create a new String object, and then
2. copy the characters 'h','e','l','l','o' from the interned String "hello" to the new String,
3. and then assign a reference to the new String to variable s1.
Note that the result is subtley different from String s1 = "hello", which just does step 3... it assigns a reference to the existing interned String object "hello" to the variable s1... it does not create and "populate" a new String object.
Try this just for fun... what is the output of the following program? Why?
package forums;
public class StringEquals
public static void main(String[] args) {
try {
String a = "Hello";
String b = "Hello";
System.out.println("a==b is "+(a==b));
String c = new String("Hello");
System.out.println("a==c is "+(a==c));
} catch (Exception e) {
e.printStackTrace();
}Now, what's the correct way to evaluate equality of String objects in Java?
HTH. Cheers. Keith. -
Cost of object creation vs reflection?
How does the cost of invoking a method using reflection compare to the cost of object creation? Thank you,
rankoi agree. in such cases, you should do the simplest thing that could possibly work. there are legitimate uses for reflection. without reflection, we have no core serialization mechanism. without serialization, we have no core RPC mechanism (RMI). no dynamic proxies without reflection. all those neat visual building tools are hampered without reflection. ORBs and scripting languages like Jython are hindered.
note that the legitimate uses of reflection shown above tend to be for core JDK, or for development tools. that should be a clue to the developer that unless you're building these kinds of systems, you should reconsider whether reflection is necessary.
that said, reflection has a high "cool" factor. i think that's what sucks developers toward it. it sucked me in, that's for sure. 8^)
--p -
Feature code price for a Order in the creation mode
Hi All,
Is there anyway or function module using which i can retrieve feature code price of an order in the creation mode.Does anybdy has any idea regarding the above query ??
-
Purchase Order Text Object missing in Transcation VOTXN
Hi Experts
I want Purchase Order Text Object in Transction VOTXN, for that Referring SAP Note 75144 - EKKO EKPO entries should be in table TFRM, if these two entries are missing, using the solution contained in Note 524453 to generate the missing entries in the table TFRM, run program RV80INCTFRM. I run that program too but still am not able to see purchase order text in Tcode VOTXN.
Please help me on this....The note Note 524453 - Purchasing text determination is not transported mentions that you need to run program RV80HGEN after RV80INCTFRM. Did you run this program? What is your SAP version? Did you also check other notes provided in 524453?
Regards, -
PM: how to track the operations in prev.maint order against object list
Dear PM Guru's.
i have one issue in my preventive maintenance scenario. i clubed the same type of machines in one maintenance order under object list tab. and i mention the list operations in maintenance order. suppose in one preventive maintenance order 10 operations are maintained and 5objects are mentioned in that order. Now i like to mention all these 10 operations activities against to 5 objects. how i can assign sequentially? i required like 10operations one by one row wise and 5objects side by side column wise. i would like to update the each operation activity against each machine column? how i have to do this one?
Please suggest me and help me.
regards
Jalendhar MeruguUsing Object functionality, we can maintain many equipments in the order.
But the constraint is that one operation can be assigned to only one equipment. In your case, you have 5 objects. If all 10 operations will be performed on 5 objects, then you have to maintain 50 operations & you should assign the objects.
In other words, if one operation will be performed on 5 objects, then you should define that one operation 5 times & you have to assign to technical objects. You can't share one operation to many equipments. -
Loading transaction data from flat file to SNP order series objects
Hi,
I am an BW developer and i need to provide data to my SNP team.
Can you please let me know more about <b>loading transaction data (sales order, purchase order, etc.,) from external systems into order based SNP objects/structure</b>. there is a 3rd party tool called webconnect that gets data from external systems and can give data in flat file or in database tables what ever required format we want.
I know we can use BAPI's, but dont know how. can you please send any <b>sample ABAP program code that calls BAPI to read flat file and write to SNP order series objects</b>.
Please let me know ASAP, how to get data from flat file into SNP order based objects, with options and I will be very grateful.
thanks in advance
RahulHi,
Please go through the following links:
https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4180456
https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4040057
https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=3832922
https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4067999
Hope this helps...
Regards,
Habeeb
Assign points if helpful..:) -
Hello,
I have a question on object creation and while loops. Have a look at the following code snippet:
while(true)
Object obj = new Object();
// Pass off obj to a new thread
Thread job = new Thread(new ObjectHandler(obj));
job.start();
}My question is, do I have to wait until the newly created Thread is finished with the Object obj before I can create a new Object called obj in the while loop?
Also does anyone have any documentation on this sort of thing?
Thanks,
Tony.Jaxie wrote:
I'm still not sure you get what I'm on about, you might want to read up on java methods and pass by value.I think we know how it works. Most of us have been programming in Java for serveral years.
>
When you pass an object to a method in java you pass it a copy of a reference to that object. Leading on from that, before an object is eligible for garbage collection in java, all references to that object must be dropped.
So with all that in place, my question was, is the creation of an object in a while loop dependent on previous objects of the same name? Objects don't have names. Have we mentioned that before?
You have a reference, larry that is referencing an unnamed object. You can also create other references that reference the same object. The thread will have one reference. You can then make larry reference another object. That will not change anything in the thread. It will still reference the old object, and that object will not be claimed by the gc until that thread stops referencing it.
So the second time we go through the loop below, do we have to wait until larry has been garbage collected, before a new larry can be created?Read the articles/tutorials and what I have written above. What do you think?
Do also note that the GC isn't executed synchronously.
Maybe you are looking for
-
Really let down by the customer service today.....
Hey Best Buy, I called the 1888 number but I'm not sure if it will get to corporate or not. And like others on this board I've read that a lot of corporate members patrol around these boards so I wanted to let everyone know my story here. Me and th
-
Retriving Localization Data Italy
Hi, i need to build a map like this http://elocation.oracle.com/elocation/ajax/ with the same information about street park etc. Can you tell mi where i find the table data with the sdo_geometry info ? Thank you very much! Have a nice day !
-
Searching emails with attachments in IOS
In IOS email, how can I get all emails from a particular sender which have an attachment included?
-
Inquira Information manager - Default value of category to be used while adding a content
Hi, I have a requirement in which a category value should be made a default and that value should be added automatically when creating a document under a channel. Description: I have a channel called as 'product & services' and in that I have a categ
-
IPTC description got lost - a bug?
Hi folks, recently I started to use LR (2.5, 64bit version) to also edit my IPTC fields (only the RAW files, Nikon in my case) and unfortunately I ran into trouble doing so. After I had finished the whole image and IPTC work I moved the image files a