Bug 562354 - Browser#setUrl not honoring custom headers on Mac OS
NSMutableURLRequest.setValue (actually setValue:forHTTPHeaderField:)
selector was confused with NSObject.setValue because MacGenerator
shortens selectors with unique prefixes.
Regression introduced in Bug 547194 (50e3251a674a).
Change-Id: I6cd3dbae58716e9e3dee1b2e317cad8da6c35d9b
Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras
index 50606c1..3f0f40b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras
@@ -511,6 +511,11 @@
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</method>
+ <method selector="setValue:forHTTPHeaderField:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
</class>
<class name="NSNotification" swt_gen="mixed">
<method selector="object" swt_gen="true">
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableURLRequest.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableURLRequest.java
index 942b0e6..81af307 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableURLRequest.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableURLRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -43,6 +43,10 @@
OS.objc_msgSend(this.id, OS.sel_setURL_, URL != null ? URL.id : 0);
}
+public void setValue(NSString value, NSString field) {
+ OS.objc_msgSend(this.id, OS.sel_setValue_forHTTPHeaderField_, value != null ? value.id : 0, field != null ? field.id : 0);
+}
+
public static NSMutableURLRequest requestWithURL(NSURL URL) {
long result = OS.objc_msgSend(OS.class_NSMutableURLRequest, OS.sel_requestWithURL_, URL != null ? URL.id : 0);
return result != 0 ? new NSMutableURLRequest(result) : null;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index 87c1be1..2b48e32 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -1874,6 +1874,7 @@
public static final long sel_setUsesScreenFonts_ = Selector.sel_setUsesScreenFonts_.value;
public static final long sel_setUsesSingleLineMode_ = Selector.sel_setUsesSingleLineMode_.value;
public static final long sel_setUsesThreadedAnimation_ = Selector.sel_setUsesThreadedAnimation_.value;
+public static final long sel_setValue_forHTTPHeaderField_ = Selector.sel_setValue_forHTTPHeaderField_.value;
public static final long sel_setValue_forKey_ = Selector.sel_setValue_forKey_.value;
public static final long sel_setValueWraps_ = Selector.sel_setValueWraps_.value;
public static final long sel_setValues_forParameter_ = Selector.sel_setValues_forParameter_.value;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java
index e40b81c..f0b28d7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/Selector.java
@@ -1157,6 +1157,7 @@
, sel_setUsesScreenFonts_("setUsesScreenFonts:")
, sel_setUsesSingleLineMode_("setUsesSingleLineMode:")
, sel_setUsesThreadedAnimation_("setUsesThreadedAnimation:")
+ , sel_setValue_forHTTPHeaderField_("setValue:forHTTPHeaderField:")
, sel_setValue_forKey_("setValue:forKey:")
, sel_setValueWraps_("setValueWraps:")
, sel_setValues_forParameter_("setValues:forParameter:")