auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void queueNextChildren2D(IntegerRangeCondition quarks, TimeRangeCondition times, Deque<Integer> queue, boolean reverse) { rwl.readLock().lock(); try { Deque<Integer> toAdd = new LinkedList<>(); for (int child = 0; child < fNbChildren; child++) { if (times.intersects(fChildStart[child], fChildEnd[child]) && quarks.intersects(fChildMin[child], fChildMax[child])) { int potentialNextSeqNb = fChildren[child]; if (!reverse) { toAdd.addFirst(potentialNextSeqNb); } else { toAdd.add(potentialNextSeqNb); } } } for (Integer seqNum : toAdd) { queue.addFirst(seqNum); } } finally { rwl.readLock().unlock(); } }

Target:
public void queueNextChildren2D(IntegerRangeCondition quarks, TimeRangeCondition times, Deque<Integer> queue, boolean reverse) { rwl.readLock().lock(); try { Deque<Integer> toAdd = new ArrayDeque<>(); for (int child = 0; child < fNbChildren; child++) { if (times.intersects(fChildStart[child], fChildEnd[child]) && quarks.intersects(fChildMin[child], fChildMax[child])) { int potentialNextSeqNb = fChildren[child]; if (!reverse) { toAdd.addFirst(potentialNextSeqNb); } else { toAdd.add(potentialNextSeqNb); } } } for (Integer seqNum : toAdd) { queue.addFirst(seqNum); } } finally { rwl.readLock().unlock(); } }
Source:
public void afterCommit( TransactionData data, Object state ) { try { for ( WritableFulltext nodeIndex : fulltextProvider.writableNodeIndices() ) { Map<Long,Map<String,Object>> nodeMap = ((Map<Long,Map<String,Object>>[]) state)[0]; removePropertyData( data.removedNodeProperties(), nodeMap, nodeIndex ); updatePropertyData( nodeMap, nodeIndex ); refreshIndex( nodeIndex ); } for ( WritableFulltext relationshipIndex : fulltextProvider.writableRelationshipIndices() ) { Map<Long,Map<String,Object>> relationshipMap = ((Map<Long,Map<String,Object>>[]) state)[1]; removePropertyData( data.removedRelationshipProperties(), relationshipMap, relationshipIndex ); updatePropertyData( relationshipMap, relationshipIndex ); refreshIndex( relationshipIndex ); } } catch ( IOException e ) { throw new RuntimeException( "Unable to update fulltext index", e ); } }

Target:
public void afterCommit( TransactionData data, Object state ) { try { for ( WritableFulltext nodeIndex : fulltextProvider.writableNodeIndices() ) { Map<Long,Map<String,Object>> nodeMap = ((Map<Long,Map<String,Object>>[]) state)[0]; removePropertyData( data.removedNodeProperties(), nodeMap, nodeIndex ); updatePropertyData( nodeMap, nodeIndex ); refreshIndex( nodeIndex ); } for ( WritableFulltext relationshipIndex : fulltextProvider.writableRelationshipIndices() ) { Map<Long,Map<String,Object>> relationshipMap = ((Map<Long,Map<String,Object>>[]) state)[1]; removePropertyData( data.removedRelationshipProperties(), relationshipMap, relationshipIndex ); updatePropertyData( relationshipMap, relationshipIndex ); refreshIndex( relationshipIndex ); } } catch ( IOException e ) { log.error( "Unable to update fulltext index", e ); } }
Source:
public void refresh(Node node) { checkNotNull(node, NULL_NODE_MSG); if (!isOrWasAttached()) { return; } NodeDescriptor nodeDescriptor = getNodeDescriptor(node); if (nodeDescriptor == null || view.getRootContainer(nodeDescriptor) == null) { return; } if (!(node instanceof HasNewPresentation || node instanceof HasPresentation)) { return; } if (node instanceof HasPresentation) { ((HasPresentation) node).getPresentation(true); } else { ((HasNewPresentation) node).getPresentation(); } Element el = getPresentationRenderer() .render( node, nodeDescriptor.getDomId(), getJoint(node), nodeStorage.getDepth(node) - 1); view.onElementChanged(nodeDescriptor, el); }

Target:
public void refresh(Node node) { checkNotNull(node, NULL_NODE_MSG); if (!isOrWasAttached()) { return; } NodeDescriptor nodeDescriptor = getNodeDescriptor(node); if (nodeDescriptor == null || view.getRootContainer(nodeDescriptor) == null) { return; } if (node instanceof HasPresentation) { ((HasPresentation) node).getPresentation(true); } else if (node instanceof HasNewPresentation) { ((HasNewPresentation) node).getPresentation(); } Element el = getPresentationRenderer() .render( node, nodeDescriptor.getDomId(), getJoint(node), nodeStorage.getDepth(node) - 1); view.onElementChanged(nodeDescriptor, el); }
Source:
public void testAnycastQueueToMulticastTopicBothAddress() throws Exception { String address = "testBoth"; File file = createMessageFile(); int noMessages = 10; Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); connection.start(); createBothTypeAddress(address); List<Message> messages = new ArrayList<>(noMessages); for (int i = 0; i < noMessages; i++) { messages.add(session.createTextMessage(RandomUtil.randomString())); } sendMessages(session, getDestination(address), messages); exportMessages(address, noMessages, file); Thread receive = new Thread(() -> { try { MessageConsumer consumer = session.createConsumer(getTopicDestination(address)); assertNotNull(consumer.receive(3000)); } catch (Exception e) { e.printStackTrace(); } }); receive.start(); TimeUnit.SECONDS.sleep(1); importMessages("topic://" + address, file); receive.join(); }

Target:
public void testAnycastQueueToMulticastTopicBothAddress() throws Exception { String address = "testBoth"; String clientId = "test-client-id"; File file = createMessageFile(); connection.setClientID(clientId); createBothTypeAddress(address); createQueue("--anycast", address, address); Session session = createSession(connection); TopicSubscriber subscriber = session.createDurableSubscriber(session.createTopic(address), "test-subscriber"); List<Message> messages = generateTextMessages(session, address); exportMessages(address, file); importMessages("topic://" + address, file); for (int i = 0; i < TEST_MESSAGE_COUNT; i++) { TextMessage messageReceived = (TextMessage) subscriber.receive(1000); assertEquals(((TextMessage) messages.get(i)).getText(), messageReceived.getText()); } }
Source:
protected void auditLog(AuditLogableBase logable, AuditLogType logType) { auditLogDirector.log(logable, logType); }

