auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void start() { this.des = new DefaultExecutorService(cache); }

Target:
public void start() { this.des = SecurityActions.getDefaultExecutorService(cache); }
Source:
public void onConnect(IClient client, RequestFunction function, AMFDataList params) { WMSProperties properties = client.getProperties(); String rtmpUrl = properties.getPropertyStr(Constants.CLIENT_PROPERTY_CONNECT_URL); String IP = client.getIp(); logger.debug("Geting url: " + rtmpUrl+ " from client "+ IP); try { HashMap<String, String> queryParameters = Utils.getRtmpUrlParameters(rtmpUrl, client.getQueryStr()); onClientConnect(properties, queryParameters); } catch (Exception e) { logger.error("Entry authentication failed with url [" + rtmpUrl + "]: " + e.getMessage()); client.rejectConnection(); sendClientOnStatusError((IClient)client, "NetStream.Play.Failed","Unable to authenticate url; [" + rtmpUrl + "]: " + e.getMessage()); EntriesDataProvider.addRejectedStream(e.getMessage(), client); } }

Target:
public void onConnect(IClient client, RequestFunction function, AMFDataList params) { WMSProperties properties = client.getProperties(); String rtmpUrl = properties.getPropertyStr(Constants.CLIENT_PROPERTY_CONNECT_URL); String IP = client.getIp(); logger.debug("Geting url: " + rtmpUrl+ " from client "+ IP); try { HashMap<String, String> queryParameters = Utils.getRtmpUrlParameters(rtmpUrl, client.getQueryStr()); onClientConnect(properties, queryParameters); } catch (Exception e) { logger.error("Entry authentication failed with url [" + rtmpUrl + "]: " + e.getMessage()); client.rejectConnection(); sendClientOnStatusError((IClient)client, "NetStream.Play.Failed","Unable to authenticate url; [" + rtmpUrl + "]: " + e.getMessage()); DiagnosticsProvider.addRejectedStream(e.getMessage(), client); } }
Source:
public String toString() { return "MockConnection{" + "localEndpoint=" + localEndpoint + ", remoteNodeEngine=" + remoteNodeEngine + ", alive=" + isAlive() + '}'; }

Target:
public String toString() { return "MockConnection{" + "localEndpoint=" + localEndpoint + ", remoteEndpoint=" + remoteEndpoint + ", alive=" + isAlive() + '}'; }
Source:
public void testFailed() throws Exception { Path manyMaps = new Path("file://" + root.getRoot().getAbsolutePath() + "/manyMaps"); fs.create(new Path(manyMaps, SortedLogState.FAILED.getMarker())).close(); RecoveryLogReader reader = new RecoveryLogReader(fs, manyMaps); IntWritable key = new IntWritable(); BytesWritable value = new BytesWritable(); for (int i = 0; i < 1000; i++) { if (i == 10) continue; assertTrue(reader.next(key, value)); assertEquals(i, key.get()); } reader.close(); }

Target:
public void testFailed() throws Exception { Path manyMaps = new Path("file://" + root.getRoot().getAbsolutePath() + "/manyMaps"); fs.create(new Path(manyMaps, SortedLogState.FAILED.getMarker())).close(); RecoveryLogReader reader = new RecoveryLogReader(fs, manyMaps); IntWritable key = new IntWritable(); BytesWritable value = new BytesWritable(); for (int i = 0; i < 1000; i++) { if (i == 10) continue; assertTrue(reader.next(key, value)); assertEquals(i, key.get()); } reader.close(); assertTrue(fs.delete(new Path(manyMaps, SortedLogState.FAILED.getMarker()))); }
Source:
private void checkOpenGL() { boolean[] requiredCapabilities = { GLContext.getCapabilities().OpenGL11, GLContext.getCapabilities().OpenGL12, GLContext.getCapabilities().OpenGL14, GLContext.getCapabilities().OpenGL15, GLContext.getCapabilities().GL_ARB_framebuffer_object, GLContext.getCapabilities().GL_ARB_texture_float, GLContext.getCapabilities().GL_ARB_half_float_pixel, GLContext.getCapabilities().GL_ARB_shader_objects}; requiredCapabilities[3] = false; String[] capabilityNames = {"OpenGL11", "OpenGL12", "OpenGL14", "OpenGL15", "GL_ARB_framebuffer_object", "GL_ARB_texture_float", "GL_ARB_half_float_pixel", "GL_ARB_shader_objects"}; boolean canRunTheGame = true; String missingCapabilitiesMessage = ""; for (int index = 0; index < requiredCapabilities.length; index++) { if (!requiredCapabilities[index]) { missingCapabilitiesMessage += " - " + capabilityNames[index] + "\n"; canRunTheGame = false; } } if (!canRunTheGame) { String completeErrorMessage = completeErrorMessage(missingCapabilitiesMessage); logger.error(completeErrorMessage); JOptionPane.showMessageDialog(null, completeErrorMessage, "Required OpenGL version(s) or extension(s) not supported", JOptionPane.ERROR_MESSAGE); System.exit(1); } }

Target:
private void checkOpenGL() { boolean[] requiredCapabilities = { GLContext.getCapabilities().OpenGL12, GLContext.getCapabilities().OpenGL14, GLContext.getCapabilities().OpenGL15, GLContext.getCapabilities().GL_ARB_framebuffer_object, GLContext.getCapabilities().GL_ARB_texture_float, GLContext.getCapabilities().GL_ARB_half_float_pixel, GLContext.getCapabilities().GL_ARB_shader_objects}; String[] capabilityNames = {"OpenGL12", "OpenGL14", "OpenGL15", "GL_ARB_framebuffer_object", "GL_ARB_texture_float", "GL_ARB_half_float_pixel", "GL_ARB_shader_objects"}; boolean canRunTheGame = true; String missingCapabilitiesMessage = ""; for (int index = 0; index < requiredCapabilities.length; index++) { if (!requiredCapabilities[index]) { missingCapabilitiesMessage += " - " + capabilityNames[index] + "\n"; canRunTheGame = false; } } if (!canRunTheGame) { String completeErrorMessage = completeErrorMessage(missingCapabilitiesMessage); throw new IllegalStateException(completeErrorMessage); } }
Source:
private List<String> getUpdateableStacks(String envCrn) { StackViewV4Responses stackViewV4Responses = stackV4Endpoint.list(0L, envCrn, false); return stackViewV4Responses.getResponses().stream(). filter(stack -> !SKIPPED_STATES.contains(stack.getCluster().getStatus())) .map(stack -> stack.getName()) .collect(Collectors.toList()); }

