auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ITmfTrace getTrace() { if (fTrace != null) { fTrace.dispose(); } Bundle bundle = BtfTestPlugin.getBundle(); Path path = new Path(fDirectory + File.separator + fPath); final URL location = FileLocator.find(bundle,path, null); try { File test = new File(FileLocator.toFileURL(location).toURI()); fTrace = new BtfTrace(); fTrace.initTrace(null, test.getAbsolutePath(), null); } catch (URISyntaxException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } catch (TmfTraceException e) { throw new RuntimeException(e); } return fTrace; }

Target:
public BtfTrace getTrace() { if (fTrace != null) { fTrace.dispose(); } Bundle bundle = BtfTestPlugin.getBundle(); Path path = new Path(fDirectory + File.separator + fPath); final URL location = FileLocator.find(bundle,path, null); File test; try { test = new File(FileLocator.toFileURL(location).toURI()); fTrace = new BtfTrace(); fTrace.initTrace(null, test.getAbsolutePath(), null); } catch (URISyntaxException | IOException | TmfTraceException e) { throw new RuntimeException(e); } return fTrace; }
Source:
public TygronSettingsLoader(String path) { try { readConfig(path); } catch (Exception e) { username = "fallbackusername"; password = "fallbackpassword"; } }

Target:
public TygronSettingsLoader(String path) throws Exception { readConfig(path); }
Source:
private void closeClientQuietly() { if (streamClient != null) { try { streamClient.close(); } catch (IOException e) { LOG.error("Error closing stream client. {}", e.getMessage(), e); } streamClient = null; } }

Target:
private void closeClientQuietly() { if (streamClient != null) { try { streamClient.close(); } catch (Throwable t) { LOG.error("Error closing stream client. {}", t.getMessage(), t); } streamClient = null; } }
Source:
public ScriptServerButtonViewModel(NicosModel model, String buttonLabel) { super(buttonLabel); flash = new FlashingButton(this, SCRIPT_BUTTON_COLOR); flash.setDefaultColour(DEFOCUSSED); Label = buttonLabel; model.addPropertyChangeListener("scriptStatus", arg0->{ status = model.getScriptStatus(); setButtonColor(); updateFlashing(); }); }

Target:
public ScriptServerButtonViewModel(NicosModel model, String buttonLabel) { super(buttonLabel); flash = new FlashingButton(this, SCRIPT_BUTTON_COLOR); Label = buttonLabel; model.addPropertyChangeListener("scriptStatus", ignored->{ status = model.getScriptStatus(); setButtonColor(); updateFlashing(); }); }
Source:
private ServiceTreeNode step(ServiceTreeNode node, PathSegment pathSegment) { if (isUUID(pathSegment.getPath())) { return node.getSubService("{id}"); } else { if (node.containsSubService(pathSegment.getPath())) { return node.getSubService(pathSegment.getPath()); } else { return node; } } }

Target:
private ServiceTreeNode step(ServiceTreeNode node, PathSegment pathSegment) { if (isID(pathSegment.getPath(), node)) { return node.getSubService("{id}"); } else { if (node.containsSubService(pathSegment.getPath())) { return node.getSubService(pathSegment.getPath()); } else { return node; } } }
Source:
public boolean parse(ByteBuffer buffer) throws IOException { int tag; while (true) { buffer.mark(); int beginning = buffer.position(); tag = FIXTags.get(buffer); if (tag == 0) { buffer.reset(); return false; } if (!beginString.get(buffer)) { buffer.reset(); return false; } if (tag != BeginString) continue; int position = buffer.position(); tag = FIXTags.get(buffer); if (tag == 0) { buffer.reset(); return false; } if (!bodyLength.get(buffer)) { buffer.reset(); return false; } if (tag != BodyLength) { buffer.position(position); continue; } int length = (int)bodyLength.asInt(); if (buffer.remaining() < length + 7) { buffer.reset(); return false; } position = buffer.position(); if (checkSumEnabled && !checkSum(buffer, beginning, position, length)) continue; int limit = buffer.limit(); buffer.limit(position + length); boolean garbled = message.get(buffer) == false; buffer.limit(limit); buffer.position(position + length + 7); if (garbled) continue; listener.message(message); return true; } }

Target:
public boolean parse(ByteBuffer buffer) throws IOException { int tag; while (true) { buffer.mark(); int beginning = buffer.position(); tag = FIXTags.get(buffer); if (tag == 0) { buffer.reset(); return false; } if (!beginString.get(buffer)) { buffer.reset(); return false; } if (tag != BeginString) continue; int position = buffer.position(); tag = FIXTags.get(buffer); if (tag == 0) { buffer.reset(); return false; } if (!bodyLength.get(buffer)) { buffer.reset(); return false; } if (tag != BodyLength) { buffer.position(position); continue; } int length = (int)bodyLength.asInt(); if (buffer.remaining() < length + 7) { buffer.reset(); return false; } position = buffer.position(); if (checkSumEnabled && !acceptCheckSum(buffer, beginning, position, length)) continue; int limit = buffer.limit(); buffer.limit(position + length); boolean garbled = message.get(buffer) == false; buffer.limit(limit); buffer.position(position + length + 7); if (garbled) continue; listener.message(message); return true; } }
Source:
public Schema inferSchema(String json) { try { final JsonNode jsonNode = mapper.readTree(json); return Schema.createRecord("outer_record", null, "org.talend", false, getFields(jsonNode)); } catch (Exception ex) { logger.error(ex.getMessage()); } return null; }

Target:
public Schema inferSchema(String json) { try { final JsonNode jsonNode = mapper.readTree(json); return Schema.createRecord("outer_record", null, "org.talend", false, getFields(jsonNode)); } catch (IOException | TalendRuntimeException e) { throw TalendRuntimeException.createUnexpectedException(e.getCause()); } }
Source:
public PersistentResourceTest() { goodUserScope = new RequestScope(null, null, mock(DataStoreTransaction.class), new User(1), null, elideSettings); badUserScope = new RequestScope(null, null, mock(DataStoreTransaction.class), new User(-1), null, elideSettings); reset(goodUserScope.getTransaction()); assertFalse(goodUserScope.isUseFilterExpressions()); }

