auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void handleGet() { if (operation == Operation.METADATA) { getVariants().add(getFormatGet(false).toRepresentation(new ResourceMetadata(resource, this))); } else { if (resource.getType() == Type.UNDEFINED) { throw new RestletException("Undefined resource path.", Status.CLIENT_ERROR_NOT_FOUND); } else { Representation rep; if (getRequest().getMethod().equals(Method.HEAD)) { rep = RESTUtils.emptyBody(); rep.setMediaType(getMediaType(resource)); } else if (resource.getType() == Type.DIRECTORY) { rep = getFormatGet(false).toRepresentation(new ResourceDirectory(resource, this)); } else { rep = new InputRepresentation(resource.in(), getMediaType(resource)); } rep.setModificationDate(new Date(resource.lastmodified())); getVariants().add(rep); if (!"".equals(resource.path())) { getResponseHeaders().add("Resource-parent", "/" + resource.parent().path()); } getResponseHeaders().add("Resource-type", resource.getType().toString().toLowerCase()); } } super.handleGet(); }

Target:
public void handleGet() { if (operation == Operation.METADATA) { getVariants().add(getFormatGet(false).toRepresentation(new ResourceMetadata(resource, this))); } else { if (resource.getType() == Type.UNDEFINED) { throw new RestletException("Undefined resource path.", Status.CLIENT_ERROR_NOT_FOUND); } else { Representation rep; if (getRequest().getMethod().equals(Method.HEAD)) { rep = RESTUtils.emptyBody(); rep.setMediaType(getMediaType(resource)); } else if (resource.getType() == Type.DIRECTORY) { rep = getFormatGet(false).toRepresentation(new ResourceDirectory(resource, this)); } else { rep = new InputRepresentation(resource.in(), getMediaType(resource)); } rep.setModificationDate(new Date(resource.lastmodified())); getVariants().add(rep); if (!"".equals(resource.path())) { getResponseHeaders().add("Resource-Parent", "/" + resource.parent().path()); } getResponseHeaders().add("Resource-Type", resource.getType().toString().toLowerCase()); } } super.handleGet(); }
Source:
public final void run() { setWorkerState(WorkerState.RUNNING); LOG.info("Running ReplicationSourceShipper Thread for wal group: {}", this.walGroupId); while (isActive()) { if (!source.isPeerEnabled()) { sleepForRetries("Replication is disabled", sleepForRetries, 1, maxRetriesMultiplier); continue; } try { WALEntryBatch entryBatch = entryReader.poll(getEntriesTimeout); LOG.debug("Shipper from source got entry batch from reader: {}", source.getQueueId(), entryBatch); if (entryBatch == null) { continue; } if (entryBatch == WALEntryBatch.NO_MORE_DATA) { noMoreData(); } else { shipEdits(entryBatch); } } catch (InterruptedException e) { LOG.trace("Interrupted while waiting for next replication entry batch", e); Thread.currentThread().interrupt(); } catch (ReplicationRuntimeException rre) { LOG.warn("Interrupted while waiting for next replication entry batch", rre); Thread.currentThread().interrupt(); } } if (!isFinished()) { setWorkerState(WorkerState.STOPPED); } else { source.removeWorker(this); postFinish(); } }

Target:
public final void run() { setWorkerState(WorkerState.RUNNING); LOG.info("Running ReplicationSourceShipper Thread for wal group: {}", this.walGroupId); while (isActive()) { if (!source.isPeerEnabled()) { sleepForRetries("Replication is disabled", sleepForRetries, 1, maxRetriesMultiplier); continue; } try { WALEntryBatch entryBatch = entryReader.poll(getEntriesTimeout); LOG.debug("Shipper from source got entry batch from reader: {}", source.getQueueId(), entryBatch); if (entryBatch == null) { continue; } if (entryBatch == WALEntryBatch.NO_MORE_DATA) { noMoreData(); } else { shipEdits(entryBatch); } } catch (InterruptedException | ReplicationRuntimeException e) { LOG.warn("Interrupted while waiting for next replication entry batch", e); Thread.currentThread().interrupt(); } } if (!isFinished()) { setWorkerState(WorkerState.STOPPED); } else { source.removeWorker(this); postFinish(); } }
Source:
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { Class<?> c = findLoadedClass(name); List<String> things = Arrays.asList("java", "com.sun", "sun", "org.xml", "org.w3c"); if(things.stream().filter(s -> name.startsWith(s)).count() > 0){ try { c = system.loadClass(name); } catch (ClassNotFoundException e3) { } } if (c == null) { try { c = findClass(name); } catch (ClassNotFoundException e) { try { c = super.loadClass(name, resolve); } catch (ClassNotFoundException e2) { try { for (ClassLoader cl : CoreClassLoaders.getInstance().getAll()) { c = cl.loadClass(name); if (c != null) break; } } catch (ClassNotFoundException e3) { if (system != null) { c = system.loadClass(name); } } } } } if (resolve) resolveClass(c); if (c == null) throw new ClassNotFoundException(name); return c; }

Target:
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { Class<?> c = findLoadedClass(name); if (name.startsWith("java") || name.startsWith("com.sun") || name.startsWith("sun") || name.startsWith("org.xml") || name.startsWith("org.w3c")) { try { c = system.loadClass(name); } catch (ClassNotFoundException e3) { } } if (c == null) { try { c = findClass(name); } catch (ClassNotFoundException e) { try { c = super.loadClass(name, resolve); } catch (ClassNotFoundException e2) { try { for (ClassLoader cl : CoreClassLoaders.getInstance().getAll()) { c = cl.loadClass(name); if (c != null) break; } } catch (ClassNotFoundException e3) { if (system != null) { c = system.loadClass(name); } } } } } if (resolve) resolveClass(c); if (c == null) throw new ClassNotFoundException(name); return c; }
Source:
public void test43() throws Exception { ClassNode cls = getClassNode(TestCls.class); String code = cls.getCode().toString(); assertThat(code, containsOne("continue;")); }

Target:
public void test43() throws Exception { getClassNode(TestCls.class); }
Source:
private void updateDefaultNameSpaces(final Node<Definition<DMNDiagram>, ?> diagramNode) { final DMNDiagram dmnDiagram = diagramNode.getContent().getDefinition(); final Definitions dmnDefinitions = dmnDiagram.getDefinitions(); if (!dmnDefinitions.getNsContext().containsValue(DMNModelInstrumentedBase.URI_FEEL)) { dmnDefinitions.getNsContext().put(DMNModelInstrumentedBase.PREFIX_FEEL, DMNModelInstrumentedBase.URI_FEEL); } if (!dmnDefinitions.getNsContext().containsValue(DMNModelInstrumentedBase.URI_DMN)) { dmnDefinitions.getNsContext().put(DMNModelInstrumentedBase.PREFIX_DMN, DMNModelInstrumentedBase.URI_DMN); } if (!dmnDefinitions.getNsContext().containsValue(DMNModelInstrumentedBase.URI_KIE)) { dmnDefinitions.getNsContext().put(DMNModelInstrumentedBase.PREFIX_KIE, DMNModelInstrumentedBase.URI_KIE); } }

Target:
private void updateDefaultNameSpaces(final Node<Definition<DMNDiagram>, ?> diagramNode) { final DMNDiagram dmnDiagram = diagramNode.getContent().getDefinition(); final Definitions dmnDefinitions = dmnDiagram.getDefinitions(); Stream.of(DMNModelInstrumentedBase.Namespace.values()) .filter(namespace -> !dmnDefinitions.getNsContext().containsValue(namespace.getUri())) .forEach(namespace -> dmnDefinitions.getNsContext().put(namespace.getPrefix(), namespace.getUri())); }
Source:
private String writeTextOutput(StringBuilder output, PlanRepresentation plan, int level, NodeRepresentation node) { output.append(indentString(level)) .append("- ") .append(node.getType()) .append(node.getIdentifier()) .append(" => [") .append(node.getOutputs()) .append("]\n"); String statsAndCost = node.getStats(); if (statsAndCost.isEmpty()) { output.append(indentMultilineString(statsAndCost, level + 2)); } if (!node.getDetails().isEmpty()) { String details = indentMultilineString(node.getDetails(), level + 2); output.append(details); if (!details.endsWith("\n")) { output.append('\n'); } } List<NodeRepresentation> children = node.getChildren().stream() .map(plan::getNode) .filter(Optional::isPresent) .map(Optional::get) .collect(toList()); for (NodeRepresentation child : children) { writeTextOutput(output, plan, level + 1, child); } return output.toString(); }

Target:
private String writeTextOutput(StringBuilder output, PlanRepresentation plan, int level, NodeRepresentation node) { output.append(indentString(level)) .append("- ") .append(node.getName()) .append(node.getIdentifier()) .append(" => [") .append(node.getOutputs()) .append("]\n"); String estimates = printEstimates(plan, node); if (!estimates.isEmpty()) { output.append(indentMultilineString(estimates, level + 2)); } String stats = printStats(plan, node); if (!stats.isEmpty()) { output.append(indentMultilineString(stats, level + 2)); } if (!node.getDetails().isEmpty()) { String details = indentMultilineString(node.getDetails(), level + 2); output.append(details); if (!details.endsWith("\n")) { output.append('\n'); } } List<NodeRepresentation> children = node.getChildren().stream() .map(plan::getNode) .filter(Optional::isPresent) .map(Optional::get) .collect(toList()); for (NodeRepresentation child : children) { writeTextOutput(output, plan, level + 1, child); } return output.toString(); }
Source:
private boolean hasAtLeastOneResolvedMining() { if (fResolvedMinings == null || fResolvedMinings.length == 0) { return false; } return Stream.of(fResolvedMinings).anyMatch(mining -> mining != null); }

Target:
private boolean hasAtLeastOneResolvedMining() { if (fResolvedMinings == null || fResolvedMinings.length == 0) { return false; } return Stream.of(fResolvedMinings).anyMatch(Objects::nonNull); }
Source:
public int compare(boolean b1, boolean b2) { throw new UnsupportedOperationException(); }

Target:
public int compare(boolean b1, boolean b2) { throw new UnsupportedOperationException( "compare(boolean, boolean) was called on a non-boolean comparator: " + toString()); }
Source:
public double similarity(MatrixRow a, MatrixRow b) { double adota = 0.0; double bdotb = 0.0; double adotb = 0.0; int na = a.getNumCols(); int nb = b.getNumCols(); int i = 0, j = 0; int ca = a.getColIndex(i); int cb = b.getColIndex(j); if( (i != 0 || j != 0) ) { while (i < na && j < nb) { if (ca < cb) { float va = a.getColValue(i++); adota += va * va; ca = a.getColIndex(i); } else if (ca > cb) { float vb = b.getColValue(j++); bdotb += vb * vb; cb = b.getColIndex(j); } else { float va = a.getColValue(i++); float vb = b.getColValue(j++); adota += va * va; bdotb += vb * vb; adotb += va * vb; ca = a.getColIndex(i); cb = b.getColIndex(j); } } } for (; i < na; i++) { float va = a.getColValue(i); adota += va * va; } for (; j < nb; j++) { float vb = b.getColValue(j); bdotb += vb * vb; } if (adota * bdotb * adotb == 0) { return 0.0; } else { return adotb / Math.sqrt(adota * bdotb); } }

Target:
public double similarity(MatrixRow a, MatrixRow b) { double adota = 0.0; double bdotb = 0.0; double adotb = 0.0; int na = a.getNumCols(); int nb = b.getNumCols(); int i = 0, j = 0; if((na == 0 || nb == 0)) { return 0; } int ca = a.getColIndex(i); int cb = b.getColIndex(j); while (i < na && j < nb) { if (ca < cb) { float va = a.getColValue(i++); adota += va * va; ca = a.getColIndex(i); } else if (ca > cb) { float vb = b.getColValue(j++); bdotb += vb * vb; cb = b.getColIndex(j); } else { float va = a.getColValue(i++); float vb = b.getColValue(j++); adota += va * va; bdotb += vb * vb; adotb += va * vb; ca = a.getColIndex(i); cb = b.getColIndex(j); } } for (; i < na; i++) { float va = a.getColValue(i); adota += va * va; } for (; j < nb; j++) { float vb = b.getColValue(j); bdotb += vb * vb; } if (adota * bdotb * adotb == 0) { return 0.0; } else { return adotb / Math.sqrt(adota * bdotb); } }
Source:
private byte evaluateFilter(int position, int index, int length) { if (filter.testLength(length)) { int currentPosLength = dictionaryBlock.getSliceLength(index); Slice data = dictionaryBlock.getSlice(index, 0, currentPosLength); if (isCharType && length != currentPosLength) { data = Chars.padSpaces(data, maxCodePointCount); } if (filter.testBytes(data.getBytes(), 0, length)) { if (outputRequired) { values[outputPositionCount] = index; } outputPositions[outputPositionCount] = position; outputPositionCount++; return Status.FILTER_PASSED; } } return Status.FILTER_FAILED; }