Target:
void auditLog(AuditLogableBase logable, AuditLogType logType) { auditLogDirector.log(logable, logType); }
Source:
static HttpPasswordInput create() { return (HttpPasswordInput) createObject(); }

Target:
static HttpPasswordInput create() { return createObject().cast(); }
Source:
public void onCorruptResponse(ReplicaId replicaId) { corruptRequests.add(replicaId); failedRequests.add(replicaId); onReplicaResponse(replicaId); }

Target:
public void onCorruptResponse(ReplicaId replicaId) { super.onCorruptResponse(replicaId); onReplicaResponse(replicaId); }
Source:
public void handleRequest(RestRequestInfo restRequestInfo) throws RestServiceException { logger.debug("Handling RestRequestInfo - {}", restRequestInfo); if (isRunning()) { if (restRequestInfo == null) { logger.error("RestRequestInfo received is null. Throwing exception"); restServerMetrics.asyncRequestHandlerRestRequestInfoNull.inc(); throw new RestServiceException("RestRequestInfo is null", RestServiceErrorCode.RestRequestInfoNull); } else if (restRequestInfo.getRestRequestMetadata() == null) { logger.error("RestRequestMetadata is null in received RestRequestInfo. Throwing exception"); restServerMetrics.asyncRequestHandlerRestRequestMetadataNull.inc(); throw new RestServiceException("RestRequestInfo missing RestRequestMetadata", RestServiceErrorCode.RequestMetadataNull); } else if (restRequestInfo.getRestResponseHandler() == null) { logger.error("RestResponseHandler is null in received RestRequestInfo. Throwing exception"); restServerMetrics.asyncRequestHandlerRestResponseHandlerNull.inc(); throw new RestServiceException("RestRequestInfo missing RestResponseHandler", RestServiceErrorCode.ReponseHandlerNull); } queue(restRequestInfo); } else { logger.error("DequeuedRequestHandler thread is not alive for handling requests. Throwing exception"); restServerMetrics.asyncRequestHandlerUnavailable.inc(); throw new RestServiceException("Requests cannot be handled because the AsyncRequestHandler is not available", RestServiceErrorCode.RequestHandlerUnavailable); } }

Target:
public void handleRequest(RestRequestInfo restRequestInfo) throws RestServiceException { if (isRunning()) { if (restRequestInfo == null) { restServerMetrics.asyncRequestHandlerRestRequestInfoNullError.inc(); throw new RestServiceException("RestRequestInfo received is null", RestServiceErrorCode.RestRequestInfoNull); } else if (restRequestInfo.getRestRequestMetadata() == null) { restServerMetrics.asyncRequestHandlerRestRequestMetadataNullError.inc(); throw new RestServiceException("RestRequestMetadata is null in received RestRequestInfo", RestServiceErrorCode.RequestMetadataNull); } else if (restRequestInfo.getRestResponseHandler() == null) { restServerMetrics.asyncRequestHandlerRestResponseHandlerNullError.inc(); throw new RestServiceException("RestResponseHandler is null in received RestRequestInfo", RestServiceErrorCode.ResponseHandlerNull); } queueRequest(restRequestInfo); } else { restServerMetrics.asyncRequestHandlerUnavailableError.inc(); throw new RestServiceException("Requests cannot be handled because the AsyncRequestHandler is not available", RestServiceErrorCode.RequestHandlerUnavailable); } }
Source:
public static boolean isTypeDef(DetailAST node) { return node.getType() == TokenTypes.CLASS_DEF || node.getType() == TokenTypes.ENUM_DEF || node.getType() == TokenTypes.INTERFACE_DEF; }

Target:
private static boolean isTypeDef(DetailAST node) { return node.getType() == TokenTypes.CLASS_DEF || node.getType() == TokenTypes.ENUM_DEF || node.getType() == TokenTypes.INTERFACE_DEF; }
Source:
private void rescheduleFindCoordinatorTask(ConsumerGroupOperationContext<?, ?> context, Supplier<Call> nextCall) { log.info("Node is no longer the Coordinator. Retrying with new coordinator.", context.node().orElse(null)); context.node(null); Call findCoordinatorCall = getFindCoordinatorCall(context, nextCall); runnable.call(findCoordinatorCall, time.milliseconds()); }

Target:
private void rescheduleFindCoordinatorTask(ConsumerGroupOperationContext<?, ?> context, Supplier<Call> nextCall) { log.info("Node is no longer the Coordinator. Retrying with new coordinator.", context.node().orElse(null)); context.setNode(null); Call findCoordinatorCall = getFindCoordinatorCall(context, nextCall); runnable.call(findCoordinatorCall, time.milliseconds()); }
Source:
private boolean compareEq(Object l, Object r) { if (l instanceof String && r instanceof String) { return l.equals(r); } if (l instanceof Boolean && r instanceof Boolean) { return l == r; } return l instanceof Number && r instanceof Number && !(l instanceof Float || r instanceof Float) && ((Number) l).longValue() == ((Number) r).longValue(); }

Target:
protected static boolean compareEq(Object l, Object r) { if (l instanceof String && r instanceof String) { return l.equals(r); } if (l instanceof Boolean && r instanceof Boolean) { return l == r; } return l instanceof Number && r instanceof Number && !(l instanceof Float || r instanceof Float) && ((Number) l).doubleValue() == ((Number) r).doubleValue(); }
Source:
public final RayTraceResult collisionRayTrace(IBlockState state, World world, BlockPos pos, Vec3d start, Vec3d end) { IMicroblockContainerTile tile = getMicroblockTile(world, pos); RayTraceResult result = tile != null ? tile.getMicroblockContainer().getPartContainer().collisionRayTrace(start, end) : null; RayTraceResult hit = collisionRayTraceDefault(state, world, pos, start, end); if (result == null || (hit != null && hit.hitVec.squareDistanceTo(start) < result.hitVec.squareDistanceTo(start))) { bounds = getSelectedBoundingBoxDefault(state, world, pos).offset(-pos.getX(), -pos.getY(), -pos.getZ()); return hit; } bounds = result.boxHit; return result; }

Target:
public final RayTraceResult collisionRayTrace(IBlockState state, World world, BlockPos pos, Vec3d start, Vec3d end) { IMicroblockContainerTile tile = getMicroblockTile(world, pos); RayTraceResult tileRaytrace = null; if (tile != null) { tileRaytrace = tile.getMicroblockContainer().getPartContainer().collisionRayTrace(start, end); } RayTraceResult defaultRaytrace = collisionRayTraceDefault(state, world, pos, start, end); if (tileRaytrace == null || (defaultRaytrace != null && defaultRaytrace.hitVec.squareDistanceTo(start) < tileRaytrace.hitVec.squareDistanceTo(start))) { return defaultRaytrace; } return tileRaytrace; }
Source:
EvidenceVerifier toEvidenceVerifier() { return new EvidenceVerifier() { @Override public SupportLevel getEvidenceVerifySupport(final DirContextFactory contextFactory, final Class<? extends Evidence> evidenceType, final String algorithmName) throws RealmUnavailableException { return getCredentialAcquireSupport(contextFactory, PasswordCredential.class, algorithmName); } @Override public IdentityEvidenceVerifier forIdentity(DirContextFactory contextFactory, String distinguishedName) throws RealmUnavailableException { return new ForIdentityLoader(contextFactory, distinguishedName); } }; }

Target:
EvidenceVerifier toEvidenceVerifier() { return new EvidenceVerifier() { @Override public SupportLevel getEvidenceVerifySupport(final DirContextFactory contextFactory, final Class<? extends Evidence> evidenceType, final String evidenceAlgorithm) throws RealmUnavailableException { if ( ! PasswordCredential.canVerifyEvidence(evidenceType, evidenceAlgorithm)) return SupportLevel.UNSUPPORTED; return getCredentialAcquireSupport(contextFactory, PasswordCredential.class, evidenceAlgorithm); } @Override public IdentityEvidenceVerifier forIdentity(DirContextFactory contextFactory, String distinguishedName) throws RealmUnavailableException { return new ForIdentityLoader(contextFactory, distinguishedName); } }; }
Source:
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) { assertEngineCompatibility(engine); if (connectorTopology != ConnectorTopology.NONE) { assertConnectorTopologyCompatibility(connectorTopology); } return getCommonRuntimeInfo(this.getClass().getClassLoader(), RUNTIME_SOURCE_CLASS); }

Target:
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) { assertEngineCompatibility(engine); assertConnectorTopologyCompatibility(connectorTopology); return getCommonRuntimeInfo(this.getClass().getClassLoader(), RUNTIME_SOURCE_CLASS); }
Source:
public Contentlet findContentletByIdentifier ( String identifier ) throws DotSecurityException, DotDataException { User user = APILocator.getUserAPI().getSystemUser(); Identifier contentletIdentifier = APILocator.getIdentifierAPI().find( identifier ); if ( contentletIdentifier == null ) { throw new DotContentletStateException( "Unable to find Contentle with Identifier [" + identifier + "]" ); } Language defaultLanguage = APILocator.getLanguageAPI().getDefaultLanguage(); Contentlet foundContentlet = null; List<Contentlet> allLanguages = APILocator.getContentletAPI().search( "+identifier:" + identifier, 0, 0, "moddate", user, false ); if(allLanguages.size()>0) { for (Contentlet contentlet : allLanguages) { if (contentlet.getLanguageId() == defaultLanguage.getId()) { foundContentlet = contentlet; } } if (foundContentlet == null) { foundContentlet = allLanguages.get(0); } } return foundContentlet; }

Target:
public Contentlet findContentletByIdentifier ( String identifier ) throws DotSecurityException, DotDataException { User user = APILocator.getUserAPI().getSystemUser(); Identifier contentletIdentifier = APILocator.getIdentifierAPI().find( identifier ); if ( contentletIdentifier == null ) { throw new DotContentletStateException( "Unable to find Contentle with Identifier [" + identifier + "]" ); } Language defaultLanguage = APILocator.getLanguageAPI().getDefaultLanguage(); Contentlet foundContentlet = null; List<Contentlet> allLanguages = APILocator.getContentletAPI().search( "+identifier:" + identifier, 0, 0, "moddate", user, false ); if(!allLanguages.isEmpty()) { for (Contentlet contentlet : allLanguages) { if (contentlet.getLanguageId() == defaultLanguage.getId()) { foundContentlet = contentlet; } } if (foundContentlet == null) { foundContentlet = allLanguages.get(0); } } return foundContentlet; }
Source:
public void referenceExpansionForDeletionByKey() throws Exception { final String key = randomKey(); final Category parent = client().executeBlocking(CategoryCreateCommand.of(CategoryDraftBuilder.of(randomSlug(), randomSlug()).build())); final Category category = client().executeBlocking(CategoryCreateCommand.of(CategoryDraftBuilder.of(randomSlug(), randomSlug()).key(key).parent(parent).build())); final CategoryDeleteCommand deleteCommand = CategoryDeleteCommand.ofKey(key, category.getVersion()).plusExpansionPaths(m -> m.parent()); final Category deletedCategory = client().executeBlocking(deleteCommand); assertThat(deletedCategory.getParent().getObj()).isNotNull().isEqualTo(parent); client().executeBlocking(CategoryDeleteCommand.of(parent)); }