Target:
public PersistentResourceTest() { goodUserScope = buildRequestScope(mock(DataStoreTransaction.class), new User(1)); badUserScope = buildRequestScope(mock(DataStoreTransaction.class), new User(-1)); reset(goodUserScope.getTransaction()); }
Source:
public Page getOutput() { if (!isBlocked().isDone()) { return null; } if (state != State.FINISHING) { return null; } state = State.FINISHED; List<ComputedStatistics> statistics = getComputedStatistics(); outputMetadata = tableFinisher.finishTable(fragmentBuilder.build()); PageBuilder page = new PageBuilder(1, TYPES); page.declarePosition(); BIGINT.writeLong(page.getBlockBuilder(0), rowCount); return page.build(); }

Target:
public Page getOutput() { if (state != State.FINISHING) { return null; } if (!isBlocked().isDone()) { return null; } state = State.FINISHED; List<ComputedStatistics> statistics = getComputedStatistics(); outputMetadata = tableFinisher.finishTable(fragmentBuilder.build(), statistics); PageBuilder page = new PageBuilder(1, TYPES); page.declarePosition(); BIGINT.writeLong(page.getBlockBuilder(0), rowCount); return page.build(); }
Source:
protected void checkUserFutures() { for (Ignite ignite : G.allGrids()) { IgniteEx ig = (IgniteEx)ignite; final Collection<GridCacheFuture<?>> futs = ig.context().cache().context().mvcc().activeFutures(); boolean hasFutures = false; for (GridCacheFuture<?> fut : futs) { if (!fut.isDone()) { if (fut instanceof GridNearTxPrepareFutureAdapter && ((GridNearTxPrepareFutureAdapter) fut).tx().system()) continue; if (fut instanceof GridDhtTxPrepareFuture && ((GridDhtTxPrepareFuture) fut).tx().system()) continue; log.error("Expecting no active future [node=" + ig.localNode().id() + ", fut=" + fut + ']'); hasFutures = true; } } if (hasFutures) fail("Some mvcc futures are not finished"); Collection<IgniteInternalTx> txs = ig.context().cache().context().tm().activeTransactions() .stream() .filter(tx -> !tx.system()) .collect(Collectors.toSet()); for (IgniteInternalTx tx : txs) log.error("Expecting no active transaction [node=" + ig.localNode().id() + ", tx=" + tx + ']'); if (!txs.isEmpty()) fail("Some transaction are not finished"); } }

Target:
protected void checkUserFutures() { for (Ignite ignite : G.allGrids()) { IgniteEx ig = (IgniteEx)ignite; final Collection<GridCacheFuture<?>> activeFuts = ig.context().cache().context().mvcc().activeFutures(); boolean hasFutures = false; for (GridCacheFuture<?> fut : activeFuts) { if (!fut.isDone()) { if (fut instanceof GridNearTxPrepareFutureAdapter && ((GridNearTxPrepareFutureAdapter) fut).tx().system()) continue; if (fut instanceof GridDhtTxPrepareFuture && ((GridDhtTxPrepareFuture) fut).tx().system()) continue; log.error("Expecting no active future [node=" + ig.localNode().id() + ", fut=" + fut + ']'); hasFutures = true; } } if (hasFutures) fail("Some mvcc futures are not finished"); Collection<IgniteInternalTx> txs = ig.context().cache().context().tm().activeTransactions() .stream() .filter(tx -> !tx.system()) .collect(Collectors.toSet()); for (IgniteInternalTx tx : txs) log.error("Expecting no active transaction [node=" + ig.localNode().id() + ", tx=" + tx + ']'); if (!txs.isEmpty()) fail("Some transaction are not finished"); } }
Source:
public List<ContentType> findContentTypesForScheme(final WorkflowScheme workflowScheme) { if (!SYSTEM_WORKFLOW_ID.equals(workflowScheme.getId())) { if (!hasValidLicense() && !this.getFriendClass().isFriend()) { throw new InvalidLicenseException("Workflow-Schemes-License-required"); } } try { return workFlowFactory.findContentTypesByScheme(workflowScheme); }catch(Exception e){ throw new DoesNotExistException(e); } }

Target:
public List<ContentType> findContentTypesForScheme(final WorkflowScheme workflowScheme) { if (!SYSTEM_WORKFLOW_ID.equals(workflowScheme.getId())) { if (!hasValidLicense() && !this.getFriendClass().isFriend()) { throw new InvalidLicenseException("Workflow-Schemes-License-required"); } } try { return workFlowFactory.findContentTypesByScheme(workflowScheme); }catch(Exception e){ Logger.debug(this,e.getMessage(),e); throw new DoesNotExistException(e); } }
Source:
private static Client setupClient(HttpClient httpClient, Duration timeout) { ReactorNettyClientHttpEngine engine = new ReactorNettyClientHttpEngine( httpClient, new DefaultChannelGroup(new DefaultEventExecutor()), HttpResources.get(), timeout); final ClientBuilder builder = ClientBuilder.newBuilder(); ResteasyClientBuilder clientBuilder = (ResteasyClientBuilder)builder; clientBuilder.httpEngine(engine); return builder.build(); }

Target:
private static Client setupClient(HttpClient httpClient, Duration timeout) { final ReactorNettyClientHttpEngine engine = new ReactorNettyClientHttpEngine( httpClient, new DefaultChannelGroup(new DefaultEventExecutor()), HttpResources.get(), timeout); final ClientBuilder builder = ClientBuilder.newBuilder(); final ResteasyClientBuilder clientBuilder = (ResteasyClientBuilder)builder; clientBuilder.httpEngine(engine); return builder.build(); }
Source:
public ChunkBuffer(int x, int z) { super(8192); this.x = x; this.z = z; }

Target:
public ChunkBuffer(int x, int z) { super(SECTOR_BYTES); this.x = x; this.z = z; }
Source:
public void setMd5(String md5Hash) throws EamDbException { this.md5Hash = md5Hash; boolean useCR = EamDb.isEnabled(); if (useCR) { EamDb.getInstance().updateDataSourceMd5Hash(this); } }

Target:
public void setMd5(String md5Hash) throws EamDbException { this.md5Hash = md5Hash; if (dataSourceObjectID != -1) { EamDb.getInstance().updateDataSourceMd5Hash(this); } }
Source:
private void setupUIFromAdapter(ListView view) { view.setAdapter(adapter); EntitySelectViewSetup.setupDivider(this, view, shortSelect.usesGridView()); findViewById(R.id.entity_select_loading).setVisibility(View.GONE); if (adapter.isFilteringByCalloutResult()) { showSearchBannerWithClearButton(); } }

