Skip to content

Commit

Permalink
Fix NPE in highlight.
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr committed Sep 8, 2018
1 parent f7b8b8e commit ee6621e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*/
package org.eclipse.lsp4xml.dom;

import java.util.ArrayList;

/**
* A Comment node.
*
Expand All @@ -19,7 +21,7 @@ public class Comment extends Node {
boolean commentSameLineEndTag;

public Comment(int start, int end, Node parent, XMLDocument ownerDocument) {
super(start, end, null, parent, ownerDocument);
super(start, end, new ArrayList<>(), parent, ownerDocument);
}

public boolean isCommentSameLineEndTag() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
*/
package org.eclipse.lsp4xml.dom;

import java.util.ArrayList;

/**
* A doctype node.
*
*/
public class DocumentType extends Node {

public DocumentType(int start, int end, Node parent, XMLDocument ownerDocument) {
super(start, end, null, parent, ownerDocument);
super(start, end, new ArrayList<>(), parent, ownerDocument);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
/**
* Copyright (c) 2018 Angelo ZERR.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package org.eclipse.lsp4xml.dom;

/**
*
* The declared "xsi:noNamespaceSchemaLocation"
*/
public class NoNamespaceSchemaLocation {

private final String location;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
/**
* Copyright (c) 2018 Angelo ZERR.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
*/
package org.eclipse.lsp4xml.dom;

import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

/**
*
* The declared "xsi:schemaLocation"
*/
public class SchemaLocation {

private final Map<String, String> schemaLocationValuePairs;
Expand All @@ -23,5 +37,5 @@ public SchemaLocation(String value) {
public String getLocationHint(String namespaceURI) {
return schemaLocationValuePairs.get(namespaceURI);
}

}

0 comments on commit ee6621e

Please sign in to comment.