Target:
private List<String> getUpdateableStacks(String envCrn) { StackViewV4Responses stackViewV4Responses = stackV4Endpoint.list(0L, envCrn, false); return stackViewV4Responses.getResponses().stream(). filter(stack -> !SKIPPED_STATES.contains(stack.getCluster().getStatus())) .map(stack -> stack.getCrn()) .collect(Collectors.toList()); }
Source:
public void exec(final Context ctx) throws IOException { final String uri = ctx.memo().read().xpath("/memo/uri/text()").get(0); final Repo repo = this.github.repos().get( new Coordinates.Simple( URI.create(uri).getPath() .replaceFirst("/", "").replaceFirst("\\.git", "") ) ); final XML content = new YamlXML( IOUtils.toString(repo.contents().get(".thindeck.yml").raw()) ).get(); final Directives dirs = new Directives() .xpath("/memo").addIf("domains"); for (final String domain : content.xpath(" dirs.xpath("/memo/domains").add("domain").set(domain); } dirs.up().up().addIf("ports"); for (final String port : content.xpath(" dirs.xpath("/memo/ports").add("port").set(port); } ctx.memo().update(dirs); }

Target:
public void exec(final Context ctx) throws IOException { final String uri = ctx.memo().read().xpath("/memo/uri/text()").get(0); final Repo repo = this.github.repos().get( new Coordinates.Simple( URI.create(uri).getPath() .replaceFirst("/", "").replaceFirst("\\.git", "") ) ); final XML content = new YamlXML( IOUtils.toString( repo.contents().get(".thindeck.yml").raw(), CharEncoding.UTF_8 ) ).get(); final Directives dirs = new Directives() .xpath("/memo").addIf("domains"); for (final String domain : content.xpath(" dirs.xpath("/memo/domains").add("domain").set(domain); } dirs.up().up().addIf("ports"); for (final String port : content.xpath(" dirs.xpath("/memo/ports").add("port").set(port); } ctx.memo().update(dirs); }
Source:
public void itemChanged(T item) { if (item != null && getView().asWidget().isVisible()) { getView().setMainTabSelectedItem(item); } else if (item == null && getView().asWidget().isVisible() && modelProvider.getMainModel().getItems().isEmpty()) { placeManager.revealPlace(getMainTabRequest()); } }

Target:
public void itemChanged(T item) { boolean widgetVisible = getView().asWidget().isVisible(); if (item != null && widgetVisible) { getView().setMainTabSelectedItem(item); } else if (item == null && widgetVisible && modelProvider.getMainModel().getItems().isEmpty()) { placeManager.revealPlace(getMainTabRequest()); } }
Source:
public void setUp() throws Exception { verifierWebWorkerConnection = spy(new VerifierWebWorkerConnectionImpl(initialize, "verifier/dtableVerifier/dtableVerifier.nocache.js", poster, receiver) { @Override Worker createWorker() { return worker; } }); }

Target:
public void setUp() { verifierWebWorkerConnection = spy(new VerifierWebWorkerConnectionImpl(initialize, "verifier/dtableVerifier/dtableVerifier.nocache.js", poster, receiver) { @Override protected Worker createWorker() { return worker; } }); }
Source:
private static long parseEnumEnumerator(CommonTree enumerator, EnumDeclaration enumDeclaration, long lastHigh) throws ParseException { List<CommonTree> children = enumerator.getChildren(); long low = 0, high = 0; boolean valueSpecified = false; String label = null; for (CommonTree child : children) { if (isUnaryString(child)) { label = parseUnaryString(child); } else if (child.getType() == CTFParser.ENUM_VALUE) { valueSpecified = true; low = parseUnaryInteger((CommonTree) child.getChild(0)); high = low; } else if (child.getType() == CTFParser.ENUM_VALUE_RANGE) { valueSpecified = true; low = parseUnaryInteger((CommonTree) child.getChild(0)); high = parseUnaryInteger((CommonTree) child.getChild(1)); } else { childTypeError(child); } } if (!valueSpecified) { low = lastHigh + 1; high = low; } if (low > high) { throw new ParseException("enum low value greater than high value"); } if (!enumDeclaration.add(low, high, label)) { throw new ParseException("enum declarator values overlap."); } if (valueSpecified && (BigInteger.valueOf(low).compareTo(enumDeclaration.getContainerType().getMinValue()) == -1 || BigInteger.valueOf(high).compareTo(enumDeclaration.getContainerType().getMaxValue()) == 1)) { throw new ParseException("enum value is not in range"); } return high; }

Target:
private static long parseEnumEnumerator(CommonTree enumerator, EnumDeclaration enumDeclaration, long lastHigh) throws ParseException { List<CommonTree> children = enumerator.getChildren(); long low = 0, high = 0; boolean valueSpecified = false; String label = null; for (CommonTree child : children) { if (isAnyUnaryString(child)) { label = parseUnaryString(child); } else if (child.getType() == CTFParser.ENUM_VALUE) { valueSpecified = true; low = parseUnaryInteger((CommonTree) child.getChild(0)); high = low; } else if (child.getType() == CTFParser.ENUM_VALUE_RANGE) { valueSpecified = true; low = parseUnaryInteger((CommonTree) child.getChild(0)); high = parseUnaryInteger((CommonTree) child.getChild(1)); } else { childTypeError(child); } } if (!valueSpecified) { low = lastHigh + 1; high = low; } if (low > high) { throw new ParseException("enum low value greater than high value"); } if (!enumDeclaration.add(low, high, label)) { throw new ParseException("enum declarator values overlap."); } if (valueSpecified && (BigInteger.valueOf(low).compareTo(enumDeclaration.getContainerType().getMinValue()) == -1 || BigInteger.valueOf(high).compareTo(enumDeclaration.getContainerType().getMaxValue()) == 1)) { throw new ParseException("enum value is not in range"); } return high; }
Source:
private static LintAnnotationsModel getAnnotations(@NonNull NlModel model, @NonNull ProgressIndicator progress) { assert ApplicationManager.getApplication().isReadAccessAllowed(); LintAnnotationsModel lintModel = new LintAnnotationsModel(); XmlFile xmlFile = model.getFile(); AndroidLintExternalAnnotator annotator = new AndroidLintExternalAnnotator(); State state = annotator.collectInformation(xmlFile); state = annotator.doAnnotate(state); if (state == null) { return lintModel; } for (ProblemData problemData : state.getProblems()) { if (progress.isCanceled()) { break; } TextRange range = problemData.getTextRange(); if (range.getStartOffset() == range.getEndOffset()) { continue; } final PsiElement startElement = xmlFile.findElementAt(range.getStartOffset()); final PsiElement endElement = xmlFile.findElementAt(range.getEndOffset()); if (startElement == null || endElement == null) { continue; } NlComponent component = model.findViewByPsi(startElement); if (component == null) { continue; } Issue issue = problemData.getIssue(); Pair<AndroidLintInspectionBase, HighlightDisplayLevel> pair = AndroidLintUtil.getHighlighLevelAndInspection(xmlFile.getProject(), issue, xmlFile); if (pair == null) { continue; } AndroidLintInspectionBase inspection = pair.getFirst(); if (inspection == null) { continue; } HighlightDisplayLevel level = pair.getSecond(); HighlightDisplayKey key = HighlightDisplayKey.find(inspection.getShortName()); if (key == null) { continue; } lintModel.addIssue(component, inspection, level); } return lintModel; }

Target:
private static LintAnnotationsModel getAnnotations(@NonNull NlModel model, @NonNull ProgressIndicator progress) { ApplicationManager.getApplication().assertReadAccessAllowed(); LintAnnotationsModel lintModel = new LintAnnotationsModel(); XmlFile xmlFile = model.getFile(); AndroidLintExternalAnnotator annotator = new AndroidLintExternalAnnotator(); State state = annotator.collectInformation(xmlFile); state = annotator.doAnnotate(state); if (state == null) { return lintModel; } for (ProblemData problemData : state.getProblems()) { if (progress.isCanceled()) { break; } TextRange range = problemData.getTextRange(); final PsiElement startElement = xmlFile.findElementAt(range.getStartOffset()); final PsiElement endElement = xmlFile.findElementAt(range.getEndOffset()); if (startElement == null || endElement == null) { continue; } NlComponent component = model.findViewByPsi(startElement); if (component == null) { continue; } Issue issue = problemData.getIssue(); Pair<AndroidLintInspectionBase, HighlightDisplayLevel> pair = AndroidLintUtil.getHighlighLevelAndInspection(xmlFile.getProject(), issue, xmlFile); if (pair == null) { continue; } AndroidLintInspectionBase inspection = pair.getFirst(); if (inspection == null) { continue; } HighlightDisplayLevel level = pair.getSecond(); HighlightDisplayKey key = HighlightDisplayKey.find(inspection.getShortName()); if (key == null) { continue; } lintModel.addIssue(component, inspection, level); } return lintModel; }
Source:
public UpdateVmCommand(T parameters) { super(parameters); if (getVdsGroup() != null) { setStoragePoolId(getVdsGroup().getStoragePoolId()); } if (isVmExist()) { setCustomDefinedProperties(parameters.getVmStaticData()); setCustomDefinedProperties(getVm().getStaticData()); } if (parameters.isConsoleEnabled() == null) { parameters.setConsoleEnabled(false); } }

Target:
public UpdateVmCommand(T parameters) { super(parameters); if (getVdsGroup() != null) { setStoragePoolId(getVdsGroup().getStoragePoolId()); } if (isVmExist()) { setCustomDefinedProperties(parameters.getVmStaticData()); setCustomDefinedProperties(getVm().getStaticData()); } }
Source:
private static IncrementalIndex makeIncrementalIndex( Bucket theBucket, AggregatorFactory[] aggs, HadoopDruidIndexerConfig config, Iterable<String> oldDimOrder ) { final HadoopTuningConfig tuningConfig = config.getSchema().getTuningConfig(); final IncrementalIndexSchema indexSchema = new IncrementalIndexSchema.Builder() .withMinTimestamp(theBucket.time.getMillis()) .withDimensionsSpec(config.getSchema().getDataSchema().getParser()) .withQueryGranularity(config.getSchema().getDataSchema().getGranularitySpec().getQueryGranularity()) .withMetrics(aggs) .build(); OnheapIncrementalIndex newIndex = new OnheapIncrementalIndex( indexSchema, true, tuningConfig.getRowFlushBoundary() ); if (oldDimOrder != null && !indexSchema.getDimensionsSpec().hasCustomDimensions()) { newIndex.loadDimensionIterable(oldDimOrder); } return newIndex; }

Target:
private static IncrementalIndex makeIncrementalIndex( Bucket theBucket, AggregatorFactory[] aggs, HadoopDruidIndexerConfig config, Iterable<String> oldDimOrder ) { final HadoopTuningConfig tuningConfig = config.getSchema().getTuningConfig(); final IncrementalIndexSchema indexSchema = new IncrementalIndexSchema.Builder() .withMinTimestamp(theBucket.time.getMillis()) .withDimensionsSpec(config.getSchema().getDataSchema().getParser()) .withQueryGranularity(config.getSchema().getDataSchema().getGranularitySpec().getQueryGranularity()) .withMetrics(aggs) .build(); OnheapIncrementalIndex newIndex = new OnheapIncrementalIndex( indexSchema, !tuningConfig.isIgnoreInvalidRows(), tuningConfig.getRowFlushBoundary() ); if (oldDimOrder != null && !indexSchema.getDimensionsSpec().hasCustomDimensions()) { newIndex.loadDimensionIterable(oldDimOrder); } return newIndex; }
Source:
public void testOpenExistingStateFile() { TestLttngKernelAnalysisModule module2 = new TestLttngKernelAnalysisModule(BENCHMARK_FILE_NAME); try { module2.setTrace(testTrace.getTrace()); } catch (TmfAnalysisException e) { fail(); } module2.schedule(); assertTrue(module2.waitForCompletion(new NullProgressMonitor())); ITmfStateSystem ssb2 = module2.getStateSystem(); assertNotNull(ssb2); assertEquals(startTime, ssb2.getStartTime()); assertEquals(endTime, ssb2.getCurrentEndTime()); }

Target:
public void testOpenExistingStateFile() { try { ITmfStateSystem ssb2 = TmfStateSystemFactory.newFullHistory(stateFile, null, true); assertNotNull(ssb2); assertEquals(startTime, ssb2.getStartTime()); assertEquals(endTime, ssb2.getCurrentEndTime()); } catch (TmfTraceException e) { fail(); } }
Source:
protected void startInternal() { super.startInternal(); service.registerAction(getStartPattern(), m -> { for (int i = 0; i < 10; i++) { String matchedString = m.group(); String fileName = matchedString.substring(matchedString.lastIndexOf("/")); try { FileInputStream fileInputStream = new FileInputStream(Paths.get(service.home, "logs", fileName).toFile()); getOutputReader().setStream(fileInputStream); return; } catch (FileNotFoundException e) { log.error("Log file not created yet"); Utils.sleep(1000); continue; } } throw new IllegalStateException("Failed to attach reader to log file"); }); }

Target:
protected void startInternal() { super.startInternal(); service.registerAction(getStartPattern(), m -> { long end = TimeService.currentTimeMillis() + service.logCreationTimeout; while (TimeService.currentTimeMillis() <= end) { String matchedString = m.group(); String fileName = matchedString.substring(matchedString.lastIndexOf("/")); try { FileInputStream fileInputStream = new FileInputStream(Paths.get(service.home, "logs", fileName).toFile()); getOutputReader().setStream(fileInputStream); return; } catch (FileNotFoundException e) { log.error("Log file not created yet"); Utils.sleep(1000); continue; } } throw new IllegalStateException("Failed to attach reader to log file"); }); }
Source:
private void validateQosOverriddenInterfaces() { for (VdsNetworkInterface iface : params.getInterfaces()) { String networkName = iface.getNetworkName(); if (networkName == null) { continue; } if (iface.isQosOverridden() && !iface.getQos().isEmpty()) { if (!hostNetworkQosSupported) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED, networkName); } HostNetworkQosValidator qosValidator = new HostNetworkQosValidator(iface.getQos()); if (qosValidator.requiredValuesPresent() != ValidationResult.VALID) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_SETUP_NETWORKS_MISSING_VALUES, networkName); } if (qosValidator.valuesConsistent() != ValidationResult.VALID) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_SETUP_NETWORKS_INCONSISTENT_VALUES, networkName); } } } }