Target:
private byte evaluateFilter(int position, int index, int length) { if (filter.testLength(length)) { int currentLength = dictionary.getSliceLength(index); Slice data = dictionary.getSlice(index, 0, currentLength); if (isCharType && length != currentLength) { data = Chars.padSpaces(data, maxCodePointCount); } if (filter.testBytes(data.getBytes(), 0, length)) { if (outputRequired) { values[outputPositionCount] = index; } outputPositions[outputPositionCount] = position; outputPositionCount++; return FILTER_PASSED; } } return FILTER_FAILED; }
Source:
public int getBucket(Page page, int position) { if (typeInfos.isPresent()) { return getHiveBucket(bucketCount, typeInfos.get(), page, position); } else if (types.isPresent()) { return HiveBucketing.getBucket(bucketCount, types.get(), page, position); } else { throw new GenericInternalException("either hiveTypes or types should be present"); } }

Target:
public int getBucket(Page page, int position) { switch (bucketFunctionType) { case HIVE_COMPATIBLE: return getHiveBucket(bucketCount, typeInfos.get(), page, position); case PRESTO_NATIVE: return HiveBucketing.getBucket(bucketCount, types.get(), page, position); default: throw new IllegalArgumentException("Unsupported bucket function type " + bucketFunctionType); } }
Source:
private List<Field> findCategoryFields(final ContentType contentType) { return contentType.fields() .stream().filter(field -> field instanceof CategoryField) .collect(CollectionsUtils.toImmutableList()); }

Target:
private List<Field> findCategoryFields(final ContentType contentType) { return contentType.fields() .stream().filter(CategoryField.class::isInstance) .collect(CollectionsUtils.toImmutableList()); }
Source:
private Optional<String> getHolidayUserFile(ZonedDateTime date, String filename) throws MalformedURLException { URL url = new URL("file:" + filename); Set<Holiday> days = getHolidayManager(url).getHolidays(date.toLocalDate(), date.toLocalDate()); return days.isEmpty() ? Optional.empty() : Optional.of(days.iterator().next().getPropertiesKey()); }

Target:
private Optional<String> getHolidayUserFile(ZonedDateTime date, String filename) throws MalformedURLException, FileNotFoundException { if (Files.exists(Paths.get(filename))) { URL url = new URL("file:" + filename); Set<Holiday> days = getHolidayManager(url).getHolidays(date.toLocalDate(), date.toLocalDate()); return days.isEmpty() ? Optional.empty() : Optional.of(days.iterator().next().getPropertiesKey()); } else { throw new FileNotFoundException(); } }
Source:
public void searchAudit() { AuditService impl = new AuditServiceImpl(); this.auditRecordList = impl.createMockAuditRecord(); if (this.auditRecordList.isEmpty() && this.auditRecordList == null) { this.auditMessage = "Audit Records not found"; auditFound = false; } else { this.auditMessage = "Audit Records Found"; auditFound = true; } }

Target:
public void searchAudit() { AuditService impl = new AuditServiceImpl(); this.auditRecordList = impl.createMockAuditRecord(); if (NullChecker.isNullish(this.auditRecordList)) { this.auditMessage = "Audit Records not found"; auditFound = false; } else { this.auditMessage = "Audit Records Found"; auditFound = true; } }
Source:
public void shouldIncludeProfileIfPresent() throws Throwable { QueryStatistics queryStatistics = mock( QueryStatistics.class ); when( queryStatistics.containsUpdates() ).thenReturn( false ); Result result = mock( Result.class ); when( result.getQueryExecutionType() ).thenReturn( explained( READ_ONLY ) ); when( result.getQueryStatistics() ).thenReturn( queryStatistics ); when( result.getNotifications() ).thenReturn( Collections.emptyList() ); when( result.getExecutionPlanDescription() ).thenReturn( plan( "Join", map( "arg1", 1 ), 2, 4, 3, 1, singletonList( "id1" ), plan( "Scan", map( "arg2", 1 ), 2, 4, 7, 1, singletonList( "id2" ) ) ) ); TransactionalContext tc = mock( TransactionalContext.class ); CypherAdapterStream stream = new CypherAdapterStream( result, Clock.systemUTC() ); Map<String,Object> meta = metadataOf( stream ); Map<String,Object> expectedChild = map( "args", map( "arg2", 1 ), "identifiers", Iterators.asSet("id2"), "operatorType", "Scan", "children", Collections.EMPTY_LIST, "rows", 1L, "dbHits", 2L, "pageCacheHits", 4L, "pageCacheMisses", 7L, "pageCacheHitRatio", 4.0 / 11 ); Map<String,Object> expectedProfile = map( "args", map( "arg1", 1 ), "identifiers", Iterators.asSet("id1"), "operatorType", "Join", "children", Arrays.asList( expectedChild ), "rows", 1L, "dbHits", 2L, "pageCacheHits", 4L, "pageCacheMisses", 3L, "pageCacheHitRatio", 4.0 / 7 ); assertThat( meta.get( "profile" ), equalTo( expectedProfile )); }

Target:
public void shouldIncludeProfileIfPresent() throws Throwable { QueryStatistics queryStatistics = mock( QueryStatistics.class ); when( queryStatistics.containsUpdates() ).thenReturn( false ); Result result = mock( Result.class ); when( result.getQueryExecutionType() ).thenReturn( explained( READ_ONLY ) ); when( result.getQueryStatistics() ).thenReturn( queryStatistics ); when( result.getNotifications() ).thenReturn( Collections.emptyList() ); when( result.getExecutionPlanDescription() ).thenReturn( plan( "Join", map( "arg1", 1 ), 2, 4, 3, 1, singletonList( "id1" ), plan( "Scan", map( "arg2", 1 ), 2, 4, 7, 1, singletonList( "id2" ) ) ) ); TransactionalContext tc = mock( TransactionalContext.class ); CypherAdapterStream stream = new CypherAdapterStream( result, Clock.systemUTC() ); Map<String,Object> meta = metadataOf( stream ); Map<String,Object> expectedChild = map( "args", map( "arg2", 1 ), "identifiers", Iterators.asSet("id2"), "operatorType", "Scan", "children", Collections.EMPTY_LIST, "rows", 1L, "dbHits", 2L, "pageCacheHits", 4L, "pageCacheMisses", 7L, "pageCacheHitRatio", 4.0 / 11 ); Map<String,Object> expectedProfile = map( "args", map( "arg1", 1 ), "identifiers", Iterators.asSet("id1"), "operatorType", "Join", "children", Arrays.asList( expectedChild ), "rows", 1L, "dbHits", 2L, "pageCacheHits", 4L, "pageCacheMisses", 3L, "pageCacheHitRatio", 4.0 / 7 ); assertMapEqualsWithDelta( (Map<String,Object>)meta.get( "profile" ), expectedProfile, 0.0001 ); }
Source:
public void delete(Sprite spriteToDelete) { if (spriteToDelete.isClone) { throw new IllegalStateException("You are deleting a clone: this means you also delete the files that are " + "referenced by the original sprite because clones are shallow copies regarding files."); } for (LookData look : spriteToDelete.getLookList()) { try { lookController.delete(look); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); } } for (SoundInfo sound : spriteToDelete.getSoundList()) { try { soundController.delete(sound); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); } } File projectDirectory = ProjectManager.getInstance().getCurrentProject().getDirectory(); try { new DeviceVariableAccessor(projectDirectory).deleteAllLocalVariables(spriteToDelete); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); } }

Target:
public void delete(Sprite spriteToDelete) { if (spriteToDelete.isClone) { throw new IllegalStateException("You are deleting a clone: this means you also delete the files that are " + "referenced by the original sprite because clones are shallow copies regarding files."); } for (LookData look : spriteToDelete.getLookList()) { try { lookController.delete(look); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); } } for (SoundInfo sound : spriteToDelete.getSoundList()) { try { soundController.delete(sound); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); } } }
Source:
int removeExecutionLogsByTime(final long millis, final int recordCleanupLimit) throws ExecutorManagerException { int totalRecordsRemoved = 0; int removedRecords; do { removedRecords = removeExecutionLogsBatch(millis, recordCleanupLimit); logger.debug("Removed batch of execution logs. Count of records removed in this batch: " + removedRecords); totalRecordsRemoved = totalRecordsRemoved + removedRecords; } while (removedRecords == recordCleanupLimit); return totalRecordsRemoved; }

Target:
int removeExecutionLogsByTime(final long millis, final int recordCleanupLimit) throws ExecutorManagerException { int totalRecordsRemoved = 0; int removedRecords; do { removedRecords = removeExecutionLogsBatch(millis, recordCleanupLimit); logger.debug("Removed batch of execution logs. Count of records removed in this batch: " + removedRecords); totalRecordsRemoved = totalRecordsRemoved + removedRecords; try { Thread.sleep(1000L); } catch (InterruptedException e) { logger.error("Execution logs cleanup thread's sleep was interrupted.", e); } } while (removedRecords == recordCleanupLimit); return totalRecordsRemoved; }
Source:
private void drawText(Batch batch, String text, float posX, float posY, String color) { Paint paint = new Paint(); float textSizeInPx = size; paint.setTextSize(textSizeInPx); if (color == null || color.length() < 7 || color.charAt(0) != '#' || color.length() > 8) { paint.setColor(Color.BLACK); } else { int[] rgb; color = color.toUpperCase(); rgb = calculateColorRGBs(color); paint.setColor((0xFF000000) | (rgb[0] << 16) | (rgb[1] << 8) | (rgb[2])); batch.setColor((float) rgb[0] / 255, (float) rgb[1] / 255, (float) rgb[2] / 255, 1); } paint.setAntiAlias(true); float xOffset = posX - 3.0f; int width = (int) (paint.measureText(text)); boolean isTextArabic = false; if (textContainsArabic(text)) { isTextArabic = true; xOffset -= width; paint.setTextAlign(Paint.Align.RIGHT); } else { paint.setTextAlign(Paint.Align.LEFT); } float baseline = -paint.ascent(); int height = (int) (baseline + paint.descent()); Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); width = isTextArabic ? width : 0; canvas.drawText(text, width, baseline, paint); Texture tex = new Texture(bitmap.getWidth(), bitmap.getHeight(), Pixmap.Format.RGBA8888); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, tex.getTextureObjectHandle()); GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); bitmap.recycle(); batch.draw(tex, xOffset, posY - textSizeInPx); batch.flush(); tex.dispose(); }

Target:
private void drawText(Batch batch, String text, float posX, float posY, String color) { Paint paint = new Paint(); float textSizeInPx = textSize; paint.setTextSize(textSizeInPx); if (isValidColorString(color)) { color = color.toUpperCase(); int[] rgb; rgb = calculateColorRGBs(color); paint.setColor((0xFF000000) | (rgb[0] << 16) | (rgb[1] << 8) | (rgb[2])); batch.setColor((float) rgb[0] / 255, (float) rgb[1] / 255, (float) rgb[2] / 255, 1); } else { paint.setColor(Color.BLACK); } paint.setAntiAlias(true); float xOffset = 3.0f; int canvasWidth = 0; int bitmapWidth = (int) (paint.measureText(text)); paint.setTextAlign(Paint.Align.LEFT); float baseline = -paint.ascent(); int height = (int) (baseline + paint.descent()); Bitmap bitmap = Bitmap.createBitmap(bitmapWidth, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); canvas.drawText(text, canvasWidth, baseline, paint); Texture tex = new Texture(bitmap.getWidth(), bitmap.getHeight(), Pixmap.Format.RGBA8888); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, tex.getTextureObjectHandle()); GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); bitmap.recycle(); batch.draw(tex, posX - xOffset, posY - textSizeInPx); batch.flush(); tex.dispose(); }
Source:
public void getProviderCertificateChain(AsyncQuery aQuery, Provider provider) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { if (source == null) { return new ArrayList<CertificateInfo>(); } return source; } }; Frontend.getInstance().runQuery(VdcQueryType.GetProviderCertificateChain, new ProviderQueryParameters(provider), aQuery); }

Target:
public void getProviderCertificateChain(AsyncQuery aQuery, Provider provider) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { if (source == null) { return Collections.<CertificateInfo> emptyList(); } return source; } }; Frontend.getInstance().runQuery(VdcQueryType.GetProviderCertificateChain, new ProviderQueryParameters(provider), aQuery); }
Source:
public TryBackToAllSnapshotsOfVmParameters() { dstSnapshotId = Guid.Empty; }

Target:
public TryBackToAllSnapshotsOfVmParameters() { dstSnapshotId = Guid.Empty; restoreMemory = true; }
Source:
private void print() { if (canceled) { out.print("[CANCELED] "); } else if (total == IProgressMonitor.UNKNOWN) { switch (animationFrame) { case 0: out.print("[-] "); break; case 1: out.print("[\\] "); break; case 2: out.print("[|] "); break; case 3: out.print("[/] "); break; } animationFrame = (animationFrame + 1) % 4; } else { out.printf("[%2d%%] ", worked / total); } out.print(task); if (subTask != null) { out.printf(" - %s", subTask); } out.print('\r'); }

Target:
private void print() { if (canceled) { out.print("[CANCELED] "); } else if (total == IProgressMonitor.UNKNOWN) { out.print(animationFrames[animationFrameId]); animationFrameId = (animationFrameId + 1) % animationFrames.length; } else { out.printf("[%2d%%] ", worked / total); } out.print(task); if (subTask != null) { out.printf(" - %s", subTask); } out.print('\r'); }
Source:
public PipelineResultIteration(AggregateIterable<Document> aggIter, Map<String, String> varToOriginalName, BindingSet bindings) { aggIter.batchSize(BATCH_SIZE); this.cursor = aggIter.iterator(); this.varToOriginalName = varToOriginalName; this.bindings = bindings; lookahead(); }

Target:
public PipelineResultIteration(AggregateIterable<Document> aggIter, Map<String, String> varToOriginalName, BindingSet bindings) { this.varToOriginalName = Preconditions.checkNotNull(varToOriginalName); this.bindings = Preconditions.checkNotNull(bindings); Preconditions.checkNotNull(aggIter); aggIter.batchSize(BATCH_SIZE); this.cursor = aggIter.iterator(); }
Source:
public Observable<Cursor> getDataPoints(@NonNull Long surveyGroupId, @Nullable Double latitude, @Nullable Double longitude, @Nullable Integer orderBy) { int safeOrderBy; if (orderBy == null) { safeOrderBy = Constants.ORDER_BY_NONE; } else { safeOrderBy = orderBy; } switch (safeOrderBy) { case Constants.ORDER_BY_DISTANCE: case Constants.ORDER_BY_DATE: case Constants.ORDER_BY_STATUS: case Constants.ORDER_BY_NAME: return briteSurveyDbAdapter .getFilteredSurveyedLocales(surveyGroupId, latitude, longitude, safeOrderBy); default: return briteSurveyDbAdapter.getSurveyedLocales(surveyGroupId); } }

Target:
public Observable<Cursor> getDataPoints(@NonNull Long surveyGroupId, @Nullable Double latitude, @Nullable Double longitude, @Nullable Integer orderBy) { if (isRequestFiltered(orderBy)) { return briteSurveyDbAdapter .getFilteredDataPoints(surveyGroupId, latitude, longitude, orderBy); } else { return briteSurveyDbAdapter.getDataPoints(surveyGroupId); } }
Source:
public void testGetSqlQueryAllInvalidRows() throws SQLException { SourceTargetColumnNames columnNames = new SourceTargetColumnNames.DataSourceColNames(pDataTable, pIndexTable, false); String sqlStr = IndexScrutinyTableOutput.getSqlQueryAllInvalidRows(conn, columnNames, SCRUTINY_TIME_MILLIS); assertEquals("SELECT \"SOURCE_TABLE\" , \"TARGET_TABLE\" , \"SCRUTINY_EXECUTE_TIME\" , \"SOURCE_ROW_PK_HASH\" , \"SOURCE_TS\" , \"TARGET_TS\" , \"HAS_TARGET_ROW\" , \"ID\" , \"PK_PART2\" , \"NAME\" , \"ZIP\" , \":ID\" , \":PK_PART2\" , \"0:NAME\" , \"0:ZIP\" FROM PHOENIX_INDEX_SCRUTINY(\"ID\" INTEGER,\"PK_PART2\" TINYINT,\"NAME\" VARCHAR,\"ZIP\" BIGINT,\":ID\" INTEGER,\":PK_PART2\" TINYINT,\"0:NAME\" VARCHAR,\"0:ZIP\" BIGINT) WHERE (\"SOURCE_TABLE\",\"TARGET_TABLE\",\"SCRUTINY_EXECUTE_TIME\") IN (('TEST_SCHEMA.TEST_INDEX_COLUMN_NAMES_UTIL','TEST_SCHEMA.TEST_ICN_INDEX',1502908914193))", sqlStr); }

Target:
public void testGetSqlQueryAllInvalidRows() throws SQLException { SourceTargetColumnNames columnNames = new SourceTargetColumnNames.DataSourceColNames(pDataTable, pIndexTable); String sqlStr = IndexScrutinyTableOutput.getSqlQueryAllInvalidRows(conn, columnNames, SCRUTINY_TIME_MILLIS); assertEquals("SELECT \"SOURCE_TABLE\" , \"TARGET_TABLE\" , \"SCRUTINY_EXECUTE_TIME\" , \"SOURCE_ROW_PK_HASH\" , \"SOURCE_TS\" , \"TARGET_TS\" , \"HAS_TARGET_ROW\" , \"ID\" , \"PK_PART2\" , \"NAME\" , \"ZIP\" , \":ID\" , \":PK_PART2\" , \"0:NAME\" , \"0:ZIP\" FROM PHOENIX_INDEX_SCRUTINY(\"ID\" INTEGER,\"PK_PART2\" TINYINT,\"NAME\" VARCHAR,\"ZIP\" BIGINT,\":ID\" INTEGER,\":PK_PART2\" TINYINT,\"0:NAME\" VARCHAR,\"0:ZIP\" BIGINT) WHERE (\"SOURCE_TABLE\",\"TARGET_TABLE\",\"SCRUTINY_EXECUTE_TIME\") IN (('TEST_SCHEMA.TEST_INDEX_COLUMN_NAMES_UTIL','TEST_SCHEMA.TEST_ICN_INDEX',1502908914193))", sqlStr); }
Source:
public BaseDaoTestCase() { Assume.assumeTrue("Uninitialized TestCase, cannot proceed. Look above for causing exception.", initialized); }

Target:
public BaseDaoTestCase() { assumeTrue("Uninitialized TestCase, cannot proceed. Look above for causing exception.", initialized); }
Source:
public String readValue(HttpServletRequest request, HttpServletResponse ignored) { String name = getName(); String value = null; javax.servlet.http.Cookie cookie = getCookie(request, name); if (cookie != null) { String path = StringUtils.clean(getPath()); if (path != null && !request.getRequestURI().startsWith(path)) { log.warn("Found '{}' cookie at path '{}', but should be only used for '{}'", new Object[] { name, request.getRequestURI(), path}); } else { value = cookie.getValue(); log.debug("Found '{}' cookie value [{}]", name, value); } } else { log.trace("No '{}' cookie value", name); } return value; }

