issue# (TFJ-734) #76

Merged
merged 5 commits into from Dec 10, 2012

Conversation

Projects
None yet
2 participants
Contributor

ApplePedlar commented Dec 7, 2012

issue# (TFJ-734)
Support Entities for User Objects

yusuke commented on 56bac03 Dec 7, 2012

  • method name consistency
    getDescriptionUrlEntities should be getDescriptionURLEntities.
  • zero-sized array instead of null
    getDescriptionURLEntities() should return zero-sized array instead of null for the better client code's convenience.
  • entity indices could point incorrect position
    entity indices need to be shifted by HTMLEntity.unescapeAndSlideEntityIncdices().
    plz refer https://github.com/yusuke/twitter4j/blob/master/twitter4j-core/src/main/java/twitter4j/internal/json/StatusJSONImpl.java for the detail.
    HTMLEntity.unescapeAndSlideEntityIncdices() also need to be corrected to expect that userMentionEntities, hashtagEntities, mediaEntities could be null.
    include that case in HTMLEntityTest.

Thanks,
Yusuke

Owner

ApplePedlar replied Dec 10, 2012

Yusuke
I fixed these problems.

ApplePedlar added some commits Dec 10, 2012

@ApplePedlar ApplePedlar issue# (TFJ-734)
renamed getDescriptionUrlEntities to getDescriptionURLEntities.
getDescriptionURLEntities() returns zero-sized array instead of null.
use HTMLEntity.unescapeAndSlideEntityIncdices() in initialize user description.
7fdb59c
@ApplePedlar ApplePedlar issue# (TFJ-734)
getDescriptionURLEntities Twitter4J 3.0.4 -> 3.0.3
5789ab4
Owner

yusuke commented Dec 10, 2012

Thanks, almost there

  • twitter4j.internal.json.LazyUser should also implement getDescriptionURLEntities()
  • creating new UserMentionEntity, HashtagEntity, MediaEntity arrays are slightly slower GC performance. We'd better allow HTMLEntity.unescapeAndSlideEntityIncdices to accept null parameters.

ApplePedlar added some commits Dec 10, 2012

@ApplePedlar ApplePedlar issue# (TFJ-734)
add getDescriptionURLEntities to LazyUser.
allow HTMLEntity.unescapeAndSlideEntityIncdices to accept null parameters.
6df5118
@ApplePedlar ApplePedlar issue# (TFJ-734)
add test methods to HTMLEntityTest.
372dd4d
Contributor

ApplePedlar commented Dec 10, 2012

Yusuke
sorry, I forgot implements of User of other library.
I fixed.

Owner

yusuke commented Dec 10, 2012

LGTM. thanks!

yusuke merged commit 1a87b36 into yusuke:master Dec 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment