mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-4894: Improve and better test Java debug connector.
This commit is contained in:
parent
24a5928c3c
commit
cce33f772e
44 changed files with 5159 additions and 1345 deletions
|
@ -1,13 +1,12 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -23,4 +22,31 @@ public class StringEditor extends PropertyEditorSupport {
|
|||
public StringEditor() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* The comment in the parent "PropertyEditorSupport" reads:
|
||||
*
|
||||
* <blockquote>
|
||||
* <p>
|
||||
* Sets the property value by parsing a given String. May raise
|
||||
* java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of
|
||||
* property can't be expressed as text.
|
||||
* </p>
|
||||
* </blockquote>
|
||||
*
|
||||
* <p>
|
||||
* which would be fine, except for the fact that Java initializes "value" to null, so every use
|
||||
* of this method has to insure that setValue has been called at least once with a non-null
|
||||
* value. If not, the method throws the IllegalArgumentException despite the fact that the input
|
||||
* is not badly formatted and CAN be expressed as text.
|
||||
*/
|
||||
@Override
|
||||
public void setAsText(String text) throws java.lang.IllegalArgumentException {
|
||||
Object value = getValue();
|
||||
if (value == null || value instanceof String) {
|
||||
setValue(text);
|
||||
return;
|
||||
}
|
||||
throw new java.lang.IllegalArgumentException(text);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue