auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
Connection createConnection() throws AmqpException; String getHost(); int getPort(); String getVirtualHost(); String getUsername(); void addConnectionListener(ConnectionListener listener); boolean removeConnectionListener(ConnectionListener listener); void clearConnectionListeners(); default Connection createPublisherConnection() throws AmqpException { return createConnection(); }

Target:
Connection createConnection() throws AmqpException; String getHost(); int getPort(); String getVirtualHost(); String getUsername(); void addConnectionListener(ConnectionListener listener); boolean removeConnectionListener(ConnectionListener listener); void clearConnectionListeners(); default @Nullable ConnectionFactory getPublisherConnectionFactory() { return null; }
Source:
private String getAuthorizationHeader(String clientId, String clientSecret) { if(clientId == null || clientSecret == null) { logger.debug("Null Client ID or Client Secret detected. Endpoint that requires authentication will reject request with 401 error."); } String creds = String.format("%s:%s", clientId, clientSecret); try { return "Basic " + new String(Base64.encode(creds.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Could not convert String"); } }

Target:
private String getAuthorizationHeader(String clientId, String clientSecret) { if(clientId == null || clientSecret == null) { logger.warn("Null Client ID or Client Secret detected. Endpoint that requires authentication will reject request with 401 error."); } String creds = String.format("%s:%s", clientId, clientSecret); try { return "Basic " + new String(Base64.encode(creds.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Could not convert String"); } }
Source:
private void resetVmAttributes(VmDynamic vm) { vm.setMigratingToVds(null); vm.getGraphicsInfos().clear(); vm.setGuestCurrentUserName(null); vm.setConsoleCurrentUserName(null); vm.setConsoleUserId(null); vm.setClientIp(""); vm.setIp(null); vm.setFqdn(null); vm.setCpuName(null); vm.setEmulatedMachine(null); vm.setVolatileRun(false); vm.setGuestAgentNicsHash(0); }

Target:
private void resetVmAttributes(VmDynamic vm) { vm.setMigratingToVds(null); vm.getGraphicsInfos().clear(); vm.setGuestCurrentUserName(null); vm.setConsoleCurrentUserName(null); vm.setConsoleUserId(null); vm.setClientIp(null); vm.setIp(null); vm.setFqdn(null); vm.setCpuName(null); vm.setEmulatedMachine(null); vm.setVolatileRun(false); vm.setGuestAgentNicsHash(0); }
Source:
public void setUp() throws Exception { when(translationService.format(GuidedDecisionTableErraiConstants.MetaDataColumnPage_MetadataNameEmpty)) .thenReturn("empty"); when(translationService.format(GuidedDecisionTableErraiConstants.MetaDataColumnPage_ThatColumnNameIsAlreadyInUsePleasePickAnother)) .thenReturn("alreadyUsed"); when(translationService.format(GuidedDecisionTableErraiConstants.MetaDataColumnPage_IsNotValidIdentifier)) .thenReturn("isNotValid"); when(validationServiceCaller.call(any())).thenReturn(validationService); }

Target:
public void setUp() throws Exception { when(translationService.format(GuidedDecisionTableErraiConstants.MetaDataColumnPage_MetadataNameEmpty)) .thenReturn("empty"); when(translationService.format(GuidedDecisionTableErraiConstants.MetaDataColumnPage_ThatColumnNameIsAlreadyInUsePleasePickAnother)) .thenReturn("alreadyUsed"); when(translationService.format(GuidedDecisionTableErraiConstants.MetaDataColumnPage_IsNotValidIdentifier)) .thenReturn("isNotValid"); validationServiceCaller = new CallerMock<>(validationService); page.validationService = validationServiceCaller; when(validationService.evaluateJavaIdentifiers(any())).thenReturn(validationResult); }
Source:
void createOrEditFileComment() { if (!Gerrit.isSignedIn()) { Gerrit.doSignIn(parent.getToken()); } if (boxes.isEmpty()) { CommentInfo info = CommentInfo.createFile( path, side, null, null); addFileComment(parent.addDraftBox(info)); } else { CommentBox box = boxes.get(boxes.size() - 1); if (box instanceof DraftBox) { ((DraftBox) box).setEdit(true); } else { addFileComment(((PublishedBox) box).addReplyBox()); } } }

Target:
void createOrEditFileComment() { if (!Gerrit.isSignedIn()) { Gerrit.doSignIn(parent.getToken()); return; } if (boxes.isEmpty()) { CommentInfo info = CommentInfo.createFile( path, side, null, null); addFileComment(parent.addDraftBox(info)); } else { CommentBox box = boxes.get(boxes.size() - 1); if (box instanceof DraftBox) { ((DraftBox) box).setEdit(true); } else { addFileComment(((PublishedBox) box).addReplyBox()); } } }
Source:
private boolean matchesNamespace(final String namespace) { return namespaces.stream().anyMatch(ns -> ns.equals(namespace)); }

Target:
private boolean matchesNamespace(final String namespace) { return namespaces.stream().anyMatch(ns -> Objects.equals(ns, namespace)); }
Source:
protected void executeQueryCommand() { try { VDSReturnValue returnValue = getBackendResourceManager().RunVdsCommand(VDSCommandType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsVDSParameters(getUpServerId(), getParameters().getClusterId(), getParameters().getVolumeName(), getParameters().getBrickName(), getParameters().detailsRequired())); getQueryReturnValue().setReturnValue(returnValue.getReturnValue()); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
protected void executeQueryCommand() { VDSReturnValue returnValue = getBackendResourceManager().RunVdsCommand(VDSCommandType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsVDSParameters(getUpServerId(getParameters().getClusterId()), getParameters().getClusterId(), getParameters().getVolumeName(), getParameters().getBrickName(), getParameters().detailsRequired())); getQueryReturnValue().setReturnValue(returnValue.getReturnValue()); }
Source:
public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException { String snippet = getSnippet("list"); snippet = snippet.replaceAll("%label%", getLabel(w)); String rowSnippet = getSnippet("list_row"); String state = itemUIRegistry.getState(w).toString(); String[] rowContents = state.split(((List) w).getSeparator()); StringBuilder rowSB = new StringBuilder(); for(String row : rowContents) { rowSB.append(StringUtils.replace(rowSnippet, "%title%", row)); } snippet = StringUtils.replace(snippet, "%rows%", rowSB.toString()); String style = ""; String color = itemUIRegistry.getLabelColor(w); if(color != null) style = "color:"+ color; snippet = StringUtils.replace(snippet, "%labelstyle%", style); style = ""; color = itemUIRegistry.getValueColor(w); if(color != null) style = "color:"+ color; snippet = StringUtils.replace(snippet, "%valuestyle%", style); sb.append(snippet); return null; }

Target:
public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException { String snippet = getSnippet("list"); snippet = snippet.replaceAll("%label%", getLabel(w)); String rowSnippet = getSnippet("list_row"); String state = itemUIRegistry.getState(w).toString(); String[] rowContents = state.split(((List) w).getSeparator()); StringBuilder rowSB = new StringBuilder(); for(String row : rowContents) { rowSB.append(StringUtils.replace(rowSnippet, "%title%", row)); } snippet = StringUtils.replace(snippet, "%rows%", rowSB.toString()); snippet = processColor(w, snippet); sb.append(snippet); return null; }
Source:
public void testRunScenarioDependentImportsAndFactData() throws Exception { final ArrayList<Fixture> fixtures = new ArrayList<Fixture>(); final Imports imports = new Imports() {{ addImport(new Import("java.sql.ClientInfoStatus")); addImport(new Import("Integer")); addImport(new Import("org.kie.Person")); }}; final Map<String, ModelField[]> modelFields = new HashMap<String, ModelField[]>() {{ put("java.sql.ClientInfoStatus", new ModelField[]{modelField("java.sql.JDBCType")}); put("org.kie.Person", new ModelField[]{modelField("org.kie.Address")}); put("org.kie.Address", new ModelField[]{modelField("org.kie.City"), modelField("org.kie.Street")}); }}; when(scenario.getFixtures()).thenReturn(fixtures); when(dataModelService.getDataModel(path)).thenReturn(modelOracle); when(modelOracle.getProjectModelFields()).thenReturn(modelFields); when(scenario.getImports()).thenReturn(imports); testEditorService.runScenario("userName", path, scenario); assertEquals(7, scenario.getImports().getImports().size()); }

Target:
public void testRunScenarioDependentImportsAndFactData() throws Exception { final ArrayList<Fixture> fixtures = new ArrayList<>(); final Imports imports = new Imports() {{ addImport(new Import("java.sql.ClientInfoStatus")); addImport(new Import("Integer")); addImport(new Import("org.kie.Person")); }}; final Map<String, ModelField[]> modelFields = new HashMap() {{ put("java.sql.ClientInfoStatus", toModelFields("java.sql.JDBCType")); put("org.kie.Person", toModelFields("org.kie.Address")); put("org.kie.Address", toModelFields("org.kie.City", "org.kie.Street")); }}; final int usedDataTypesCount = 7; when(scenario.getFixtures()).thenReturn(fixtures); when(dataModelService.getDataModel(path)).thenReturn(modelOracle); when(modelOracle.getProjectModelFields()).thenReturn(modelFields); when(scenario.getImports()).thenReturn(imports); testEditorService.runScenario("userName", path, scenario); assertEquals(usedDataTypesCount, scenario.getImports().getImports().size()); }
Source:
public void testDefaultLoggerClosesItStreams() throws Exception { final Checker checker = new Checker(); try (CloseAndFlushTestByteArrayOutputStream testInfoOutputStream = new CloseAndFlushTestByteArrayOutputStream(); CloseAndFlushTestByteArrayOutputStream testErrorOutputStream = new CloseAndFlushTestByteArrayOutputStream()) { checker.setModuleClassLoader(Thread.currentThread().getContextClassLoader()); checker.addListener(new DefaultLogger(testInfoOutputStream, OutputStreamOptions.CLOSE, testErrorOutputStream, OutputStreamOptions.CLOSE)); final File tmpFile = temporaryFolder.newFile("file.java"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verify(checker, tmpFile.getPath(), expected); assertEquals("Close count was not expected", 1, testInfoOutputStream.getCloseCount()); assertEquals("Flush count was not expected", 3, testInfoOutputStream.getFlushCount()); assertEquals("Close count was not expected", 1, testErrorOutputStream.getCloseCount()); assertEquals("Flush count was not expected", 1, testErrorOutputStream.getFlushCount()); } }

Target:
public void testDefaultLoggerClosesItStreams() throws Exception { final Checker checker = new Checker(); try (CloseAndFlushTestByteArrayOutputStream testInfoOutputStream = new CloseAndFlushTestByteArrayOutputStream(); CloseAndFlushTestByteArrayOutputStream testErrorOutputStream = new CloseAndFlushTestByteArrayOutputStream()) { checker.setModuleClassLoader(Thread.currentThread().getContextClassLoader()); checker.addListener(new DefaultLogger(testInfoOutputStream, true, testErrorOutputStream, true)); final File tmpFile = temporaryFolder.newFile("file.java"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verify(checker, tmpFile.getPath(), expected); assertEquals("Close count was not expected", 1, testInfoOutputStream.getCloseCount()); assertEquals("Flush count was not expected", 3, testInfoOutputStream.getFlushCount()); assertEquals("Close count was not expected", 1, testErrorOutputStream.getCloseCount()); assertEquals("Flush count was not expected", 1, testErrorOutputStream.getFlushCount()); } }
Source:
private QueryContext createQueryContext(Session session) { QueryContext newQueryContext = new QueryContext(context.getConf(), session); String tajoTest = System.getProperty(CommonTestingUtil.TAJO_TEST_KEY); if (tajoTest != null && tajoTest.equalsIgnoreCase(CommonTestingUtil.TAJO_TEST_TRUE)) { newQueryContext.putAll(CommonTestingUtil.getSessionVarsForTest()); } synchronized (session) { if (session.getQueryCache() == null) { session.setQueryCache(CacheBuilder.newBuilder() .maximumSize(200) .expireAfterAccess(1, TimeUnit.HOURS) .build(new CacheLoader<String, Expr>() { public Expr load(String sql) throws SQLSyntaxError { return analyzer.parse(sql); } }) ); } } return newQueryContext; }

Target:
private QueryContext createQueryContext(Session session) { QueryContext newQueryContext = new QueryContext(context.getConf(), session); String tajoTest = System.getProperty(CommonTestingUtil.TAJO_TEST_KEY); if (tajoTest != null && tajoTest.equalsIgnoreCase(CommonTestingUtil.TAJO_TEST_TRUE)) { newQueryContext.putAll(CommonTestingUtil.getSessionVarsForTest()); } int queryCacheSize = context.getConf().getIntVar(TajoConf.ConfVars.QUERY_SESSION_QUERY_CACHE_SIZE); if (queryCacheSize > 0 && session.getQueryCache() == null) { Weigher<String, Expr> weighByLength = new Weigher<String, Expr>() { public int weigh(String key, Expr expr) { return key.length(); } }; LoadingCache<String, Expr> cache = CacheBuilder.newBuilder() .maximumWeight(queryCacheSize * 1024) .weigher(weighByLength) .expireAfterAccess(1, TimeUnit.HOURS) .build(new CacheLoader<String, Expr>() { public Expr load(String sql) throws SQLSyntaxError { return analyzer.parse(sql); } }); session.setQueryCache(cache); } return newQueryContext; }
Source:
public void addField(@NonNull String name, @NonNull IDeclaration declaration) { if (Arrays.asList(fFieldNames).contains(name)) { return; } @NonNull IDeclaration[] fields = Arrays.copyOf(fFields, fFields.length + 1); fields[fFields.length] = declaration; fFields = fields; @NonNull String[] names = Arrays.copyOf(fFieldNames, fFieldNames.length + 1); names[fFieldNames.length] = name; fFieldNames = names; fMaxAlign = Math.max(fMaxAlign, declaration.getAlignment()); }

Target:
public void addField(@NonNull String name, @NonNull IDeclaration declaration) { if (Arrays.asList(fFieldNames).contains(name)) { Activator.log(IStatus.WARNING, "Struct already contains a field named " + name); return; } @NonNull IDeclaration[] fields = Arrays.copyOf(fFields, fFields.length + 1); fields[fFields.length] = declaration; fFields = fields; @NonNull String[] names = Arrays.copyOf(fFieldNames, fFieldNames.length + 1); names[fFieldNames.length] = name; fFieldNames = names; fMaxAlign = Math.max(fMaxAlign, declaration.getAlignment()); }
Source:
public void writeData(ObjectDataOutput out) throws IOException { IOUtil.writeObject(out, key); IOUtil.writeObject(out, value); out.writeLong(cost); out.writeLong(creationTime); out.writeLong(expirationTime); out.writeLong(hits); out.writeLong(lastAccessTime); out.writeLong(lastStoredTime); out.writeLong(lastUpdateTime); out.writeLong(version); out.writeLong(ttl); out.writeLong(maxIdle); }

Target:
public void writeData(ObjectDataOutput out) throws IOException { IOUtil.writeObject(out, key); IOUtil.writeObject(out, value); out.writeLong(cost); out.writeLong(creationTime); out.writeLong(expirationTime); out.writeLong(hits); out.writeLong(lastAccessTime); out.writeLong(lastStoredTime); out.writeLong(lastUpdateTime); out.writeLong(version); out.writeLong(ttl); if (out.getVersion().isGreaterOrEqual(V3_11)) { out.writeLong(maxIdle); } }
Source:
public void setUp() throws Exception { dockerHostAddress = ElasticSearchRestDataContextIT.determineHostName(); externalClient = new RestHighLevelClient(RestClient.builder(new HttpHost(dockerHostAddress, 9200))); externalClient.indices().create(new CreateIndexRequest(INDEX_NAME), RequestOptions.DEFAULT); final PutMappingRequest putMappingRequest = new PutMappingRequest(INDEX_NAME); putMappingRequest .source(ElasticSearchUtils .getMappingSource(new MutableTable(DEFAULT_TABLE_NAME, TableType.TABLE, new MutableSchema( INDEX_NAME), new MutableColumn("name", ColumnType.STRING), new MutableColumn("age", ColumnType.INTEGER)))); externalClient.indices().putMapping(putMappingRequest, RequestOptions.DEFAULT); factory = new ElasticSearchRestDataContextFactory(); }

Target:
public void setUp() throws Exception { dockerHostAddress = ElasticSearchRestDataContextIT.determineHostName(); externalClient = new RestHighLevelClient(RestClient .builder(new HttpHost(dockerHostAddress, ElasticSearchRestDataContextIT.DEFAULT_REST_CLIENT_PORT))); externalClient.indices().create(new CreateIndexRequest(INDEX_NAME), RequestOptions.DEFAULT); final MutableTable table = new MutableTable(DEFAULT_TABLE_NAME, TableType.TABLE, new MutableSchema(INDEX_NAME), new MutableColumn("name", ColumnType.STRING), new MutableColumn("age", ColumnType.INTEGER)); final PutMappingRequest putMappingRequest = new PutMappingRequest(INDEX_NAME) .source(ElasticSearchUtils.getMappingSource(table)); externalClient.indices().putMapping(putMappingRequest, RequestOptions.DEFAULT); factory = new ElasticSearchRestDataContextFactory(); properties = new DataContextPropertiesImpl(); properties .put(DataContextPropertiesImpl.PROPERTY_URL, "http://" + dockerHostAddress + ":" + ElasticSearchRestDataContextIT.DEFAULT_REST_CLIENT_PORT); properties.put(DataContextPropertiesImpl.PROPERTY_DATABASE, INDEX_NAME); }
Source:
private void initEnumValues() { if ( enumValues == null ) { Class<Enum<?>> returnedClass = coreEnumType.returnedClass(); this.enumValues = returnedClass.getEnumConstants(); if ( enumValues == null ) { throw new NullPointerException( "Failed to init enumValues" ); } } }

Target:
private void initEnumValues() { if ( enumValues == null ) { Class<? extends Enum<?>> returnedClass = coreEnumType.returnedClass(); this.enumValues = returnedClass.getEnumConstants(); if ( enumValues == null ) { throw new NullPointerException( "Failed to init enumValues" ); } } }
Source:
private void scheduleRefreshAccessToken(long expireDateInMs) { long refreshAfter = expireDateInMs - System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(10); if (refreshAfter < 0) { RealmLog.debug("Expires time already reached for the access token, refreshing now"); refreshAccessToken(); } else { RealmLog.debug("Scheduling an access_token refresh in " + (refreshAfter) + " milliseconds"); if (refreshTokenTask != null) { refreshTokenTask.cancel(); } ScheduledFuture<?> task = REFRESH_TOKENS_EXECUTOR.schedule(new Runnable() { @Override public void run() { refreshAccessToken(); } }, refreshAfter, TimeUnit.MILLISECONDS); refreshTokenTask = new RealmAsyncTaskImpl(task, REFRESH_TOKENS_EXECUTOR); } }

Target:
private void scheduleRefreshAccessToken(long expireDateInMs) { long refreshAfter = expireDateInMs - System.currentTimeMillis() - REFRESH_MARGIN_DELAY; if (refreshAfter < 0) { RealmLog.debug("Expires time already reached for the access token, refreshing now"); refreshAccessToken(); } else { RealmLog.debug("Scheduling an access_token refresh in " + (refreshAfter) + " milliseconds"); if (refreshTokenTask != null) { refreshTokenTask.cancel(); } ScheduledFuture<?> task = REFRESH_TOKENS_EXECUTOR.schedule(new Runnable() { @Override public void run() { refreshAccessToken(); } }, refreshAfter, TimeUnit.MILLISECONDS); refreshTokenTask = new RealmAsyncTaskImpl(task, REFRESH_TOKENS_EXECUTOR); } }
Source:
public void performRequestDetailLineValidation(ConcurRequestExtractRequestDetailFileLine detailFileLine, List<String> uniqueRequestIdsInFile) { if (requestDetailFileLineIsCashAdvance(detailFileLine)) { boolean lineValidationPassed = true; lineValidationPassed = requestedCashAdvanceHasNotBeenClonedInFile(detailFileLine, uniqueRequestIdsInFile); LOG.info("requestedCashAdvanceHasNotBeenClonedInFile = " + lineValidationPassed); lineValidationPassed &= requestedCashAdvanceHasNotBeenUsedInExpenseReport(detailFileLine); LOG.info("requestedCashAdvanceHasNotBeenUsedInExpenseReport = " + lineValidationPassed); lineValidationPassed &= requestedCashAdvanceIsNotBeingDuplicated(detailFileLine); LOG.info("requestedCashAdvanceIsNotBeingDuplicated = " + lineValidationPassed); lineValidationPassed &= requestedCashAdvanceAccountingInformationIsValid(detailFileLine); LOG.info("requestedCashAdvanceAccountingInformationIsValid = " + lineValidationPassed); detailFileLine.getValidationResult().setValidCashAdvanceLine(lineValidationPassed); LOG.info("performRequestDetailLineValidation: Detail File Line validation : " + ((lineValidationPassed) ? "PASSED" : ("FAILED" + KFSConstants.NEWLINE + detailFileLine.toString()))); } }

Target:
public void performRequestDetailLineValidation(ConcurRequestExtractRequestDetailFileLine detailFileLine, List<String> uniqueRequestIdsInFile) { if (requestDetailFileLineIsCashAdvance(detailFileLine)) { boolean lineValidationPassed = true; lineValidationPassed = requestedCashAdvanceHasNotBeenClonedInFile(detailFileLine, uniqueRequestIdsInFile); LOG.info("performRequestDetailLineValidation: requestedCashAdvanceHasNotBeenClonedInFile = " + lineValidationPassed); lineValidationPassed &= requestedCashAdvanceHasNotBeenUsedInExpenseReport(detailFileLine); LOG.info("performRequestDetailLineValidation: requestedCashAdvanceHasNotBeenUsedInExpenseReport = " + lineValidationPassed); lineValidationPassed &= requestedCashAdvanceIsNotBeingDuplicated(detailFileLine); LOG.info("performRequestDetailLineValidation: requestedCashAdvanceIsNotBeingDuplicated = " + lineValidationPassed); lineValidationPassed &= requestedCashAdvanceAccountingInformationIsValid(detailFileLine); LOG.info("performRequestDetailLineValidation: requestedCashAdvanceAccountingInformationIsValid = " + lineValidationPassed); detailFileLine.getValidationResult().setValidCashAdvanceLine(lineValidationPassed); LOG.info("performRequestDetailLineValidation: Detail File Line validation : " + ((lineValidationPassed) ? "PASSED" : ("FAILED" + KFSConstants.NEWLINE + detailFileLine.toString()))); } }
Source:
public static VarSimToolNamespace fromName(final String name) { if (name != null) { for (final VarSimToolNamespace varSimTool : values()) { if (varSimTool == Unknown) { continue; } if (varSimTool.toolName.equals(name) || varSimTool.name().equalsIgnoreCase(name)) { return varSimTool; } } } return Unknown; }

Target:
public static VarSimToolNamespace fromName(final String name) { if (name != null) { for (final VarSimToolNamespace varSimTool : values()) { if (varSimTool == Unknown) { continue; } if (varSimTool.command.equals(name) || varSimTool.name().equalsIgnoreCase(name)) { return varSimTool; } if (varSimTool.commandAliases != null) { for (final String commandAlias : varSimTool.commandAliases) { if (commandAlias.equalsIgnoreCase(name)) { return varSimTool; } } } } } return Unknown; }
Source:
private void fetchRequests(RequestRegistrationCallback<GetOperation> requestRegistrationCallback) { Iterator<ReplicaId> replicaIterator = operationTracker.getReplicaIterator(); while (replicaIterator.hasNext()) { ReplicaId replicaId = replicaIterator.next(); String hostname = replicaId.getDataNodeId().getHostname(); Port port = replicaId.getDataNodeId().getPortToConnectTo(); GetRequest getRequest = createGetRequest(blobId, getOperationFlag(), GetOptions.None); RequestInfo request = new RequestInfo(hostname, port, getRequest); int correlationId = getRequest.getCorrelationId(); correlationIdToGetRequestInfo.put(correlationId, new GetRequestInfo(replicaId, time.milliseconds())); requestRegistrationCallback.registerRequestToSend(this, request); replicaIterator.remove(); if (RouterUtils.isRemoteReplica(routerConfig, replicaId)) { routerMetrics.crossColoRequestCount.inc(); } routerMetrics.getDataNodeBasedMetrics(replicaId.getDataNodeId()).getBlobInfoRequestRate.mark(); } }

Target:
private void fetchRequests(RequestRegistrationCallback<GetOperation> requestRegistrationCallback) { Iterator<ReplicaId> replicaIterator = operationTracker.getReplicaIterator(); while (replicaIterator.hasNext()) { ReplicaId replicaId = replicaIterator.next(); String hostname = replicaId.getDataNodeId().getHostname(); Port port = replicaId.getDataNodeId().getPortToConnectTo(); GetRequest getRequest = createGetRequest(blobId, getOperationFlag(), GetOptions.None); RequestInfo request = new RequestInfo(hostname, port, getRequest); int correlationId = getRequest.getCorrelationId(); correlationIdToGetRequestInfo.put(correlationId, new GetRequestInfo(replicaId, time.milliseconds())); requestRegistrationCallback.registerRequestToSend(this, request); replicaIterator.remove(); if (RouterUtils.isRemoteReplica(routerConfig, replicaId)) { logger.trace("Making request to a remote replica in", replicaId.getDataNodeId().getDatacenterName()); routerMetrics.crossColoRequestCount.inc(); } routerMetrics.getDataNodeBasedMetrics(replicaId.getDataNodeId()).getBlobInfoRequestRate.mark(); } }
Source:
private IProbeArrayStrategy createStrategyFor(final ClassLoader classLoader, final long classId, final String className, final int probeCount) { final Class<?> cls; final String field; synchronized (companions) { Companion companion = companions.get(classLoader); if (companion == null) { final byte[] definition = createCompanionClass(); try { cls = (Class<?>) DEFINE_CLASS.invoke(classLoader, COMPANION_NAME, definition, 0, definition.length); companion = new Companion(cls); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } companions.put(classLoader, companion); } else { cls = companion.cls.get(); assert cls != null; } if (companion.usedFields == FIELDS_PER_CLASS) { throw new UnsupportedOperationException(); } field = "p" + companion.usedFields; companion.usedFields++; } final boolean[] probes = runtimeData .getExecutionData(classId, className, probeCount).getProbes(); try { cls.getField(field).set(null, probes); } catch (IllegalAccessException e) { throw new RuntimeException(); } catch (NoSuchFieldException e) { throw new RuntimeException(); } return new IProbeArrayStrategy() { public int storeInstance(MethodVisitor mv, int variable) { mv.visitFieldInsn(Opcodes.GETSTATIC, COMPANION_NAME, field, InstrSupport.DATAFIELD_DESC); mv.visitVarInsn(Opcodes.ASTORE, variable); return 1; } public void addMembers(ClassVisitor cv, int probeCount) { } }; }

Target:
private IProbeArrayStrategy createStrategyFor(final ClassLoader classLoader, final long classId, final String className, final int probeCount) { final Class<?> cls; final String companionName; final int fieldId; synchronized (companions) { Companion companion = companions.get(classLoader); if (companion == null) { companion = new Companion(); companion.defineNew(classLoader); companions.put(classLoader, companion); } else if (companion.usedFields == FIELDS_PER_CLASS) { companion.defineNew(classLoader); } cls = companion.cls.get(); assert cls != null; companionName = companion.getName(); fieldId = companion.usedFields; companion.usedFields++; } final boolean[] probes = runtimeData .getExecutionData(classId, className, probeCount).getProbes(); try { cls.getMethod(INIT_METHOD_NAME, int.class, boolean[].class) .invoke(null, fieldId, probes); } catch (IllegalAccessException e) { throw new RuntimeException(); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getCause()); } return new IProbeArrayStrategy() { public int storeInstance(MethodVisitor mv, int variable) { mv.visitFieldInsn(Opcodes.GETSTATIC, companionName, fieldNameFor(fieldId), InstrSupport.DATAFIELD_DESC); mv.visitVarInsn(Opcodes.ASTORE, variable); return 1; } public void addMembers(ClassVisitor cv, int probeCount) { } }; }
Source:
public List<Thing> parseGeneric(String jsonText) throws ParseException, RedditError { return parseGeneric(jsonText, "children"); }

Target:
public List<Thing> parseGeneric(String jsonText) throws RedditParseException { return parseGeneric(jsonText, "children"); }
Source:
public List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint) { if (booleanConstraint == BooleanConstraint.FALSE) { return inverse().setConstraint(initialProgramState, BooleanConstraint.TRUE); } Set<RelationalSymbolicValue> knownRelations = knownRelations(initialProgramState).collect(Collectors.toSet()); Set<RelationalSymbolicValue> newRelations = new HashSet<>(); newRelations.add(this); newRelations.addAll(transitiveRelations(knownRelations)); boolean unfulfilled = newRelations.stream() .map(r -> r.resolveState(knownRelations)) .anyMatch(RelationState.UNFULFILLED::equals); if (unfulfilled) { return ImmutableList.of(); } return getNewProgramStates(initialProgramState, newRelations); }

Target:
public List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint) { if (booleanConstraint == BooleanConstraint.FALSE) { return inverse().setConstraint(initialProgramState, BooleanConstraint.TRUE); } Set<RelationalSymbolicValue> knownRelations = knownRelations(initialProgramState); Set<RelationalSymbolicValue> newRelations = new HashSet<>(); newRelations.add(this); newRelations.addAll(transitiveRelations(knownRelations)); boolean unfulfilled = newRelations.stream() .map(r -> r.resolveRelationState(knownRelations)) .anyMatch(RelationState.UNFULFILLED::equals); if (unfulfilled) { return ImmutableList.of(); } return getNewProgramStates(initialProgramState, newRelations); }
Source:
boolean hasInflightBatches(TopicPartition topicPartition) { return topicPartitionBookkeeper.contains(topicPartition) && !topicPartitionBookkeeper.getPartition(topicPartition).inflightBatchesBySequence.isEmpty(); }

Target:
synchronized boolean hasInflightBatches(TopicPartition topicPartition) { return topicPartitionBookkeeper.contains(topicPartition) && !topicPartitionBookkeeper.getPartition(topicPartition).inflightBatchesBySequence.isEmpty(); }
Source:
public Concept getNonCodedDrugConcept() { String conceptUuid = Context.getAdministrationService().getGlobalProperty(OpenmrsConstants.GP_DRUG_ORDER_DRUG_OTHER); if (org.apache.commons.lang.StringUtils.isNotBlank(conceptUuid)) { return Context.getConceptService().getConceptByUuid(conceptUuid); } return null; }

Target:
public Concept getNonCodedDrugConcept() { String conceptUuid = Context.getAdministrationService().getGlobalProperty(OpenmrsConstants.GP_DRUG_ORDER_DRUG_OTHER); if (StringUtils.hasText(conceptUuid)) { return Context.getConceptService().getConceptByUuid(conceptUuid); } return null; }
Source:
public ValidationResult canVnicWithExternalNetworkBePlugged() { if (RequiredAction.PLUG == getRequiredAction() && !nic.isLinked()) { final boolean vnicAttachedToExternalNetwork = isVnicAttachedToExternalNetwork(); if (validationResult != ValidationResult.VALID) { return validationResult; } if (vnicAttachedToExternalNetwork) { return new ValidationResult(VdcBllMessages.PLUGGED_UNLINKED_VM_INTERFACE_WITH_EXTERNAL_NETWORK_IS_NOT_SUPPORTED); } } return ValidationResult.VALID; }

Target:
public ValidationResult canVnicWithExternalNetworkBePlugged() { return ValidationResult.failWith(VdcBllMessages.PLUGGED_UNLINKED_VM_INTERFACE_WITH_EXTERNAL_NETWORK_IS_NOT_SUPPORTED) .when(RequiredAction.PLUG == getRequiredAction() && !nic.isLinked() && isVnicAttachedToExternalNetwork()); }
Source:
public T jsonRead(JsonParser parser) throws IOException { switch (parser.getCurrentToken()) { case VALUE_NUMBER_INT: { return convertFromMillis(parser.getLongValue()); } case VALUE_NUMBER_FLOAT: { BigDecimal value = parser.getDecimalValue(); Timestamp timestamp = DecimalUtils.toTimestamp(value); return convertFromTimestamp(timestamp); } default: { String jsonDateTime = parser.getText(); Instant instant = Instant.parse(jsonDateTime.replace(" ", "T")); Timestamp ts = Timestamp.from(instant); return convertFromTimestamp(ts); } } }

Target:
public T jsonRead(JsonParser parser) throws IOException { switch (parser.getCurrentToken()) { case VALUE_NUMBER_INT: { return convertFromMillis(parser.getLongValue()); } case VALUE_NUMBER_FLOAT: { BigDecimal value = parser.getDecimalValue(); Timestamp timestamp = DecimalUtils.toTimestamp(value); return convertFromTimestamp(timestamp); } default: { String jsonDateTime = parser.getText(); return convertFromTimestamp(dateTimeParser.parse(jsonDateTime)); } } }
Source:
public void detachVideo() { RCLogger.i(TAG, "detachVideo()"); if (localRenderLayout == null ||remoteRenderLayout == null) { return; } localRender.setVisibility(View.INVISIBLE); remoteRender.setVisibility(View.INVISIBLE); peerConnectionClient.detachVideo(); }

Target:
public void detachVideo() { RCLogger.i(TAG, "detachVideo()"); if (localRender != null) { localRender.setVisibility(View.INVISIBLE); } if(remoteRender != null) { remoteRender.setVisibility(View.INVISIBLE); } peerConnectionClient.detachVideo(); }
Source:
private <T> Optional<T> readWithStatFrom(String path, ThrowingReader<T> supplier, BiConsumer<T, Stat> statDecorator, boolean quiet) { try { Stat stat = new Stat(); byte[] data = zookeeper.getData().storingStatIn(stat).forPath(path); if (ArrayUtils.isNotEmpty(data)) { T t = supplier.read(data); statDecorator.accept(t, stat); return Optional.of(t); } else { logWarnOrThrowException("No data at path " + path, new InternalProcessingException("No data at path " + path), quiet); } } catch (JsonMappingException malformedException) { logWarnOrThrowException("Unable to read data from path " + path, new MalformedDataException(path, malformedException), quiet); } catch (InternalProcessingException e) { throw e; } catch (Exception exception) { logWarnOrThrowException("Unable to read data from path " + path, new InternalProcessingException(exception), quiet); } return Optional.empty(); }

Target:
private <T> Optional<T> readWithStatFrom(String path, ThrowingReader<T> supplier, BiConsumer<T, Stat> statDecorator, boolean quiet) { try { Stat stat = new Stat(); byte[] data = zookeeper.getData().storingStatIn(stat).forPath(path); if (ArrayUtils.isNotEmpty(data)) { T t = supplier.read(data); statDecorator.accept(t, stat); return Optional.of(t); } } catch (JsonMappingException malformedException) { logWarnOrThrowException("Unable to read data from path " + path, new MalformedDataException(path, malformedException), quiet); } catch (InternalProcessingException e) { throw e; } catch (Exception exception) { logWarnOrThrowException("Unable to read data from path " + path, new InternalProcessingException(exception), quiet); } return Optional.empty(); }
Source:
public Node jjtGetChild(final int index) { try { return (Node) children.get(index); } catch (final ClassCastException e) { return new AntlrBaseNode(); } }

Target:
public Node jjtGetChild(final int index) { try { return (Node) childrenStream().skip(index).findFirst().orElse(null); } catch (final ClassCastException e) { throw new IllegalArgumentException("Accessing invalid Antlr node", e); } }
Source:
private void handleResponse(String clientEndpoint, final String ticket, final LwM2mResponse response) { excutorService.submit(new Runnable() { @Override public void run() { try { sendResponse(ticket, response); } catch (Throwable t) { LOG.error("Unable to send response.", t); sendError(ticket, String.format("Expected error while sending LWM2M response.(%s)", t.getMessage())); } } }); }

Target:
private void handleResponse(String clientEndpoint, final String ticket, final LwM2mResponse response) { executorService.submit(new Runnable() { @Override public void run() { try { sendResponse(ticket, response); } catch (Throwable t) { LOG.error("Unable to send response.", t); sendError(ticket, String.format("Expected error while sending LWM2M response.(%s)", t.getMessage())); } } }); }
Source:
public void setInterfaceConfig(String iface, InterfaceConfiguration cfg) { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); LinkAddress linkAddr = cfg.getLinkAddress(); if (linkAddr == null || linkAddr.getAddress() == null) { throw new IllegalStateException("Null LinkAddress given"); } final ArrayList<String> flags = new ArrayList<>(); InterfaceConfigurationParcel cfgParcel = new InterfaceConfigurationParcel(); cfgParcel.ifName = iface; cfgParcel.hwAddr = ""; cfgParcel.addr = linkAddr.getAddress().getHostAddress(); cfgParcel.prefixLength = linkAddr.getPrefixLength(); cfg.getFlags().forEach(flags::add); cfgParcel.flags = flags.toArray(EMPTY_STRING_ARRAY); try { mNetdService.interfaceSetCfg(cfgParcel); } catch (RemoteException | ServiceSpecificException e) { throw new IllegalStateException(e); } }

Target:
public void setInterfaceConfig(String iface, InterfaceConfiguration cfg) { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); LinkAddress linkAddr = cfg.getLinkAddress(); if (linkAddr == null || linkAddr.getAddress() == null) { throw new IllegalStateException("Null LinkAddress given"); } final InterfaceConfigurationParcel cfgParcel = cfg.toParcel(iface); try { mNetdService.interfaceSetCfg(cfgParcel); } catch (RemoteException | ServiceSpecificException e) { throw new IllegalStateException(e); } }
Source:
public String toString() { String msg = "Buffered read safe SpHandle " + m_safeSpHandle; msg += m_initiateMsg != null ? m_initiateMsg.toString() : m_fragmentMsg.toString(); return msg; }

Target:
public String toString() { String msg = "Buffered read safe SpHandle " + TxnEgo.txnIdToString(m_safeSpHandle) + ", "; msg += m_initiateMsg != null ? m_initiateMsg.toString() : m_fragmentMsg.toString(); return msg; }
Source:
public boolean matchEvents() { if (!(fTraces.size() > 0)) { return false; } initMatching(); Job job = new Job(Messages.TmfEventMatching_MatchingEvents) { @Override protected IStatus run(final IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, fTraces.size()); for (ITmfTrace trace : fTraces) { subMonitor.beginTask(NLS.bind(Messages.TmfEventMatching_LookingEventsFrom, trace.getName()), IProgressMonitor.UNKNOWN); SubMonitor childMonitor = subMonitor.newChild(1); EventMatchingBuildRequest request = new EventMatchingBuildRequest(TmfEventMatching.this, trace, childMonitor); trace.sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { Activator.logInfo(e.getMessage()); } if (childMonitor.isCanceled()) { return Status.CANCEL_STATUS; } } return Status.OK_STATUS; } }; job.schedule(); try { job.join(); } catch (InterruptedException e) { } finalizeMatching(); return true; }

Target:
public boolean matchEvents() { if (!(fTraces.size() > 0)) { return false; } initMatching(); Job job = new Job(Messages.TmfEventMatching_MatchingEvents) { @Override protected IStatus run(final IProgressMonitor monitor) { for (ITmfTrace trace : fTraces) { monitor.beginTask(NLS.bind(Messages.TmfEventMatching_LookingEventsFrom, trace.getName()), IProgressMonitor.UNKNOWN); setName(NLS.bind(Messages.TmfEventMatching_RequestingEventsFrom, trace.getName())); EventMatchingBuildRequest request = new EventMatchingBuildRequest(TmfEventMatching.this, trace, monitor); trace.sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { Activator.logInfo(e.getMessage()); } if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } } return Status.OK_STATUS; } }; job.schedule(); try { job.join(); } catch (InterruptedException e) { } finalizeMatching(); return true; }
Source:
public void startDialogWithoutPassingAnyParameters() throws IOException, InterruptedException { sttService = new STTServiceStub(); ksService = new KSServiceStub(); ttsService = new TTSServiceStub(); hliStub = new HumanLanguageInterpreterStub(); source = new AudioSourceStub(); registerService(sttService); registerService(ksService); registerService(ttsService); registerService(hliStub); registerService(source); Dictionary<String, Object> config = new Hashtable<String, Object>(); config.put(CONFIG_KEYWORD, "word"); config.put(CONFIG_DEFAULT_STT, sttService.getId()); config.put(CONFIG_DEFAULT_KS, ksService.getId()); config.put(CONFIG_DEFAULT_HLI, hliStub.getId()); config.put(CONFIG_DEFAULT_VOICE, voice.getUID()); ConfigurationAdmin configAdmin = super.getService(ConfigurationAdmin.class); String pid = "org.eclipse.smarthome.voice"; Configuration configuration = configAdmin.getConfiguration(pid); configuration.update(config); Thread.sleep(100); voiceManager.startDialog(); assertTrue(ksService.isWordSpotted()); }

Target:
public void startDialogWithoutPassingAnyParameters() throws IOException, InterruptedException { sttService = new STTServiceStub(); ksService = new KSServiceStub(); ttsService = new TTSServiceStub(); hliStub = new HumanLanguageInterpreterStub(); source = new AudioSourceStub(); registerService(sttService); registerService(ksService); registerService(ttsService); registerService(hliStub); registerService(source); Dictionary<String, Object> config = new Hashtable<String, Object>(); config.put(CONFIG_KEYWORD, "word"); config.put(CONFIG_DEFAULT_STT, sttService.getId()); config.put(CONFIG_DEFAULT_KS, ksService.getId()); config.put(CONFIG_DEFAULT_HLI, hliStub.getId()); config.put(CONFIG_DEFAULT_VOICE, voice.getUID()); ConfigurationAdmin configAdmin = super.getService(ConfigurationAdmin.class); String pid = "org.eclipse.smarthome.voice"; Configuration configuration = configAdmin.getConfiguration(pid); configuration.update(config); waitForAssert(() -> { try { voiceManager.startDialog(); } catch (Exception ex) { } assertTrue(ksService.isWordSpotted()); }); }
Source:
public final <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) { Contracts.assertNotNull( object, MESSAGES.validatedObjectMustNotBeNull() ); BeanMetaData<?> beanMetaData = beanMetaDataManager.getBeanMetaData( object.getClass() ); if ( !beanMetaData.hasConstraints() ) { return Collections.emptySet(); } ValidationOrder validationOrder = determineGroupValidationOrder( groups ); ValidationContext<T> validationContext = getValidationContextBuilder().forValidate( object ); ValueContext<?, Object> valueContext = ValueContext.getLocalExecutionContext( parameterNameProvider, object, beanMetaData, PathImpl.createRootPath() ); return validateInContext( validationContext, valueContext, validationOrder ); }

Target:
public final <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) { Contracts.assertNotNull( object, MESSAGES.validatedObjectMustNotBeNull() ); ValidationContext<T> validationContext = getValidationContextBuilder().forValidate( object ); if ( !validationContext.getRootBeanMetaData().hasConstraints() ) { return Collections.emptySet(); } ValidationOrder validationOrder = determineGroupValidationOrder( groups ); ValueContext<?, Object> valueContext = ValueContext.getLocalExecutionContext( parameterNameProvider, object, validationContext.getRootBeanMetaData(), PathImpl.createRootPath() ); return validateInContext( validationContext, valueContext, validationOrder ); }
Source:
BackgroundEditorPool() { backgroundEditors = new LRUCache(CAPACITY); Application application = ApplicationManager.getApplication(); this.messageBusConnection = application.getMessageBus().connect(); messageBusConnection.subscribe(appLifecycleListener.TOPIC, appLifecycleListener); Disposer.register(application, this); }

Target:
BackgroundEditorPool() { backgroundEditors = new LRUCache(CAPACITY); Application application = ApplicationManager.getApplication(); this.messageBusConnection = application.getMessageBus().connect(); messageBusConnection.subscribe(AppLifecycleListener.TOPIC, appLifecycleListener); Disposer.register(application, this); }
Source:
public static RefineryRecipe findRecipe(FluidStack input0, FluidStack input1) { for(RefineryRecipe recipe : recipeList) { if(!input0.isEmpty()) { if((!recipe.input0.isEmpty())&&input0.containsFluid(recipe.input0)) { if((recipe.input1.isEmpty()&&input1.isEmpty())||((!recipe.input1.isEmpty())&&(!input1.isEmpty())&&input1.containsFluid(recipe.input1))) return recipe; } if((!recipe.input1.isEmpty())&&input0.containsFluid(recipe.input1)) { if(((recipe.input0.isEmpty())&&(input1.isEmpty()))||((!recipe.input0.isEmpty())&&(!input1.isEmpty())&&input1.containsFluid(recipe.input0))) return recipe; } } else if(!input1.isEmpty()) { if((recipe.input0.isEmpty())&&input1.containsFluid(recipe.input0)&&(recipe.input1.isEmpty())) return recipe; if((!recipe.input1.isEmpty())&&input1.containsFluid(recipe.input1)&&(recipe.input0.isEmpty())) return recipe; } } return null; }

Target:
public static RefineryRecipe findRecipe(FluidStack input0, FluidStack input1) { for(RefineryRecipe recipe : recipeList) { if(!input0.isEmpty()) { if(!recipe.input0.isEmpty()&&input0.containsFluid(recipe.input0)) { if((recipe.input1.isEmpty()&&input1.isEmpty())||(!recipe.input1.isEmpty()&&!input1.isEmpty()&&input1.containsFluid(recipe.input1))) return recipe; } if(!recipe.input1.isEmpty()&&input0.containsFluid(recipe.input1)) { if((recipe.input0.isEmpty()&&input1.isEmpty())||(!recipe.input0.isEmpty()&&!input1.isEmpty()&&input1.containsFluid(recipe.input0))) return recipe; } } else if(!input1.isEmpty()) { if(!recipe.input0.isEmpty()&&input1.containsFluid(recipe.input0)&&recipe.input1.isEmpty()) return recipe; if(!recipe.input1.isEmpty()&&input1.containsFluid(recipe.input1)&&recipe.input0.isEmpty()) return recipe; } } return null; }
Source:
public boolean isContainer(){ return !type.isUnit; }

Target:
public boolean isContainer(){ return type != null ? type.isContainer() : (children != null && children.size() > 0); }
Source:
private ObjectNode processTProperties(Properties cProperties) { ObjectNode schema = JsonNodeFactory.instance.objectNode(); schema.put(JsonSchemaConstants.TAG_TITLE, cProperties.getDisplayName()); schema.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.TYPE_OBJECT); schema.putObject(JsonSchemaConstants.TAG_PROPERTIES); List<Property> propertyList = getSubProperty(cProperties); for (Property property : propertyList) { String name = property.getName(); if (property.isRequired()) { addToRequired(schema, name); } ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperty(property)); } List<Properties> propertiesList = getSubProperties(cProperties); for (Properties properties : propertiesList) { String name = properties.getName(); if (properties instanceof ReferenceProperties<?>) { ReferenceProperties<?> referenceProperties = (ReferenceProperties<?>) properties; ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processReferenceProperties(referenceProperties)); } else { ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperties(properties)); } } return schema; }

Target:
private ObjectNode processTProperties(Properties cProperties) { ObjectNode schema = JsonNodeFactory.instance.objectNode(); schema.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.TYPE_OBJECT); schema.putObject(JsonSchemaConstants.TAG_PROPERTIES); List<Property> propertyList = getSubProperty(cProperties); for (Property property : propertyList) { String name = property.getName(); if (property.isRequired()) { addToRequired(schema, name); } ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperty(property)); } List<Properties> propertiesList = getSubProperties(cProperties); for (Properties properties : propertiesList) { String name = properties.getName(); if (properties instanceof ReferenceProperties<?>) { ReferenceProperties<?> referenceProperties = (ReferenceProperties<?>) properties; ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processReferenceProperties(referenceProperties)); } else { ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperties(properties)); } } return schema; }
Source:
public Object getAttribute(final short tag) { AttributeTagInfo info = lazyAttributeTags.get(tag); if (info != null) { if (!initializedAttributes.contains(info.lazyAttribute)) { Object ret; try { Method method = this.getClass().getDeclaredMethod(info.getterImplName); method.setAccessible(true); ret = method.invoke(this); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } setAttribute(tag, ret); } } return super.getAttribute(tag); }

Target:
public Object getAttribute(final short tag) { LazyAttribute attr = lazyAttributeTags.get(tag); if (attr != null) { if (!initializedAttributes.contains(attr)) { setAttribute(tag, attr.getAttribute(this)); } } return super.getAttribute(tag); }