auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createStats() { float heightHealthTexture = activity.getResourceManager().getLoadedTextureRegion(R.drawable.onhealth).getHeight(); float scale = cameraSize.y * RELATIVE_HP_HEIGHT / heightHealthTexture; float widthHealthTexture = activity.getResourceManager().getLoadedTextureRegion(R.drawable.onhealth).getWidth() * scale; positionHitPoint = new PointF( (1 - RELATIVE_SCREEN_BORDER) * cameraSize.x - widthHealthTexture , RELATIVE_SCREEN_BORDER * cameraSize.y * scale); for (int i = 0; i < Player.FULL_HP; i++) { HitPoint hitPoint = new HitPoint( activity , this , positionHitPoint , scale); hitPoints.add(hitPoint); positionHitPoint.x -= RELATIVE_SPACE_BETWEEN_CONTROLS * cameraSize.x + widthHealthTexture; } scoreFont = FontFactory.create( activity.getEngine().getFontManager() , activity.getEngine().getTextureManager() , FONT_ATLAS_SIDE , FONT_ATLAS_SIDE , Typeface.create(Typeface.DEFAULT, Typeface.NORMAL) , heightHealthTexture * scale , true , Color.WHITE_ABGR_PACKED_INT); scoreFont.load(); textScore = new Text( positionHitPoint.x , positionHitPoint.y , scoreFont , "Score: 000000" , activity.getEngine().getVertexBufferObjectManager()); textScore.setPosition( positionHitPoint.x - textScore.getWidth() , RELATIVE_SCREEN_BORDER * cameraSize.y); this.attachChild(textScore); }

Target:
private void createStats() { float healthTextureHeight = activity.getResourceManager().getLoadedTextureRegion(R.drawable.onhealth).getHeight(); float scale = cameraSize.y * RELATIVE_HP_HEIGHT / healthTextureHeight; float healthTextureWidth = activity.getResourceManager().getLoadedTextureRegion(R.drawable.onhealth).getWidth() * scale; positionHitPoint = new PointF( (1 - RELATIVE_SCREEN_BORDER) * cameraSize.x - healthTextureWidth , RELATIVE_SCREEN_BORDER * cameraSize.y * scale); for (int i = 0; i < Player.FULL_HP; i++) { HealthIndicator healthIndicator = new HealthIndicator( activity , this , positionHitPoint , scale); healthIndicators.add(healthIndicator); positionHitPoint.x -= RELATIVE_SPACE_BETWEEN_CONTROLS * cameraSize.x + healthTextureWidth; } scoreFont = FontFactory.create( activity.getEngine().getFontManager() , activity.getEngine().getTextureManager() , FONT_ATLAS_SIDE , FONT_ATLAS_SIDE , Typeface.create(Typeface.DEFAULT, Typeface.NORMAL) , healthTextureHeight * scale , true , Color.WHITE_ABGR_PACKED_INT); scoreFont.load(); scoreText = new Text( positionHitPoint.x , positionHitPoint.y , scoreFont , activity.getResources().getString(R.string.SCORE) + ": 000000" , activity.getEngine().getVertexBufferObjectManager()); scoreText.setPosition( positionHitPoint.x - scoreText.getWidth() , RELATIVE_SCREEN_BORDER * cameraSize.y); this.attachChild(scoreText); }
Source:
private void storeEvent(Map<String, Object> event, Date timestamp) { try { ObjectMapper m = new ObjectMapper(); StringWriter w = new StringWriter(); m.writeValue(w, event); BaseDAO<EventQueue> eventDao = new BaseDAO<EventQueue>(EventQueue.class); EventQueue eventQ = new EventQueue(); eventQ.setCreatedDateTime(timestamp); eventQ.setPayload(w.toString()); eventDao.save(eventQ); notifyLog(); } catch (Exception e) { logger.log(Level.SEVERE, "could not store " + event.get("eventType") + " event. Error: " + e.toString()); } }

Target:
private void storeEvent(Map<String, Object> event, Date timestamp) { try { ObjectMapper m = new ObjectMapper(); StringWriter w = new StringWriter(); m.writeValue(w, event); BaseDAO<EventQueue> eventDao = new BaseDAO<EventQueue>(EventQueue.class); EventQueue eventQ = new EventQueue(); eventQ.setCreatedDateTime(timestamp); eventQ.setPayload(w.toString()); eventDao.save(eventQ); notifyLog(); } catch (Exception e) { logger.log(Level.SEVERE, "could not store " + event.get("eventType") + " event. Error: " + e.toString(), e); } }
Source:
private static ImmutableList<Event> remap (final Map<TypeAndTime,Long> mapping,final ImmutableList<Event> originalEvents) { final List<Event> mappedEvents = new ArrayList<>(); for (final Event event : originalEvents) { final TypeAndTime typeAndTime = new TypeAndTime(event.getType(),event.getStartTimestamp()); final Long mappedTime = mapping.get(typeAndTime); if (mappedTime == null) { mappedEvents.add(event); continue; } mappedEvents.add(Event.createFromType( event.getType(), mappedTime, mappedTime + 60000L, event.getTimezoneOffset(), event.getDescription(), event.getSoundInfo(), event.getSleepDepth())); } return ImmutableList.copyOf(mappedEvents); }

Target:
private static ImmutableList<Event> remap (final Map<TypeAndTime,Long> mapping,final ImmutableList<Event> originalEvents) { final List<Event> mappedEvents = Lists.newArrayList(); for (final Event event : originalEvents) { final TypeAndTime typeAndTime = new TypeAndTime(event.getType(),event.getStartTimestamp()); final Long mappedTime = mapping.get(typeAndTime); if (mappedTime == null) { mappedEvents.add(event); continue; } mappedEvents.add(Event.createFromType( event.getType(), mappedTime, mappedTime + 60000L, event.getTimezoneOffset(), event.getDescription(), event.getSoundInfo(), event.getSleepDepth())); } return ImmutableList.copyOf(mappedEvents); }
Source:
public synchronized ClassLoader getClassLoader(ObjectId rulesId) { if (rulesId == null || rulesDir == null) { return null; } Reference<? extends ClassLoader> ref = classLoaderCache.get(rulesId); if (ref != null) { ClassLoader cl = ref.get(); if (cl != null) { return cl; } classLoaderCache.remove(rulesId); ref.enqueue(); } cleanCache(); File jarFile = new File(rulesDir, "rules-" + rulesId.getName() + ".jar"); if (!jarFile.isFile()) { return null; } ClassLoader defaultLoader = getClass().getClassLoader(); URL url; try { url = jarFile.toURI().toURL(); } catch (MalformedURLException e) { log.error("Path to rules jar is broken", e); return null; } URL[] urls = new URL[]{url}; ClassLoader urlLoader = new URLClassLoader(urls, defaultLoader); LoaderRef lRef = new LoaderRef(rulesId, urlLoader); classLoaderCache.put(rulesId, lRef); return urlLoader; }

