Resolves checkstyle errors for remaining p (#1091)
* Reduces checkstyle errors in page-object * Reduces checkstyle errors in partial-response * Reduces checkstyle errors in pipeline * Reduces checkstyle errors in poison-pill * Reduces checkstyle errors in priority-queue * Reduces checkstyle errors in private-class-data * Reduces checkstyle errors in property * Reduces checkstyle errors in prototype * Reduces checkstyle errors in proxy
This commit is contained in:
		
				
					committed by
					
						 Ilkka Seppälä
						Ilkka Seppälä
					
				
			
			
				
	
			
			
			
						parent
						
							1fdc650545
						
					
				
				
					commit
					271d7ae9bd
				
			| @@ -25,16 +25,15 @@ package com.iluwatar.priority.queue; | ||||
|  | ||||
| /** | ||||
|  * Prioritize requests sent to services so that requests with a higher priority are received and | ||||
|  * processed more quickly than those of a lower priority. | ||||
|  * This pattern is useful in applications that offer different service level guarantees | ||||
|  * to individual clients. | ||||
|  * Example :Send multiple message with different priority to worker queue. | ||||
|  * Worker execute higher priority message first | ||||
|  * processed more quickly than those of a lower priority. This pattern is useful in applications | ||||
|  * that offer different service level guarantees to individual clients. Example :Send multiple | ||||
|  * message with different priority to worker queue. Worker execute higher priority message first | ||||
|  * | ||||
|  * @see "https://docs.microsoft.com/en-us/previous-versions/msp-n-p/dn589794(v=pandp.10)" | ||||
|  */ | ||||
| public class Application { | ||||
|   /** | ||||
|    * main entry | ||||
|    * main entry. | ||||
|    */ | ||||
|   public static void main(String[] args) throws Exception { | ||||
|  | ||||
|   | ||||
| @@ -24,7 +24,7 @@ | ||||
| package com.iluwatar.priority.queue; | ||||
|  | ||||
| /** | ||||
|  * Message bean | ||||
|  * Message bean. | ||||
|  */ | ||||
| public class Message implements Comparable<Message> { | ||||
|   private final String message; | ||||
|   | ||||
| @@ -23,11 +23,11 @@ | ||||
|  | ||||
| package com.iluwatar.priority.queue; | ||||
|  | ||||
| import static java.util.Arrays.copyOf; | ||||
|  | ||||
| import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
|  | ||||
| import static java.util.Arrays.copyOf; | ||||
|  | ||||
| /** | ||||
|  * Keep high Priority message on top using maxHeap. | ||||
|  * | ||||
| @@ -50,14 +50,14 @@ public class PriorityMessageQueue<T extends Comparable> { | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Remove top message from queue | ||||
|    * Remove top message from queue. | ||||
|    */ | ||||
|   public T remove() { | ||||
|     if (isEmpty()) { | ||||
|       return null; | ||||
|     } | ||||
|  | ||||
|     T root = queue[0]; | ||||
|     final T root = queue[0]; | ||||
|     queue[0] = queue[size - 1]; | ||||
|     size--; | ||||
|     maxHeapifyDown(); | ||||
| @@ -65,7 +65,7 @@ public class PriorityMessageQueue<T extends Comparable> { | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Add message to queue | ||||
|    * Add message to queue. | ||||
|    */ | ||||
|   public void add(T t) { | ||||
|     ensureCapacity(); | ||||
| @@ -75,7 +75,7 @@ public class PriorityMessageQueue<T extends Comparable> { | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Check queue size | ||||
|    * Check queue size. | ||||
|    */ | ||||
|   public boolean isEmpty() { | ||||
|     return size == 0; | ||||
|   | ||||
| @@ -24,7 +24,7 @@ | ||||
| package com.iluwatar.priority.queue; | ||||
|  | ||||
| /** | ||||
|  * Manage priority queue | ||||
|  * Manage priority queue. | ||||
|  */ | ||||
| public class QueueManager { | ||||
|   /* | ||||
| @@ -37,7 +37,7 @@ public class QueueManager { | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Publish message to queue | ||||
|    * Publish message to queue. | ||||
|    */ | ||||
|   public void publishMessage(Message message) { | ||||
|     messagePriorityMessageQueue.add(message); | ||||
| @@ -45,7 +45,7 @@ public class QueueManager { | ||||
|  | ||||
|  | ||||
|   /** | ||||
|    * recive message from queue | ||||
|    * recive message from queue. | ||||
|    */ | ||||
|   public Message receiveMessage() { | ||||
|     if (messagePriorityMessageQueue.isEmpty()) { | ||||
|   | ||||
| @@ -27,7 +27,7 @@ import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
|  | ||||
| /** | ||||
|  * Message Worker | ||||
|  * Message Worker. | ||||
|  */ | ||||
| public class Worker { | ||||
|  | ||||
| @@ -40,7 +40,7 @@ public class Worker { | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Keep checking queue for message | ||||
|    * Keep checking queue for message. | ||||
|    */ | ||||
|   @SuppressWarnings("squid:S2189") | ||||
|   public void run() throws Exception { | ||||
| @@ -56,7 +56,7 @@ public class Worker { | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Process message | ||||
|    * Process message. | ||||
|    */ | ||||
|   private void processMessage(Message message) { | ||||
|     LOGGER.info(message.toString()); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user