Target:
private void validateQosOverriddenInterfaces() { for (VdsNetworkInterface iface : params.getInterfaces()) { String networkName = iface.getNetworkName(); if (networkName == null || !iface.isQosOverridden()) { continue; } if (!hostNetworkQosSupported) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED, networkName); } if (iface.getQos() != null && !iface.getQos().isEmpty()) { HostNetworkQosValidator qosValidator = new HostNetworkQosValidator(iface.getQos()); if (qosValidator.requiredValuesPresent() != ValidationResult.VALID) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_SETUP_NETWORKS_MISSING_VALUES, networkName); } if (qosValidator.valuesConsistent() != ValidationResult.VALID) { addViolation(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_SETUP_NETWORKS_INCONSISTENT_VALUES, networkName); } } } }
Source:
static PathAddress translateProxyPath(OperationContext context, PathAddress address) throws OperationFailedException { Set<Resource.ResourceEntry> children = context.readResourceFromRoot(address).getChildren(ProxyConfigurationResourceDefinition.WILDCARD_PATH.getKey()); if (children.size() != 1) { throw new OperationFailedException(ModClusterLogger.ROOT_LOGGER.legacyOperationsWithMultipleProxies()); } PathAddress proxyPath = PathAddress.pathAddress(ProxyConfigurationResourceDefinition.pathElement(children.iterator().next().getName())); address = address.append(proxyPath); return address; }