Target:
public synchronized ClassLoader getClassLoader(ObjectId rulesId) { if (rulesId == null || rulesDir == null) { return null; } Reference<? extends ClassLoader> ref = classLoaderCache.get(rulesId); if (ref != null) { ClassLoader cl = ref.get(); if (cl != null) { return cl; } classLoaderCache.remove(rulesId); ref.enqueue(); } cleanCache(); File jarFile = new File(rulesDir, "rules-" + rulesId.getName() + ".jar"); if (!jarFile.isFile()) { return null; } ClassLoader defaultLoader = getClass().getClassLoader(); URL url; try { url = jarFile.toURI().toURL(); } catch (MalformedURLException e) { log.error("Path to rules jar is broken", e); return null; } ClassLoader urlLoader = new URLClassLoader(new URL[]{url}, defaultLoader); LoaderRef lRef = new LoaderRef(rulesId, urlLoader); classLoaderCache.put(rulesId, lRef); return urlLoader; }
Source:
private static boolean shouldBeAloneOnLineWithAloneOrSinglelineOption(Details details, String targetSrcLine) { return !isAloneOnLine(details, targetSrcLine) && !isEmptyBody(details.lcurly) && !isSingleLineBlock(details); }

Target:
private static boolean shouldBeAloneOnLineWithAloneOrSinglelineOption(Details details, String targetSrcLine) { return !isAloneOnLine(details, targetSrcLine) && !isSingleLineBlock(details) && !isEmptyBody(details.lcurly); }
Source:
public boolean equals(Object object) { if (this == object) { return true; } if (object instanceof Account) { final Account other = Account.class.cast(object); return equal(getContainerCount(), other.getContainerCount()) && equal(getObjectCount(), other.getObjectCount()) && equal(getBytesUsed(), other.getBytesUsed()) && equal(getMetadata(), other.getMetadata()); } else { return false; } }

Target:
public boolean equals(Object object) { if (this == object) return true; if (object == null || getClass() != object.getClass()) return false; Account that = Account.class.cast(object); return Objects.equal(this.containerCount, that.containerCount) && Objects.equal(this.objectCount, that.objectCount) && Objects.equal(this.bytesUsed, that.bytesUsed) && Objects.equal(this.getTransactionId(), that.getTransactionId()); }
Source:
public EmptyFXMatrix() { }

Target:
private EmptyFXMatrix() { }
Source:
protected void parseFilesets(final StartElement declareStep) throws XMLStreamException { Attribute inputs = declareStep .getAttributeByName(XProcScriptConstants.Attributes.PX_INPUT_FILESETS); Attribute outputs = declareStep .getAttributeByName(XProcScriptConstants.Attributes.PX_OUTPUT_FILESETS); if (inputs!=null){ String splitInputs[]=inputs.getValue().split(" "); for( String fset : splitInputs){ this.scriptBuilder.withInputFileset(fset); } } if (outputs!=null){ String splitOutputs[]=outputs.getValue().split(" "); for( String fset : splitOutputs){ this.scriptBuilder.withOutputFileset(fset); } } }

Target:
protected void parseFilesets(final StartElement declareStep) throws XMLStreamException { Attribute inputs = declareStep .getAttributeByName(XProcScriptConstants.Attributes.PX_INPUT_FILESETS); Attribute outputs = declareStep .getAttributeByName(XProcScriptConstants.Attributes.PX_OUTPUT_FILESETS); if (inputs!=null){ String splitInputs[]=inputs.getValue().split("\\s+"); for( String fset : splitInputs){ this.scriptBuilder.withInputFileset(fset); } } if (outputs!=null){ String splitOutputs[]=outputs.getValue().split("\\s+"); for( String fset : splitOutputs){ this.scriptBuilder.withOutputFileset(fset); } } }
Source:
LuceneChangeIndex( @GerritServerConfig Config cfg, SitePaths sitePaths, @IndexExecutor(INTERACTIVE) ListeningExecutorService executor, Provider<ReviewDb> db, ChangeData.Factory changeDataFactory, FillArgs fillArgs, @Assisted Schema<ChangeData> schema, @Assisted @Nullable String base) throws IOException { this.sitePaths = sitePaths; this.fillArgs = fillArgs; this.executor = executor; this.db = db; this.changeDataFactory = changeDataFactory; this.schema = schema; Version luceneVersion = checkNotNull( LUCENE_VERSIONS.get(schema), "unknown Lucene version for index schema: %s", schema); CustomMappingAnalyzer analyzer = new CustomMappingAnalyzer(new StandardAnalyzer(CharArraySet.EMPTY_SET), CUSTOM_CHAR_MAPPING); queryBuilder = new QueryBuilder(analyzer); BooleanQuery.setMaxClauseCount(cfg.getInt("index", "defaultMaxClauseCount", BooleanQuery.getMaxClauseCount())); GerritIndexWriterConfig openConfig = new GerritIndexWriterConfig(luceneVersion, cfg, "changes_open"); GerritIndexWriterConfig closedConfig = new GerritIndexWriterConfig(luceneVersion, cfg, "changes_closed"); if (cfg.getBoolean("index", "lucene", "testInmemory", false)) { dir = null; openIndex = new SubIndex(new RAMDirectory(), "ramOpen", openConfig); closedIndex = new SubIndex(new RAMDirectory(), "ramClosed", closedConfig); } else { if (base == null) { dir = LuceneVersionManager.getDir(sitePaths, schema); } else { dir = Paths.get(base); } openIndex = new SubIndex(dir.resolve(CHANGES_OPEN), openConfig); closedIndex = new SubIndex(dir.resolve(CHANGES_CLOSED), closedConfig); } }

