method does not override or implement a method from a supertype #Override - react-native

I am using bugsnag-react-native version 2.2.3, I am getting below error while building in android
"method does not override or implement a method from a supertype #override"
and in ios, it's working fine.
and when i comment #override in node_modules/bugsnag-react-native/android/src/main/java/com/bugsnag/BugsnagReactNative.java file then it' successfully build.
I replaced this
#override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
to
//#override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
and it's working
when i use latest version so i am getting so many errors.
So please suggest, Dont want to change in node module.

This issue was fixed in a later version. Could you try updating to the newest bugsnag-react-native version (2.7.0)?

Related

Camel PropertyInject working example details needed

I created a class extending RouteBuilder but #PropertyInjector field value is null.
Maven pom.xml has camel-core dependency.
There are some posts that says they got this code working but the code is showing only the
RouteBuilder part. Is there any specific jar to be added or CamelContext.addRoutes() in a particular way to get the injection working?
If there is any github code that contains working example for Camel #PropertyInject annotation please share that link.
If I understand your question correctly something like this is what you want to achieve?
#Component
public class TestClass extends RouteBuilder {
#PropertyInject("test.name")
private String name;
#Override
public void configure() throws Exception {
from("direct:test")
.log(name);
}
}
The property test.name will be something you put in your application.properties file.

How to remove Startup/Configuration tab from Intellij Plugin extending RunConfigurationBase

I am creating a custom IntelliJ plugin (following the IntelliJ tutorial) that implements a custom Run Configuration. My plugin will "run" the contents the open file in the editor on a remote server and display the result in IntelliJ (sort of a script playground). I used the IntelliJ GUI Designer to create the form and it shows up in the Edit Run Configuration, however it shows up under 2 tabs (Configuration and Startup/Configuration) .. neither of which I explicitly define, I assume they come from my extending of RunConfigurationBase?.
public class RunConfigurationImpl extends RunConfigurationBase {
public RunConfigurationImpl(Project project, ConfigurationFactory factory, String name) {
super(project, factory, name);
}
#NotNull
#Override
public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
return new SettingsEditorImpl();
}
#Nullable
#Override
public SettingsEditor<ConfigurationPerRunnerSettings> getRunnerSettingsEditor(ProgramRunner runner) {
return null;
}
#Override
public void checkConfiguration() throws RuntimeConfigurationException {
}
#Nullable
#Override
public RunProfileState getState(#NotNull Executor executor, #NotNull ExecutionEnvironment executionEnvironment) throws ExecutionException {
return null;
}
}
The first tab is fine (Configuration) ..
However I do not want to list the same fields again on the Startup/Connection tab, in fact, I'm happy to just do away with this tab -- or really, I don't care which tab I get rid off, I just
want the fields to show once.
Any pointers on how to get rid of this tab?
See com.intellij.execution.configurations.RunConfiguration#getRunnerSettingsEditor It returns null by default so let it stay null, don’t override it.
This is a consolidation of Vassiliy's answer and ensuing comments.
In order to remove the Startup/Connection tab in the custom Run Configuration UI, ensure that null is being returned from the methods getRunnerSettingsEditor() custom the classes that extends com.intellij.execution.configurations.RunConfiguration and com.intellij.execution.runners.ProgramRunner
By default the API abstract classes return null for these methods, so make sure you are not overriding them.

Interceptor on super method in CDI 1.0/JEE6

In the following case,
public class Base {
#Transactional
public void doSave() {
// ...
}
}
public class Inherited extends Base {
public void someMethod() {
super.doSave();
}
#Override
public void doSave() {
super.doSave();
}
}
If I add the #Transactional annotation to Inherited.someMethod, the interceptor gets called without issue.
However, without the annotation on the inherited class, the interceptor does not get involved in the call to the super class from Inherited.someMethod().
Furthermore, calling Inherited.doSave() does not seem to get the interceptor invoked either. I would have expected the annotation on the superclass to be also valid on the subclass. Is this not the expected behaviour?
I am using Apache DeltaSpike for the #Transactional annotation and this is being deployed as a war in an ear (technically as a jar in a war in an ear). However, this may not be relevant as trying with a custom interceptor shows the same behaviour.
This is JBoss EAP 6.3.0 Alpha in case its relevant.
This is expected. Interceptors are only applied if the object is managed. When you you write it this way with inheritence, it's not applied as it's not part of a call stack that CDI is aware of. You would need to inject Base into your class and call Base.doSave

Registering a Jackson module for Spring Data REST