Target:
private void setupUIFromAdapter(ListView view) { view.setAdapter(adapter); EntitySelectViewSetup.setupDivider(this, view, shortSelect.usesGridView()); findViewById(R.id.entity_select_loading).setVisibility(View.GONE); setSearchBannerState(); }
Source:
private boolean areFileassetFieldsPresent(final GraphQLObjectType objectType) { List<String> fileAssetFields = list(FILEASSET_FILE_NAME_FIELD_VAR, FILEASSET_DESCRIPTION_FIELD_VAR, FILEASSET_FILEASSET_FIELD_VAR, FILEASSET_METADATA_FIELD_VAR, FILEASSET_SHOW_ON_MENU_FIELD_VAR, FILEASSET_SORT_ORDER_FIELD_VAR); return objectType.getFieldDefinitions().stream().allMatch((fieldDefinition -> fileAssetFields.contains(fieldDefinition.getName()))); }

Target:
private boolean areFileassetFieldsPresent(final GraphQLObjectType objectType) { final List<String> fileAssetFields = list(FILEASSET_FILE_NAME_FIELD_VAR, FILEASSET_DESCRIPTION_FIELD_VAR, FILEASSET_FILEASSET_FIELD_VAR, FILEASSET_METADATA_FIELD_VAR, FILEASSET_SHOW_ON_MENU_FIELD_VAR, FILEASSET_SORT_ORDER_FIELD_VAR); return objectType.getFieldDefinitions().stream().allMatch(fieldDefinition -> fileAssetFields.contains(fieldDefinition.getName())); }
Source:
@Override public int size() { if (data == null && rawData == null) return 0; else { if (data != null) return data.length; if (rawData != null) return rawData.length; else throw new IllegalStateException(); } }

Target:
@Override public int size() { if (data == null && rawData == null) return 0; else return data != null ? data.length : rawData.length; }
Source:
private static Manifest loadGuavaManifest() { InputStream in = null; try { Enumeration<URL> resources = Resources.class.getClassLoader() .getResources("META-INF/MANIFEST.MF"); while (resources.hasMoreElements()) { in = resources.nextElement().openStream(); Manifest manifest = new Manifest(in); Attributes mainAttributes = manifest.getMainAttributes(); String symbolicName = mainAttributes.getValue("Bundle-SymbolicName"); if ("com.google.guava".equals(symbolicName)) { return manifest; } } throw new DriverInternalError("Error while looking up Guava manifest: " + "no manifest with symbolic name 'com.google.guava' found in classpath."); } catch (Exception e) { throw new DriverInternalError("Error while looking up Guava manifest", e); } finally { if (in != null) { try { in.close(); } catch (IOException e) { } } } }

Target:
private static Manifest loadGuavaManifest() { InputStream in = null; try { Enumeration<URL> resources = Preconditions.class.getClassLoader() .getResources("META-INF/MANIFEST.MF"); while (resources.hasMoreElements()) { in = resources.nextElement().openStream(); Manifest manifest = new Manifest(in); Attributes mainAttributes = manifest.getMainAttributes(); String symbolicName = mainAttributes.getValue("Bundle-SymbolicName"); if ("com.google.guava".equals(symbolicName)) { return manifest; } } throw new DriverInternalError("Error while looking up Guava manifest: " + "no manifest with symbolic name 'com.google.guava' found in classpath."); } catch (Exception e) { throw new DriverInternalError("Error while looking up Guava manifest", e); } finally { if (in != null) { try { in.close(); } catch (IOException e) { } } } }
Source:
public boolean equals(Object other) { if(other == null) { return false;} if(this == other) { return true;} if (other instanceof BindingSetRow) { BindingSetRow row = (BindingSetRow) other; return new EqualsBuilder().append(this.nodeId, row.nodeId).append(this.bindingSetString, row.bindingSetString) .isEquals(); } return false; }

Target:
public boolean equals(Object other) { if(this == other) { return true;} if (other instanceof BindingSetRow) { BindingSetRow row = (BindingSetRow) other; return Objects.equals(nodeId, row.nodeId) && Objects.equals(bindingSetString, row.bindingSetString); } return false; }
Source:
MptrXmlElementAccess(DivType div, Mets parent, InputStreamProviderInterface inputStreamProvider) { String href = null; try { linkedStructure.setOrder(div.getORDER()); href = div.getMptr().stream().findFirst().get().getHref(); URI uri = new URI(href); linkedStructure.setUri(uri); Mets child; try (InputStream in = inputStreamProvider.getInputStream(uri, true)) { child = MetsXmlElementAccess.readMets(in); } ensureParenthood(parent, child, inputStreamProvider); Structure linked = MetsXmlElementAccess.toWorkpiece(child, inputStreamProvider).getStructure(); linkedStructure.setLabel(linked.getLabel()); linkedStructure.setType(linked.getType()); } catch (IOException e) { throw new UncheckedIOException(e); } catch (URISyntaxException e) { throw new DataBindingException("Erroneous URI: \"" + href + "\" (" + e.getMessage() + ')', e); } }

Target:
MptrXmlElementAccess(DivType div, Mets parent, InputStreamProviderInterface inputStreamProvider) throws IOException { String href = null; try { linkedStructure.setOrder(div.getORDER()); href = div.getMptr().stream().findFirst().get().getHref(); URI uri = new URI(href); linkedStructure.setUri(uri); Mets child; try (InputStream inputStream = inputStreamProvider.getInputStream(uri, true)) { child = MetsXmlElementAccess.readMets(inputStream); } ensureParenthood(parent, child, inputStreamProvider); IncludedStructuralElement linked = MetsXmlElementAccess.toWorkpiece(child, inputStreamProvider).getRootElement(); linkedStructure.setLabel(linked.getLabel()); linkedStructure.setType(linked.getType()); } catch (URISyntaxException e) { throw new DataBindingException("Erroneous URI: \"" + href + "\" (" + e.getMessage() + ')', e); } }
Source:
private void postUninstalledEvent(String extensionId) { if (eventPublisher != null) { Event event = ExtensionEventFactory.createExtensionUninstalledEvent(extensionId); eventPublisher.post(event); } }

Target:
private void postUninstalledEvent(String extensionId) { Event event = ExtensionEventFactory.createExtensionUninstalledEvent(extensionId); eventPublisher.post(event); }
Source:
public void applySnapshot(DaoState snapshot) { allowDaoStateChange = true; assertDaoStateChange(); log.info("Apply snapshot with chain height {}", snapshot.getChainHeight()); daoState.setChainHeight(snapshot.getChainHeight()); daoState.getTxMap().clear(); daoState.getTxMap().putAll(snapshot.getTxMap()); daoState.getBlocks().clear(); daoState.getBlocks().addAll(snapshot.getBlocks()); daoState.getCycles().clear(); daoState.getCycles().addAll(snapshot.getCycles()); daoState.getUnspentTxOutputMap().clear(); daoState.getUnspentTxOutputMap().putAll(snapshot.getUnspentTxOutputMap()); daoState.getSpentInfoMap().clear(); daoState.getSpentInfoMap().putAll(snapshot.getSpentInfoMap()); daoState.getConfiscatedLockupTxList().clear(); daoState.getConfiscatedLockupTxList().addAll(snapshot.getConfiscatedLockupTxList()); daoState.getIssuanceMap().clear(); daoState.getIssuanceMap().putAll(snapshot.getIssuanceMap()); daoState.getParamChangeList().clear(); daoState.getParamChangeList().addAll(snapshot.getParamChangeList()); daoState.getEvaluatedProposalList().clear(); daoState.getEvaluatedProposalList().addAll(snapshot.getEvaluatedProposalList()); daoState.getDecryptedBallotsWithMeritsList().clear(); daoState.getDecryptedBallotsWithMeritsList().addAll(snapshot.getDecryptedBallotsWithMeritsList()); }

Target:
public void applySnapshot(DaoState snapshot) { allowDaoStateChange = true; assertDaoStateChange(); log.info("Apply snapshot with chain height {}", snapshot.getChainHeight()); daoState.setChainHeight(snapshot.getChainHeight()); daoState.setTxCache(snapshot.getTxCache()); daoState.getBlocks().clear(); daoState.getBlocks().addAll(snapshot.getBlocks()); daoState.getCycles().clear(); daoState.getCycles().addAll(snapshot.getCycles()); daoState.getUnspentTxOutputMap().clear(); daoState.getUnspentTxOutputMap().putAll(snapshot.getUnspentTxOutputMap()); daoState.getSpentInfoMap().clear(); daoState.getSpentInfoMap().putAll(snapshot.getSpentInfoMap()); daoState.getConfiscatedLockupTxList().clear(); daoState.getConfiscatedLockupTxList().addAll(snapshot.getConfiscatedLockupTxList()); daoState.getIssuanceMap().clear(); daoState.getIssuanceMap().putAll(snapshot.getIssuanceMap()); daoState.getParamChangeList().clear(); daoState.getParamChangeList().addAll(snapshot.getParamChangeList()); daoState.getEvaluatedProposalList().clear(); daoState.getEvaluatedProposalList().addAll(snapshot.getEvaluatedProposalList()); daoState.getDecryptedBallotsWithMeritsList().clear(); daoState.getDecryptedBallotsWithMeritsList().addAll(snapshot.getDecryptedBallotsWithMeritsList()); }
Source:
public void visitToken(DetailAST token) { switch (token.getType()) { case TokenTypes.CLASS_DEF: final DetailAST serviceClientAnnotationToken = getServiceClientAnnotation(token); final String className = token.findFirstToken(TokenTypes.IDENT).getText(); hasServiceClientBuilderAnnotation = serviceClientAnnotationToken != null; if (hasServiceClientBuilderAnnotation) { if (!hasServiceClientsAnnotationProperty(serviceClientAnnotationToken)) { log(serviceClientAnnotationToken, String.format( "Annotation @%s should have ''serviceClients'' as property of annotation and should list all of the service clients it can build.", SERVICE_CLIENT_BUILDER)); } if (!className.endsWith("ClientBuilder")) { log(token, String.format("@ServiceClientBuilder class ''%s''should be named <ServiceName>ClientBuilder.", className)); } } else { if (className.endsWith("ClientBuilder")) { log(token, String.format("Class ''%s'' should be annotated with @ServiceClientBuilder.", className)); } } break; case TokenTypes.METHOD_DEF: if (!hasServiceClientBuilderAnnotation) { return; } if (hasAsyncClientBuilder && hasClientBuilder) { return; } final String methodName = token.findFirstToken(TokenTypes.IDENT).getText(); if (BUILD_ASYNC_CLIENT.equals(methodName)) { hasAsyncClientBuilder = true; } if (BUILD_CLIENT.equals(methodName)) { hasClientBuilder = true; } break; default: break; } }

Target:
public void visitToken(DetailAST token) { switch (token.getType()) { case TokenTypes.CLASS_DEF: hasServiceClientBuilderAnnotationStack.push(hasServiceClientBuilderAnnotation); hasBuildMethodStack.push(hasBuildMethod); final DetailAST serviceClientAnnotationBuilderToken = getServiceClientBuilderAnnotation(token); final String className = token.findFirstToken(TokenTypes.IDENT).getText(); hasServiceClientBuilderAnnotation = serviceClientAnnotationBuilderToken != null; if (hasServiceClientBuilderAnnotation) { if (!className.endsWith("ClientBuilder")) { log(token, String.format("Class annotated with @ServiceClientBuilder ''%s'' should be named <ServiceName>ClientBuilder.", className)); } } else { if (className.endsWith("ClientBuilder")) { log(token, String.format("Class ''%s'' should be annotated with @ServiceClientBuilder.", className)); } } break; case TokenTypes.METHOD_DEF: if (!hasServiceClientBuilderAnnotation) { return; } final String methodName = token.findFirstToken(TokenTypes.IDENT).getText(); if (!methodName.startsWith("build")) { break; } hasBuildMethod = true; if (!methodName.endsWith("Client")) { log(token, String.format( "@ServiceClientBuilder class should not have a method name, ''%s'' starting with ''build'' but not ending with ''Client''." , methodName)); } break; default: break; } }
Source:
public void setListeners(StatsStorageRouter statsStorage, Collection<? extends IterationListener> listeners) { StatsStorageRouterProvider routerProvider = null; if(listeners != null ){ for(IterationListener l : listeners){ if(l instanceof RoutingIterationListener){ RoutingIterationListener rl = (RoutingIterationListener)l; if(rl.getStorageRouter() == null){ log.warn("RoutingIterationListener provided without providing any StatsStorage instance. Iterator may not function without one. Listener: {}", l); } else if(!(rl.getStorageRouter() instanceof Serializable)){ throw new IllegalStateException("RoutingIterationListener provided with non-serializable storage router"); } if(routerProvider == null){ routerProvider = new VanillaStatsStorageRouterProvider(); } } } } this.listeners.clear(); if(listeners != null) { this.listeners.addAll(listeners); if (trainingMaster != null) trainingMaster.setListeners(statsStorage, this.listeners); } }

Target:
public void setListeners( StatsStorageRouter statsStorage, Collection<? extends IterationListener> listeners) { StatsStorageRouterProvider routerProvider = null; if (listeners != null) { for (IterationListener l : listeners) { if (l instanceof RoutingIterationListener) { RoutingIterationListener rl = (RoutingIterationListener) l; if (statsStorage == null) { log.warn( "RoutingIterationListener provided without providing any StatsStorage instance. Iterator may not function without one. Listener: {}", l); } else if (!(rl.getStorageRouter() instanceof Serializable)) { throw new IllegalStateException( "RoutingIterationListener provided with non-serializable storage router " + "\nRoutingIterationListener class: " + rl.getClass().getName() + "\nStatsStorageRouter class: " + statsStorage.getClass().getName()); } if (routerProvider == null) { routerProvider = new VanillaStatsStorageRouterProvider(); } } } } this.listeners.clear(); if (listeners != null) { this.listeners.addAll(listeners); if (trainingMaster != null) trainingMaster.setListeners(statsStorage, this.listeners); } }
Source:
public void testInvalidJsonInput() throws IOException { String json = "{\n" + " \"h\\ello\": true,\n" + " \"foo\": [\"world\"]\n" + "}"; try { JsonReader reader = new JsonReader(reader(json)); reader.beginObject(); assertEquals("hello", reader.nextName()); fail(); } catch (IOException expected) { } }

Target:
public void testInvalidJsonInput() throws IOException { String json = "{\n" + " \"h\\ello\": true,\n" + " \"foo\": [\"world\"]\n" + "}"; JsonReader reader = new JsonReader(reader(json)); reader.beginObject(); try { reader.nextName(); fail(); } catch (IOException expected) { } }
Source:
public boolean selfComparison(ColumnReference cr, boolean forIndexExpression) throws StandardException{ ValueNode otherSide = null; JBitSet tablesReferenced; List<ColumnReference> lcr, rcr; lcr = leftOperand.getHashableJoinColumnReference(); if(lcr != null && !lcr.isEmpty()){ int bound = forIndexExpression ? lcr.size() : 1; for (int i = 0; i < bound; i++) { if (lcr.get(i) == cr) { otherSide = rightOperand; break; } } } if (otherSide == null) { rcr = rightOperand.getHashableJoinColumnReference(); if (rcr != null && !rcr.isEmpty()) { int bound = forIndexExpression ? rcr.size() : 1; for (int i = 0; i < bound; i++) { if (rcr.get(i) == cr) { otherSide = leftOperand; break; } } } } if (otherSide == null) { if(SanityManager.DEBUG){ SanityManager.THROWASSERT( "ColumnReference not found on either side of binary comparison."); } } assert otherSide != null; tablesReferenced=otherSide.getTablesReferenced(); return tablesReferenced.get(cr.getTableNumber()); }

Target:
public boolean selfComparison(ColumnReference cr, boolean forIndexExpression) throws StandardException{ ValueNode otherSide = null; JBitSet tablesReferenced; List<ColumnReference> lcr, rcr; lcr = leftOperand.getHashableJoinColumnReference(); if(lcr != null && !lcr.isEmpty()){ if (forIndexExpression || lcr.size() == 1) { for (ColumnReference columnReference : lcr) { if (columnReference.equals(cr)) { otherSide = rightOperand; break; } } } } if (otherSide == null) { rcr = rightOperand.getHashableJoinColumnReference(); if (rcr != null && !rcr.isEmpty()) { if (forIndexExpression || rcr.size() == 1) { for (ColumnReference columnReference : rcr) { if (columnReference.equals(cr)) { otherSide = leftOperand; break; } } } } } if (otherSide == null) { if(SanityManager.DEBUG){ SanityManager.THROWASSERT( "ColumnReference not found on either side of binary comparison."); } } assert otherSide != null; tablesReferenced=otherSide.getTablesReferenced(); return tablesReferenced.get(cr.getTableNumber()); }
Source:
public void shouldRecordSuccessTestExecutionWhenSaveAll() { String oldValue = System.getProperty("RECORDER_SAVE_ALL"); System.setProperty("RECORDER_SAVE_ALL", "true"); TestRecorderRule testRecorderRule = new TestRecorderRule(); Description shouldNotRecordSuccessTestExecutionByDefault = Description.createTestDescription("org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest", "shouldRecordSuccessTestExecutionWhenSaveAll"); testRecorderRule.starting(shouldNotRecordSuccessTestExecutionByDefault); System.out.println("Hello World"); testRecorderRule.succeeded(shouldNotRecordSuccessTestExecutionByDefault); testRecorderRule.finished(shouldNotRecordSuccessTestExecutionByDefault); File outputFile = new File("target", "org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest-shouldRecordSuccessTestExecutionWhenSaveAll.mov"); assertThat(outputFile.exists(), is(true)); if(oldValue != null) { System.setProperty("RECORDER_SAVE_ALL", oldValue); } else { System.clearProperty("RECORDER_SAVE_ALL"); } outputFile.delete(); }

Target:
public void shouldRecordSuccessTestExecutionWhenSaveAll() { TestRecorderRule.RECORDER_OPTION = TestRecorderRule.ALWAYS; TestRecorderRule testRecorderRule = new TestRecorderRule(); Description shouldNotRecordSuccessTestExecutionByDefault = Description.createTestDescription("org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest", "shouldRecordSuccessTestExecutionWhenSaveAll"); testRecorderRule.starting(shouldNotRecordSuccessTestExecutionByDefault); System.out.println("Hello World"); testRecorderRule.succeeded(shouldNotRecordSuccessTestExecutionByDefault); testRecorderRule.finished(shouldNotRecordSuccessTestExecutionByDefault); File outputFile = new File("target", "org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest-shouldRecordSuccessTestExecutionWhenSaveAll.mov"); assertThat(outputFile.exists(), is(true)); TestRecorderRule.RECORDER_OPTION = TestRecorderRule.FAILURES; outputFile.delete(); }
Source:
public org.jclouds.openstack.ceilometer.v2.CeilometerApiMetadata build() { return new org.jclouds.openstack.ceilometer.v2.CeilometerApiMetadata(this); }

Target:
public CeilometerApiMetadata build() { return new CeilometerApiMetadata(this); }
Source:
private X509Certificate[] loadCertificateCollection(String[] certificates) throws IOException, CertificateException { logger.debug("Load certificates collection"); CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); List<X509Certificate> collections = new ArrayList<X509Certificate>(); for(int i = 0; i < certificates.length; i++) { String certificate = certificates[i]; try(InputStream in = new FileInputStream(certificate)) { List<X509Certificate> certificatesChains = (List<X509Certificate>) certificateFactory.generateCertificates(in); collections.addAll(certificatesChains); } } return collections.toArray(new X509Certificate[collections.size()]); }

Target:
private X509Certificate[] loadCertificateCollection(String[] certificates) throws IOException, CertificateException { logger.debug("Load certificates collection"); CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); List<X509Certificate> collections = new ArrayList<X509Certificate>(); for(int i = 0; i < certificates.length; i++) { String certificate = certificates[i]; logger.debug("Loading certificates from file " + certificate); try(InputStream in = new FileInputStream(certificate)) { List<X509Certificate> certificatesChains = (List<X509Certificate>) certificateFactory.generateCertificates(in); collections.addAll(certificatesChains); } } return collections.toArray(new X509Certificate[collections.size()]); }
Source:
public void requestWhenDisabled() throws Exception { Map<String, String> s = new HashMap<>(); s.put("url", "http://localhost:" + wireMockRule.port()); s.put("database", "test-db"); s.put("enabled", "false"); stubFor(any(urlPathEqualTo("/write")) .atPriority(10) .willReturn(aResponse() .withStatus(404) .withBody("{\"status\":\"Error\",\"message\":\"Should not be called\"}"))); InfluxDbOutputWriter writer = new InfluxDbOutputWriter(FAKE_CLOCK); writer.postConstruct(s); writer.writeQueryResult("foo", null, 1); writer.postCollect(); }

Target:
public void requestWhenDisabled() throws Exception { Map<String, String> s = new HashMap<>(); s.put("url", "http://localhost:" + wireMockRule.port()); s.put("database", "test-db"); s.put("enabled", "false"); InfluxDbOutputWriter writer = new InfluxDbOutputWriter(FAKE_CLOCK); writer.postConstruct(s); writer.writeQueryResult("foo", null, 1); writer.postCollect(); verify(exactly(0), getRequestedFor(urlEqualTo("/write"))); }
Source:
private void parseAndBuildConfig(Config config) throws Exception { Node w3cRootNode; YamlMapping yamlRootNode; try { yamlRootNode = ((YamlMapping) YamlLoader.load(in)); } catch (Exception ex) { throw new InvalidConfigurationException("Invalid YAML configuration", ex); } YamlNode imdgRoot = yamlRootNode.childAsMapping(ConfigSections.HAZELCAST.name().toLowerCase()); if (imdgRoot == null) { throw new InvalidConfigurationException("No mapping with hazelcast key is found in the provided configuration"); } w3cRootNode = W3cDomUtil.asW3cNode(imdgRoot); new YamlMemberDomConfigProcessor(true, config).buildConfig(w3cRootNode); }

Target:
private void parseAndBuildConfig(Config config) throws Exception { YamlMapping yamlRootNode; try { yamlRootNode = ((YamlMapping) YamlLoader.load(in)); } catch (Exception ex) { throw new InvalidConfigurationException("Invalid YAML configuration", ex); } YamlNode imdgRoot = yamlRootNode.childAsMapping(ConfigSections.HAZELCAST.name().toLowerCase()); if (imdgRoot == null) { throw new InvalidConfigurationException("No mapping with hazelcast key is found in the provided configuration"); } new YamlMemberDomConfigProcessor(true, config).buildConfig(W3cDomUtil.asW3cNode(imdgRoot)); }
Source:
public void visitToken(DetailAST ast) { if (!isSkipCase(ast)) { final DetailAST ident = ast.findFirstToken(TokenTypes.IDENT); final DetailAST assign = ast.findFirstToken(TokenTypes.ASSIGN); final DetailAST exprStart = assign.getFirstChild().getFirstChild(); final DetailAST type = ast.findFirstToken(TokenTypes.TYPE); if (isObjectType(type) && exprStart.getType() == TokenTypes.LITERAL_NULL) { log(ident, MSG_KEY, ident.getText(), "null"); } if (!onlyObjectReferences) { final int primitiveType = type.getFirstChild().getType(); if (primitiveType == TokenTypes.LITERAL_BOOLEAN && exprStart.getType() == TokenTypes.LITERAL_FALSE) { log(ident, MSG_KEY, ident.getText(), "false"); } if (isNumericType(primitiveType) && isZero(exprStart)) { log(ident, MSG_KEY, ident.getText(), "0"); } if (primitiveType == TokenTypes.LITERAL_CHAR && isZeroChar(exprStart)) { log(ident, MSG_KEY, ident.getText(), "\\0"); } } } }

Target:
public void visitToken(DetailAST ast) { if (!isSkipCase(ast)) { final DetailAST ident = ast.findFirstToken(TokenTypes.IDENT); final DetailAST assign = ast.findFirstToken(TokenTypes.ASSIGN); final DetailAST exprStart = assign.getFirstChild().getFirstChild(); final DetailAST type = ast.findFirstToken(TokenTypes.TYPE); if (isObjectType(type) && exprStart.getType() == TokenTypes.LITERAL_NULL) { log(ident, MSG_KEY, ident.getText(), "null"); } if (!onlyObjectReferences) { validateNonObjects(ast); } } }
Source:
private void setIcons() { for (int i = 0; i < tabs.size(); i++) { String tabNumber = tabs.get(i); TabLayout.Tab tabToSet = tabLayout.getTabAt(i); Context c = getContext(); if (tabToSet != null && c != null) { if (tabNumber.startsWith(TAB_NUMBER_KIOSK + "\t")) { String kiosk[] = tabNumber.split("\t"); if (kiosk.length == 2) { try { tabToSet.setIcon(KioskTranslator.getKioskIcons(kiosk[1], getContext())); } catch (Exception e) { } } } else if (tabNumber.startsWith(TAB_NUMBER_CHANNEL + "\t")) { tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_channel)); } else { switch (tabNumber) { case TAB_NUMBER_BLANK: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_hot)); break; case TAB_NUMBER_SUBSCIRPTIONS: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_channel)); break; case TAB_NUMBER_FEED: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.rss)); break; case TAB_NUMBER_BOOKMARKS: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_bookmark)); break; case TAB_NUMBER_HISTORY: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.history)); break; } } } } }

Target:
private void setIcons() { for (int i = 0; i < tabs.size(); i++) { String tabInformation = tabs.get(i); TabLayout.Tab tabToSet = tabLayout.getTabAt(i); Context c = getContext(); if (tabToSet != null && c != null) { if (tabInformation.startsWith(TAB_NUMBER_KIOSK + "\t")) { String kiosk[] = tabInformation.split("\t"); if (kiosk.length == 3) { tabToSet.setIcon(KioskTranslator.getKioskIcons(kiosk[1], getContext())); } } else if (tabInformation.startsWith(TAB_NUMBER_CHANNEL + "\t")) { tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_channel)); } else { switch (tabInformation) { case TAB_NUMBER_BLANK: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_hot)); break; case TAB_NUMBER_SUBSCIRPTIONS: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_channel)); break; case TAB_NUMBER_FEED: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.rss)); break; case TAB_NUMBER_BOOKMARKS: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.ic_bookmark)); break; case TAB_NUMBER_HISTORY: tabToSet.setIcon(ThemeHelper.resolveResourceIdFromAttr(getContext(), R.attr.history)); break; } } } } }
Source:
@Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); setCancelable(false); if (getArguments() != null) { this.title = getArguments().getString(ARGS_TITLE); this.message = getArguments().getString(ARGS_MESSAGE); this.cancel = getArguments().getString(ARGS_CANCEL); } }

Target:
@Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); setCancelable(false); if (getArguments() != null) { mTitle = getArguments().getString(ARGS_TITLE); mMessage = getArguments().getString(ARGS_MESSAGE); mCancel = getArguments().getString(ARGS_CANCEL); } }
Source:
private void prepareSolutionFile(File file) { try { List<String> lines = FileUtils.readLines(file); List<String> parsedLines = new ArrayList<>(); for (String line : lines) { if (line.contains(beginSolution) || line.contains(endSolution) || line.contains(stubMarker)) { continue; } parsedLines.add(line); } FileUtils.writeLines(file, parsedLines); } catch (IOException ex) { System.out.println("Unexpected IOException, preparation of file {" + file.getAbsolutePath() + "} interrupted"); } }

Target:
private void prepareSolutionFile(File file) { try { List<String> lines = Files.readAllLines(file.toPath(), charset); List<String> filteredLines = new ArrayList<>(); for (String line : lines) { if (line.contains(beginSolution) || line.contains(endSolution) || line.contains(stubMarker)) { continue; } filteredLines.add(line); } Files.write(file.toPath(), filteredLines, charset); } catch (IOException ex) { throw new RuntimeException("Unexpected IOException, preparation of file {" + file.getAbsolutePath() + "} interrupted", ex); } }
Source:
private void afterInitialSchemaRefresh(CqlIdentifier keyspace) { try { nodeStateManager.markInitialized(); context.getLoadBalancingPolicyWrapper().init(); context.getConfigLoader().onDriverInit(context); LOG.debug("[{}] Initialization complete, ready", logPrefix); poolManager .init(keyspace) .whenComplete( (v, error) -> { if (error != null) { initFuture.completeExceptionally(error); } else { notifyLifecycleListeners(); initFuture.complete(DefaultSession.this); } }); } catch (Throwable throwable) { forceCloseAsync() .whenComplete( (v, error) -> { initFuture.completeExceptionally(throwable); }); } }

Target:
private void afterInitialSchemaRefresh(CqlIdentifier keyspace) { try { nodeStateManager.markInitialized(); context.getLoadBalancingPolicyWrapper().init(); context.getConfigLoader().onDriverInit(context); LOG.debug("[{}] Initialization complete, ready", logPrefix); poolManager .init(keyspace) .whenComplete( (v, error) -> { if (error != null) { initFuture.completeExceptionally(error); } else { initFuture.complete(DefaultSession.this); notifyLifecycleListeners(); } }); } catch (Throwable throwable) { forceCloseAsync() .whenComplete( (v, error) -> { initFuture.completeExceptionally(throwable); }); } }
Source:
protected String velocify(String tpl) { try { StringWriter w = new StringWriter(); Velocity.evaluate(velocityContext, w, "OutgoingEmail", tpl); return w.toString(); } catch(Exception e) { return tpl.toString(); } }

Target:
protected String velocify(String tpl) throws EmailException { try { StringWriter w = new StringWriter(); Velocity.evaluate(velocityContext, w, "OutgoingEmail", tpl); return w.toString(); } catch(Exception e) { throw new EmailException("Velocity template "+ tpl.toString(), e); } }
Source:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); newsList = (RecyclerView) view.findViewById(R.id.news_list); newsList.setHasFixedSize(true); LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); newsList.setLayoutManager(layoutManager); dataset = new ArrayList<>(0); newsAdapter = new NewsAdapter(dataset); newsList.setAdapter(newsAdapter); RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST); this.newsList.addItemDecoration(itemDecoration); subscription = stories.subscribe(new Subscriber<List<ItemPOJO>>() { @Override public void onCompleted() { newsAdapter.notifyDataSetChanged(); Log.d("stories", "completed"); } @Override public void onError(Throwable e) { Log.d("stories err", e.toString()); } @Override public void onNext(List<ItemPOJO> itemPOJOs) { Log.d("stories", String.valueOf(itemPOJOs.size())); for (ItemPOJO item : itemPOJOs) { dataset.add(item); } } }); }