Target:
LuceneChangeIndex( @GerritServerConfig Config cfg, SitePaths sitePaths, @IndexExecutor(INTERACTIVE) ListeningExecutorService executor, Provider<ReviewDb> db, ChangeData.Factory changeDataFactory, FillArgs fillArgs, @Assisted Schema<ChangeData> schema, @Assisted @Nullable String base) throws IOException { this.sitePaths = sitePaths; this.fillArgs = fillArgs; this.executor = executor; this.db = db; this.changeDataFactory = changeDataFactory; this.schema = schema; Version luceneVersion = checkNotNull( LUCENE_VERSIONS.get(schema), "unknown Lucene version for index schema: %s", schema); CustomMappingAnalyzer analyzer = new CustomMappingAnalyzer(new StandardAnalyzer(CharArraySet.EMPTY_SET), CUSTOM_CHAR_MAPPING); queryBuilder = new QueryBuilder(analyzer); BooleanQuery.setMaxClauseCount(cfg.getInt("index", "defaultMaxClauseCount", BooleanQuery.getMaxClauseCount())); GerritIndexWriterConfig openConfig = new GerritIndexWriterConfig(luceneVersion, cfg, "changes_open"); GerritIndexWriterConfig closedConfig = new GerritIndexWriterConfig(luceneVersion, cfg, "changes_closed"); if (cfg.getBoolean("index", "lucene", "testInmemory", false)) { openIndex = new SubIndex(new RAMDirectory(), "ramOpen", openConfig); closedIndex = new SubIndex(new RAMDirectory(), "ramClosed", closedConfig); } else { Path dir = base != null ? Paths.get(base) : LuceneVersionManager.getDir(sitePaths, schema); openIndex = new SubIndex(dir.resolve(CHANGES_OPEN), openConfig); closedIndex = new SubIndex(dir.resolve(CHANGES_CLOSED), closedConfig); } }
Source:
public final Maybe<T> switchIfEmpty(SingleSource<? extends T> other) { ObjectHelper.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new MaybeSwitchIfEmptyToSingle<T>(this, other)); }

Target:
public final Single<T> switchIfEmpty(SingleSource<? extends T> other) { ObjectHelper.requireNonNull(other, "other is null"); return RxJavaPlugins.onAssembly(new MaybeSwitchIfEmptySingle<T>(this, other)); }
Source:
protected boolean isTokenAboutToExpire() { if(tokenFetchTime == -1 || super.isTokenAboutToExpire()){ return true; } boolean expiring = false; long offset = ONE_HOUR; if ((tokenFetchTime + offset) < System.currentTimeMillis()) expiring = true; if (expiring) { LOG.debug("MSIToken: token renewing : " + offset + " milliseconds window"); } return expiring; }

Target:
protected boolean isTokenAboutToExpire() { if (tokenFetchTime == -1 || super.isTokenAboutToExpire()) { return true; } boolean expiring = false; long elapsedTimeSinceLastTokenRefreshInMillis = System.currentTimeMillis() - tokenFetchTime; expiring = elapsedTimeSinceLastTokenRefreshInMillis >= ONE_HOUR || elapsedTimeSinceLastTokenRefreshInMillis < 0; if (expiring) { LOG.debug( "MSIToken: token renewing. Time elapsed since last token fetch:" + " milli seconds", elapsedTimeSinceLastTokenRefreshInMillis); } return expiring; }
Source:
public int hashCode() { return dimFilter != null ? dimFilter.hashCode() : 0; }

Target:
public int hashCode() { return dimFilter.hashCode(); }
Source:
public String errorCode() { return errorCode; }

Target:
public ErrorCode errorCode(){ return ErrorCode.getFromCode(code); }
Source:
public RequestSpec connectTimeout(Duration duration) { delegate.connectTimeout(duration); return null; }

Target:
public RequestSpec connectTimeout(Duration duration) { delegate.connectTimeout(duration); return this; }
Source:
private boolean isDockerContainer(final AbstractNodeTemplate nodeTemplate) { if (nodeTemplate.getProperties() == null) { return false; } final Element propertyElement = nodeTemplate.getProperties().getDOMElement(); final NodeList childNodeList = propertyElement.getChildNodes(); int check = 0; boolean foundDockerImageProp = false; for (int index = 0; index < childNodeList.getLength(); index++) { if (childNodeList.item(index).getNodeType() != Node.ELEMENT_NODE) { continue; } if (childNodeList.item(index).getLocalName().equals("ContainerPort")) { check++; } else if (childNodeList.item(index).getLocalName().equals("Port")) { check++; } else if (childNodeList.item(index).getLocalName().equals("ContainerImage")) { foundDockerImageProp = true; } } if (check != 2) { return false; } return true; }

Target:
private boolean isDockerContainer(final AbstractNodeTemplate nodeTemplate) { if (nodeTemplate.getProperties() == null) { return false; } final Element propertyElement = nodeTemplate.getProperties().getDOMElement(); final NodeList childNodeList = propertyElement.getChildNodes(); int check = 0; boolean foundDockerImageProp = false; for (int index = 0; index < childNodeList.getLength(); index++) { if (childNodeList.item(index).getNodeType() != Node.ELEMENT_NODE) { continue; } if (childNodeList.item(index).getLocalName().equals("ContainerPort")) { check++; } else if (childNodeList.item(index).getLocalName().equals("Port")) { check++; } else if (childNodeList.item(index).getLocalName().equals("ImageID")) { foundDockerImageProp = true; } } if (check != 2) { return false; } return true; }
Source:
public void testProcessBeanAttributesEventFails() { final ProcessBeanAttributes<SimpleBean> event = extension.getProcessBeanAttributes(); new Invocation() { void execute() { event.addDefinitionError(new NullPointerException()); } }.run(); new Invocation() { void execute() { event.getAnnotated(); } }.run(); new Invocation() { void execute() { event.getBeanAttributes(); } }.run(); }

Target:
public void testProcessBeanAttributesEventFails() { final ProcessBeanAttributes<SimpleBean> event = extension.getProcessBeanAttributes(); AnnotatedType<SimpleBean> type = beanManager.createAnnotatedType(SimpleBean.class); final BeanAttributes<SimpleBean> attributes = beanManager.createBeanAttributes(type); new Invocation() { void execute() { event.addDefinitionError(new NullPointerException()); } }.run(); new Invocation() { void execute() { event.getAnnotated(); } }.run(); new Invocation() { void execute() { event.setBeanAttributes(attributes); } }.run(); new Invocation() { void execute() { event.getBeanAttributes(); } }.run(); new Invocation() { void execute() { event.veto(); } }.run(); }
Source:
public int read(ByteBuffer dst) throws IOException { int remaining = dst.remaining(); final byte[] tmp = getBuf(); int read = 0; int offset = 0; while (remaining > 0) { int copyLen = Math.min(Math.min(remaining, bufferSize), available()); if (copyLen == 0) { break; } System.arraycopy(data, (int)pos, tmp, 0, copyLen); dst.put(tmp, offset, copyLen); read += copyLen; offset += copyLen; pos += copyLen; remaining -= copyLen; } return read; }