Target:
public String readValue(HttpServletRequest request, HttpServletResponse ignored) { String name = getName(); String value = null; javax.servlet.http.Cookie cookie = getCookie(request, name); if (cookie != null) { String path = StringUtils.clean(getPath()); if (path != null && !pathMatches(path, request.getRequestURI())) { log.warn("Found '{}' cookie at path '{}', but should be only used for '{}'", new Object[] { name, request.getRequestURI(), path}); } else { value = cookie.getValue(); log.debug("Found '{}' cookie value [{}]", name, value); } } else { log.trace("No '{}' cookie value", name); } return value; }
Source:
public void beforeMethod() { manager = new PersistentUUIDManagerImpl(); eventLogManager = new EventLogManagerImpl(); topologyManager = new ClusterTopologyManagerImpl() { @Override public void broadcastRebalanceStart(String cacheName, CacheTopology cacheTopology, boolean totalOrder, boolean distributed) { } @Override public void broadcastTopologyUpdate(String cacheName, CacheTopology cacheTopology, AvailabilityMode availabilityMode, boolean totalOrder, boolean distributed) { } @Override public void broadcastStableTopologyUpdate(String cacheName, CacheTopology cacheTopology, boolean totalOrder, boolean distributed) { } @Override public void broadcastShutdownCache(String cacheName, CacheTopology cacheTopology, boolean totalOrder, boolean distributed) throws Exception { } }; preferConsistencyStrategy = new PreferConsistencyStrategy(eventLogManager, manager); }

Target:
public void beforeMethod() { manager = new PersistentUUIDManagerImpl(); eventLogManager = new EventLogManagerImpl(); topologyManager = Mockito.mock(ClusterTopologyManager.class); preferConsistencyStrategy = new PreferConsistencyStrategy(eventLogManager, manager); }
Source:
private void addProcessorConfig(ImportConfiguration config, Map<String, AbstractImporterFactory> importerModules) { Properties properties = config.getmoduleProperties(); String module = properties.getProperty(ImportDataProcessor.IMPORT_MODULE); String attrs[] = module.split("\\|"); String bundleJar = attrs[1]; FormatterBuilder formatterBuilder = config.getFormatterBuilder(); try { ImporterWrapper wrapper = m_importers.get(bundleJar); if (wrapper == null) { AbstractImporterFactory importFactory = importerModules.get(bundleJar); wrapper = new ImporterWrapper(importFactory); String name = wrapper.getImporterType(); if (name == null || name.trim().isEmpty()) { throw new RuntimeException("Importer must implement and return a valid unique name."); } m_importers.put(bundleJar, wrapper); } wrapper.configure(properties, formatterBuilder); } catch(Throwable t) { m_logger.error("Failed to configure import handler for " + bundleJar, t); Throwables.propagate(t); } }

Target:
private void addProcessorConfig(ImportConfiguration config, Map<String, AbstractImporterFactory> importerModules) { Properties properties = config.getmoduleProperties(); String module = properties.getProperty(ImportDataProcessor.IMPORT_MODULE); assert(module != null); String attrs[] = module.split("\\|"); String bundleJar = attrs[1]; FormatterBuilder formatterBuilder = config.getFormatterBuilder(); try { ImporterWrapper wrapper = m_importers.get(bundleJar); if (wrapper == null) { AbstractImporterFactory importFactory = importerModules.get(bundleJar); wrapper = new ImporterWrapper(importFactory); String name = wrapper.getImporterType(); if (name == null || name.trim().isEmpty()) { throw new RuntimeException("Importer must implement and return a valid unique name."); } m_importers.put(bundleJar, wrapper); } wrapper.configure(properties, formatterBuilder); } catch(Throwable t) { m_logger.error("Failed to configure import handler for " + bundleJar, t); Throwables.propagate(t); } }
Source:
public T executeOperation(Transport transport) { HeaderParams params = writeHeader(transport, GET_STREAM_REQUEST); transport.writeArray(keyBytes); transport.writeVInt(offset); transport.flush(); short status = readHeaderAndValidate(transport, params); T result = null; if (HotRodConstants.isNotExist(status)) { result = null; } else { if (HotRodConstants.isSuccess(status)) { retryable = false; short flags = transport.readByte(); long creation = -1; int lifespan = -1; long lastUsed = -1; int maxIdle = -1; if ((flags & INFINITE_LIFESPAN) != INFINITE_LIFESPAN) { creation = transport.readLong(); lifespan = transport.readVInt(); } if ((flags & INFINITE_MAXIDLE) != INFINITE_MAXIDLE) { lastUsed = transport.readLong(); maxIdle = transport.readVInt(); } long version = transport.readLong(); result = codec.readAsStream(transport, new VersionedMetadataImpl(creation, lifespan, lastUsed, maxIdle, version), () -> { transport.setBusy(false); transport.getTransportFactory().releaseTransport(transport); } ); } } return result; }

Target:
public T executeOperation(Transport transport) { HeaderParams params = writeHeader(transport, GET_STREAM_REQUEST); transport.writeArray(keyBytes); transport.writeVInt(offset); transport.flush(); short status = readHeaderAndValidate(transport, params); T result = null; if (HotRodConstants.isNotExist(status)) { result = null; } else { if (HotRodConstants.isSuccess(status)) { retryable = false; short flags = transport.readByte(); long creation = -1; int lifespan = -1; long lastUsed = -1; int maxIdle = -1; if ((flags & INFINITE_LIFESPAN) != INFINITE_LIFESPAN) { creation = transport.readLong(); lifespan = transport.readVInt(); } if ((flags & INFINITE_MAXIDLE) != INFINITE_MAXIDLE) { lastUsed = transport.readLong(); maxIdle = transport.readVInt(); } long version = transport.readLong(); transport.setBusy(true); result = codec.readAsStream(transport, new VersionedMetadataImpl(creation, lifespan, lastUsed, maxIdle, version), () -> { transport.setBusy(false); transport.getTransportFactory().releaseTransport(transport); } ); } } return result; }
Source:
public void afterPropertiesSet() throws Exception { ThymeleafViewResolver viewResolver = applicationContext.getBean(ThymeleafViewResolver.class); if (viewResolver == null) { LOG.warn( "Cannot adjust ThymeleafViewResolver: " + "bean of this type wasn't found in application context" ); return; } boolean production = environment.acceptsProfiles("prod"); boolean useCdn = Boolean.valueOf(environment.getProperty(SecurityConfig.APP_USE_CDN)); viewResolver.setStaticVariables(resourcesAsMap(production, useCdn)); }

