Permalink
Browse files

suppress the warnings.

  • Loading branch information...
1 parent 4ed9259 commit 681f13ec9e71642b62be4f2febc471ba671b5c34 Albert Cheng committed Jan 9, 2013
@@ -52,6 +52,7 @@ public void register(Builder.Registry registry) {
registry.add(VersionHeadersFilter.class);
registry.alter(ClientConfig.class, new Builder.Alteration<ClientConfig>() {
+ @SuppressWarnings("rawtypes")
@Override
public ClientConfig alter(ClientConfig instance, Builder builder, Map<String, Object> properties) {
@@ -49,6 +49,7 @@
import com.microsoft.windowsazure.services.media.models.Job;
import com.microsoft.windowsazure.services.media.models.JobInfo;
import com.microsoft.windowsazure.services.media.models.Task;
+import com.microsoft.windowsazure.services.media.models.TaskInfo;
import com.microsoft.windowsazure.services.table.implementation.InputStreamDataSource;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.UniformInterfaceException;
@@ -298,7 +299,6 @@ private DataSource createBatchCreateEntityPart(String verb, String entityName, E
* @throws ServiceException
* the service exception
*/
- @SuppressWarnings("rawtypes")
public void parseBatchResult(ClientResponse response) throws IOException, ServiceException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
InputStream inputStream = response.getEntityInputStream();
@@ -316,7 +316,6 @@ public void parseBatchResult(ClientResponse response) throws IOException, Servic
entityBatchOperations.size()), response);
}
- ArrayList<Object> result = new ArrayList<Object>();
for (int i = 0; i < parts.size(); i++) {
DataSource ds = parts.get(i);
EntityBatchOperation entityBatchOperation = entityBatchOperations.get(i);
@@ -352,9 +351,10 @@ else if (entityBatchOperation instanceof Job.CreateBatchOperation) {
}
}
else if (entityBatchOperation instanceof Task.CreateBatchOperation) {
- EntryType entryType = null;
try {
- entryType = oDataAtomUnmarshaller.unmarshalEntry(content);
+ TaskInfo taskInfo = oDataAtomUnmarshaller.unmarshalEntry(content, TaskInfo.class);
+ Task.CreateBatchOperation taskCreateBatchOperation = (Task.CreateBatchOperation) entityBatchOperation;
+ taskCreateBatchOperation.setTaskInfo(taskInfo);
}
catch (JAXBException e) {
throw new ServiceException(e);
@@ -104,7 +104,7 @@ public void marshalEntryType(EntryType entryType, OutputStream stream) throws JA
new JAXBElement<EntryType>(new QName(Constants.ATOM_NS, "entry"), EntryType.class, entryType), stream);
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "rawtypes" })
private JAXBElement<EntryType> createEntry(Object content) {
ContentType atomContent = new ContentType();
EntryType atomEntry = new EntryType();
@@ -75,6 +75,7 @@ public ODataAtomUnmarshaller() throws JAXBException {
* @throws JAXBException
* @throws ServiceException
*/
+ @SuppressWarnings("rawtypes")
public <T extends ODataEntity> ListResult<T> unmarshalFeed(InputStream stream, Class<T> contentType)
throws JAXBException, ServiceException {
validateNotNull(stream, "stream");
@@ -105,6 +106,7 @@ public ODataAtomUnmarshaller() throws JAXBException {
* @throws JAXBException
* @throws ServiceException
*/
+ @SuppressWarnings("rawtypes")
public <T extends ODataEntity> T unmarshalEntry(InputStream stream, Class<T> contentType) throws JAXBException,
ServiceException {
validateNotNull(stream, "stream");
@@ -116,6 +118,7 @@ public ODataAtomUnmarshaller() throws JAXBException {
return contentFromEntry(contentType, marshallingContentType, entry);
}
+ @SuppressWarnings("rawtypes")
private <T extends ODataEntity> T contentFromEntry(Class<T> contentType, Class<?> marshallingContentType,
EntryType entry) throws JAXBException, ServiceException {
unmarshalODataContent(entry, contentType);
@@ -126,6 +129,7 @@ public ODataAtomUnmarshaller() throws JAXBException {
private EntryType asEntry(Object o) {
if (o instanceof JAXBElement) {
+ @SuppressWarnings("rawtypes")
JAXBElement e = (JAXBElement) o;
if (e.getDeclaredType() == EntryType.class) {
return (EntryType) e.getValue();
@@ -154,6 +158,7 @@ private void unmarshalEntryActions(EntryType entry) throws JAXBException {
}
}
+ @SuppressWarnings("rawtypes")
private void unmarshalEntryContent(EntryType entry, Class<?> contentType) throws JAXBException {
Class<?> marshallingContentType = getMarshallingContentType(contentType);
ContentType contentElement = getFirstOfType(ContentType.class, entry.getEntryChildren());
@@ -170,9 +175,11 @@ private void unmarshalEntryContent(EntryType entry, Class<?> contentType) throws
}
}
+ @SuppressWarnings("unchecked")
private <T> T getFirstOfType(Class<T> targetType, List<Object> collection) {
for (Object c : collection) {
if (c instanceof JAXBElement) {
+ @SuppressWarnings("rawtypes")
JAXBElement e = (JAXBElement) c;
if (e.getDeclaredType() == targetType) {
return (T) e.getValue();
@@ -182,6 +189,7 @@ private void unmarshalEntryContent(EntryType entry, Class<?> contentType) throws
return null;
}
+ @SuppressWarnings("rawtypes")
private <T extends ODataEntity> T constructResultObject(Class<T> contentType, EntryType entry, Object contentObject)
throws ServiceException {
Class<?> marshallingType = getMarshallingContentType(contentType);
@@ -34,6 +34,7 @@ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotati
return ODataEntity.isODataEntityCollectionType(type, genericType);
}
+ @SuppressWarnings("unchecked")
@Override
public ListResult<ODataEntity<?>> readFrom(Class<ListResult<ODataEntity<?>>> type, Type genericType,
Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders,
@@ -74,7 +74,7 @@ public static CreateBatchOperation create(String mediaProcessorId, String taskBo
}
/**
- * Create an operation that will list the tasks pointed to by the given link
+ * Create an operation that will list the tasks pointed to by the given link.
*
* @param link
* link to tasks
@@ -93,6 +93,9 @@ public static CreateBatchOperation create(String mediaProcessorId, String taskBo
/** The task type. */
private final TaskType taskType;
+ /** The task info. */
+ private TaskInfo taskInfo;
+
/**
* Instantiates a new creates the batch operation.
*
@@ -228,6 +231,27 @@ public CreateBatchOperation setInitializationVector(String initializationVector)
this.taskType.setInitializationVector(initializationVector);
return this;
}
+
+ /**
+ * Sets the task info.
+ *
+ * @param taskInfo
+ * the task info
+ * @return the creates the batch operation
+ */
+ public CreateBatchOperation setTaskInfo(TaskInfo taskInfo) {
+ this.taskInfo = taskInfo;
+ return this;
+ }
+
+ /**
+ * Gets the task info.
+ *
+ * @return the task info
+ */
+ public TaskInfo getTaskInfo() {
+ return taskInfo;
+ }
}
}
@@ -173,9 +173,8 @@ public void uploadAesProtectedAssetAndDownloadSuccess() throws Exception {
// encrypt the file.
byte[] encryptedContent = EncryptionHelper.EncryptFile(smallWMVInputStream, aesKey, initializationVector);
- // upload the encrypted file to the server.
- AssetFileInfo assetFileInfo = uploadEncryptedAssetFile(assetInfo, locatorInfo, contentKeyInfo,
- "uploadAesProtectedAssetSuccess", encryptedContent);
+ uploadEncryptedAssetFile(assetInfo, locatorInfo, contentKeyInfo, "uploadAesProtectedAssetSuccess",
+ encryptedContent);
// submit and execute the decoding job.
JobInfo jobInfo = decodeAsset("uploadAesProtectedAssetSuccess", assetInfo);
@@ -46,7 +46,6 @@ private void verifyJobInfoEqual(String message, JobInfo expected, JobInfo actual
expected.getStartTime(), expected.getEndTime(), actual);
}
- @SuppressWarnings("deprecation")
private void verifyJobProperties(String message, String testName, Integer priority, double runningDuration,
JobState state, String templateId, Date created, Date lastModified, Date startTime, Date endTime,
JobInfo actualJob) {
@@ -52,6 +52,7 @@ public void createMediaBatchOperationFailedWithNullUri() throws JAXBException, P
URI serviceUri = null;
// Act
+ @SuppressWarnings("unused")
MediaBatchOperations mediaBatchOperations = new MediaBatchOperations(serviceUri);
// Assert
@@ -74,6 +74,7 @@ public void canUnmarshallAssetFromFeed() throws Exception {
Assert.assertEquals("nb:cid:UUID:1f6c7bb4-8013-486e-b4c9-2e4a6842b9a6", entries.get(0).getId());
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void canMarshalEntryFromJavaObject() throws Exception {
AssetType a = new AssetType();

0 comments on commit 681f13e

Please sign in to comment.