Target:
public void referenceExpansionForDeletionByKey() throws Exception { final String key = randomKey(); final Category parent = client().executeBlocking(CategoryCreateCommand.of(CategoryDraftBuilder.of(randomLocalizedString(), randomSlug()).build())); final Category category = client().executeBlocking(CategoryCreateCommand.of(CategoryDraftBuilder.of(randomLocalizedString(), randomSlug()).key(key).parent(parent).build())); final CategoryDeleteCommand deleteCommand = CategoryDeleteCommand.ofKey(key, category.getVersion()).plusExpansionPaths(m -> m.parent()); final Category deletedCategory = client().executeBlocking(deleteCommand); assertThat(deletedCategory.getParent().getObj()).isNotNull().isEqualTo(parent); client().executeBlocking(CategoryDeleteCommand.of(parent)); }
Source:
private static void checkMap(String fieldName, Object mapObj, Class<?> valueType) { checkArgument(mapObj instanceof Map, "'%s' needs to be a JSON object. Found: %s", fieldName, getClassName(mapObj)); Map<?, ?> map = (Map<?, ?>)mapObj; map.entrySet().forEach( entry -> { checkArgument(valueType.isInstance(entry.getValue()), "Expected %s as value type, found %s, type: %s", valueType.getName(), entry.getValue(), getClassName(entry.getValue())); }); }

Target:
private static void checkMap(String fieldName, Object mapObj, Class<?> valueType) { checkArgument(mapObj instanceof Map, "'%s' needs to be a JSON object. Found: %s", fieldName, getClassName(mapObj)); Map<?, ?> map = (Map<?, ?>)mapObj; map.forEach( (__, value) -> { checkArgument(valueType.isInstance(value), "Expected %s as value type, found %s, type: %s", valueType.getName(), value, getClassName(value)); }); }
Source:
public String getReportTemplateHome() { Path templatesPath = Paths.get(getGlobalProperty(RadiologyConstants.GP_MRRT_REPORT_TEMPLATE_DIR, true)); if (!templatesPath.isAbsolute()) { templatesPath = Paths.get(OpenmrsUtil.getApplicationDataDirectory(), templatesPath.toString()); } if (!templatesPath.toFile() .exists()) { templatesPath.toFile() .mkdirs(); } return templatesPath.toString(); }

Target:
public File getReportTemplateHome() { Path templatesPath = Paths.get(getGlobalProperty(RadiologyConstants.GP_MRRT_REPORT_TEMPLATE_DIR, true)); if (!templatesPath.isAbsolute()) { templatesPath = Paths.get(OpenmrsUtil.getApplicationDataDirectory(), templatesPath.toString()); } if (!templatesPath.toFile() .exists()) { templatesPath.toFile() .mkdirs(); } return templatesPath.toFile(); }
Source:
private void walk(TypedVar symbol) { JSType type = symbol.getType(); if (!type.isInterface() && !isTypedef(type)) valueSymbolsWalked++; if (type.isFunctionType()) { FunctionType ftype = (FunctionType) type; boolean ordinaryFunctionAppearingAsClass = ftype.isConstructor() && "Function".equals(ftype.getDisplayName()); if (ftype.isOrdinaryFunction() || ordinaryFunctionAppearingAsClass) { maybeEmitJsDoc(symbol.getJSDocInfo(), false); emit("function"); emit(getUnqualifiedName(symbol)); visitFunctionDeclaration(ftype); emit(";"); emitBreak(); return; } maybeEmitJsDoc(symbol.getJSDocInfo(), true); if (!ftype.isNominalConstructor()) { visitVarDeclaration(symbol, ftype); return; } if (symbol.getName().equals(ftype.getDisplayName())) { visitClassOrInterface(getUnqualifiedName(symbol), ftype); } else { visitClassOrInterfaceAlias(getUnqualifiedName(symbol), ftype); } } else { maybeEmitJsDoc(symbol.getJSDocInfo(), false); if (type.isEnumType()) { visitEnumType(symbol.getName(), (EnumType) type); return; } if (isTypedef(type)) { if (isArrayLike(symbol)) { emitSkipTypeAlias(symbol); emitBreak(); return; } JSType registryType = typeRegistry.getType(symbol.getName()); if (registryType != null) { visitTypeAlias(registryType, getUnqualifiedName(symbol)); return; } } visitVarDeclaration(symbol, type); } }