Target:
static PathAddress translateProxyPath(OperationContext context, PathAddress address) throws OperationFailedException { Set<Resource.ResourceEntry> children = context.readResourceFromRoot(address, false).getChildren(ProxyConfigurationResourceDefinition.WILDCARD_PATH.getKey()); if (children.size() != 1) { throw new OperationFailedException(ModClusterLogger.ROOT_LOGGER.legacyOperationsWithMultipleProxies()); } PathAddress proxyPath = PathAddress.pathAddress(ProxyConfigurationResourceDefinition.pathElement(children.iterator().next().getName())); address = address.append(proxyPath); return address; }
Source:
private void importRootProject(File rootDir, IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor); progress.setWorkRemaining(3); WorkspaceOperations workspaceOperations = CorePlugin.workspaceOperations(); Optional<IProject> projectOrNull = workspaceOperations.findProjectByLocation(rootDir); if (!projectOrNull.isPresent() && this.newProjectHandler.shouldImport()) { String projectName = findFreeProjectName(rootDir.getName()); projectOrNull = Optional.of(workspaceOperations.createProject(projectName, rootDir, ImmutableList.<String>of(), progress.newChild(1))); } if (projectOrNull.isPresent()) { IProject project = projectOrNull.get(); project.refreshLocal(IResource.DEPTH_INFINITE, progress.newChild(1)); CorePlugin.workspaceOperations().addNature(project, GradleProjectNature.ID, progress.newChild(1)); this.newProjectHandler.afterImport(project); progress.worked(1); } }

Target:
private void importRootProject(File rootDir, IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor); progress.setWorkRemaining(3); WorkspaceOperations workspaceOperations = CorePlugin.workspaceOperations(); Optional<IProject> projectOrNull = workspaceOperations.findProjectByLocation(rootDir); if (!projectOrNull.isPresent() && this.newProjectHandler.shouldImportNewProjects()) { String projectName = findFreeProjectName(rootDir.getName()); projectOrNull = Optional.of(workspaceOperations.createProject(projectName, rootDir, ImmutableList.<String>of(), progress.newChild(1))); } if (projectOrNull.isPresent()) { IProject project = projectOrNull.get(); project.refreshLocal(IResource.DEPTH_INFINITE, progress.newChild(1)); CorePlugin.workspaceOperations().addNature(project, GradleProjectNature.ID, progress.newChild(1)); this.newProjectHandler.afterProjectImported(project); progress.worked(1); } }
Source:
public ActionResult execute() throws EntityDoesNotExistException { Assumption.assertPostParamNotNull(Const.ParamsNames.REGKEY, regkey); String nextUrl = getNextUrl(); statusToAdmin = "Action Student Clicked Join Link" + (account.googleId == null ? "<br/>Email: " + account.email : "<br/>Google ID: " + account.googleId + "<br/>Key: " + regkey); if (logic.getCurrentUser() == null) { return createRedirectToAuthenticatedJoinPage(nextUrl); } String confirmUrl = Const.ActionURIs.STUDENT_COURSE_JOIN_AUTHENTICATED + "?" + Const.ParamsNames.REGKEY + "=" + regkey + "&" + Const.ParamsNames.NEXT_URL + "=" + Sanitizer.sanitizeForNextUrl(nextUrl); String nextUrlType = nextUrl.replaceFirst("^(/page/[A-Za-z]+)\\?.*$", "$1"); boolean isRedirectResult = Const.SystemParams.PAGES_ACCESSIBLE_WITHOUT_GOOGLE_LOGIN.contains(nextUrlType); String courseId = new Url(nextUrl).get(Const.ParamsNames.COURSE_ID); data = new StudentCourseJoinConfirmationPageData(account, student, confirmUrl, Logic.getLogoutUrl(Sanitizer.sanitizeForNextUrl(confirmUrl)), isRedirectResult, courseId); excludeStudentDetailsFromResponseParams(); return createShowPageResult( Const.ViewURIs.STUDENT_COURSE_JOIN_CONFIRMATION, data); }

