[FIX] UrlFixes

ducasse at iam.unibe.ch ducasse at iam.unibe.ch
Thu Sep 30 18:42:47 UTC 2004


there is conflict with 3.8unstable can you check that?
Thanks

Checking 6281UrlFixes-jgp.cs (#5985) for method conflicts with
changesets after 5985FlapThumbnailLabels-dew ...
...checking HierarchicalUrl>>privateInitializeFromText:
CONFLICT found for HierarchicalUrl class>>privateInitializeFromText:
with newer changeset 6150-HierarchicalUrlFix-jrp
...checking HierarchicalUrl>>privateInitializeFromText:relativeTo:
1 conflict found.
 (params is Undeclared) 


privateInitializeFromText: aString 
	"see class comments for the logic for parsing the URL. The
	section numbers 
	listed below refer to sections in RFC 1808. Section 2.4 states
	'this section
	describes the parsing rules for breaking down a URL (relative
	or absolute) into the component parts described in Section
	2.1.' It further states 
	'The rules are listed in the order in which they would be
	applied by the parser.'
	"
	| remainder ind specifiedSchemeName |
	remainder := aString.
	"Parsing the Fragment Identifier [2.4.1] (Done in Url
	class>>absoluteFromText) "
	"Parsing the Scheme [2.4.2]"
	schemeName
		ifNil: [specifiedSchemeName := Url schemeNameForString: remainder.
			specifiedSchemeName
				ifNotNil: [schemeName := specifiedSchemeName].
				ifNotNil: [schemeName := specifiedSchemeName.
					remainder := remainder copyFrom: schemeName size + 2 to: remainder
size].
			schemeName
				ifNil: ["assume HTTP"
					schemeName := 'http']].
	schemeName
		ifNotNil: [remainder := remainder copyFrom: schemeName size + 2 to:
remainder size].
	"Parsing the Network Location/Login [2.4.3]"
	"remove leading // if it's there"
	(remainder beginsWith: '//')
		ifTrue: [remainder := remainder copyFrom: 3 to: remainder size].
	"Get the authority"
	"get the query"
	ind := remainder indexOf: $?.
	ind > 0
		ifTrue: [query := remainder copyFrom: ind + 1 to: remainder size.
			remainder := remainder copyFrom: 1 to: ind - 1].
	"get the authority"
	ind := remainder indexOf: $/.
	ind > 0
		ifTrue: [ind = 1
				ifTrue: [authority := '']
				ifFalse: [authority := remainder copyFrom: 1 to: ind - 1.
					remainder := remainder copyFrom: ind + 1 to: remainder size]]
		ifFalse: [authority := remainder.
			remainder := ''].
	"Extract the (optional) username+password"
	"extract the username+password"
	(authority includes: $@)
		ifTrue: [username := authority copyUpTo: $@.
			authority := authority copyFrom: (authority indexOf: $@)
							+ 1 to: authority size.
			(username includes: $:)
				ifTrue: [password := username copyFrom: (username indexOf: $:)
									+ 1 to: username size.
					username := username copyUpTo: $:]].
	"Extract the (optional) port from authority"
	"Extract the port"
	(authority includes: $:)
		ifTrue: [| lastColonIndex portString | 
			lastColonIndex := authority
						findLast: [:c | c = $:].
			portString := authority copyFrom: lastColonIndex + 1 to: authority
size.
			portString isAllDigits
				ifTrue: [port := Integer readFromString: portString.
					port > 65535
						ifTrue: [self error: 'Invalid port number'].
					authority := authority copyFrom: 1 to: lastColonIndex - 1]
				ifFalse: [self error: 'Invalid port number']].
	"Parsing the Query Information [2.4.4]"
	ind := remainder indexOf: $?.
	ind > 0
		ifTrue: [query := remainder copyFrom: ind + 1 to: remainder size.
			remainder := remainder copyFrom: 1 to: ind - 1].
	"Parsing the Parameters [2.4.5]"
	ind := remainder indexOf: $;.
	ind > 0
		ifTrue: [params := remainder copyFrom: ind + 1 to: remainder size.
			remainder := remainder copyFrom: 1 to: ind - 1].
	"Parsing the Path [2.4.6]"
	"get the path"
	path := self privateParsePath: remainder relativeTo: #()



More information about the Squeak-dev mailing list