Target:
private void walk(TypedVar symbol) { JSType type = symbol.getType(); if (!type.isInterface() && !isTypedef(type)) valueSymbolsWalked++; if (type.isFunctionType()) { FunctionType ftype = (FunctionType) type; boolean ordinaryFunctionAppearingAsClass = ftype.isConstructor() && "Function".equals(ftype.getDisplayName()); if (ftype.isOrdinaryFunction() || ordinaryFunctionAppearingAsClass) { maybeEmitJsDoc(symbol.getJSDocInfo(), false); emit("function"); emit(getUnqualifiedName(symbol)); visitFunctionDeclaration(ftype); emit(";"); emitBreak(); return; } maybeEmitJsDoc(symbol.getJSDocInfo(), true); if (!ftype.isNominalConstructor()) { visitVarDeclaration(symbol, ftype); return; } if (isAliasedClassOrInterface(symbol, ftype)) { visitClassOrInterface(getUnqualifiedName(symbol), ftype); } else { visitClassOrInterfaceAlias(getUnqualifiedName(symbol), ftype); } } else { maybeEmitJsDoc(symbol.getJSDocInfo(), false); if (type.isEnumType()) { visitEnumType(symbol.getName(), (EnumType) type); return; } if (isTypedef(type)) { if (isArrayLike(symbol)) { emitSkipTypeAlias(symbol); emitBreak(); return; } JSType registryType = typeRegistry.getType(symbol.getName()); if (registryType != null) { visitTypeAlias(registryType, getUnqualifiedName(symbol)); return; } } visitVarDeclaration(symbol, type); } }
Source:
LocalDateTime extractExpiryDate(Map<String, String> args, ZoneId effectiveTimeZone) { if (args.containsKey("se")) { val se = args.get("se"); val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssX"); val zdt = ZonedDateTime.parse(se, formatter); return zdt.withZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime(); } else { log.error("Could not identify expected date parameters in request: {}", flattenMap(args)); throw new IllegalArgumentException( String.format("Could not parse presigned URL - missing expected expiry date parameters")); } }

Target:
LocalDateTime extractExpiryDate(Map<String, String> args, ZoneId effectiveTimeZone) { if (args.containsKey(QueryConstants.SIGNED_EXPIRY)) { val se = args.get(QueryConstants.SIGNED_EXPIRY); val zdt = ZonedDateTime.parse(se, formatter); return zdt.withZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime(); } else { log.error("Could not identify expected date parameters in request: {}", flattenMap(args)); throw new IllegalArgumentException("Could not parse presigned URL - missing expected expiry date parameters"); } }
Source:
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { if (DEBUG) Log.d(TAG, "Fling velocity: dX=[" + velocityX + "], dY=[" + velocityY + "]"); if (playerImpl == null) return false; final float absVelocityX = Math.abs(velocityX); final float absVelocityY = Math.abs(velocityY); if (absVelocityX > shutdownFlingVelocity) { closePopup(); return true; } else if (Math.max(absVelocityX, absVelocityY) > tossFlingVelocity) { if (absVelocityX > tossFlingVelocity) popupLayoutParams.x = (int) velocityX; if (absVelocityY > tossFlingVelocity) popupLayoutParams.y = (int) velocityY; checkPositionBounds(); windowManager.updateViewLayout(playerImpl.getRootView(), popupLayoutParams); return true; } return false; }

Target:
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { if (DEBUG) Log.d(TAG, "Fling velocity: dX=[" + velocityX + "], dY=[" + velocityY + "]"); if (playerImpl == null) return false; final float absVelocityX = Math.abs(velocityX); final float absVelocityY = Math.abs(velocityY); if (Math.max(absVelocityX, absVelocityY) > tossFlingVelocity) { if (absVelocityX > tossFlingVelocity) popupLayoutParams.x = (int) velocityX; if (absVelocityY > tossFlingVelocity) popupLayoutParams.y = (int) velocityY; checkPopupPositionBounds(); windowManager.updateViewLayout(playerImpl.getRootView(), popupLayoutParams); return true; } return false; }
Source:
public void testGetContainersFromNotExistingServerInstance() { ServerInstanceKey serverInstance = new ServerInstanceKey("not-existing", "not-existing", "not-existing", "not-existing"); try { controllerClient.getContainers(serverInstance); fail("Should throw exception about the server instance not existing."); } catch (KieServerControllerClientException e) { assertNotFoundException((T) e); assertEquals("Kie Services Client Provider not found for url: not-existing", e.getMessage()); } }

Target:
public void testGetContainersFromNotExistingServerInstance() { ServerInstanceKey serverInstance = new ServerInstanceKey("not-existing", "not-existing", "not-existing", "not-existing"); try { controllerClient.getContainers(serverInstance); fail("Should throw exception about the server instance not existing."); } catch (KieServerControllerClientException e) { assertNotFoundException((T) e); assertThat(e.getMessage()).endsWith("Kie Services Client Provider not found for url: not-existing"); } }
Source:
public T createInterceptedInstance(T instance) { if (used) { throw InterceptorLogger.LOG.interceptionFactoryNotReusable(); } UnproxyableResolutionException exception = Proxies.getUnproxyableTypeException(annotatedType.getBaseType(), null, beanManager.getServices(), ignoreFinalMethods); if (exception != null) { throw exception; } Optional<InterceptionFactoryData<T>> cached = beanManager.getServices().get(InterceptionFactoryDataCache.class) .getInterceptionFactoryData(configurator != null ? configurator.complete() : annotatedType); if (!cached.isPresent()) { used = true; return instance; } InterceptionFactoryData<T> data = cached.get(); InterceptedProxyMethodHandler methodHandler = new InterceptedProxyMethodHandler(instance); methodHandler.setInterceptorMethodHandler(new InterceptorMethodHandler( InterceptionContext.forNonConstructorInterception(data.getInterceptionModel(), creationalContext, beanManager, data.getSlimAnnotatedType()))); T proxy = (System.getSecurityManager() == null) ? data.getInterceptedProxyFactory().run() : AccessController.doPrivileged(data.getInterceptedProxyFactory()); ((ProxyObject) proxy).setHandler(methodHandler); used = true; return proxy; }

Target:
public T createInterceptedInstance(T instance) { if (used) { throw InterceptorLogger.LOG.interceptionFactoryNotReusable(); } UnproxyableResolutionException exception = Proxies.getUnproxyableTypeException(annotatedType.getBaseType(), null, beanManager.getServices(), ignoreFinalMethods); if (exception != null) { throw exception; } used = true; Optional<InterceptionFactoryData<T>> cached = beanManager.getServices().get(InterceptionFactoryDataCache.class) .getInterceptionFactoryData(configurator != null ? configurator.complete() : annotatedType); if (!cached.isPresent()) { return instance; } InterceptionFactoryData<T> data = cached.get(); InterceptedProxyMethodHandler methodHandler = new InterceptedProxyMethodHandler(instance); methodHandler.setInterceptorMethodHandler(new InterceptorMethodHandler( InterceptionContext.forNonConstructorInterception(data.getInterceptionModel(), creationalContext, beanManager, data.getSlimAnnotatedType()))); T proxy = (System.getSecurityManager() == null) ? data.getInterceptedProxyFactory().run() : AccessController.doPrivileged(data.getInterceptedProxyFactory()); ((ProxyObject) proxy).setHandler(methodHandler); return proxy; }
Source:
private void registerTableElement(TableEditableElement tableElement) { if (!linkedEditableElements.containsKey( tableElement.getSourceName()) && hasDataSource(mapContext.getLayerModel(), tableElement.getSourceName())) { LOGGER.debug(I18N.tr("Link the editable element with the toc")); linkedEditableElements.put(tableElement.getSourceName(), tableElement); tableElement.addPropertyChangeListener(TableEditableElement.PROP_SELECTION, tableSelectionChangeListener); tableElement.addPropertyChangeListener(TableEditableElement.PROP_OPEN, tableEditableClose); if (!tableElement.getSelection().isEmpty()) { onTableSelectionChange(tableElement); } else { if(mapContext!=null) { ILayer[] layers = mapContext.getLayers(); Set<Integer> mergedSelection = new IntegerUnion(); for (ILayer layer : layers) { DataSource source = layer.getDataSource(); if (source != null && source.getName().equals(tableElement.getSourceName())) { mergedSelection.addAll(layer.getSelection()); } } tableElement.setSelection(mergedSelection); } } } }

Target:
private void registerTableElement(TableEditableElement tableElement) { if (!linkedEditableElements.containsKey( tableElement.getSourceName()) && hasDataSource(mapContext.getLayerModel(), tableElement.getSourceName())) { LOGGER.debug(I18N.tr("Link the editable element with the Toc")); linkedEditableElements.put(tableElement.getSourceName(), tableElement); tableElement.addPropertyChangeListener(TableEditableElement.PROP_SELECTION, tableSelectionChangeListener); tableElement.addPropertyChangeListener(TableEditableElement.PROP_OPEN, tableEditableClose); if (!tableElement.getSelection().isEmpty()) { onTableSelectionChange(tableElement); } else { if(mapContext!=null) { ILayer[] layers = mapContext.getLayers(); Set<Integer> mergedSelection = new IntegerUnion(); for (ILayer layer : layers) { DataSource source = layer.getDataSource(); if (source != null && source.getName().equals(tableElement.getSourceName())) { mergedSelection.addAll(layer.getSelection()); } } tableElement.setSelection(mergedSelection); } } } }
Source:
public MessageValues extractHeaders(byte[] payload, boolean copyRequestHeaders, MessageHeaders requestHeaders) throws Exception { ByteBuffer byteBuffer = ByteBuffer.wrap(payload); int headerCount = byteBuffer.get() & 0xff; if (headerCount < 255) { return oldExtractHeaders(byteBuffer, payload, headerCount, copyRequestHeaders, requestHeaders); } else { headerCount = byteBuffer.get() & 0xff; Map<String, Object> headers = new HashMap<String, Object>(); for (int i = 0; i < headerCount; i++) { int len = byteBuffer.get() & 0xff; String headerName = new String(payload, byteBuffer.position(), len, "UTF-8"); byteBuffer.position(byteBuffer.position() + len); len = byteBuffer.getInt(); String headerValue = new String(payload, byteBuffer.position(), len, "UTF-8"); Object headerContent = this.objectMapper.fromJson(headerValue, Object.class); headers.put(headerName, headerContent); byteBuffer.position(byteBuffer.position() + len); } byte[] newPayload = new byte[byteBuffer.remaining()]; byteBuffer.get(newPayload); return buildMessageValues(newPayload, headers, copyRequestHeaders, requestHeaders); } }

Target:
private MessageValues extractHeaders(byte[] payload, boolean copyRequestHeaders, MessageHeaders requestHeaders) throws Exception { ByteBuffer byteBuffer = ByteBuffer.wrap(payload); int headerCount = byteBuffer.get() & 0xff; if (headerCount < 255) { return oldExtractHeaders(byteBuffer, payload, headerCount, copyRequestHeaders, requestHeaders); } else { headerCount = byteBuffer.get() & 0xff; Map<String, Object> headers = new HashMap<String, Object>(); for (int i = 0; i < headerCount; i++) { int len = byteBuffer.get() & 0xff; String headerName = new String(payload, byteBuffer.position(), len, "UTF-8"); byteBuffer.position(byteBuffer.position() + len); len = byteBuffer.getInt(); String headerValue = new String(payload, byteBuffer.position(), len, "UTF-8"); Object headerContent = this.objectMapper.fromJson(headerValue, Object.class); headers.put(headerName, headerContent); byteBuffer.position(byteBuffer.position() + len); } byte[] newPayload = new byte[byteBuffer.remaining()]; byteBuffer.get(newPayload); return buildMessageValues(newPayload, headers, copyRequestHeaders, requestHeaders); } }
Source:
public V001() { super(); WikibaseUris uris = WikibaseUris.getURISystem(); addHandler(new InlineFixedWidthHexIntegerURIHandler(uris.reference(), 40)); }

Target:
public V001() { super(); addHandler(new InlineFixedWidthHexIntegerURIHandler(uris.reference(), 40)); }
Source:
public void incSize(int by) { size += by; }

Target:
private void incSize(int by) { size += by; }
Source:
public Optional<T> nextOrEndOfStream(long timeoutMillis, String errorMsg) throws InterruptedException { Optional<T> value = abq.poll(timeoutMillis, TimeUnit.MILLISECONDS); if (value == null) { env.flop(String.format("%s within %d ms", errorMsg, timeoutMillis)); return null; } else { return value; } }

Target:
public Optional<T> nextOrEndOfStream(long timeoutMillis, String errorMsg) throws InterruptedException { Optional<T> value = abq.poll(timeoutMillis, TimeUnit.MILLISECONDS); if (value == null) { env.flop(String.format("%s within %d ms", errorMsg, timeoutMillis)); } return value; }
Source:
public void onRenameListConfirmed(int position, String newListName) { dataSource.renameList(nameListsAdapter.getItem(position), newListName); preferencesManager.renameList(nameListsAdapter.getItem(position), newListName); nameListsAdapter.renameItem(position, newListName); nameListsAdapter.notifyItemChanged(position); }

Target:
public void onRenameListConfirmed(int position, String newListName) { dataSource.renameList(nameListsAdapter.getItem(position), newListName); preferencesManager.renameList(nameListsAdapter.getItem(position), newListName); nameListsAdapter.renameItem(position, newListName); }
Source:
public boolean aggregate(KeyType key, int keyHash) { final ByteBuffer keyBuffer = keySerde.toByteBuffer(key); if (keyBuffer == null) { return false; } Preconditions.checkArgument( keyBuffer.remaining() == keySize, "key size[%s] != keySize[%s]", keyBuffer.remaining(), keySize ); int bucket = findBucket( tableBuffer, buckets, bucketSize, size < Math.min(maxSize, maxBufferGrouperSize), keyBuffer, keySize, keyHash ); if (bucket < 0) { if (size < maxBufferGrouperSize) { growIfPossible(); bucket = findBucket(tableBuffer, buckets, bucketSize, size < maxSize, keyBuffer, keySize, keyHash); } if (bucket < 0) { return false; } } final int offset = bucket * bucketSize; if (!isUsed(bucket)) { tableBuffer.position(offset); tableBuffer.putInt(keyHash | 0x80000000); tableBuffer.put(keyBuffer); for (int i = 0; i < aggregators.length; i++) { aggregators[i].init(tableBuffer, offset + aggregatorOffsets[i]); } buffer.putInt(tableArenaSize + size * Ints.BYTES, offset); size++; } for (int i = 0; i < aggregators.length; i++) { aggregators[i].aggregate(tableBuffer, offset + aggregatorOffsets[i]); } return true; }

Target:
public boolean aggregate(KeyType key, int keyHash) { final ByteBuffer keyBuffer = keySerde.toByteBuffer(key); if (keyBuffer == null) { return false; } Preconditions.checkArgument( keyBuffer.remaining() == keySize, "keySerde.toByteBuffer(key).remaining[%s] != keySerde.keySize[%s], buffer was the wrong size?!", keyBuffer.remaining(), keySize ); int bucket = findBucket( tableBuffer, buckets, bucketSize, size < Math.min(maxSize, bufferGrouperMaxSize), keyBuffer, keySize, keyHash ); if (bucket < 0) { if (size < bufferGrouperMaxSize) { growIfPossible(); bucket = findBucket(tableBuffer, buckets, bucketSize, size < maxSize, keyBuffer, keySize, keyHash); } if (bucket < 0) { return false; } } final int offset = bucket * bucketSize; if (!isUsed(bucket)) { tableBuffer.position(offset); tableBuffer.putInt(keyHash | 0x80000000); tableBuffer.put(keyBuffer); for (int i = 0; i < aggregators.length; i++) { aggregators[i].init(tableBuffer, offset + aggregatorOffsets[i]); } buffer.putInt(tableArenaSize + size * Ints.BYTES, offset); size++; } for (int i = 0; i < aggregators.length; i++) { aggregators[i].aggregate(tableBuffer, offset + aggregatorOffsets[i]); } return true; }
Source:
public static void main(String[] args) throws Exception { GrobidProperties.getInstance(); AcknowledgmentTrainer trainer = new AcknowledgmentTrainer(); AbstractTrainer.runTraining(trainer); AbstractTrainer.runEvaluation(trainer); System.exit(0); }

Target:
public static void main(String[] args) throws Exception { GrobidProperties.getInstance(); AcknowledgmentTrainer trainer = new AcknowledgmentTrainer(); AbstractTrainer.runTraining(trainer); System.out.println(AbstractTrainer.runEvaluation(trainer)); System.exit(0); }
Source:
protected void setActionMessageParameters() { if (getVdsGroup().supportsGlusterService() || getVdsGroup(getParameters().getClusterId()).supportsGlusterService()) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__MOVE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__HOST); } }

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__MOVE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__HOST); }
Source:
public boolean addJobToQueue(Job job) { return Optional.of(job).map(scheduledJobs::add).isPresent(); }