Target:
public int read(ByteBuffer dst) throws IOException { int remaining = (int)(count - pos); if(remaining <= 0) { return -1; } int length = Math.min(dst.remaining(), remaining); dst.put(data, (int)pos, length); pos += length; return length; }
Source:
public void uninstall(String extensionId) { Extension ext = getExtension(extensionId, null); if (ext != null && ext.isInstalled()) { String type = getType(extensionId); switch (type) { case EXT_TYPE_RULE_TEMPLATE: marketplaceRuleTemplateProvider.remove(extensionId); postUninstalledEvent(extensionId); break; case EXT_TYPE_BINDING: uninstallBinding(extensionId); break; default: postFailureEvent(extensionId, "Id not known."); break; } } }

Target:
public void uninstall(String extensionId) { Extension ext = getExtension(extensionId, null); if (ext instanceof MarketplaceExtension) { MarketplaceExtension mpExt = (MarketplaceExtension) ext; for (MarketplaceExtensionHandler handler : extensionHandlers) { if (handler.supports(mpExt)) { if (handler.isInstalled(mpExt)) { try { handler.uninstall(mpExt); postUninstalledEvent(extensionId); } catch (MarketplaceHandlerException e) { postFailureEvent(extensionId, e.getMessage()); } } else { postFailureEvent(extensionId, "Extension is not installed."); } return; } } } postFailureEvent(extensionId, "Extension not known."); }
Source:
public void registerSegmentCallback( final Executor exec, final SegmentCallback callback, final Predicate<Pair<DruidServerMetadata, DataSegment>> filter ) { segmentPredicates.put(callback, filter); registerSegmentCallback( exec, new SegmentCallback() { @Override public CallbackAction segmentAdded( DruidServerMetadata server, DataSegment segment ) { final CallbackAction action; if(filter.apply(Pair.of(server, segment))) { action = callback.segmentAdded(server, segment); if (action.equals(CallbackAction.UNREGISTER)) { segmentPredicates.remove(callback); } } else { action = CallbackAction.CONTINUE; } return action; } @Override public CallbackAction segmentRemoved( DruidServerMetadata server, DataSegment segment ) { { final CallbackAction action; if(filter.apply(Pair.of(server, segment))) { action = callback.segmentRemoved(server, segment); if (action.equals(CallbackAction.UNREGISTER)) { segmentPredicates.remove(callback); } } else { action = CallbackAction.CONTINUE; } return action; } } @Override public CallbackAction segmentViewInitialized() { return callback.segmentViewInitialized(); } } ); }

Target:
public void registerSegmentCallback( final Executor exec, final SegmentCallback callback, final Predicate<Pair<DruidServerMetadata, DataSegment>> filter ) { SegmentCallback filteringCallback = new SingleServerInventoryView.FilteringSegmentCallback(callback, filter); segmentPredicates.put(filteringCallback, filter); registerSegmentCallback( exec, filteringCallback ); }
Source:
public final void freeMacs(List<String> macs) { List<String> macsToRelease = filterOutUnusedMacs(macs); if (macsToRelease.isEmpty()) { log.warn("Call to release with empty collection as parameter."); } else { TransactionalStrategyState strategyForMacRelease = getStrategyForMacRelease(); log.debug("Using as release strategy", strategyForMacRelease); strategyForMacRelease.releaseMacsOnCommit(macsToRelease); } }

Target:
public final void freeMacs(List<String> macs) { List<String> macsToRelease = filterOutUnusedMacs(macs); if (macsToRelease.isEmpty()) { log.warn("Trying to release MACs using empty collection as parameter."); } else { TransactionalStrategyState strategyForMacRelease = getStrategyForMacRelease(); log.debug("Using as release strategy", strategyForMacRelease); strategyForMacRelease.releaseMacsOnCommit(macsToRelease); } }
Source:
public synchronized Bomb createBomb(){ if (numBombs == 0){ throw new RuntimeException("Cannot create a bomb; out of bombs"); } numBombs--; return new Bomb(this); }

Target:
public synchronized Bomb createBomb(){ if (numBombs == 0){ throw new BufferUnderflowException(); } numBombs--; return new Bomb(this); }
Source:
public SimpleClusterTierClientEntity(EntityClientEndpoint<EhcacheEntityMessage, EhcacheEntityResponse> endpoint, Timeouts timeouts, String storeIdentifier, Executor asyncWorker) { this.endpoint = endpoint; this.timeouts = timeouts; this.storeIdentifier = storeIdentifier; this.asyncWorker = asyncWorker; this.messageFactory = new LifeCycleMessageFactory(); endpoint.setDelegate(new EndpointDelegate<EhcacheEntityResponse>() { @Override public void handleMessage(EhcacheEntityResponse messageFromServer) { LOGGER.trace("Entity response received from server: {}", messageFromServer); fireResponseEvent(messageFromServer); } @Override public byte[] createExtendedReconnectData() { synchronized (lock) { ClusterTierReconnectMessage reconnectMessage = new ClusterTierReconnectMessage(eventsEnabled); reconnectListeners.forEach(reconnectListener -> reconnectListener.onHandleReconnect(reconnectMessage)); return reconnectMessageCodec.encode(reconnectMessage); } } @Override public void didDisconnectUnexpectedly() { LOGGER.info("Cluster tier for cache disconnected", storeIdentifier); fireDisconnectionEvent(); } }); }

Target:
public SimpleClusterTierClientEntity(EntityClientEndpoint<EhcacheEntityMessage, EhcacheEntityResponse> endpoint, Timeouts timeouts, String storeIdentifier, Executor asyncWorker) { this.endpoint = endpoint; this.timeouts = timeouts; this.storeIdentifier = storeIdentifier; this.asyncWorker = requireNonNull(asyncWorker); this.messageFactory = new LifeCycleMessageFactory(); endpoint.setDelegate(new EndpointDelegate<EhcacheEntityResponse>() { @Override public void handleMessage(EhcacheEntityResponse messageFromServer) { LOGGER.trace("Entity response received from server: {}", messageFromServer); fireResponseEvent(messageFromServer); } @Override public byte[] createExtendedReconnectData() { synchronized (lock) { ClusterTierReconnectMessage reconnectMessage = new ClusterTierReconnectMessage(eventsEnabled); reconnectListeners.forEach(reconnectListener -> reconnectListener.onHandleReconnect(reconnectMessage)); return reconnectMessageCodec.encode(reconnectMessage); } } @Override public void didDisconnectUnexpectedly() { LOGGER.info("Cluster tier for cache disconnected", storeIdentifier); fireDisconnectionEvent(); } }); }
Source:
private void deleteWorkflows(String workflowIdParams) { jdbc.update("delete from nflow_workflow_state where workflow_id in " + workflowIdParams); jdbc.update("update nflow_workflow set root_workflow_id=null, parent_workflow_id=null, parent_action_id=null " + "where id in " + workflowIdParams); jdbc.update("delete from nflow_workflow_action where workflow_id in " + workflowIdParams); jdbc.update("delete from nflow_workflow where id in " + workflowIdParams); }

