Make TcfEuV2's IsServiceSpecific not a condition for encoding Vendors…#93
Open
shawjef3 wants to merge 2 commits intoIABTechLab:masterfrom
Open
Make TcfEuV2's IsServiceSpecific not a condition for encoding Vendors…#93shawjef3 wants to merge 2 commits intoIABTechLab:masterfrom
shawjef3 wants to merge 2 commits intoIABTechLab:masterfrom
Conversation
…Allowed or VendorsDisclosed. TcfEuV2#encodeSection() now uses the same criteria as iabtcf-java's TCStringEncoder to determine if a segment should be encoded. TCF 2.3 makes VendorsDisclosed required, and so its encoding should not be conditional on IsServiceSpecific. I made additional changes to reduce the amount of whitespace. TcfEuV2#encodeSection() no longer creates an intermediate collection.
Author
|
This is for #83. |
Contributor
|
i have ported a similar change into the beta/4.X branch in d14a86b |
Author
|
@yuzawa-san @HeinzBaumann are either of you able to merge this? I don't have permission. |
Collaborator
|
@shawjef3 similar change was included in the 4.X branch which was merged, could you test that branch? |
Author
|
@lamrowena The 4.x branch looks good. I used the following test. It would be good to merge and publish this anyway. Some people might not have the luxury of upgrading their JVM. @Test
public void testIsServiceSpecific() {
final TcfEuV2 tcfEuV2 = new TcfEuV2();
tcfEuV2.setFieldValue(TcfEuV2Field.IS_SERVICE_SPECIFIC, false);
final IntegerSet expectedVendorsDisclosed = new IntegerSet();
expectedVendorsDisclosed.add(1);
tcfEuV2.setFieldValue(TcfEuV2Field.VENDORS_DISCLOSED, expectedVendorsDisclosed);
final IntegerSet expectedVendorsAllowed = new IntegerSet();
expectedVendorsAllowed.add(2);
tcfEuV2.setFieldValue(TcfEuV2Field.VENDORS_ALLOWED, expectedVendorsAllowed);
final String encoded = tcfEuV2.encode();
final TcfEuV2 decoded = new TcfEuV2(encoded);
Assertions.assertEquals(expectedVendorsDisclosed, decoded.getVendorsDisclosed());
Assertions.assertEquals(expectedVendorsAllowed, decoded.getVendorsAllowed());
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…Allowed or VendorsDisclosed.
TcfEuV2#encodeSection() now uses the same criteria as iabtcf-java's TCStringEncoder to determine if a segment should be encoded.
TCF 2.3 makes VendorsDisclosed required, and so its encoding should not be conditional on IsServiceSpecific.
I made additional changes to reduce the amount of whitespace.
TcfEuV2#encodeSection() no longer creates an intermediate collection.