403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.33
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/comms/rxtx/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/comms/rxtx/files/patch-src-gnu-io-CommPortEnumerator.java
--- src/gnu/io/CommPortEnumerator.java.orig	2007-04-26 05:26:05 UTC
+++ src/gnu/io/CommPortEnumerator.java
@@ -69,50 +69,79 @@ import java.util.Enumeration;
 class CommPortEnumerator implements Enumeration
 {
 	private CommPortIdentifier index;
-	private final static boolean debug = false;
+	private final static boolean debug = "true".equals( System.getProperty( "gnu.io.rxtx.DEBUG" ) );
 	static
 	{
-		if (debug)
-			System.out.println("CommPortEnumerator:{}");
+		if (debug) System.out.println("CommPortEnumerator:Static{}");
 	}
 
 	CommPortEnumerator()
 	{
 	}
-/*------------------------------------------------------------------------------
-        nextElement()
-        accept:
-        perform:
-        return:
-        exceptions:
-        comments:
-------------------------------------------------------------------------------*/
+
 	public Object nextElement()
 	{
-		if(debug) System.out.println("CommPortEnumerator:nextElement()");
+		if (debug) System.out.println("CommPortEnumerator:nextElement()");
+		
 		synchronized (CommPortIdentifier.Sync)
 		{
-			if(index != null) index = index.next;
-			else index=CommPortIdentifier.CommPortIndex;
+			if(index != null)
+			{
+				index = index.next;
+			}
+			else
+			{
+				index=CommPortIdentifier.CommPortIndex;
+			}
+			if (debug) System.out.println(" CommPortEnumerator:nextElement(" + index + ")");
 			return(index);
 		}
 	}
-/*------------------------------------------------------------------------------
-        hasMoreElements()
-        accept:
-        perform:
-        return:
-        exceptions:
-        comments:
-------------------------------------------------------------------------------*/
+
 	public boolean hasMoreElements()
 	{
-		if(debug) System.out.println("CommPortEnumerator:hasMoreElements() " + CommPortIdentifier.CommPortIndex == null ? false : true );
+		if (debug) System.out.println("CommPortEnumerator:hasMoreElements()");
+		
+		if (CommPortIdentifier.CommPortIndex == null)
+		{
+			 if (debug) System.out.println(" ComPortIndex is null...");
+		}
+		else
+		{
+			if (debug) System.out.println(" ComPortIndex is not null...");
+		}
+		
 		synchronized (CommPortIdentifier.Sync)
 		{
-			if(index != null) return index.next == null ? false : true;
-			else return CommPortIdentifier.CommPortIndex == null ?
-				false : true;
+			if (debug) System.out.println(" Syncronised");
+			if(index != null) 
+			{
+				if (debug) System.out.println(" Valid index");
+				if (index.next == null)
+				{
+					if (debug) System.out.println("CommPortEnumerator:hasMoreElements: Exit(Next index is null - false)");
+					return false;
+				}
+				else
+				{
+					if (debug) System.out.println("CommPortEnumerator:hasMoreElements: Exit(Next index is not null - true)");
+					return true;
+				}
+			}
+			else 
+			{
+				if (debug) System.out.println(" Index is not valid");
+				if (CommPortIdentifier.CommPortIndex == null)
+				{
+					if (debug) System.out.println("CommPortEnumerator:hasMoreElements: Exit(CommPortIdentifier.CommPortIndex is null - false)");
+					return false;
+				}
+				else
+				{
+					if (debug) System.out.println("CommPortEnumerator:hasMoreElements: Exit(CommPortIdentifier.CommPortIndex is not null - true)");
+					return true;
+				}
+			}
 		}
 	}
 }

Youez - 2016 - github.com/yon3zu
LinuXploit