Target:
public ActionResult execute() throws EntityDoesNotExistException { Assumption.assertPostParamNotNull(Const.ParamsNames.REGKEY, regkey); String nextUrl = getNextUrl(); statusToAdmin = "Action Student Clicked Join Link" + (account.googleId == null ? "<br/>Email: " + account.email : "<br/>Google ID: " + account.googleId + "<br/>Key: " + regkey); if (logic.getCurrentUser() == null) { return createRedirectToAuthenticatedJoinPage(nextUrl); } String confirmUrl = Const.ActionURIs.STUDENT_COURSE_JOIN_AUTHENTICATED + "?" + Const.ParamsNames.REGKEY + "=" + regkey + "&" + Const.ParamsNames.NEXT_URL + "=" + Sanitizer.sanitizeForNextUrl(nextUrl); String nextUrlType = getPageTypeOfUrl(nextUrl); boolean isRedirectResult = !Const.SystemParams.PAGES_ACCESSIBLE_WITHOUT_REGISTRATION.contains(nextUrlType); boolean isNextUrlAccessibleWithoutLogin = Const.SystemParams.PAGES_ACCESSIBLE_WITHOUT_GOOGLE_LOGIN.contains(nextUrlType); String courseId = student.course; data = new StudentCourseJoinConfirmationPageData(account, student, confirmUrl, Logic.getLogoutUrl(Sanitizer.sanitizeForNextUrl(confirmUrl)), isRedirectResult, courseId, isNextUrlAccessibleWithoutLogin); excludeStudentDetailsFromResponseParams(); return createShowPageResult( Const.ViewURIs.STUDENT_COURSE_JOIN_CONFIRMATION, data); }
Source:
public boolean add(Object resource, Utils.ValueHolder<UInt128> outHash) { try { if (resource instanceof Resource) { resource = getSortedJsonStringValueFromResource((Resource)resource); } outHash.v = DistinctHash.getHash(resource); boolean value = true; if (lastHash != null) { value = !(outHash.v.equals(lastHash)); } lastHash = outHash.v; return value; } catch (IOException e) { throw new IllegalStateException("Failed to add value to distinct map" +e); } }

Target:
public boolean add(Object resource, Utils.ValueHolder<UInt128> outHash) { try { if (resource instanceof Resource) { resource = getSortedJsonStringValueFromResource((Resource)resource); } outHash.v = DistinctHash.getHash(resource); boolean value = true; if (lastHash != null) { value = !(outHash.v.equals(lastHash)); } lastHash = outHash.v; return value; } catch (IOException e) { throw new IllegalStateException("Failed to add value to distinct map", e); } }
Source:
public void rethrowsExceptionsFromMappingFunction() { RuntimeException ex = new IllegalStateException("bad"); TransactionService unusableService = SplitKeyDelegatingTransactionService.create( num -> { throw ex; }, transactionServiceMap); assertThatThrownBy(() -> unusableService.get(5L)) .isExactlyInstanceOf(IllegalStateException.class) .hasMessage("bad"); }

Target:
public void rethrowsExceptionsFromMappingFunction() { RuntimeException ex = new IllegalStateException("bad"); TransactionService unusableService = new SplitKeyDelegatingTransactionService<>( num -> { throw ex; }, transactionServiceMap); assertThatThrownBy(() -> unusableService.get(5L)).isEqualTo(ex); }
Source:
public void closeEditors() { IFile file = getBookmarksFile(); FileEditorInput input = new FileEditorInput(file); IWorkbench wb = PlatformUI.getWorkbench(); for (IWorkbenchWindow wbWindow : wb.getWorkbenchWindows()) { for (IWorkbenchPage wbPage : wbWindow.getPages()) { for (IEditorReference editorReference : wbPage.getEditorReferences()) { try { IEditorPart editor = editorReference.getEditor(false); if (editor instanceof ITmfTraceEditor && editorReference.getEditorInput().equals(input)) { wbPage.closeEditor(editor, false); } } catch (PartInitException e) { Activator.getDefault().logError(NLS.bind(Messages.TmfCommonProjectElement_ErrorClosingEditor, getName()), e); } } } } }

Target:
public void closeEditors() { IFile file = getBookmarksFile(); FileEditorInput input = new FileEditorInput(file); IWorkbench wb = PlatformUI.getWorkbench(); for (IWorkbenchWindow wbWindow : wb.getWorkbenchWindows()) { for (IWorkbenchPage wbPage : wbWindow.getPages()) { for (IEditorReference editorReference : wbPage.getEditorReferences()) { try { if (editorReference.getEditorInput().equals(input)) { IEditorPart editor = editorReference.getEditor(false); if (editor == null || editor instanceof ITmfTraceEditor) { wbPage.closeEditors(new IEditorReference[] { editorReference }, false); } } } catch (PartInitException e) { Activator.getDefault().logError(NLS.bind(Messages.TmfCommonProjectElement_ErrorClosingEditor, getName()), e); } } } } }
Source:
private void removeDeletedSessions(Guid clusterId, final Map<String, GlusterGeoRepSession> sessionsMap) { List<GlusterGeoRepSession> sessionsInDb = getGeoRepDao().getGeoRepSessionsInCluster(clusterId); if (sessionsInDb == null) { return; } List<GlusterGeoRepSession> sessionsToDelete = new ArrayList<>(); for (GlusterGeoRepSession grepSession: sessionsInDb) { if (sessionsMap.get(grepSession.getSessionKey()) == null) { sessionsToDelete.add(grepSession); } } for (final GlusterGeoRepSession session : sessionsToDelete) { log.debug("geo-rep session: detected removed for volume: {}", session.getSessionKey(), session.getMasterVolumeName()); getGeoRepDao().remove(session.getId()); logGeoRepMessage(AuditLogType.GLUSTER_GEOREP_SESSION_DELETED_FROM_CLI, clusterId, session); } }