I have a working project based on the Spring Data REST example project, and I'm trying to do custom serialization using a Jackson module based on this wiki page.
Here's my Jackson module:
public class CustomModule extends SimpleModule {
public static Logger logger = LoggerFactory.getLogger(CustomModule.class);
public CustomModule() {
super("CustomModule", new Version(1, 0, 0, null));
}
#Override
public void setupModule(SetupContext context) {
logger.debug("CustomModule.setupModule");
SimpleSerializers simpleSerializers = new SimpleSerializers();
simpleSerializers.addSerializer(new CustomDateTimeSerializer());
context.addSerializers(simpleSerializers);
}
}
The wiki page says:
Any Module bean declared within the scope of your ApplicationContext will be picked up by the exporter and registered with its ObjectMapper.
I'm still pretty new to Spring, so I might just be putting my module bean definition in the wrong place; currently it's in src/main/resources/META-INF/spring-data-rest/shared.xml, which is imported from repositories-export.xml:
<bean id="customModule" class="org.hierax.wpa.schema.mapping.CustomModule" />
I don't see the log statement in setupModule, but I do see log output for other classes in the same package.
I'm using Spring Data REST 1.0.0.RC2.
Currently, it's possible to customize a module in Spring Boot like this:
#Bean
public Module customModule() {
return new CustomModule();
}
Reference: Latest Jackson integration improvements in Spring
I've had success using the solution outlined in the wiki entry that you have linked to (although perhaps it has changed since this stack overflow post)
In my instance I was using spring-data-rest-webmvc#1.0.0.RELEASE
Your code seems to be correct and provided that your application context is being loaded correctly I don't see any reason for it not to be working.
I've attached my simpler Module which exemplifies the use of a date formatter:
#Component
public class JsonMarshallingConfigModule extends SimpleModule {
public JsonMarshallingConfigModule() {
super("JsonMarshallingConfigModule", new Version(1, 0, 0, "SNAPSHOT"));
}
#Override public void setupModule(SetupContext context) {
context.getSerializationConfig().setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"));
}
}
Perhaps it can be used to outline if it is infact the jackson module that is the problem or spring-data-rest-mvcweb.

junit.framework.AssertionFailedError: No tests found in register

I'm having a problem getting this test case to work. Can anyone point me in the right direction? I know I'm doing something wrong, I just don't know what.
import org.junit.*;
import com.thoughtworks.selenium.*;
import org.openqa.selenium.server.*;
#SuppressWarnings("deprecation")
public class register extends SeleneseTestCase {
Selenium selenium;
private SeleniumServer seleniumServer;
public static final String MAX_WAIT = "60000";
public final String CRN = "12761";
public void setUp() throws Exception {
RemoteControlConfiguration rc = new RemoteControlConfiguration();
rc.setAvoidProxy(true);
rc.setSingleWindow(true);
rc.setReuseBrowserSessions(true);
seleniumServer = new SeleniumServer(rc);
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://google.com/");
seleniumServer.start();
selenium.start();
}
#Test
public void register_test() throws Exception {
//TESTS IN HERE
}
#After
public void tearDown() throws Exception {
selenium.stop();
// Thread.sleep(500000);
}
}
And I'm getting the following errors:
junit.framework.AssertionFailedError: No tests found in register
at jumnit.framework.TestSuite$1.runTest(TestSuite.java:97)
I'm stumped.
You can't both extend TestCase (or SeleniumTestCase) and also use JUnit annotations (#Test). The test runners for JUnit3 and 4 are different, and my assumption is when JUnit sees that you've extended TestCase, it uses the old runner.
Remove the #Test annotation, and instead follow the old convention of naming your test with the word "test" prefixed, and that will fix it.
public void testRegister() throws Exception {
//TESTS IN HERE
}
PS. I'd recommend following more standard Java naming conventions, such as camel casing.
PPS. Here's a link that explains this in more detail.
This means you did not created method names starting with test in following test cases class what you running currently
I was able to solve this error in my case--that is, running tests with a <junit> Ant task--by pointing to a 1.7 or later version of Ant. Ant 1.7+ honors nested <classpath> elements, in which I was pointing to a JUnit 4.x jar, which as CodeSpelunker indicated understands #Test annotations. http://ant.apache.org/faq.html#delegating-classloader provided the aha moment for me.
I'm using mockk in Kotlin for Android and I had this error.
My class was declared like this (autogenerated by Android Studio):
class MyClassTest : TestCase() {
but removing TestCase fixed the error
class MyClassTest {