Hi Justin,
If I understand you correctly, you would like to change
st_mtime = st_mtime;
to
st_mtime = FileStats.st_mtime;
or
FileStats.st_mtime = FileStats.st_mtime;
by using the refactoring wizard.
Refactoring by definition never changes the semantics of the program. The
program behaviour is identical, but it is reorganized to be clearer and
easier to maintain.
st_mtime is a subfield of statds and FileStats.st_mtime is a subfield of
FileStats, so this is no longer a refactoring and that is why it is not
allowed.
(that is why any field with a '.' in it is considered an invalid name in
the refactoring dialog). You can rename the data structure or the subfield
but you cannot change from the reference to one data structure to another.
Regards,
Edmund (E.H.)
Reinhardt
Technical Architect for Rational Developer for i
Phone: 1-905-413-3125 | Home: IBM
1-905-854-6195
E-mail: edmund.reinhardt@xxxxxxxxxx 8200 Warden Ave
RDi Community: ibm.biz/rdi_hub Markham, ON L6G 1C7
Find me on: LinkedIn: Canada
http://ca.linkedin.com/in/edmundreinhardt/
From: Justin Taylor <JUSTIN@xxxxxxxxxxxxx>
To: "Rational Developer for IBM i / Websphere Development Studio
Client for System i & iSeries" <wdsci-l@xxxxxxxxxxxx>
Date: 04/01/2017 11:12 AM
Subject: Re: [WDSCI-L] Refactor & Qualified DS
Sent by: "WDSCI-L" <wdsci-l-bounces@xxxxxxxxxxxx>
In the sample, if you try to refactor the st_mtime variable to
FileStats.st_mtime on the C-spec, it won't let you. It tells you it's an
invalid name.
-----Original Message-----
From: Edmund Reinhardt [mailto:edmund.reinhardt@xxxxxxxxxx]
Sent: Wednesday, January 04, 2017 8:58 AM
To: Rational Developer for IBM i / Websphere Development Studio Client for
System i & iSeries <wdsci-l@xxxxxxxxxxxx>
Subject: Re: [WDSCI-L] Refactor & Qualified DS
Hi Justin
I think I understand what is going on.
In the source code as it stands both references to the subfield refer to
the statds DS so of course that works. But I think you intended the line
to be
st_mtime = FileStats.st_mtime;
and in that case, it still works and renames the subfield in statds.
The real clue comes from the fact that statds was originally declared in
a /INCLUDE
Refactoring does not currently process /INCLUDE and /COPY files. At this
point the refactoring has to be redone in every file. The challenge in
your example is, because the refactoring doesn't see the /include, it has
no idea that st_mtime is a subfield in the data structure referenced in the
LIKEDS. It just sees it as another dangling reference without a
definition.
This limitation is one of my next priorities but of course an RFE is always
helpful because I have many "next priorities".
Regards,
Edmund (E.H.)
Reinhardt
Technical Architect for Rational Developer for i
Phone: 1-905-413-3125 | Home: IBM
1-905-854-6195
E-mail: edmund.reinhardt@xxxxxxxxxx 8200 Warden Ave
RDi Community: ibm.biz/rdi_hub Markham, ON L6G 1C7
Find me on: LinkedIn: Canada
http://ca.linkedin.com/in/edmundreinhardt/
--
This is the Rational Developer for IBM i / Websphere Development Studio
Client for System i & iSeries (WDSCI-L) mailing list
To post a message email: WDSCI-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/wdsci-l.
As an Amazon Associate we earn from qualifying purchases.