Target:
private void deleteWorkflows(String workflowIdParams) { jdbc.update("delete from nflow_workflow where id in " + workflowIdParams); }
Source:
public MicroservicesRegistry() { ServiceLoader<SwaggerService> swaggerServices = ServiceLoader.load(SwaggerService.class); Iterator<SwaggerService> iterator = swaggerServices.iterator(); if (iterator.hasNext()) { SwaggerService swaggerService = iterator.next(); swaggerService.init(this); services.add(swaggerService); } }

Target:
public MicroservicesRegistry() { if (DataHolder.getInstance().getBundleContext() == null) { ServiceLoader<SwaggerService> swaggerServices = ServiceLoader.load(SwaggerService.class); Iterator<SwaggerService> iterator = swaggerServices.iterator(); if (iterator.hasNext()) { SwaggerService swaggerService = iterator.next(); swaggerService.init(this); services.add(swaggerService); } } }
Source:
public void handleResponse(Packet response) { long correlationID = response.getCorrelationID(); Packet packet = store.get(correlationID); store.remove(correlationID); if (packet != null) { responseHandler.responseHandler(packet, response); } }

Target:
public void handleResponse(Packet response) { long correlationID = response.getCorrelationID(); Packet packet = store.remove(correlationID); if (packet != null) { responseHandler.responseHandler(packet, response); } }
Source:
public void updateScreen() { ++this.progress; if (this.progress % 20 == 0) { this.connection.sendPacket(new CPacketKeepAlive()); } if(this.progress % 200 == 0) { assignScreenContent(); } if (this.screenReassign) { this.assignScreenContent(); this.screenReassign = false; } if(this.screenEntities.getLeft() instanceof EntityKoaHunter) { this.screenEntities.getLeft().ticksExisted++; } if(this.screenEntities.getRight() instanceof EntityKoaHunter) { this.screenEntities.getRight().ticksExisted++; } this.animTick++; }

Target:
public void updateScreen() { super.updateScreen(); if (this.screenReassign) { this.assignScreenContent(); this.screenReassign = false; } if (this.screenEntities.getLeft() instanceof EntityKoaHunter) { this.screenEntities.getLeft().ticksExisted++; } if (this.screenEntities.getRight() instanceof EntityKoaHunter) { this.screenEntities.getRight().ticksExisted++; } this.animTick++; }
Source:
public void setUp() { tested = spy(new DiagramMarshaller() { @Override public Graph unmarshall(Metadata metadata, InputStream input) throws IOException { return graph; } @Override public String marshall(Diagram diagram) throws IOException { return null; } @Override public DiagramMetadataMarshaller getMetadataMarshaller() { return null; } }); request = MarshallingRequest.builder() .metadata(metadata) .input(input) .mode(MarshallingRequest.Mode.ERROR) .build(); }

Target:
public void setUp(){ request = MarshallingRequest.builder() .metadata(metadata) .input(input) .mode(MarshallingRequest.Mode.ERROR) .build(); }
Source:
public void shouldProcessingFromSinkTopic() { final KStream<String, String> source = builder.stream("topic-source"); source.to("topic-sink"); final MockProcessorSupplier<String, String> processorSupplier = new MockProcessorSupplier<>(); source.process(processorSupplier); final ConsumerRecordFactory<String, String> recordFactory = new ConsumerRecordFactory<>(new StringSerializer(), new StringSerializer(), 0L); try (final TopologyTestDriver driver = new TopologyTestDriver(builder.build(), props)) { driver.pipeInput(recordFactory.create("topic-source", "A", "aa")); } assertEquals(asList(new KeyValueTimestamp<>("A", "aa", 0)), processorSupplier.theCapturedProcessor().processed); }

Target:
public void shouldProcessingFromSinkTopic() { final KStream<String, String> source = builder.stream("topic-source"); source.to("topic-sink"); final MockProcessorSupplier<String, String> processorSupplier = new MockProcessorSupplier<>(); source.process(processorSupplier); final ConsumerRecordFactory<String, String> recordFactory = new ConsumerRecordFactory<>(new StringSerializer(), new StringSerializer(), 0L); try (final TopologyTestDriver driver = new TopologyTestDriver(builder.build(), props)) { driver.pipeInput(recordFactory.create("topic-source", "A", "aa")); } assertEquals(Collections.singletonList(new KeyValueTimestamp<>("A", "aa", 0)), processorSupplier.theCapturedProcessor().processed); }
Source:
void setUnresolvedCompact(boolean unresolvedCompact) { this.unresolvedCompact = unresolvedCompact; if (outer != null) { outer.setUnresolvedCompact(true); } }

Target:
void setUnresolvedCompact(boolean unresolvedCompact) { this.unresolvedCompact = unresolvedCompact; }
Source:
protected void initSimulations() { d_models = new HashMap<Task, MCMCWrapper>(); initAllBaselineModels(); initNetworkMetaProgressModels(); }

Target:
protected void initSimulations() { d_models = new HashMap<Task, MCMCWrapper>(); initAllBaselineModels(); initNetworkMetaAnalysisModels(); }
Source:
public void testParseError() throws Exception { String path = new URI(resultPath()).getPath(); new File(path).mkdirs(); File file = new File(path, "my_file"); file.createNewFile(); FileUtils.writeFileUtf8(file, "{\"x\":\"x5\",\"y\":5,\"a\":1,\"b\":1}\n" + "{I am a wrong json.}\n" + "{\"x\":\"x5\",\"y\":5,\"a\":1,\"b\":1}"); check("select * from nonPartitionedTable", JavaConverters.asScalaIteratorConverter(Arrays.asList( Row.of("x5,5,1,1"), Row.of("x5,5,1,1")).iterator()).asScala().toSeq()); }

Target:
public void testParseError() throws Exception { String path = new URI(resultPath()).getPath(); new File(path).mkdirs(); File file = new File(path, "temp_file"); file.createNewFile(); FileUtils.writeFileUtf8(file, "{\"x\":\"x5\",\"y\":5,\"a\":1,\"b\":1}\n" + "{I am a wrong json.}\n" + "{\"x\":\"x5\",\"y\":5,\"a\":1,\"b\":1}"); check("select * from nonPartitionedTable", Arrays.asList( Row.of("x5,5,1,1"), Row.of("x5,5,1,1"))); }
Source:
public void initialize(SparkExecutionPluginContext context) throws Exception { super.initialize(context); FileSet fileSet = context.getDataset(config.fileSetName); Location modelLocation = fileSet.getBaseLocation().append(config.path); if (!modelLocation.exists()) { throw new IllegalArgumentException(String.format("Failed to find model to use for Regression. Location does " + "not exist: {}.", modelLocation)); } JavaSparkContext javaSparkContext = context.getSparkContext(); SparkContext sparkContext = JavaSparkContext.toSparkContext(javaSparkContext); loadedModel = DecisionTreeModel.load(sparkContext, modelLocation.toURI().getPath()); }