Target:
public void afterPropertiesSet() throws Exception { ThymeleafViewResolver viewResolver = applicationContext.getBean(ThymeleafViewResolver.class); if (viewResolver == null) { LOG.warn( "Cannot adjust ThymeleafViewResolver: " + "bean of this type wasn't found in application context" ); return; } boolean productionEnv = environment.acceptsProfiles("prod"); viewResolver.setStaticVariables(resourcesAsMap(productionEnv)); }
Source:
public List<Mica.StudySummaryDto> listCollectionStudyStates(@QueryParam("query") String query, @QueryParam("from") @DefaultValue("0") Integer from, @QueryParam("limit") Integer limit, @QueryParam("type") String type, @Context HttpServletResponse response) { Stream<? extends EntityState> result; long totalCount; if(limit == null) limit = MAX_LIMIT; if(limit < 0) throw new IllegalArgumentException("limit cannot be negative"); if(Strings.isNullOrEmpty(query)) { List<? extends EntityState> studyStates = (type != null ? getStudyServiceByType(type).findAllStates() : studyService.findAllStates()).stream() .filter(s -> subjectAclService.isPermitted("/draft/collection-study", "VIEW", s.getId()) || subjectAclService.isPermitted("/draft/harmonization-study", "VIEW", s.getId())) .collect(toList()); totalCount = studyStates.size(); result = studyStates.stream().sorted((o1, o2) -> o1.getId().compareTo(o2.getId())).skip(from).limit(limit); } else { DocumentService.Documents<Study> studyDocuments = draftStudyService.find(from, limit, null, null, null, query); totalCount = studyDocuments.getTotal(); result = (type != null ? getStudyServiceByType(type).findAllStates(studyDocuments.getList().stream().map(Study::getId).collect(toList())) : studyService.findAllStates(studyDocuments.getList().stream().map(Study::getId).collect(toList()))) .stream(); } response.addHeader("X-Total-Count", Long.toString(totalCount)); return result.map(dtos::asDto).collect(toList()); }

Target:
public List<Mica.StudySummaryDto> listCollectionStudyStates(@QueryParam("query") String query, @QueryParam("from") @DefaultValue("0") Integer from, @QueryParam("limit") Integer limit, @QueryParam("type") String type, @Context HttpServletResponse response) { Stream<? extends EntityState> result; long totalCount; if(limit == null) limit = MAX_LIMIT; if(limit < 0) throw new IllegalArgumentException("limit cannot be negative"); if(Strings.isNullOrEmpty(query)) { List<? extends EntityState> studyStates = (!Strings.isNullOrEmpty(type) ? getStudyServiceByType(type).findAllStates() : studyService.findAllStates()).stream() .filter(s -> subjectAclService.isPermitted("/draft/collection-study", "VIEW", s.getId()) || subjectAclService.isPermitted("/draft/harmonization-study", "VIEW", s.getId())) .collect(toList()); totalCount = studyStates.size(); result = studyStates.stream().sorted((o1, o2) -> o1.getId().compareTo(o2.getId())).skip(from).limit(limit); } else { DocumentService.Documents<Study> studyDocuments = draftStudyService.find(from, limit, null, null, null, query); totalCount = studyDocuments.getTotal(); result = (!Strings.isNullOrEmpty(type) ? getStudyServiceByType(type).findAllStates(studyDocuments.getList().stream().map(Study::getId).collect(toList())) : studyService.findAllStates(studyDocuments.getList().stream().map(Study::getId).collect(toList()))) .stream(); } response.addHeader("X-Total-Count", Long.toString(totalCount)); return result.map(dtos::asDto).collect(toList()); }
Source:
public Mutation toMutation(K key) { V valueFromStorage = (V) valueDataConversion.fromStorage(value); return new Mutations.ReadWriteWithValue<>(valueFromStorage, f); }

Target:
public Mutation toMutation(K key) { return new Mutations.ReadWriteWithValue<>(value, f); }
Source:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (savedInstanceState == null) { ReaderUpdateServiceStarter.startService(getActivity(), EnumSet.of(ReaderUpdateLogic.UpdateTask.TAGS)); if (mIsEmailSignup) { AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_EMAIL_EPILOGUE_VIEWED); if (TextUtils.isEmpty(mAccountStore.getAccount().getEmail())) { startProgress(false); } else { populateViews(); } } else { AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_SOCIAL_EPILOGUE_VIEWED); new DownloadAvatarAndUploadGravatarThread(mPhotoUrl, mEmailAddress, mAccount.getAccessToken()).start(); mImageManager.loadIntoCircle(mHeaderAvatar, ImageType.AVATAR_WITHOUT_BACKGROUND, mPhotoUrl); } } else { mDialog = (FullScreenDialogFragment) getFragmentManager().findFragmentByTag(FullScreenDialogFragment.TAG); if (mDialog != null) { mDialog.setOnConfirmListener(this); mDialog.setOnDismissListener(this); } mDisplayName = savedInstanceState.getString(KEY_DISPLAY_NAME); mUsername = savedInstanceState.getString(KEY_USERNAME); mIsAvatarAdded = savedInstanceState.getBoolean(KEY_IS_AVATAR_ADDED); if (mIsEmailSignup) { mPhotoUrl = StringUtils.notNullStr(savedInstanceState.getString(KEY_PHOTO_URL)); mEmailAddress = savedInstanceState.getString(KEY_EMAIL_ADDRESS); mHeaderEmailAddress.setText(mEmailAddress); mHeaderAvatarAdd.setVisibility(mIsAvatarAdded ? View.GONE : View.VISIBLE); } mImageManager.loadIntoCircle(mHeaderAvatar, ImageType.AVATAR_WITHOUT_BACKGROUND, mPhotoUrl); } }