Target:
public boolean addJobToQueue(Job job) { if (job != null) { return scheduledJobs.add(job); } return false; }
Source:
public void testReadAttribute() throws Exception { CLIWrapper cli = new CLIWrapper(true); { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute namespaces", false)); } { assertFalse("Expected command to fail on invalid node", cli.sendLine("read-attribute --node=subsystem=request-controller namespaces", true)); String output = cli.readOutput(); assertTrue(output.matches("WFLYCTL0201.*namespaces.*")); } { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute active-requests --node=subsystem=request-controller", false)); } { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute --node=subsystem=request-controller active-requests", false)); } cli.quit(); }

Target:
public void testReadAttribute() throws Exception { CLIWrapper cli = new CLIWrapper(true); { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute namespaces", true)); } { assertFalse("Expected command to fail on invalid node", cli.sendLine("read-attribute --node=subsystem=request-controller namespaces", true)); String output = cli.readOutput(); assertTrue(output.matches("WFLYCTL0201.*namespaces.*")); } { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute active-requests --node=subsystem=request-controller", true)); } { assertTrue("Failed to read attribute: " + cli.readOutput(), cli.sendLine("read-attribute --node=subsystem=request-controller active-requests", true)); } cli.quit(); }
Source:
public WriteContext init(final Configuration configuration) { schema = MessageTypeParser.parseMessageType(configuration.get("parquet.hive.schema")); return new WriteContext(schema, new HashMap<>()); }

