- Timestamp:
- 04/22/16 09:32:33 (9 years ago)
- Location:
- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogTextInputPseudomizer.java
r1353 r2125 234 234 235 235 if ("tagname".equals(param.getKey())) { 236 if ("input_text".equals(param.getValue()) || 236 if ("input_text".equals(param.getValue()) || "textarea".equals(param.getValue()) || 237 "input_password".equals(param.getValue()) || 237 238 (pseudomizeSearchInputs && "input_search".equals(param.getValue())) || 238 239 (pseudomizeFileInputs && "input_file".equals(param.getValue()))) … … 253 254 @Override 254 255 protected boolean handleEvent(String type, Map<String, String> parameters) throws SAXException { 255 String timestampStr = parameters.get("timestamp");256 257 long timestamp = Long.MAX_VALUE;258 259 if (timestampStr != null) {260 timestamp = Long.parseLong(timestampStr);261 }262 263 EventEntry newEvent = new EventEntry(type, parameters, timestamp);264 265 int start = 0;266 int end = sortedEvents.size();267 int center = 0;268 long centerTimestamp;269 270 while (start != end) {271 center = start + ((end - start) / 2);272 273 if ((center != start) || (center != end)) {274 centerTimestamp = sortedEvents.get(center).timestamp;275 276 if (centerTimestamp < newEvent.timestamp) {277 start = Math.max(center, start + 1);278 }279 else if (centerTimestamp > newEvent.timestamp) {280 end = Math.min(center, end - 1);281 }282 else {283 // add the event directly where the center is, as the timestamps of the center284 // and the new event are equal285 end = center;286 start = end;287 break;288 }289 }290 else {291 // add the event to the position denoted by the add index292 break;293 }294 }295 296 sortedEvents.add(start, newEvent);297 298 256 if ("onchange".equals(type)) { 299 257 String targetId = parameters.get("target"); … … 319 277 } 320 278 } 279 280 sortedEvents.add(new EventEntry(type, parameters)); 321 281 322 282 return true; … … 377 337 */ 378 338 private Map<String, String> parameters; 379 339 380 340 /** 381 341 * <p> 382 * the timestamp of the event342 * creates a new event entry with event type and parameters 383 343 * </p> 384 344 */ 385 private long timestamp; 386 387 /** 388 * <p> 389 * creates a new event entry with event type, parameters and the timestamp 390 * </p> 391 */ 392 private EventEntry(String type, Map<String, String> parameters, long timestamp) { 345 private EventEntry(String type, Map<String, String> parameters) { 393 346 this.type = type; 394 347 this.parameters = parameters; 395 this.timestamp = timestamp;396 348 } 397 349
Note: See TracChangeset
for help on using the changeset viewer.