Questions tagged [generated-code]
231 questions
4
votes
1 answer
error: cannot find symbol @dagger.Module(includes = {InflationInject_ViewModule.class})
I've tried implementing Jake Wharton's AssistedInject with Dagger 2 (https://github.com/square/AssistedInject) in my project.
My code is pretty much identical to…

Villa
- 459
- 7
- 17
4
votes
2 answers
FxCop Suppression
I have a control on an Asp.Net page, on that page is a control with the name "PaReq" that violates the rule:
CA1704:IdentifiersShouldBeSpelledCorrectly
I've used suppression before I'm not sure how to suppress this error since it is defined in…

TWith2Sugars
- 3,384
- 2
- 26
- 43
4
votes
1 answer
Visual Studio generate code from UML diagrams?
I'm doing research on producing code from UML diagram using Visual Studio 2015. From what I have done, I have created Use case, Activity, Sequence and Class diagram before generating the code.
When I generate the code, I see that Visual Studio only…

Arif Sam
- 281
- 1
- 8
- 26
4
votes
2 answers
When I use WinForms (C#) designer in VS2010, it still generates code that StyleCop complains about
Some problems that I recall (there may be more):
Includes regions
Does not use this. prefix for member variables and methods
Includes comments like the one below ( having // by itself catches the eye of StyleCop)
//
// fileNameTextBox
//
If I…

Hamish Grubijan
- 10,562
- 23
- 99
- 147
4
votes
0 answers
Generate code with Custom Attribute in C#
I'm making a game using C# and I've been using A LOT of the following property definition:
private Prop _attack;
public int Attack
{
get { return _attack.Get(); }
set { _attack.Set(value); }
}
The "Prop" class implementation is not…

Ramon Amorim
- 111
- 1
- 1
- 7
4
votes
2 answers
Is it possible to mark files/folders in Eclipse as generated?
my project structure looks like this:
src/main/java
src/main/resources
src/main/generated
....
in the generated folder I place a files which are generated by external software (for example classes generated by JAXB).
In Eclipse all mentioned…

Marcel
- 4,054
- 5
- 36
- 50
4
votes
4 answers
What is the advantage of partial classes over inheritance?
C# has the concept of partial classes. One instance I've seen this used is in WSDLs. Visual Studio could contact a server to find a service, and automatically generate a partial class based on it. Visual Studios would then provide you with a blank…

David says Reinstate Monica
- 19,209
- 22
- 79
- 122
4
votes
1 answer
Dynamically adding mojo-generated code to source path
I have authored a mojo that generates code and sticks it under {root}/target/generated-sources/foo. When I execute:
mvn clean install
I get errors indicating that the generated sources are not being included in the build path (the generated files…

Kent Boogaart
- 175,602
- 35
- 392
- 393
4
votes
2 answers
How to put Maven-generated sources under version control?
I'm using Maven to build and deploy jOOQ. I now want to start generating XJC-generated classes using appropriate Maven plugins (before, I used ant scripts). This works very nicely for me, but I'm afraid that some users wanting to build jOOQ…

Lukas Eder
- 211,314
- 129
- 689
- 1,509
3
votes
1 answer
Thrift generated files with new compiler version name classes differently
I updated my thrift compiler to the latest version, and it appears to be naming classes in the generated code differently than before. T_User_UserBase becomes UserBase. Of course, I have many references to the original class names in my code, and…

worker1138
- 2,071
- 5
- 29
- 36
3
votes
2 answers
API for indentation of generated code
in my current project, we have a couple of code generator routines to help us through some mindless tasks. Everything works fine from the technical point of view, so that might be more a curiosity than a real issue: when I open a newly generated…

Andrea
- 884
- 1
- 10
- 23
3
votes
4 answers
How to duplicate a file but change a few parameters inside?
I am using python as an interface to several fortran files in my model. I want to duplicate a fortran file several times but at each copy, I will change the parameters that describe my model.
For example: I have the fortran file below
!file.f
!…

mikeP
- 801
- 2
- 11
- 20
3
votes
2 answers
Generated code not taken into account in maven compile process
I have a maven project generating a new class from an annotation processor during a compile process. The class is successfully generated in /target/generated-sources/annotations/, but it is not compiled into the .jar. Why?
…

Jérôme Verstrynge
- 57,710
- 92
- 283
- 453
3
votes
1 answer
Tell Entity Framework to use the name "Children" instead of "InverseParent" when generating entities
We are using Entity Framework Core for a large project with database-first design. We use the "scaffold" command to generate entities from the database. In other words, we are doing something like this in the NuGet package…

William Jockusch
- 26,513
- 49
- 182
- 323
3
votes
1 answer
py.test: How to generate tests from fixtures
I'm writing a set of tools to test the behavior of a custom HTTP server: whether it is setting appropriate response codes, header fields etc. I'm using pytest to write tests.
The goal is to make requests to several resources, and then evaluate the…

David
- 166
- 8