Target:
private void removeDeletedSessions(Guid clusterId, final Map<String, GlusterGeoRepSession> sessionsMap) { List<GlusterGeoRepSession> sessionsInDb = getGeoRepDao().getGeoRepSessionsInCluster(clusterId); if (sessionsInDb == null || sessionsInDb.isEmpty()) { return; } List<GlusterGeoRepSession> sessionsToDelete = new ArrayList<>(); for (GlusterGeoRepSession grepSession: sessionsInDb) { if (sessionsMap.get(grepSession.getSessionKey()) == null) { sessionsToDelete.add(grepSession); } } for (final GlusterGeoRepSession session : sessionsToDelete) { log.debug("geo-rep session '{}' detected removed for volume '{}'", session.getSessionKey(), session.getMasterVolumeName()); getGeoRepDao().remove(session.getId()); logGeoRepMessage(AuditLogType.GLUSTER_GEOREP_SESSION_DELETED_FROM_CLI, clusterId, session); } }
Source:
public void initialize(boolean newInstance, InstanceInitializationFactory factory, String locale) { for (Enumeration en = formInstances.keys(); en.hasMoreElements(); ) { String instanceId = (String)en.nextElement(); DataInstance instance = formInstances.get(instanceId); formInstances.put(instanceId, instance.initialize(factory, instanceId)); } if (newInstance) { preloadInstance(mainInstance.getRoot()); } if (getLocalizer() != null) { if(locale == null || !getLocalizer().hasLocale(locale)) { if(getLocalizer().getLocale() == null) { getLocalizer().setToDefault(); } } else { getLocalizer().setLocale(locale); } } if (newInstance) { actionController.triggerActionsFromEvent(Action.EVENT_XFORMS_READY, this); } initAllTriggerables(); }

Target:
public void initialize(boolean newInstance, InstanceInitializationFactory factory, String locale) { for (Enumeration en = formInstances.keys(); en.hasMoreElements(); ) { String instanceId = (String)en.nextElement(); DataInstance instance = formInstances.get(instanceId); formInstances.put(instanceId, instance.initialize(factory, instanceId)); } if (newInstance) { preloadInstance(mainInstance.getRoot()); } initLocale(locale); if (newInstance) { actionController.triggerActionsFromEvent(Action.EVENT_XFORMS_READY, this); } initAllTriggerables(); }
Source:
public DatabaseRepairSubTab() { reportsTable = new FlexTable(); reportsTable.addStyleName("dataTable"); add(new HTML("<h3>Form corruption report</h3>")); add(reportsTable); reviewPanel = new FlowPanel("div"); add(new HTML("<h3>Review panel</h3>")); add(reviewPanel); update(); }

Target:
public DatabaseRepairSubTab() { add(new HTML("<h3>Form corruption report</h3>")); reportsTable = new FlexTable(); reportsTable.addStyleName("dataTable"); add(reportsTable); noProblemsNotice = new HTMLPanel("div", "No problems to report"); add(noProblemsNotice); reviewPanelTitle = new HTML("<h3>Review panel</h3>"); add(reviewPanelTitle); reviewPanel = new FlowPanel("div"); add(reviewPanel); update(); }
Source:
public PaneBasedSelectionWizardDescription createPaneBasedSelectionWizardDescription() { PaneBasedSelectionWizardDescriptionImpl paneBasedSelectionWizardDescription = new PaneBasedSelectionWizardDescriptionImpl(); return paneBasedSelectionWizardDescription; }

Target:
public PaneBasedSelectionWizardDescription createPaneBasedSelectionWizardDescription() { PaneBasedSelectionWizardDescriptionImpl paneBasedSelectionWizardDescription = new PaneBasedSelectionWizardDescriptionImpl(); ElementSelectVariable elementSelectVariable = this.createElementSelectVariable(); elementSelectVariable.setName("element"); ContainerViewVariable containerViewVariable = this.createContainerViewVariable(); containerViewVariable.setName("containerView"); SelectContainerVariable selectContainerVariable = this.createSelectContainerVariable(); selectContainerVariable.setName("container"); paneBasedSelectionWizardDescription.setElement(elementSelectVariable); paneBasedSelectionWizardDescription.setContainer(selectContainerVariable); paneBasedSelectionWizardDescription.setContainerView(containerViewVariable); InitialOperation initialOperation = this.createInitialOperation(); paneBasedSelectionWizardDescription.setInitialOperation(initialOperation); return paneBasedSelectionWizardDescription; }
Source:
public void should_throw_exception_when_accessing_api_after_logout() throws LoginException, LogoutException { expectedEx.expect(IllegalStateException.class); expectedEx.expectMessage("You must call login prior to access any API."); client.login(VALID_USERNAME, VALID_PASSWORD); client.logout(); client.getProcessAPI(); }

Target:
public void should_throw_exception_when_accessing_api_after_logout() throws LoginException, LogoutException { client.login(VALID_USERNAME, VALID_PASSWORD); client.logout(); expectedEx.expect(IllegalStateException.class); expectedEx.expectMessage("You must call login() prior to accessing any API."); client.getProcessAPI(); }
Source:
private Action authenticate(final BasicAuth basicAuth) { return new Action.Simple() { @Override public F.Promise<Result> call(final Http.Context ctx) throws Throwable { final boolean isAuthorized; final String authorizationHeader = ctx.request().getHeader(AUTHORIZATION); if (authorizationHeader != null) { isAuthorized = basicAuth.isAuthorized(authorizationHeader); } else { isAuthorized = false; ctx.response().setHeader(WWW_AUTHENTICATE, "Basic realm=\"" + basicAuth.getRealm() + "\""); } return authenticationResult(ctx, isAuthorized); } private F.Promise<Result> authenticationResult(final Http.Context ctx, final boolean isAuthorized) throws Throwable { if (isAuthorized) { Logger.debug("Authorized"); return delegate.call(ctx); } else { Logger.debug("Unauthorized"); return F.Promise.pure(unauthorized()); } } }; }

