kevin1986xu / asmack

Automatically exported from code.google.com/p/asmack
Other
0 stars 0 forks source link

Adapted malfunctioning patch files #49

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Some patches do not work anymore. I corrected them as follows:

99-PubSubNode-protected-constructor.patch:

Index: org/jivesoftware/smackx/pubsub/Node.java                                 

===================================================================             

--- org/jivesoftware/smackx/pubsub/Node.java  (revision 11464)                  

+++ org/jivesoftware/smackx/pubsub/Node.java  (working copy)                    

@@ -48,7 +48,7 @@                                                               

   * @param connection The connection the node is associated with                                          
   * @param nodeName The node id                                            
   */                                                                             
- Node(Connection connection, String nodeName)                                  

+ protected Node(Connection connection, String nodeName)                        

  {                                                                                                        
    con = connection;                                                                                      
    id = nodeName;                                                                                         

30-swtich-debugging-implementations.patch (scrambled letters in "switch"!):

--- org/jivesoftware/smack/Connection.java  2009-12-06 21:02:51.000000000 +0100 

+++ ../../src-unpatched/trunk/org/jivesoftware/smack/Connection.java  
2009-12-06 20:59:23.000000000 +0100    
@@ -747,12 +747,12 @@                                                           

                 if (debuggerClass == null) {                                                                
                     try {                                                                                   
                         debuggerClass =                                                                     
-                                
Class.forName("org.jivesoftware.smackx.debugger.EnhancedDebugger");         
+                                
Class.forName("de.measite.smack.AndroidDebugger");                          
                     }                                                                                       
                     catch (Exception ex) {                                                                  
                         try {                                                                               
                             debuggerClass =                                                                 
-                                    
Class.forName("org.jivesoftware.smack.debugger.LiteDebugger");          
+                                    
Class.forName("org.jivesoftware.smack.debugger.ConsoleDebugger");       
                         }                                                                                   
                         catch (Exception ex2) {                                                             
                             ex2.printStackTrace();                                                          

22-remove-beans.Property-deps.patch:

--- 
../../src-unpatched/trunk/org/jivesoftware/smack/util/PacketParserUtils.java  
2009-12-06 19:45:45.000000\
000 +0100                                                                       

+++ org/jivesoftware/smack/util/PacketParserUtils.java  2009-12-06 
19:48:13.000000000 +0100                  
@@ -25,7 +25,6 @@                                                               

 import org.jivesoftware.smack.provider.ProviderManager;                                                     
 import org.xmlpull.v1.XmlPullParser;                                                                        

-import java.beans.PropertyDescriptor;                                          

 import java.io.ByteArrayInputStream;                                                                        
 import java.io.ObjectInputStream;                                                                           
 import java.util.ArrayList;                                                                                 
@@ -433,14 +432,14 @@                                                           

             if (eventType == XmlPullParser.START_TAG) {                                                     
                 String name = parser.getName();                                                             
                 String stringValue = parser.nextText();                                                     
-                PropertyDescriptor descriptor = new PropertyDescriptor(name, 
objectClass);                  
-                // Load the class type of the property.                        

-                Class propertyType = descriptor.getPropertyType();             

+                Class propertyType = object.getClass().getClass().getMethod(   

+                    "get" + Character.toUpperCase(name.charAt(0)) + 
name.substring(1)).getReturnType();     
                 // Get the value of the property by converting it from a                                    
                 // String to the correct object type.                                                       
                 Object value = decode(propertyType, stringValue);                                           
                 // Set the value of the bean.                                                               
-                descriptor.getWriteMethod().invoke(object, value);             

+                object.getClass().getMethod("set" + 
Character.toUpperCase(name.charAt(0)) + name.substring(\
1), propertyType)                                                               

+                .invoke(object, value);                                        

             }                                                                                               
             else if (eventType == XmlPullParser.END_TAG) {                                                  
                 if (parser.getName().equals(elementName)) {                                                 

Cheers,
Holger                                                                          

Original issue reported on code.google.com by Choose.H...@gmail.com on 6 Feb 2011 at 7:40