Target:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (savedInstanceState == null) { ReaderUpdateServiceStarter.startService(WordPress.getContext(), EnumSet.of(ReaderUpdateLogic.UpdateTask.TAGS)); if (mIsEmailSignup) { AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_EMAIL_EPILOGUE_VIEWED); if (TextUtils.isEmpty(mAccountStore.getAccount().getEmail())) { startProgress(false); } else { populateViews(); } } else { AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_SOCIAL_EPILOGUE_VIEWED); new DownloadAvatarAndUploadGravatarThread(mPhotoUrl, mEmailAddress, mAccount.getAccessToken()).start(); mImageManager.loadIntoCircle(mHeaderAvatar, ImageType.AVATAR_WITHOUT_BACKGROUND, mPhotoUrl); } } else { mDialog = (FullScreenDialogFragment) getFragmentManager().findFragmentByTag(FullScreenDialogFragment.TAG); if (mDialog != null) { mDialog.setOnConfirmListener(this); mDialog.setOnDismissListener(this); } mDisplayName = savedInstanceState.getString(KEY_DISPLAY_NAME); mUsername = savedInstanceState.getString(KEY_USERNAME); mIsAvatarAdded = savedInstanceState.getBoolean(KEY_IS_AVATAR_ADDED); if (mIsEmailSignup) { mPhotoUrl = StringUtils.notNullStr(savedInstanceState.getString(KEY_PHOTO_URL)); mEmailAddress = savedInstanceState.getString(KEY_EMAIL_ADDRESS); mHeaderEmailAddress.setText(mEmailAddress); mHeaderAvatarAdd.setVisibility(mIsAvatarAdded ? View.GONE : View.VISIBLE); } mImageManager.loadIntoCircle(mHeaderAvatar, ImageType.AVATAR_WITHOUT_BACKGROUND, mPhotoUrl); } }
Source:
public void theRetrieveAssociationLNObjectlistRequestIsReceived() throws Throwable { this.correlationUidPattern = Pattern.compile(this.organisationId.getOrganisationId() + "\\|\\|\\|\\S{17}\\|\\|\\|\\S{17}"); this.testCase = this.wsdlProjectFactory.createWsdlTestCase(SOAP_PROJECT_XML, TEST_SUITE_XML, TEST_CASE_XML); PROPERTIES_MAP.put("DeviceIdentificationE", this.deviceId.getDeviceId()); PROPERTIES_MAP.put("OrganisationIdentification", this.organisationId.getOrganisationId()); final TestCaseResult runTestStepByName = this.testCaseRunner.runWsdlTestCase(this.testCase, PROPERTIES_MAP, TEST_CASE_NAME_REQUEST); final TestStepResult runTestStepByNameResult = runTestStepByName.getRunTestStepByName(); final WsdlTestCaseRunner wsdlTestCaseRunner = runTestStepByName.getResults(); assertEquals(TestStepStatus.OK, runTestStepByNameResult.getStatus()); for (final TestStepResult tcr : wsdlTestCaseRunner.getResults()) { this.response = ((MessageExchange) tcr).getResponseContent(); this.correlationUidMatcher = this.correlationUidPattern.matcher(this.response); } this.correlationUidMatcher.find(); this.correlationUid = this.correlationUidMatcher.group(); }

Target:
public void theRetrieveAssociationLNObjectlistRequestIsReceived() throws Throwable { this.correlationUidPattern = Pattern.compile(this.organisationId.getOrganisationId() + "\\|\\|\\|\\S{17}\\|\\|\\|\\S{17}"); this.testCase = this.wsdlProjectFactory.createWsdlTestCase(SOAP_PROJECT_XML, TEST_SUITE_XML, TEST_CASE_XML); PROPERTIES_MAP.put("DeviceIdentificationE", this.deviceId.getDeviceId()); PROPERTIES_MAP.put("OrganisationIdentification", this.organisationId.getOrganisationId()); final TestCaseResult runTestStepByName = this.testCaseRunner.runWsdlTestCase(this.testCase, PROPERTIES_MAP, TEST_CASE_NAME_REQUEST); final TestStepResult runTestStepByNameResult = runTestStepByName.getRunTestStepByName(); final WsdlTestCaseRunner wsdlTestCaseRunner = runTestStepByName.getResults(); assertEquals(TestStepStatus.OK, runTestStepByNameResult.getStatus()); for (final TestStepResult tcr : wsdlTestCaseRunner.getResults()) { this.response = ((MessageExchange) tcr).getResponseContent(); this.correlationUidMatcher = this.correlationUidPattern.matcher(this.response); } assertTrue(this.correlationUidMatcher.find()); this.correlationUid = this.correlationUidMatcher.group(); }
Source:
public void break_without_argument() { verifyBlockCfg("" + "while (cond( succ = [body, END], elem = 1 )) {" + " body( succ = [END], elem = 2 );" + " break;" + "}"); verifyBlockCfg("" + "do {" + " body( succ = [END] );" + " break;" + "} while (cond( succ = [body, END] ));"); verifyBlockCfg("" + "while (outerCond( succ = [innerCond, END] )) {" + " while (innerCond( succ = [bodyInner, ifCond] )) {" + " bodyInner( succ = [innerCond] );" + " }" + " if (ifCond( succ = [bodyIf, outerCond] )) {" + " bodyIf( succ = [END] );" + " break;" + " }" + "}"); verifyBlockCfg("" + "before(succ = [cond], elem = 1);" + "for ($i=1 ; cond( succ = [body, END], elem = 1); $i++) {" + " body( succ = [END], elem = 2 );" + " break;" + "}"); verifyBlockCfg("" + "before(succ = [cond], elem = 1);" + "foreach ( cond(succ = [body, END], elem = 1) as $key) {" + " body( succ = [END], elem = 2 );" + " break;" + "}"); }

Target:
public void break_without_argument() { verifyBlockCfg("" + "while (cond( succ = [body, END], elem = 1 )) {" + " body( succ = [END], elem = 2 );" + " break;" + "}"); verifyBlockCfg("" + "do {" + " body( succ = [END] );" + " break;" + "} while (cond( succ = [body, END] ));"); verifyBlockCfg("" + "while (outerCond( succ = [innerCond, END] )) {" + " while (innerCond( succ = [bodyInner, ifCond] )) {" + " bodyInner( succ = [innerCond] );" + " }" + " if (ifCond( succ = [bodyIf, outerCond] )) {" + " bodyIf( succ = [END] );" + " break;" + " }" + "}"); verifyBlockCfg("" + "before(succ = [cond]);" + "for (; cond( succ = [body, END]) ; updateBlock(succ = [cond])) {" + " body( succ = [END]);" + " break;" + "}"); verifyBlockCfg("" + "before(succ = [cond], elem = 1);" + "foreach ( cond(succ = [body, END], elem = 1) as $foo) {" + " body( succ = [END], elem = 2 );" + " break;" + "}"); }
Source:
private static StringBuilder getStringBuilder(JPQLNextSerializer serializer) { try { Field builderField = SerializerBase.class.getDeclaredField("builder"); builderField.setAccessible(true); return (StringBuilder) builderField.get(serializer); } catch (Exception e) { throw new IllegalStateException(e); } }

Target:
private static StringBuilder getStringBuilder(JPQLNextSerializer serializer) { try { return (StringBuilder) BUILDER_FIELD.get(serializer); } catch (Exception e) { throw new IllegalStateException(e); } }
Source:
public void log(Request request, Response response) { final int status = response.getCommittedMetaData().getStatus(); registry.meter(prefix + '.' + status + "-responses").mark(); wrapped.log(request, response); }

Target:
public void log(Request request, Response response) { final int status = response.getCommittedMetaData().getStatus(); registry.meter(prefix + '.' + status + "-responses").mark(); if (wrapped != null) { wrapped.log(request, response); } }