Target:
private Action authenticate(final BasicAuth basicAuth) { return new Action.Simple() { @Override public F.Promise<Result> call(final Http.Context ctx) throws Throwable { final boolean isAuthorized; final String authorizationHeader = ctx.request().getHeader(AUTHORIZATION); if (authorizationHeader != null) { isAuthorized = basicAuth.isAuthorized(authorizationHeader); } else { isAuthorized = false; ctx.response().setHeader(WWW_AUTHENTICATE, "Basic realm=\"" + basicAuth.getRealm() + "\""); } return authenticationResult(ctx, isAuthorized); } private F.Promise<Result> authenticationResult(final Http.Context ctx, final boolean isAuthorized) throws Throwable { if (isAuthorized) { LOGGER.debug("Authorized"); return delegate.call(ctx); } else { LOGGER.info("Unauthorized"); return F.Promise.pure(unauthorized()); } } }; }
Source:
public Object unmarshal(HierarchicalStreamReader reader, final UnmarshallingContext context) { AuthorizationMatrixProperty as = new AuthorizationMatrixProperty(); String prop = reader.peekNextChild(); if (prop!=null && prop.equals("useProjectSecurity")) { reader.moveDown(); reader.getValue(); reader.moveUp(); prop = reader.peekNextChild(); } if ("blocksInheritance".equals(prop)) { reader.moveDown(); as.setBlocksInheritance("true".equals(reader.getValue())); reader.moveUp(); } while (reader.hasMoreChildren()) { reader.moveDown(); try { as.add(reader.getValue()); } catch (IllegalArgumentException ex) { Logger.getLogger(AuthorizationMatrixProperty.class.getName()) .log(Level.WARNING,"Skipping a non-existent permission",ex); RobustReflectionConverter.addErrorInContext(context, ex); } reader.moveUp(); } if (GlobalMatrixAuthorizationStrategy.migrateHudson2324(as.grantedPermissions)) OldDataMonitor.report(context, "1.301"); return as; }

Target:
public Object unmarshal(HierarchicalStreamReader reader, final UnmarshallingContext context) { AuthorizationMatrixProperty as = new AuthorizationMatrixProperty(); String prop = reader.peekNextChild(); if (prop!=null && prop.equals("useProjectSecurity")) { reader.moveDown(); reader.getValue(); reader.moveUp(); prop = reader.peekNextChild(); } else if ("blocksInheritance".equals(prop)) { reader.moveDown(); as.setBlocksInheritance("true".equals(reader.getValue())); reader.moveUp(); } while (reader.hasMoreChildren()) { reader.moveDown(); try { as.add(reader.getValue()); } catch (IllegalArgumentException ex) { Logger.getLogger(AuthorizationMatrixProperty.class.getName()) .log(Level.WARNING,"Skipping a non-existent permission",ex); RobustReflectionConverter.addErrorInContext(context, ex); } reader.moveUp(); } if (GlobalMatrixAuthorizationStrategy.migrateHudson2324(as.grantedPermissions)) OldDataMonitor.report(context, "1.301"); return as; }
Source:
public boolean isExecutable() { IReview review = ((ReviewDetailSection) getContext()).getReview(); ReviewStatus currentStatus = review.getState(); return getModelObject() != null && getModelObject().getId() != null && currentStatus != ReviewStatus.ABANDONED && currentStatus != ReviewStatus.MERGED; }

Target:
public boolean isExecutable() { ReviewStatus currentStatus = getReview().getState(); return getModelObject() != null && getModelObject().getId() != null && currentStatus != ReviewStatus.ABANDONED && currentStatus != ReviewStatus.MERGED; }
Source:
public static String makeLogName(long zxid) { return LOG_FILE_PREFIX + "." + Long.toHexString(zxid); }

Target:
public static String makeLogName(long zxid) { return FileTxnLog.LOG_FILE_PREFIX + "." + Long.toHexString(zxid); }
Source:
private long copyPackBypassCache(PackOutputStream out, ReadableChannel rc) throws IOException { ByteBuffer buf = newCopyBuffer(out, rc); long position = 12; long remaining = length - (12 + 20); boolean packHeadSkipped = false; while (0 < remaining) { DfsBlock b = cache.get(key, alignToBlock(position)); if (b != null) { int ptr = (int) (position - b.start); int n = (int) Math.min(b.size() - ptr, remaining); if (n <= 0) { throw packfileIsTruncated(); } b.write(out, position, n); position += n; remaining -= n; rc.position(position); packHeadSkipped = true; continue; } int ptr = packHeadSkipped ? 0 : 12; buf.position(0); int bufLen = read(rc, buf); if (bufLen <= ptr) { throw packfileIsTruncated(); } int n = (int) Math.min(bufLen - ptr, remaining); out.write(buf.array(), ptr, n); position += n; remaining -= n; packHeadSkipped = true; } return position; }

Target:
private long copyPackBypassCache(PackOutputStream out, ReadableChannel rc) throws IOException { ByteBuffer buf = newCopyBuffer(out, rc); long position = 12; long remaining = length - (12 + 20); boolean packHeadSkipped = false; while (0 < remaining) { DfsBlock b = cache.get(key, alignToBlock(position)); if (b != null) { int ptr = (int) (position - b.start); if (b.size() <= ptr) { throw packfileIsTruncated(); } int n = (int) Math.min(b.size() - ptr, remaining); b.write(out, position, n); position += n; remaining -= n; rc.position(position); packHeadSkipped = true; continue; } int ptr = packHeadSkipped ? 0 : 12; buf.position(0); int bufLen = read(rc, buf); if (bufLen <= ptr) { throw packfileIsTruncated(); } int n = (int) Math.min(bufLen - ptr, remaining); out.write(buf.array(), ptr, n); position += n; remaining -= n; packHeadSkipped = true; } return position; }
Source:
protected boolean canDoAction() { boolean retValue; List<EventNotificationMethod> event_notification_methods = (DbFacade.getInstance() .getEventDao().getEventNotificationMethodsById(getParameters().getEventSubscriber().getmethod_id())); if (event_notification_methods.size() > 0) { List<event_map> event_map = DbFacade.getInstance().getEventDao().getEventMapByName( getParameters().getEventSubscriber().getevent_up_name()); if (event_map.size() > 0) { DbUser user = DbFacade.getInstance() .getDbUserDao() .get(getParameters().getEventSubscriber().getsubscriber_id()); if (user == null) { addCanDoActionMessage(VdcBllMessages.USER_MUST_EXIST_IN_DB); retValue = false; } else { retValue = ValidateRemove(event_notification_methods, getParameters().getEventSubscriber(), user); } } else { addCanDoActionMessage(VdcBllMessages.EN_UNSUPPORTED_NOTIFICATION_EVENT); retValue = false; } } else { addCanDoActionMessage(VdcBllMessages.EN_UNKNOWN_NOTIFICATION_METHOD); retValue = false; } return retValue; }

