Skip to content

Commit ca3b44b

Browse files
committed
# Fixed bad comparison
1 parent 88e3263 commit ca3b44b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

services/azure-media/src/main/java/com/microsoft/windowsazure/services/media/models/AssetDeliveryProtocol.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
22
* Copyright Microsoft Corporation
3-
*
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
* http://www.apache.org/licenses/LICENSE-2.0
8-
*
8+
*
99
* Unless required by applicable law or agreed to in writing, software
1010
* distributed under the License is distributed on an "AS IS" BASIS,
1111
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,9 +18,9 @@
1818
import java.util.EnumSet;
1919

2020
/**
21-
*
21+
*
2222
* Specifies the protocol of an AssetDeliveryPolicy.
23-
*
23+
*
2424
*/
2525
public enum AssetDeliveryProtocol {
2626

@@ -42,7 +42,7 @@ public enum AssetDeliveryProtocol {
4242

4343
/**
4444
* Instantiates a new content key type.
45-
*
45+
*
4646
* @param contentKeyTypeCode
4747
* the content key type code
4848
*/
@@ -52,7 +52,7 @@ private AssetDeliveryProtocol(int falgValue) {
5252

5353
/**
5454
* Gets the flags value.
55-
*
55+
*
5656
* @return the flags value
5757
*/
5858
public int getFlagValue() {
@@ -63,7 +63,7 @@ public int getFlagValue() {
6363
* Given an integer representing the protocols as a bit vector, convert it
6464
* into an <code>EnumSet&lt;AssetDeliveryProtocol&gt;</code> object
6565
* containing the correct protocols *
66-
*
66+
*
6767
* @param bits
6868
* The bit vector of protocols
6969
* @return The set of protocols in an <code>EnumSet</code> object.
@@ -73,7 +73,7 @@ public static EnumSet<AssetDeliveryProtocol> protocolsFromBits(int bits) {
7373
.of(AssetDeliveryProtocol.None);
7474

7575
for (AssetDeliveryProtocol p : AssetDeliveryProtocol.values()) {
76-
if ((bits & p.getFlagValue()) != p.getFlagValue()) {
76+
if ((bits & p.getFlagValue()) == p.getFlagValue()) {
7777
perms.remove(AssetDeliveryProtocol.None);
7878
perms.add(p);
7979
}
@@ -85,18 +85,18 @@ public static EnumSet<AssetDeliveryProtocol> protocolsFromBits(int bits) {
8585
/**
8686
* Convert an <code>EnumSet</code> containing protocols into the
8787
* corresponding integer bit vector to be passed to Media services.
88-
*
88+
*
8989
* @param perms
9090
* The protocols
9191
* @return The bit vector to go out over the wire.
9292
*/
9393
public static int bitsFromProtocols(EnumSet<AssetDeliveryProtocol> protos) {
9494
int result = 0;
95-
95+
9696
for (AssetDeliveryProtocol p : protos) {
9797
result |= p.getFlagValue();
9898
}
99-
99+
100100
return result;
101101
}
102102
}

0 commit comments

Comments
 (0)