Target:
public void initialize(SparkExecutionPluginContext context) throws Exception { super.initialize(context); FileSet fileSet = context.getDataset(config.fileSetName); Location modelLocation = fileSet.getBaseLocation().append(config.path); if (!modelLocation.exists()) { throw new IllegalArgumentException(String.format("Failed to find model to use for Regression. Location does " + "not exist: %s.", modelLocation)); } JavaSparkContext javaSparkContext = context.getSparkContext(); SparkContext sparkContext = JavaSparkContext.toSparkContext(javaSparkContext); loadedModel = DecisionTreeModel.load(sparkContext, modelLocation.toURI().getPath()); }
Source:
public H3IndexHandler(File indexDir, SegmentMetadataImpl segmentMetadata, IndexLoadingConfig indexLoadingConfig, SegmentDirectory.Writer segmentWriter) { _indexDir = indexDir; _segmentWriter = segmentWriter; _segmentName = segmentMetadata.getName(); _segmentVersion = SegmentVersion.valueOf(segmentMetadata.getVersion()); for (String column : indexLoadingConfig.getH3IndexColumns()) { ColumnMetadata columnMetadata = segmentMetadata.getColumnMetadataFor(column); if (columnMetadata != null) { _h3IndexColumns.add(columnMetadata); } } }

Target:
public H3IndexHandler(File indexDir, SegmentMetadataImpl segmentMetadata, IndexLoadingConfig indexLoadingConfig, SegmentDirectory.Writer segmentWriter) { _indexDir = indexDir; _segmentWriter = segmentWriter; _segmentName = segmentMetadata.getName(); _segmentVersion = SegmentVersion.valueOf(segmentMetadata.getVersion()); for (H3IndexColumn h3IndexConfig : indexLoadingConfig.getH3IndexColumns()) { ColumnMetadata columnMetadata = segmentMetadata.getColumnMetadataFor(h3IndexConfig.getName()); if (columnMetadata != null) { _h3IndexColumns.add(columnMetadata); _h3IndexMap.put(h3IndexConfig.getName(), h3IndexConfig); } } }
Source:
private Object validateAndSet(String[] values, HashMap toEmit) { Object pojoObject = null; try { List<FixedWidthSchema.FixedWidthField> fields = schema.getFields(); try { if (clazz != null) { pojoObject = clazz.newInstance(); } } catch (InstantiationException ie) { pojoObject = null; } for (int i = 0; i < fields.size(); i++) { FixedWidthSchema.FixedWidthField currentField = fields.get(i); FixedWidthParser.TypeInfo typeInfo = setters.get(i); validateAndSetCurrentField(currentField, values[i], typeInfo, pojoObject, toEmit); } } catch (StringIndexOutOfBoundsException e) { throw new RuntimeException("Record length and tuple length mismatch ", e); } catch (IllegalAccessException ie) { throw new RuntimeException("Illegal Access ", ie); } catch (Exception e) { throw new RuntimeException("Exception in validation"); } return pojoObject; }

Target:
private Object validateAndSet(String[] values, HashMap toEmit) { Object pojoObject = null; try { List<FixedWidthSchema.Field> fields = schema.getFields(); try { if (clazz != null) { pojoObject = clazz.newInstance(); } } catch (InstantiationException ie) { throw new RuntimeException("Exception in instantiating", ie); } for (int i = 0; i < fields.size(); i++) { FixedWidthSchema.Field currentField = fields.get(i); FixedWidthParser.TypeInfo typeInfo = setters.get(i); validateAndSetCurrentField(currentField, values[i], typeInfo, pojoObject, toEmit); } } catch (StringIndexOutOfBoundsException e) { throw new RuntimeException("Record length and tuple length mismatch ", e); } catch (IllegalAccessException ie) { throw new RuntimeException("Illegal Access ", ie); } catch (Exception e) { throw new RuntimeException("Exception in validation", e); } return pojoObject; }
Source:
public MultipleCurrencyAmount accruedInterest(SwapFixedIborDefinition swapDefinition, DayCount fixedLegDayCount, DayCount iborLegDayCount, Calendar calendar, ZonedDateTime valuationDate, ZonedDateTimeDoubleTimeSeries indexTimeSeries, MulticurveProviderDiscount multicurves) { ArgumentChecker.notNull(swapDefinition, "swapDefinition"); ArgumentChecker.notNull(fixedLegDayCount, "fixedLegDayCount"); ArgumentChecker.notNull(iborLegDayCount, "iborLegDayCount"); ArgumentChecker.notNull(calendar, "calendar"); ArgumentChecker.notNull(valuationDate, "valuationDate"); ArgumentChecker.notNull(indexTimeSeries, "indexTimeSeries"); ArgumentChecker.notNull(multicurves, "multicurves"); Annuity<? extends Coupon> iborLeg = swapDefinition.getIborLeg().toDerivative(valuationDate, indexTimeSeries); double iborLegAccruedInterest = getAccrued(iborLegDayCount, calendar, valuationDate, swapDefinition.getIborLeg(), indexTimeSeries) * Math.signum(iborLeg.getNthPayment(0).getNotional()); CouponFixedDefinition refFixed = swapDefinition.getFixedLeg().getNthPayment(0); double fixedLegAccruedInterest = getAccrued(fixedLegDayCount, calendar, valuationDate, swapDefinition.getFixedLeg(), indexTimeSeries) * Math.signum(refFixed.getNotional()) * refFixed.getRate(); return MultipleCurrencyAmount.of(swapDefinition.getCurrency(), iborLegAccruedInterest + fixedLegAccruedInterest); }

