diff --git a/src/org/ntlab/pushPullRefactoring/Pull2PushRewriter.java b/src/org/ntlab/pushPullRefactoring/Pull2PushRewriter.java index b24f39a..8ea10b8 100644 --- a/src/org/ntlab/pushPullRefactoring/Pull2PushRewriter.java +++ b/src/org/ntlab/pushPullRefactoring/Pull2PushRewriter.java @@ -56,8 +56,8 @@ + System.getProperty("line.separator") ; addStatement(srcUnitRewrite, srcUnit, srcDec[0],importPushRef,TypeDeclaration.MODIFIERS2_PROPERTY); - // Handling �N���X�� updateAvailable() ���\�b�h�� updateRequest() ���\�b�h�̍Ō�ɁCShipping �N���X�� - // updateHandling() ���\�b�h���t�B�[���h value �������Ƃ��ēn���ČĂяo���s��lj�����D + // �]�����N���X��update���\�b�h�̍Ō�ɁC�]����N���X��update���\�b�h�� + //�t�B�[���h value �������Ƃ��ēn���ČĂяo���s��lj�����D Type srcType = searchFieldDeclaration(srcUnit, "State").getType(); for (var update : messages) { var invocations = getPutMethodInvocations(update); @@ -104,25 +104,26 @@ }); ASTRewrite dstUnitRewrite = ASTRewrite.create(dstDec[0].getAST()); - // Shipping �N���X�̃t�B�[���h handling ���폜����D + //�]����N���X��PullReference���t�^���ꂽ�t�B�[���h���폜����D deleteASTNode(dstUnitRewrite, dstUnit, searchFieldDeclaration(dstUnit, "PullReference", srcValue)); - // Shipping �N���X�ɏo�Ɏw���̓��e��ۑ����邽�߂̃t�B�[���h Item value ��lj�����D + // �]����N���X�ɏ�Ԃ�ێ�����t�B�[���hvalue ��lj�����D Type dstType = searchMethodDeclaration(dstUnit, "Getter").getReturnType2(); - String stateCode = "@State" + System.getProperty("line.separator") + dstType.toString() + " value;"; addStatement(dstUnitRewrite, dstUnit, dstDec[0], stateCode); - // Shipping �N���X�� void updateHandling(ItemHandling handling) ���\�b�h��lj�����D - // Shipping �N���X�� getValue() - // ���\�b�h���ōs���Ă����C���[�U�̓��͂ɑ΂��鏈�����e(ItemHandling)�����Ƃɏo�Ɏw���̓��e(Item)���쐬���鏈�����CupdateHandling() - // ���\�b�h�Ɉړ����C�o�Ɏw���̓��e�� value �t�B�[���h�ɕۑ�����悤�ɂ���D + + // �]����N���X��update���\�b�h��lj�����D + // �]����N���X��get���\�b�h���ōs���Ă����C�߂�l���v�Z���鏈���� + // update���\�b�h�Ɉړ����C�X�V��̒l��value�ɕۑ�����悤�ɂ���D String updateCode = generatePutMethod(dstType, new Type[] { srcType }, new String[] { srcValue }); addStatement(dstUnitRewrite, dstUnit, dstDec[0], updateCode); + // Shipping �N���X�� getValue() ���\�b�h�� value �t�B�[���h�̒l��Ԃ��悤�ɏ���������D Statement statement = (Statement) dstUnitRewrite.createStringPlaceholder("{ return this.value; }", ASTNode.VARIABLE_DECLARATION_STATEMENT); replaceASTNode(dstUnitRewrite, dstUnit, searchMethodDeclaration(dstUnit, "Getter").getBody(), statement); + //�ύX��K�p���� try { applyRewrite(srcUnit, srcUnitRewrite, pm); applyRewrite(dstUnit, dstUnitRewrite, pm); @@ -133,7 +134,13 @@ } } - + /** + * PUT���\�b�h���쐬����. + * @param �]���惊�\�[�X�̌^ + * @param �]�������\�[�X�̌^ + * @param �]�����̃��\�[�X�� + * @return + */ public String generatePutMethod(Type updatedValueType, Type[] paramTypes, String[] srcNames) { String paramType = "String";