Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #86 from gcheng/nowarnings

no Eclipse warnings for new code.
  • Loading branch information...
commit b29d50dcc38a5897ee62f72c46b5727ff5a250e6 2 parents 811ff73 + 9b33725
Albert Cheng authored
View
1  microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/Exports.java
@@ -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) {
View
6 ...ure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaBatchOperations.java
@@ -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,8 @@ else if (entityBatchOperation instanceof Job.CreateBatchOperation) {
}
}
else if (entityBatchOperation instanceof Task.CreateBatchOperation) {
- EntryType entryType = null;
try {
- entryType = oDataAtomUnmarshaller.unmarshalEntry(content);
+ oDataAtomUnmarshaller.unmarshalEntry(content, TaskInfo.class);
}
catch (JAXBException e) {
throw new ServiceException(e);
View
2  ...zure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomMarshaller.java
@@ -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();
View
8 ...re-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomUnmarshaller.java
@@ -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);
View
1  ...rc/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntityCollectionProvider.java
@@ -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,
View
3  microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Task.java
@@ -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
@@ -228,6 +228,7 @@ public CreateBatchOperation setInitializationVector(String initializationVector)
this.taskType.setInitializationVector(initializationVector);
return this;
}
+
}
}
View
1  microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/JobIntegrationTest.java
@@ -47,7 +47,6 @@ private void verifyJobInfoEqual(String message, JobInfo expected, JobInfo actual
expected.getStartTime(), expected.getEndTime(), null, 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,
Integer expectedTaskCount, JobInfo actualJob) throws ServiceException {
View
1  ...api/src/test/java/com/microsoft/windowsazure/services/media/implementation/MediaBatchOperationsTest.java
@@ -52,6 +52,7 @@ public void createMediaBatchOperationFailedWithNullUri() throws JAXBException, P
URI serviceUri = null;
// Act
+ @SuppressWarnings("unused")
MediaBatchOperations mediaBatchOperations = new MediaBatchOperations(serviceUri);
// Assert
View
1  ...e-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/ODataSerializationTest.java
@@ -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();
View
4 microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/TaskEntityTest.java
@@ -17,8 +17,6 @@
import static org.junit.Assert.*;
-import java.net.URLEncoder;
-
import javax.xml.bind.JAXBElement;
import org.junit.Test;
@@ -32,7 +30,6 @@
*/
public class TaskEntityTest {
static final String sampleTaskId = "nb:cid:UUID:1151b8bd-9ada-4e7f-9787-8dfa49968eab";
- private final String expectedUri = String.format("Tasks('%s')", URLEncoder.encode(sampleTaskId, "UTF-8"));
private TaskType getTaskType(EntryType entryType) {
for (Object child : entryType.getEntryChildren()) {
@@ -43,6 +40,7 @@ private TaskType getTaskType(EntryType entryType) {
ContentType contentType = (ContentType) element.getValue();
for (Object grandChild : contentType.getContent()) {
if (grandChild instanceof JAXBElement) {
+ @SuppressWarnings("rawtypes")
JAXBElement contentElement = (JAXBElement) grandChild;
TaskType taskType = (TaskType) contentElement.getValue();
return taskType;
Please sign in to comment.
Something went wrong with that request. Please try again.