Target:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); newsList = (RecyclerView) view.findViewById(R.id.news_list); LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); newsList.setLayoutManager(layoutManager); dataset = new ArrayList<>(); newsAdapter = new NewsAdapter(dataset); newsList.setAdapter(newsAdapter); RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST); this.newsList.addItemDecoration(itemDecoration); subscription = stories.subscribe(new Subscriber<List<ItemPOJO>>() { @Override public void onCompleted() { newsAdapter.notifyDataSetChanged(); Log.d("stories", "completed"); } @Override public void onError(Throwable e) { Log.d("stories err", e.toString()); } @Override public void onNext(List<ItemPOJO> itemPOJOs) { Log.d("stories", String.valueOf(itemPOJOs.size())); dataset.addAll(itemPOJOs); } }); }
Source:
private static String getModules(Map<String, ModuleService> modules) { StringBuilder sb = new StringBuilder(String.format("Available Modules:%n")); for(ModuleService entry : modules.values()) { sb.append( String.format(" %-10s - %s", entry.getName(), entry.getDescription()) ); } return sb.toString(); }

Target:
private static String getModules(Map<String, ModuleService> modules) { StringBuilder sb = new StringBuilder("Available Modules:"); for(ModuleService entry : modules.values()) { sb.append( String.format("%n %-10s - %s", entry.getName(), entry.getDescription()) ); } return sb.toString(); }
Source:
Loader create(QueryExecutor queryExecutor, String tableName) throws SQLException { List<JDBCType> columnTypes = queryExecutor.executeQuery("SELECT * FROM " + tableName + " LIMIT 1").getColumnTypes(); try { return new BatchLoader(queryExecutor, tableName, columnTypes.size()); } catch (SQLException sqlException) { LOGGER.debug("Unable to insert data with PreparedStatement", sqlException); return new InsertLoader(queryExecutor, tableName, columnTypes); } }

Target:
Loader create(QueryExecutor queryExecutor, String tableName) throws SQLException { List<JDBCType> columnTypes = queryExecutor.executeQuery("SELECT * FROM " + tableName + " LIMIT 1").getColumnTypes(); try { return new BatchLoader(queryExecutor, tableName, columnTypes.size()); } catch (SQLException sqlException) { LOGGER.warn("Unable to insert data with PreparedStatement", sqlException); return new InsertLoader(queryExecutor, tableName, columnTypes); } }
Source:
private static Timestamp formatBirthDate(Timestamp birthDate, final int dateOnlyLength, PRPAMT201306UV02LivingSubjectBirthTime birthTime) { Timestamp parseBirthDate = birthDate; IVLTSExplicit birthday = birthTime.getValue().get(0); LOG.info("Found birthTime in query parameters = " + birthday.getValue()); UTCDateUtil utcDateUtil = new UTCDateUtil(); if (birthday.getValue().length() == dateOnlyLength) { parseBirthDate = new Timestamp(utcDateUtil.parseDate(birthday.getValue(), UTCDateUtil.DATE_ONLY_FORMAT, null).getTime()); } else if (birthday.getValue().length() > dateOnlyLength) { parseBirthDate = new Timestamp( utcDateUtil.parseDate(birthday.getValue(), UTCDateUtil.DATE_FORMAT_UTC, null).getTime()); } else { LOG.info("message does not contain a valid formatted birthtime"); } return parseBirthDate; }

Target:
private static Timestamp formatBirthDate(Timestamp birthDate, final int dateOnlyLength, PRPAMT201306UV02LivingSubjectBirthTime birthTime) { Timestamp parseBirthDate = birthDate; IVLTSExplicit birthday = birthTime.getValue().get(0); LOG.info("Found birthTime in query parameters ", birthday.getValue()); UTCDateUtil utcDateUtil = new UTCDateUtil(); if (birthday.getValue().length() == dateOnlyLength) { parseBirthDate = new Timestamp(utcDateUtil.parseDate(birthday.getValue(), UTCDateUtil.DATE_ONLY_FORMAT, null).getTime()); } else if (birthday.getValue().length() > dateOnlyLength) { parseBirthDate = new Timestamp( utcDateUtil.parseDate(birthday.getValue(), UTCDateUtil.DATE_FORMAT_UTC, null).getTime()); } else { LOG.info("message does not contain a valid formatted birthtime"); } return parseBirthDate; }
Source:
private boolean initGlusterHost() { glusterHostUuidFound = true; if (GlusterFeatureSupported.glusterHostUuidSupported(getVdsGroup().getcompatibility_version())) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterHostUUID, new VdsIdVDSCommandParametersBase(getVds().getId())); Guid addServerGlusterUuid = Guid.createGuidFromString((String) returnValue.getReturnValue()); if (returnValue.getSucceeded() && returnValue.getReturnValue() != null) { if (!validateGlusterHostUuid(addServerGlusterUuid)) { glusterHostUuidFound = true; setNonOperational(NonOperationalReason.GLUSTER_HOST_UUID_ALREADY_FOUND, null); return false; } saveGlusterHostUuid(addServerGlusterUuid); } else { glusterHostUuidFound = false; setNonOperational(NonOperationalReason.GLUSTER_HOST_UUID_NOT_FOUND, null); } } return glusterHostUuidFound && initGlusterPeerProcess(); }

Target:
private boolean initGlusterHost() { glusterHostUuidFound = true; if (GlusterFeatureSupported.glusterHostUuidSupported(getVdsGroup().getcompatibility_version())) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterHostUUID, new VdsIdVDSCommandParametersBase(getVds().getId())); Guid addedServerUuid = Guid.createGuidFromString((String) returnValue.getReturnValue()); if (returnValue.getSucceeded() && returnValue.getReturnValue() != null) { if (!checkIfHostUuidExists(addedServerUuid)) { glusterHostUuidFound = true; setNonOperational(NonOperationalReason.GLUSTER_HOST_UUID_ALREADY_EXISTS, null); return false; } saveGlusterHostUuid(addedServerUuid); } else { glusterHostUuidFound = false; setNonOperational(NonOperationalReason.GLUSTER_HOST_UUID_NOT_FOUND, null); } } return glusterHostUuidFound && initGlusterPeerProcess(); }