Target:
public WriteContext init(final Configuration configuration) { schema = parseMessageType(configuration.get("parquet.hive.schema")); return new WriteContext(schema, new HashMap<>()); }
Source:
public void untrackedFileNotIncluded() throws Exception { String trackedPath = "tracked.txt"; writeTrashFile(trackedPath, "content2"); git.add().addFilepattern(trackedPath).call(); RevCommit stashed = git.stashCreate().call(); assertNotNull(stashed); validateStashedCommit(stashed); assertTrue("untracked file should be left untouched.", untrackedFile.exists()); assertEquals("content", read(untrackedFile)); }

Target:
public void untrackedFileNotIncluded() throws Exception { String trackedPath = "tracked.txt"; writeTrashFile(trackedPath, "content2"); git.add().addFilepattern(trackedPath).call(); RevCommit stashed = git.stashCreate().call(); validateStashedCommit(stashed); assertTrue("untracked file should be left untouched.", untrackedFile.exists()); assertEquals("content", read(untrackedFile)); }
Source:
private Composite createFixedComp(Composite parent) { Composite comp = createComposite(parent); comp.setLayout(GridLayoutFactory.fillDefaults().create()); Label l = createLabel(comp, shortText); l.setLayoutData(GridDataFactory.swtDefaults().create()); return comp; }

Target:
private Composite createFixedComp(Composite parent) { Composite comp = createComposite(parent); GridLayoutFactory.fillDefaults().applyTo(comp); Label l = createLabel(comp, shortText); GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.BEGINNING).applyTo(l); return comp; }
Source:
public boolean childNodeAdded(String name, NodeState after) { if(name.equals(FulltextIndexConstants.PROP_FACETS)) { return true; } return super.childNodeAdded(name, after); }

