Changeset 29736 in osm for applications/editors/josm/plugins/openstreetbugs
- Timestamp:
- 2013-07-02T23:50:50+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/openstreetbugs
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/openstreetbugs/.classpath
r11590 r29736 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER "/>4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> 5 5 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 6 6 <classpathentry kind="output" path="build"/> -
applications/editors/josm/plugins/openstreetbugs/.settings/org.eclipse.jdt.core.prefs
r11568 r29736 1 #Fri Oct 31 10:08:06 CET 20082 1 eclipse.preferences.version=1 2 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore 3 org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull 4 org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault 5 org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable 6 org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled 7 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 9 org.eclipse.jdt.core.compiler.compliance=1.6 10 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 11 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 12 org.eclipse.jdt.core.compiler.problem.autoboxing=ignore 13 org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning 14 org.eclipse.jdt.core.compiler.problem.deadCode=warning 15 org.eclipse.jdt.core.compiler.problem.deprecation=warning 16 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled 17 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled 18 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning 19 org.eclipse.jdt.core.compiler.problem.emptyStatement=warning 20 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 21 org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore 22 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore 23 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled 24 org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore 25 org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning 26 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning 27 org.eclipse.jdt.core.compiler.problem.forbiddenReference=error 28 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning 29 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled 30 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning 31 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 32 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning 33 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 34 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning 35 org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore 36 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore 37 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 38 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 39 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 40 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled 41 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore 42 org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 43 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning 44 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning 45 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 46 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 47 org.eclipse.jdt.core.compiler.problem.nullReference=warning 48 org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error 49 org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning 50 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 51 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 52 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 53 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore 54 org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore 55 org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning 56 org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning 57 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore 58 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore 59 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore 60 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore 61 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore 62 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled 63 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning 64 org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled 65 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled 66 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 67 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 68 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled 69 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning 70 org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning 71 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 72 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 73 org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 74 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore 75 org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore 76 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore 77 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled 78 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 79 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 80 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 81 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning 82 org.eclipse.jdt.core.compiler.problem.unusedLocal=warning 83 org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning 84 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore 85 org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled 86 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled 87 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled 88 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 89 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning 90 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning 91 org.eclipse.jdt.core.compiler.source=1.6 3 92 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false 4 93 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 … … 72 161 org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false 73 162 org.eclipse.jdt.core.formatter.indentation.size=4 163 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert 74 164 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert 75 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert 165 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert 166 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert 76 167 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert 168 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert 77 169 org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert 78 170 org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java
r29373 r29736 273 273 } 274 274 275 public void setLayer(OsbLayer layer) {276 this.layer = layer;277 }278 279 275 public DataSet getDataSet() { 280 276 return dataSet; 281 277 } 282 278 283 public void setDataSet(DataSet dataSet) {284 this.dataSet = dataSet;285 }286 287 279 public OsbDialog getDialog() { 288 280 return dialog; -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/CloseAction.java
r16134 r29736 54 54 result = "ok"; 55 55 } else { 56 result = HttpUtils.post(uri, null,post, CHARSET);56 result = HttpUtils.post(uri, post, CHARSET); 57 57 } 58 58 -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/DownloadAction.java
r19050 r29736 64 64 65 65 // download the data 66 String content = HttpUtils.get(uri, null,CHARSET);66 String content = HttpUtils.get(uri, CHARSET); 67 67 68 68 // clear dataset -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/EditAction.java
r16134 r29736 57 57 result = "ok"; 58 58 } else { 59 result = HttpUtils.post(uri, null,post, CHARSET);59 result = HttpUtils.post(uri, post, CHARSET); 60 60 } 61 61 -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/NewAction.java
r26345 r29736 65 65 result = "ok 12345"; 66 66 } else { 67 result = HttpUtils.post(uri, null,post, CHARSET);67 result = HttpUtils.post(uri, post, CHARSET); 68 68 } 69 69 -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/api/util/HttpUtils.java
r13497 r29736 28 28 package org.openstreetmap.josm.plugins.osb.api.util; 29 29 30 import static org.openstreetmap.josm.tools.I18n.tr;31 32 30 import java.io.ByteArrayOutputStream; 33 31 import java.io.IOException; … … 36 34 import java.net.URL; 37 35 import java.net.URLConnection; 38 import java.util.Iterator; 39 import java.util.List; 40 import java.util.Map; 41 import java.util.Map.Entry; 36 37 import org.openstreetmap.josm.tools.Utils; 42 38 43 39 public class HttpUtils { 44 public static String get(String url, Map<String, String> headers, String charset) throws IOException { 45 URL page = new URL(url); 46 URLConnection con = page.openConnection(); 47 if(headers != null) { 48 for (Iterator<Entry<String,String>> iterator = headers.entrySet().iterator(); iterator.hasNext();) { 49 Entry<String, String> entry = iterator.next(); 50 con.setRequestProperty(entry.getKey(), entry.getValue()); 51 } 52 } 53 40 public static String get(String url, String charset) throws IOException { 54 41 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 55 42 int length = -1; 56 43 byte[] b = new byte[1024]; 57 InputStream in = con.getInputStream();44 InputStream in = Utils.openURL(new URL(url)); 58 45 while( (length = in.read(b)) > 0 ) { 59 46 bos.write(b, 0, length); 60 47 } 48 Utils.close(in); 61 49 62 50 return new String(bos.toByteArray(), charset); 63 }64 65 public static HttpResponse getResponse(String url, Map<String, String> headers, String charset) throws IOException {66 URL page = new URL(url);67 URLConnection con = page.openConnection();68 if(headers != null) {69 for (Iterator<Entry<String,String>> iterator = headers.entrySet().iterator(); iterator.hasNext();) {70 Entry<String, String> entry = iterator.next();71 con.setRequestProperty(entry.getKey(), entry.getValue());72 }73 }74 75 ByteArrayOutputStream bos = new ByteArrayOutputStream();76 int length = -1;77 byte[] b = new byte[1024];78 InputStream in = con.getInputStream();79 while( (length = in.read(b)) > 0 ) {80 bos.write(b, 0, length);81 }82 83 HttpResponse response = new HttpResponse(new String(bos.toByteArray(), charset), con.getHeaderFields());84 return response;85 51 } 86 52 … … 88 54 * 89 55 * @param url 90 * @param headers91 56 * @param content the post body 92 57 * @param responseCharset the expected charset of the response … … 94 59 * @throws IOException 95 60 */ 96 public static String post(String url, Map<String, String> headers,String content, String responseCharset) throws IOException {61 public static String post(String url, String content, String responseCharset) throws IOException { 97 62 // initialize the connection 98 63 URL page = new URL(url); 99 64 URLConnection con = page.openConnection(); 100 65 con.setDoOutput(true); 101 if(headers != null) {102 for (Iterator<Entry<String,String>> iterator = headers.entrySet().iterator(); iterator.hasNext();) {103 Entry<String, String> entry = iterator.next();104 con.setRequestProperty(entry.getKey(), entry.getValue());105 }106 }107 66 108 67 //send the post … … 119 78 bos.write(b, 0, length); 120 79 } 80 Utils.close(in); 81 Utils.close(os); 121 82 122 83 return new String(bos.toByteArray(), responseCharset); 123 84 } 124 125 /**126 * Adds a parameter to a given URI127 * @param uri128 * @param param129 * @param value130 * @return131 */132 public static String addParameter(String uri, String param, String value) {133 StringBuilder sb = new StringBuilder(uri);134 if(uri.contains("?")) {135 sb.append('&');136 } else {137 sb.append('?');138 }139 140 sb.append(param);141 sb.append('=');142 sb.append(value);143 144 return sb.toString();145 }146 147 public static Map<String, List<String>> head(String url, Map<String, String> headers, String charset) throws IOException {148 URL page = new URL(url);149 URLConnection con = page.openConnection();150 if(headers != null) {151 for (Iterator<Entry<String,String>> iterator = headers.entrySet().iterator(); iterator.hasNext();) {152 Entry<String, String> entry = iterator.next();153 con.setRequestProperty(entry.getKey(), entry.getValue());154 }155 }156 157 return con.getHeaderFields();158 }159 160 public static String getHeaderField(Map<String, List<String>> headers, String headerField) {161 if(!headers.containsKey(headerField)) {162 return null;163 }164 165 List<String> value = headers.get(headerField);166 if(value.size() == 1) {167 return value.get(0);168 } else {169 throw new RuntimeException(tr("Header contains several values and cannot be mapped to a single string"));170 }171 }172 85 } -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/dialogs/TextInputDialog.java
r23191 r29736 49 49 import javax.swing.SwingConstants; 50 50 import javax.swing.SwingUtilities; 51 import javax.swing.WindowConstants; 51 52 52 53 import org.openstreetmap.josm.gui.widgets.ComboBoxHistory; … … 153 154 } 154 155 } 155 setDefaultCloseOperation( JDialog.DISPOSE_ON_CLOSE);156 setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 156 157 } 157 158
Note:
See TracChangeset
for help on using the changeset viewer.