Target:
public MultipleCurrencyAmount accruedInterest(SwapFixedIborDefinition swapDefinition, DayCount fixedLegDayCount, DayCount iborLegDayCount, Calendar calendar, ZonedDateTime valuationDate, ZonedDateTimeDoubleTimeSeries indexTimeSeries, MulticurveProviderDiscount multicurves) { ArgumentChecker.notNull(swapDefinition, "swapDefinition"); ArgumentChecker.notNull(fixedLegDayCount, "fixedLegDayCount"); ArgumentChecker.notNull(iborLegDayCount, "iborLegDayCount"); ArgumentChecker.notNull(calendar, "calendar"); ArgumentChecker.notNull(valuationDate, "valuationDate"); ArgumentChecker.notNull(indexTimeSeries, "indexTimeSeries"); ArgumentChecker.notNull(multicurves, "multicurves"); checkNotionalAndFixedRate(swapDefinition); double iborLegAccruedInterest = getAccrued(iborLegDayCount, calendar, valuationDate, swapDefinition.getIborLeg(), indexTimeSeries); CouponFixedDefinition refFixed = swapDefinition.getFixedLeg().getNthPayment(0); double fixedLegAccruedInterest = getAccrued(fixedLegDayCount, calendar, valuationDate, swapDefinition.getFixedLeg(), indexTimeSeries) * refFixed.getRate(); return MultipleCurrencyAmount.of(swapDefinition.getCurrency(), iborLegAccruedInterest + fixedLegAccruedInterest); }
Source:
public Response act(final Request req) throws IOException { final User user = this.base.user(new RqAuth(req).identity().urn()); return new RsPage( "/xsl/admin.xsl", req, new XeSource() { @Override public Iterable<Directive> toXembly() throws IOException { return TkAdmin.this.list(user); } } ); }

Target:
public Response act(final Request req) throws IOException { final User user = this.base.user(new RqAuth(req).identity().urn()); return new RsPage( "/xsl/admin.xsl", req, this.base, new XeAppend( "docs", new XeTransform<>( user.docs().names(), new XeTransform.Func<String>() { @Override public XeSource transform(final String name) { return new XeAppend( "doc", new XeDirectives( new Directives() .add("path").set( String.format( "%s/%s", user.urn(), name ) ) ) ); } } ) ) ); }
Source:
public static Map<String,String> getIdToNameMap(Instance instance) { TableMap map = tableMapCache; if (map == null || tableMapTimestamp.longValue() + TABLE_MAP_CACHE_EXPIRATION <= System.nanoTime()) { tableMapCache = new TableMap(instance); tableMapTimestamp.set(System.nanoTime()); map = tableMapCache; } return map.getIdtoNameMap(); }

Target:
public static Map<String,String> getIdToNameMap(Instance instance) { return getTableMap(instance).getIdtoNameMap(); }
Source:
public void commitAfterSquashMerge() throws Exception { Git git = new Git(db); writeTrashFile("file1", "file1"); git.add().addFilepattern("file1").call(); RevCommit first = git.commit().setMessage("initial commit").call(); assertTrue(new File(db.getWorkTree(), "file1").exists()); createBranch(first, "refs/heads/branch1"); checkoutBranch("refs/heads/branch1"); writeTrashFile("file2", "file2"); git.add().addFilepattern("file2").call(); git.commit().setMessage("second commit").call(); assertTrue(new File(db.getWorkTree(), "file2").exists()); checkoutBranch("refs/heads/master"); MergeResult result = git.merge().include(db.getRef("branch1")) .setSquash(true).call(); assertTrue(new File(db.getWorkTree(), "file1").exists()); assertTrue(new File(db.getWorkTree(), "file2").exists()); assertEquals(MergeResult.MergeStatus.FAST_FORWARD_SQUASHED, result.getMergeStatus()); git.commit().call(); assertEquals("commit: Squashed commit of the following:", db .getReflogReader(Constants.HEAD).getLastEntry().getComment()); assertEquals("commit: Squashed commit of the following:", db .getReflogReader(db.getBranch()).getLastEntry().getComment()); }

Target:
public void commitAfterSquashMerge() throws Exception { Git git = new Git(db); writeTrashFile("file1", "file1"); git.add().addFilepattern("file1").call(); RevCommit first = git.commit().setMessage("initial commit").call(); assertTrue(new File(db.getWorkTree(), "file1").exists()); createBranch(first, "refs/heads/branch1"); checkoutBranch("refs/heads/branch1"); writeTrashFile("file2", "file2"); git.add().addFilepattern("file2").call(); git.commit().setMessage("second commit").call(); assertTrue(new File(db.getWorkTree(), "file2").exists()); checkoutBranch("refs/heads/master"); MergeResult result = git.merge().include(db.getRef("branch1")) .setSquash(true).call(); assertTrue(new File(db.getWorkTree(), "file1").exists()); assertTrue(new File(db.getWorkTree(), "file2").exists()); assertEquals(MergeResult.MergeStatus.FAST_FORWARD_SQUASHED, result.getMergeStatus()); RevCommit squashedCommit = git.commit().call(); assertEquals(1, squashedCommit.getParentCount()); assertNull(db.readSquashCommitMsg()); assertEquals("commit: Squashed commit of the following:", db .getReflogReader(Constants.HEAD).getLastEntry().getComment()); assertEquals("commit: Squashed commit of the following:", db .getReflogReader(db.getBranch()).getLastEntry().getComment()); }
Source:
public static ReferenceSource getDefaultCRAMReferenceSource() { if (null != Defaults.REFERENCE_FASTA) { if (Defaults.REFERENCE_FASTA.exists()) { return new ReferenceSource(Defaults.REFERENCE_FASTA); } else { throw new IllegalArgumentException( "The file specified by the reference property does not exist: " + Defaults.REFERENCE_FASTA.getName()); } } else if (Defaults.USE_CRAM_REF_DOWNLOAD) { return new ReferenceSource(); } else { throw new IllegalStateException( "A valid CRAM reference was not supplied and one cannot be acquired via property settings"); } }

Target:
public static ReferenceSource getDefaultCRAMReferenceSource() { if (null != Defaults.REFERENCE_FASTA) { if (Defaults.REFERENCE_FASTA.exists()) { return new ReferenceSource(Defaults.REFERENCE_FASTA); } else { throw new IllegalArgumentException( "The file specified by the reference_fasta property does not exist: " + Defaults.REFERENCE_FASTA.getName()); } } else if (Defaults.USE_CRAM_REF_DOWNLOAD) { return new ReferenceSource(); } else { throw new IllegalStateException( "A valid CRAM reference was not supplied and one cannot be acquired via the property settings reference_fasta or use_cram_ref_download"); } }
Source:
private void expandObjectLitAssignment(NodeTraversal t, Node export) { Preconditions.checkState(export.getParent().isAssign()); Node insertionRef = export.getParent().getParent(); Preconditions.checkState(insertionRef.isExprResult()); Node insertionParent = insertionRef.getParent(); Preconditions.checkNotNull(insertionParent); Node rValue = NodeUtil.getRValueOfLValue(export); Node key = rValue.getFirstChild(); while (key != null) { Node lhs; if (key.isQuotedString()) { lhs = IR.getelem(export.cloneTree(), IR.string(key.getString())); } else { lhs = IR.getprop(export.cloneTree(), IR.string(key.getString())); } Node value = null; if (key.isStringKey()) { if (key.hasChildren()) { value = key.getFirstChild().detachFromParent(); } else { value = IR.name(key.getString()); } } else if (key.isMemberFunctionDef() || key.isGetterDef()) { value = key.getFirstChild().detach(); } Node expr = IR.exprResult(IR.assign(lhs, value)).useSourceInfoIfMissingFromForTree(key); insertionParent.addChildAfter(expr, insertionRef); visitExport(t, lhs.getFirstChild()); if (expr.getParent() != null) { insertionRef = expr; } key = key.getNext(); } export.getParent().getParent().detach(); }