Target:
protected boolean canDoAction() { boolean retValue; List<EventNotificationMethod> eventNotificationMethods = (DbFacade.getInstance() .getEventDao().getEventNotificationMethodsById(getParameters().getEventSubscriber().getmethod_id())); if (eventNotificationMethods.size() > 0) { List<event_map> event_map = DbFacade.getInstance().getEventDao().getEventMapByName( getParameters().getEventSubscriber().getevent_up_name()); if (event_map.size() > 0) { DbUser user = DbFacade.getInstance() .getDbUserDao() .get(getParameters().getEventSubscriber().getsubscriber_id()); if (user == null) { addCanDoActionMessage(VdcBllMessages.USER_MUST_EXIST_IN_DB); retValue = false; } else { retValue = ValidateRemove(eventNotificationMethods, getParameters().getEventSubscriber(), user); } } else { addCanDoActionMessage(VdcBllMessages.EN_UNSUPPORTED_NOTIFICATION_EVENT); retValue = false; } } else { addCanDoActionMessage(VdcBllMessages.EN_UNKNOWN_NOTIFICATION_METHOD); retValue = false; } return retValue; }
Source:
public PasswordAuthenticator create(Map<String, String> config) { try { Bootstrap app = new Bootstrap( binder -> { configBinder(binder).bindConfig(LdapConfig.class); binder.bind(LdapAuthenticator.class).in(Scopes.SINGLETON); if (config.get(INTERNAL_LDAP_USER_CONFIG) != null) { httpClientBinder(binder).bindGlobalFilter(new BasicAuthRequestFilter(config.get(INTERNAL_LDAP_USER_CONFIG), config.get(INTERNAL_LDAP_PASSWORD_CONFIG))); } }); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(LdapAuthenticator.class); } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } }

Target:
public PasswordAuthenticator create(Map<String, String> config) { try { Bootstrap app = new Bootstrap( binder -> { configBinder(binder).bindConfig(LdapConfig.class); binder.bind(LdapAuthenticator.class).in(Scopes.SINGLETON); }); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(LdapAuthenticator.class); } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } }
Source:
private void addRunCmds(StringBuilder b) { if (runcmds.size() > 0) { for (String runCmd : runcmds) { b.append(DockerFileDictionaryEnum.RUN.name()).append(" ").append(runCmd).append("\n"); } } }

Target:
private void addRunCmds(StringBuilder b) { for (String runCmd : runcmds) { b.append(DockerFileDictionary.RUN.name()).append(" ").append(runCmd).append("\n"); } }
Source:
public void createTable(TableDescriptor desc) throws IOException { getResult(asyncAdmin.createTable(desc)); }

Target:
public void createTable(TableDescriptor desc) throws IOException { createTable(desc, null); }
Source:
public void start(final ServiceProvider<Service> serviceProvider) { try { Properties properties = new Properties(); properties.put(ConnectionPropertyNames.CONNECTION_NAME, CONNECTION_PREFIX + this.entityIdentifier); properties.put(ConnectionPropertyNames.CONNECTION_TIMEOUT, Long.toString(operationTimeouts.getLifecycleOperationTimeout().toMillis())); clusterConnection = ConnectionFactory.connect(clusterUri, properties); } catch (ConnectionException ex) { throw new RuntimeException(ex); } entityFactory = new EhcacheClientEntityFactory(clusterConnection, operationTimeouts); try { if (configuration.isAutoCreate()) { entity = autoCreateEntity(); } else { try { entity = entityFactory.retrieve(entityIdentifier, configuration.getServerConfiguration()); } catch (EntityNotFoundException e) { throw new IllegalStateException("The clustered tier manager '" + entityIdentifier + "' does not exist." + " Please review your configuration.", e); } catch (TimeoutException e) { throw new RuntimeException("Could not connect to the clustered tier manager '" + entityIdentifier + "'; retrieve operation timed out", e); } } } catch (RuntimeException e) { entityFactory = null; try { Connection conn = clusterConnection; clusterConnection = null; if (conn != null) { conn.close(); } } catch (IOException ex) { LOGGER.warn("Error closing cluster connection: " + ex); } throw e; } }

Target:
public void start(final ServiceProvider<Service> serviceProvider) { initClusterConnection(); createEntityFactory(); try { if (configuration.isAutoCreate()) { entity = autoCreateEntity(); } else { try { entity = entityFactory.retrieve(entityIdentifier, configuration.getServerConfiguration()); } catch (EntityNotFoundException e) { throw new IllegalStateException("The clustered tier manager '" + entityIdentifier + "' does not exist." + " Please review your configuration.", e); } catch (TimeoutException e) { throw new RuntimeException("Could not connect to the clustered tier manager '" + entityIdentifier + "'; retrieve operation timed out", e); } } } catch (RuntimeException e) { entityFactory = null; closeConnection(); throw e; } }
Source:
private Analyzer getAnalyzer(String lang) { if (lang == null) { return new StandardAnalyzer(); } switch(lang) { case "ar": return new ArabicAnalyzer(); case "bg": return new BulgarianAnalyzer(); case "br": return new BrazilianAnalyzer(); case "ca": return new CatalanAnalyzer(); case "cz": return new CzechAnalyzer(); case "da": return new DanishAnalyzer(); case "de": return new GermanAnalyzer(); case "el": return new GreekAnalyzer(); case "en": return new EnglishAnalyzer(); case "es": return new SpanishAnalyzer(); case "eu": return new BasqueAnalyzer(); case "fa": return new PersianAnalyzer(); case "fi": return new FinnishAnalyzer(); case "fr": return new FrenchAnalyzer(); case "ga": return new IrishAnalyzer(); case "gl": return new GalicianAnalyzer(); case "hi": return new HindiAnalyzer(); case "hu": return new HungarianAnalyzer(); case "hy": return new ArmenianAnalyzer(); case "id": return new IndonesianAnalyzer(); case "it": return new ItalianAnalyzer(); case "lt": return new LithuanianAnalyzer(); case "lv": return new LatvianAnalyzer(); case "nl": return new DutchAnalyzer(); case "no": return new NorwegianAnalyzer(); case "pt": return new PortugueseAnalyzer(); case "ro": return new RomanianAnalyzer(); case "ru": return new RussianAnalyzer(); case "sv": return new SwedishAnalyzer(); case "th": return new ThaiAnalyzer(); case "tr": return new TurkishAnalyzer(); default: return new StandardAnalyzer(); } }

Target:
private Analyzer getAnalyzer(String lang) { if (!analyzers.containsKey(lang)) { analyzers.put(lang, createAnalyzer(lang)); } return analyzers.get(lang); }