Target:
public boolean childNodeAdded(String name, NodeState after) { if(name.equals(FulltextIndexConstants.PROP_FACETS)) { for(PropertyState property : after.getProperties()) { if(!ignorableFacetConfigProps.contains(property.getName())) return super.childNodeAdded(name, after); } return true; } return super.childNodeAdded(name, after); }
Source:
private Clip getClip() throws LineUnavailableException { if (closingThreads > 0) return null; for (Iterator<Clip> iter = clips.iterator(); iter.hasNext();) { Clip c = iter.next(); if (!c.isRunning() && !c.isActive()) { iter.remove(); clips.add(c); return c; } } Clip c = null; if (extraClips >= MAX_CLIPS) { Log.debug("Stopping an existing clip"); if (clips.isEmpty()) return null; c = clips.removeFirst(); c.stop(); clips.add(c); } else { Log.debug("creating a new clip"); DataLine.Info info = new DataLine.Info(Clip.class, format); c = (Clip) AudioSystem.getLine(info); if (format != null) c.open(format, audioData, 0, audioData.length); if (c.getClass().getSimpleName().equals("PulseAudioClip")) { c.addLineListener(new PulseAudioFixerListener(c)); } clips.add(c); if (clips.size() != 1) extraClips++; } return c; }

Target:
private Clip getClip() throws LineUnavailableException { if (closingThreads > 0) return null; for (Iterator<Clip> iter = clips.iterator(); iter.hasNext();) { Clip c = iter.next(); if (!c.isRunning() && !c.isActive()) { iter.remove(); clips.add(c); return c; } } Clip c = null; if (extraClips >= MAX_CLIPS) { if (clips.isEmpty()) return null; c = clips.removeFirst(); c.stop(); clips.add(c); } else { DataLine.Info info = new DataLine.Info(Clip.class, format); c = (Clip) AudioSystem.getLine(info); if (format != null) c.open(format, audioData, 0, audioData.length); if (c.getClass().getSimpleName().equals("PulseAudioClip")) { c.addLineListener(new PulseAudioFixerListener(c)); } clips.add(c); if (clips.size() != 1) extraClips++; } return c; }
Source:
@Override public void applyDelta(PageMemory pageMem, long pageAddr) throws IgniteCheckedException { BPlusIO<?> io = PageIO.getBPlusIO(pageAddr); int cnt0 = io.getCount(pageAddr); assert cnt0 == cnt + itemsCnt : "unexpected count: cnt0=" + cnt0 + ", cnt=" + cnt + ", itemsCnt=" + itemsCnt; for (int i = 0; i < itemsCnt; ++i) { int idx = items[i]; io.copyItems(pageAddr, pageAddr, idx + 1, idx, cnt0 - idx, false); } io.setCount(pageAddr, cnt); }

Target:
@Override public void applyDelta(PageMemory pageMem, long pageAddr) throws IgniteCheckedException { BPlusIO<?> io = PageIO.getBPlusIO(pageAddr); int cnt0 = io.getCount(pageAddr); if (cnt0 != cnt + itemsCnt) { throw new DeltaApplicationException("Count is wrong [expCnt=" + (cnt + itemsCnt) + ", actual=" + cnt0 + ']'); } io.purge(pageAddr, items, itemsCnt); }
Source:
public void doLogout(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { HttpSession session = req.getSession(false); if(session!=null) session.invalidate(); Authentication auth = SecurityContextHolder.getContext().getAuthentication(); SecurityContextHolder.clearContext(); String contextPath = req.getContextPath().length() > 0 ? req.getContextPath() : "/"; { Cookie cookie = new Cookie(ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, ""); cookie.setMaxAge(0); cookie.setSecure(req.isSecure()); cookie.setHttpOnly(true); cookie.setPath(contextPath); rsp.addCookie(cookie); } for (Cookie cookie : req.getCookies()) { if (!cookie.getName().startsWith("JSESSIONID.")) continue; String cookieContextPath = cookie.getPath(); if (cookieContextPath == null) { if (!contextPath.equals("/")) continue; } else if (!cookieContextPath.equals(contextPath)) { continue; } cookie.setMaxAge(0); cookie.setValue(""); rsp.addCookie(cookie); } rsp.sendRedirect2(getPostLogOutUrl(req,auth)); }

Target:
public void doLogout(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { HttpSession session = req.getSession(false); if(session!=null) session.invalidate(); Authentication auth = SecurityContextHolder.getContext().getAuthentication(); SecurityContextHolder.clearContext(); String contextPath = req.getContextPath().length() > 0 ? req.getContextPath() : "/"; resetRememberMeCookie(req, rsp, contextPath); clearStaleSessionCookies(req, rsp, contextPath); rsp.sendRedirect2(getPostLogOutUrl(req,auth)); }
Source:
private void sleepOnReboot(final VDSStatus status) { long sleepInterval = TimeUnit.SECONDS.toMillis( Config.<Integer> getValue(ConfigValues.ServerRebootTimeout)); log.info("Waiting seconds, for server to finish reboot process.", sleepInterval); ThreadUtils.sleep(sleepInterval); setVdsStatus(status); }

Target:
private void sleepOnReboot(final VDSStatus status) { int sleepTimeInSec = Config.<Integer> getValue(ConfigValues.ServerRebootTimeout); log.info("Waiting seconds, for server to finish reboot process.", sleepTimeInSec); ThreadUtils.sleep(TimeUnit.SECONDS.toMillis(sleepTimeInSec)); setVdsStatus(status); }
Source:
private long getExpiry() { String expiry = addActionConfig.expiry; if (expiry != null && !expiry.isEmpty()) { try { return Long.parseLong(expiry); } catch (NumberFormatException e) { } DateTime dt = new DateTime(expiry); return dt.getMillis(); } return 0; }

Target:
private long getExpiry() { String expiry = addActionConfig.expiry; if (expiry != null) { try { return Long.parseLong(expiry); } catch (NumberFormatException e) { } DateTime dt = new DateTime(expiry); return dt.getMillis(); } return 0; }
Source:
public void onFinish(Map<PageTitle, LinkPreviewContents> result) { if (!isAdded()) { return; } if (result.size() > 0) { progressBar.setVisibility(View.GONE); contents = (LinkPreviewContents) result.values().toArray()[0]; layoutPreview(); } else { loadContentFromCache(); } }

Target:
public void onFinish(Map<PageTitle, LinkPreviewContents> result) { if (!isAdded()) { return; } if (!result.isEmpty()) { progressBar.setVisibility(View.GONE); contents = (LinkPreviewContents) result.values().toArray()[0]; layoutPreview(); } else { loadContentFromCache(); } }