Target:
private void expandObjectLitAssignment(NodeTraversal t, Node export) { checkState(export.getParent().isAssign()); Node insertionRef = export.getParent().getParent(); checkState(insertionRef.isExprResult()); Node insertionParent = insertionRef.getParent(); checkNotNull(insertionParent); Node rValue = NodeUtil.getRValueOfLValue(export); Node key = rValue.getFirstChild(); while (key != null) { Node lhs; if (key.isQuotedString()) { lhs = IR.getelem(export.cloneTree(), IR.string(key.getString())); } else { lhs = IR.getprop(export.cloneTree(), IR.string(key.getString())); } Node value = null; if (key.isStringKey()) { if (key.hasChildren()) { value = key.removeFirstChild(); } else { value = IR.name(key.getString()); } } else if (key.isMemberFunctionDef()) { value = key.getFirstChild().detach(); } Node expr = null; if (!key.isGetterDef()) { expr = IR.exprResult(IR.assign(lhs, value)).useSourceInfoIfMissingFromForTree(key); insertionParent.addChildAfter(expr, insertionRef); visitExport(t, lhs.getFirstChild()); } else { Node getter = key.detach(); String moduleName = t.getInput().getPath().toModuleName(); Node moduleObj = t.getScope().getVar(moduleName).getNode().getFirstChild(); moduleObj.addChildToBack(getter); } if (expr != null && expr.getParent() != null) { insertionRef = expr; } key = key.getNext(); } export.getParent().getParent().detach(); }
Source:
public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, View child, View target, int dx, int dy, int[] consumed) { try { if (linearLayoutManager.findLastCompletelyVisibleItemPosition() < adapter.getItemCount() - 3) { if (dy > 0 && changeInYDir < 0 || dy < 0 && changeInYDir > 0) { child.animate().cancel(); changeInYDir = 0; } changeInYDir += dy; if (changeInYDir > toolbarHeight && child.getVisibility() == View.VISIBLE && !isViewHidden) hideView(child); else if (changeInYDir < 0 && child.getVisibility() == View.GONE && !mIsShowing) { if (child instanceof FloatingActionButton) { if (chatBox == null) chatBox = coordinatorLayout.findViewById(R.id.messageBoxContainer); if (chatBox.getVisibility() == View.VISIBLE) { return; } } showView(child); } } } catch (NullPointerException e) { ZLog.logException(e); } }

Target:
public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, View child, View target, int dx, int dy, int[] consumed) throws NullPointerException { if (linearLayoutManager.findLastCompletelyVisibleItemPosition() < adapter.getItemCount() - 3) { if (dy > 0 && changeInYDir < 0 || dy < 0 && changeInYDir > 0) { child.animate().cancel(); changeInYDir = 0; } changeInYDir += dy; if ((changeInYDir > toolbarHeight && child.getVisibility() == View.VISIBLE) && (!isViewHidden || isTopSnackBar(child))) hideView(child); else if (changeInYDir < 0 && (child.getVisibility() == View.GONE && !mIsShowing) || isTopSnackBar(child)) { if (child instanceof FloatingActionButton) { if (chatBox == null) chatBox = coordinatorLayout.findViewById(R.id.messageBoxContainer); if (chatBox.getVisibility() == View.VISIBLE) { return; } } showView(child); } } }
Source:
private Logger getLogger() throws Exception { System.setProperty("java.util.logging.config.file", CB.getConfugrationFilePath()); Logger logger = Logger.getLogger(Candybean.class.getName()); return logger; }

Target:
private Logger getLogger() throws Exception { System.setProperty("java.util.logging.config.file", AbstractTest.getConfigrationFilePath()); Logger logger = Logger.getLogger(Candybean.class.getName()); return logger; }
Source:
private void scanGuiceModules(Set<Class<?>> classes) throws IOException { try { Class<?> sysModuleBaseClass = Module.class; Class<?> httpModuleBaseClass = Class.forName("com.google.inject.servlet.ServletModule"); Class<?> sshModuleBaseClass = Class.forName("com.google.gerrit.sshd.CommandModule"); sshModuleClass = null; httpModuleClass = null; sysModuleClass = null; for (Class<?> clazz : classes) { if(clazz.isLocalClass()) continue; if (sshModuleBaseClass.isAssignableFrom(clazz)) { sshModuleClass = getUniqueGuiceModule(sshModuleBaseClass, sshModuleClass, clazz); } else if (httpModuleBaseClass.isAssignableFrom(clazz)) { httpModuleClass = getUniqueGuiceModule(httpModuleBaseClass, httpModuleClass, clazz); } else if (sysModuleBaseClass.isAssignableFrom(clazz)) { sysModuleClass = getUniqueGuiceModule(sysModuleBaseClass, sysModuleClass, clazz); } } } catch (ClassNotFoundException e) { throw new IOException( "Cannot find base Gerrit classes for Guice Plugin Modules", e); } }

Target:
private void scanGuiceModules(Set<Class<?>> classes) throws IOException { try { Class<?> sysModuleBaseClass = Module.class; Class<?> httpModuleBaseClass = Class.forName("com.google.inject.servlet.ServletModule"); Class<?> sshModuleBaseClass = Class.forName("com.google.gerrit.sshd.CommandModule"); sshModuleClass = null; httpModuleClass = null; sysModuleClass = null; for (Class<?> clazz : classes) { if (clazz.isLocalClass()) { continue; } if (sshModuleBaseClass.isAssignableFrom(clazz)) { sshModuleClass = getUniqueGuiceModule(sshModuleBaseClass, sshModuleClass, clazz); } else if (httpModuleBaseClass.isAssignableFrom(clazz)) { httpModuleClass = getUniqueGuiceModule(httpModuleBaseClass, httpModuleClass, clazz); } else if (sysModuleBaseClass.isAssignableFrom(clazz)) { sysModuleClass = getUniqueGuiceModule(sysModuleBaseClass, sysModuleClass, clazz); } } } catch (ClassNotFoundException e) { throw new IOException( "Cannot find base Gerrit classes for Guice Plugin Modules", e); } }